[vlc-commits] packetizer: hevc: delay prefix sei parsing

Francois Cartegnie git at videolan.org
Tue Apr 4 14:17:29 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr  4 11:30:59 2017 +0200| [a4fdc7acd993c0b116ff6d651e511b3cd6a71d45] | committer: Francois Cartegnie

packetizer: hevc: delay prefix sei parsing

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

 modules/packetizer/hevc.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index c50ba71..935ba0e 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -504,6 +504,24 @@ static void GetXPSSet(uint8_t i_pps_id, void *priv,
             *pp_vps = p_sys->rgi_p_decvps[hevc_get_sps_vps_id(*pp_sps)];
 }
 
+static void ParseStoredSEI( decoder_t *p_dec )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+
+    for( block_t *p_nal = p_sys->pre.p_chain;
+                  p_nal; p_nal = p_nal->p_next )
+    {
+        if( p_nal->i_buffer < 5 )
+            continue;
+
+        if( hevc_getNALType(&p_nal->p_buffer[4]) == HEVC_NAL_PREF_SEI )
+        {
+            HxxxParse_AnnexB_SEI( p_nal->p_buffer, p_nal->i_buffer,
+                                  2 /* nal header */, ParseSEICallback, p_dec );
+        }
+    }
+}
+
 static block_t *ParseVCL(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_frag)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
@@ -539,6 +557,8 @@ static block_t *ParseVCL(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_frag)
             ActivateSets(p_dec, p_pps, p_sps, p_vps);
         }
 
+        ParseStoredSEI( p_dec );
+
         switch(i_nal_type)
         {
             case HEVC_NAL_BLA_W_LP:
@@ -612,10 +632,7 @@ static block_t * ParseAUHead(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_na
         }
 
         case HEVC_NAL_PREF_SEI:
-            HxxxParse_AnnexB_SEI( p_nalb->p_buffer, p_nalb->i_buffer,
-                                  2 /* nal header */, ParseSEICallback, p_dec );
-            break;
-
+            /* stored an parsed later when we get sps & frame */
         default:
             break;
     }



More information about the vlc-commits mailing list