[vlc-commits] demux: ts: add object stream descriptors

Francois Cartegnie git at videolan.org
Tue Mar 31 21:22:40 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Mar 29 01:03:47 2015 +0100| [18bc9eaf91cae7c3ab1d7378e6eceb02260cf78a] | committer: Francois Cartegnie

demux: ts: add object stream descriptors

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

 modules/demux/mpeg4_iod.h |    6 ++++++
 modules/demux/ts.c        |   21 +++++++++++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mpeg4_iod.h b/modules/demux/mpeg4_iod.h
index 0ef10b9..431b54b 100644
--- a/modules/demux/mpeg4_iod.h
+++ b/modules/demux/mpeg4_iod.h
@@ -92,6 +92,12 @@ typedef struct
 
 } iod_descriptor_t;
 
+typedef struct
+{
+    int i_version;
+    DECL_ARRAY(iod_descriptor_t *) objects;
+} od_descriptors_t;
+
 iod_descriptor_t *IODNew( vlc_object_t *p_object, unsigned i_data, const uint8_t *p_data );
 void IODFree( iod_descriptor_t *p_iod );
 
diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 302f366..06f42ce 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -210,6 +210,7 @@ typedef struct
     int             i_pid_pcr;
     /* IOD stuff (mpeg4) */
     iod_descriptor_t *iod;
+    iod_descriptors_t od;
 
     DECL_ARRAY(ts_pid_t *) e_streams;
 
@@ -3960,13 +3961,20 @@ static bool PMTEsHasComponentTag( const dvbpsi_pmt_es_t *p_es,
 
 static const es_mpeg4_descriptor_t * GetMPEG4DescByEsId( const ts_pmt_t *pmt, uint16_t i_es_id )
 {
-    if( pmt->iod )
     for( int i = 0; i < ES_DESCRIPTOR_COUNT; i++ )
     {
-        if( pmt->iod->es_descr[i].i_es_id == i_es_id )
+        const es_mpeg4_descriptor_t *es_descr = &pmt->iod->es_descr[i];
+        if( es_descr->i_es_id == i_es_id && es_descr->b_ok )
+            return es_descr;
+    }
+    for( int i=0; i<pmt->od.objects.i_size; i++ )
+    {
+        const iod_descriptor_t *od = pmt->od.objects.p_elems[i];
+        for( int j = 0; j < ES_DESCRIPTOR_COUNT; j++ )
         {
-            if ( pmt->iod->es_descr[i].b_ok )
-                return &pmt->iod->es_descr[i];
+            const es_mpeg4_descriptor_t *es_descr = &od->es_descr[j];
+            if( es_descr->i_es_id == i_es_id && es_descr->b_ok )
+                return es_descr;
         }
     }
     return NULL;
@@ -5544,6 +5552,8 @@ static ts_pmt_t *ts_pmt_New( demux_t *p_demux )
     pmt->i_number   = -1;
     pmt->i_pid_pcr  = 0x1FFF;
     pmt->iod        = NULL;
+    pmt->od.i_version = -1;
+    ARRAY_INIT( pmt->od.objects );
 
     pmt->i_last_dts = -1;
 
@@ -5568,6 +5578,9 @@ static void ts_pmt_Del( demux_t *p_demux, ts_pmt_t *pmt )
     ARRAY_RESET( pmt->e_streams );
     if( pmt->iod )
         IODFree( pmt->iod );
+    for( int i=0; i<pmt->od.objects.i_size; i++ )
+        IODFree( pmt->od.objects.p_elems[i] );
+    ARRAY_RESET( pmt->od.objects );
     if( pmt->i_number > -1 )
         es_out_Control( p_demux->out, ES_OUT_DEL_GROUP, pmt->i_number );
     free( pmt );



More information about the vlc-commits mailing list