[vlc-commits] packetizer: hevc: add drain

Francois Cartegnie git at videolan.org
Tue Sep 24 20:57:16 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep 24 15:59:50 2019 +0200| [7793d7bb84da43929d14f9602d5babf0869fa52b] | committer: Francois Cartegnie

packetizer: hevc: add drain

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7793d7bb84da43929d14f9602d5babf0869fa52b
---

 modules/packetizer/hevc.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 900c8647ee..fe919df4b2 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -114,6 +114,7 @@ static void PacketizeReset(void *p_private, bool b_broken);
 static block_t *PacketizeParse(void *p_private, bool *pb_ts_used, block_t *);
 static block_t *ParseNALBlock(decoder_t *, bool *pb_ts_used, block_t *);
 static int PacketizeValidate(void *p_private, block_t *);
+static block_t * PacketizeDrain(void *);
 static bool ParseSEICallback( const hxxx_sei_data_t *, void * );
 static block_t *GetCc( decoder_t *, decoder_cc_desc_t * );
 static block_t *GetXPSCopy(decoder_sys_t *);
@@ -213,7 +214,7 @@ static int Open(vlc_object_t *p_this)
     packetizer_Init(&p_sys->packetizer,
                     p_hevc_startcode, sizeof(p_hevc_startcode), startcode_FindAnnexB,
                     p_hevc_startcode, 1, 5,
-                    PacketizeReset, PacketizeParse, PacketizeValidate, NULL,
+                    PacketizeReset, PacketizeParse, PacketizeValidate, PacketizeDrain,
                     p_dec);
 
     /* Copy properties */
@@ -995,6 +996,28 @@ static int PacketizeValidate( void *p_private, block_t *p_au )
     return VLC_SUCCESS;
 }
 
+static block_t * PacketizeDrain(void *p_private)
+{
+    decoder_t *p_dec = p_private;
+    decoder_sys_t *p_sys = p_dec->p_sys;
+
+    block_t *p_out = NULL;
+
+    if( p_sys->frame.p_chain &&
+        p_sys->sets != MISSING &&
+        p_sys->b_recovery_point )
+    {
+        p_out = OutputQueues(p_sys, true);
+        if( p_out )
+        {
+            p_out = GatherAndValidateChain(p_out);
+            if( p_out )
+                SetOutputBlockProperties( p_dec, p_out );
+        }
+    }
+    return p_out;
+}
+
 static bool ParseSEICallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
 {
     decoder_t *p_dec = (decoder_t *) cbdata;



More information about the vlc-commits mailing list