[vlc-commits] hxxx_sei: allow to differentiate T35 payloads

Francois Cartegnie git at videolan.org
Thu Nov 17 18:05:43 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 16 20:12:17 2016 +0100| [c8c9f30d7264895798690ee234e00d6b647f353a] | committer: Francois Cartegnie

hxxx_sei: allow to differentiate T35 payloads

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

 modules/packetizer/h264.c     |  6 +++++-
 modules/packetizer/hevc.c     |  8 +++++++-
 modules/packetizer/hxxx_sei.c |  5 +++--
 modules/packetizer/hxxx_sei.h | 16 ++++++++++++++--
 4 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 18f9aaa..2e39e97 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -957,7 +957,11 @@ static bool ParseSeiCallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
             /* Look for user_data_registered_itu_t_t35 */
         case HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35:
         {
-            cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.p_cc, p_sei_data->itu_t35.i_cc );
+            if( p_sei_data->itu_t35.type == HXXX_ITU_T35_TYPE_CC )
+            {
+                cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.u.cc.p_data,
+                                                       p_sei_data->itu_t35.u.cc.i_data );
+            }
         } break;
 
             /* Look for SEI recovery point */
diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 39283fe..8392e64 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -695,7 +695,13 @@ static bool ParseSEICallback( const hxxx_sei_data_t *p_sei_data, void *cbdata )
     decoder_sys_t *p_sys = p_dec->p_sys;
 
     if( p_sei_data->i_type == HXXX_SEI_USER_DATA_REGISTERED_ITU_T_T35 )
-        cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.p_cc, p_sei_data->itu_t35.i_cc );
+    {
+        if( p_sei_data->itu_t35.type == HXXX_ITU_T35_TYPE_CC )
+        {
+            cc_storage_append( p_sys->p_ccs, true, p_sei_data->itu_t35.u.cc.p_data,
+                                                   p_sei_data->itu_t35.u.cc.i_data );
+        }
+    }
 
     return true;
 }
diff --git a/modules/packetizer/hxxx_sei.c b/modules/packetizer/hxxx_sei.c
index 85a59ed..04550e5 100644
--- a/modules/packetizer/hxxx_sei.c
+++ b/modules/packetizer/hxxx_sei.c
@@ -119,8 +119,9 @@ void HxxxParseSEI(const uint8_t *p_buf, size_t i_buf,
                     ( i_t35 >= sizeof(p_DIRECTV_data_start_code) &&
                          !memcmp( p_t35, p_DIRECTV_data_start_code, sizeof(p_DIRECTV_data_start_code) ) ) )
                 {
-                    sei_data.itu_t35.i_cc = i_t35 - 3;
-                    sei_data.itu_t35.p_cc = &p_t35[3];
+                    sei_data.itu_t35.type = HXXX_ITU_T35_TYPE_CC;
+                    sei_data.itu_t35.u.cc.i_data = i_t35 - 3;
+                    sei_data.itu_t35.u.cc.p_data = &p_t35[3];
                     b_continue = pf_callback( &sei_data, cbdata );
                 }
 
diff --git a/modules/packetizer/hxxx_sei.h b/modules/packetizer/hxxx_sei.h
index 6189c17..7b53a57 100644
--- a/modules/packetizer/hxxx_sei.h
+++ b/modules/packetizer/hxxx_sei.h
@@ -28,6 +28,11 @@ enum hxxx_sei_type_e
     HXXX_SEI_RECOVERY_POINT = 6
 };
 
+enum hxxx_sei_t35_type_e
+{
+    HXXX_ITU_T35_TYPE_CC,
+};
+
 typedef struct
 {
     unsigned i_type;
@@ -36,8 +41,15 @@ typedef struct
         bs_t *p_bs; /* for raw/unhandled in common code callbacks */
         struct
         {
-            const uint8_t *p_cc;
-            size_t i_cc;
+            enum hxxx_sei_t35_type_e type;
+            union
+            {
+                struct
+                {
+                    const uint8_t *p_data;
+                    size_t i_data;
+                } cc;
+            } u;
         } itu_t35;
         struct
         {



More information about the vlc-commits mailing list