[vlc-commits] demux: ts: rename pes structs as stream

Francois Cartegnie git at videolan.org
Wed Jun 21 21:34:04 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jun 19 18:03:30 2017 +0200| [4e52f70c3d37de6c926e6770895d1321273a1296] | committer: Francois Cartegnie

demux: ts: rename pes structs as stream

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

 modules/demux/mpeg/ts.c                 | 118 ++++++++++++++++----------------
 modules/demux/mpeg/ts_pid.c             |  12 ++--
 modules/demux/mpeg/ts_pid.h             |   4 +-
 modules/demux/mpeg/ts_psi.c             | 104 ++++++++++++++--------------
 modules/demux/mpeg/ts_scte.c            |   4 +-
 modules/demux/mpeg/ts_sl.c              |  10 +--
 modules/demux/mpeg/ts_sl.h              |   2 +-
 modules/demux/mpeg/ts_streams.c         |  38 +++++-----
 modules/demux/mpeg/ts_streams.h         |  18 ++---
 modules/demux/mpeg/ts_streams_private.h |  12 ++--
 10 files changed, 161 insertions(+), 161 deletions(-)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 7337880cb9..7ba4c02258 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -166,7 +166,7 @@ static int ChangeKeyCallback( vlc_object_t *, char const *, vlc_value_t, vlc_val
 /* Helpers */
 static bool PIDReferencedByProgram( const ts_pmt_t *, uint16_t );
 void UpdatePESFilters( demux_t *p_demux, bool b_all );
-static inline void FlushESBuffer( ts_pes_t *p_pes );
+static inline void FlushESBuffer( ts_stream_t *p_pes );
 static void UpdatePIDScrambledState( demux_t *p_demux, ts_pid_t *p_pid, bool );
 static inline int PIDGet( block_t *p )
 {
@@ -679,7 +679,7 @@ static int Demux( demux_t *p_demux )
             block_Release( p_pkt );
             break;
 
-        case TYPE_PES:
+        case TYPE_STREAM:
             p_sys->b_end_preparse = true;
 
             if( p_sys->es_creation == DELAY_ES ) /* No longer delay ES since that pid's program sends data */
@@ -697,11 +697,11 @@ static int Demux( demux_t *p_demux )
                 continue;
             }
 
-            if( p_pid->u.p_pes->transport == TS_TRANSPORT_PES )
+            if( p_pid->u.p_stream->transport == TS_TRANSPORT_PES )
             {
                 b_frame = GatherPESData( p_demux, p_pid, p_pkt, i_header );
             }
-            else if( p_pid->u.p_pes->transport == TS_TRANSPORT_SECTIONS )
+            else if( p_pid->u.p_stream->transport == TS_TRANSPORT_SECTIONS )
             {
                 b_frame = GatherSectionsData( p_demux, p_pid, p_pkt, i_header );
             }
@@ -764,7 +764,7 @@ static int EITCurrentEventTime( const ts_pmt_t *p_pmt, demux_sys_t *p_sys,
     return VLC_EGENERIC;
 }
 
-static inline void HasSelectedES( es_out_t *out, const ts_pes_es_t *p_es,
+static inline void HasSelectedES( es_out_t *out, const ts_es_t *p_es,
                                   const ts_pmt_t *p_pmt, bool *pb_stream_selected )
 {
     for( ; p_es && !*pb_stream_selected; p_es = p_es->p_next )
@@ -817,7 +817,7 @@ void UpdatePESFilters( demux_t *p_demux, bool b_all )
             for( int j=0; j<p_pmt->e_streams.i_size; j++ )
             {
                 ts_pid_t *espid = p_pmt->e_streams.p_elems[j];
-                ts_pes_t *p_pes = espid->u.p_pes;
+                ts_stream_t *p_pes = espid->u.p_stream;
 
                 bool b_stream_selected = true;
                 if( !p_pes->b_always_receive && !b_all )
@@ -851,7 +851,7 @@ void UpdatePESFilters( demux_t *p_demux, bool b_all )
             ts_pid_t *espid = p_pmt->e_streams.p_elems[j];
             UpdateHWFilter( p_sys, espid );
             if( (espid->i_flags & FLAG_FILTERED) == 0 )
-                FlushESBuffer( espid->u.p_pes );
+                FlushESBuffer( espid->u.p_stream );
         }
         UpdateHWFilter( p_sys, GetPID(p_sys, p_pmt->i_pid_pcr) );
     }
@@ -1250,7 +1250,7 @@ invalid:
     return NULL;
 }
 
-static block_t * ConvertPESBlock( demux_t *p_demux, ts_pes_es_t *p_es,
+static block_t * ConvertPESBlock( demux_t *p_demux, ts_es_t *p_es,
                                   size_t i_pes_size, uint8_t i_stream_id,
                                   block_t *p_block )
 {
@@ -1317,7 +1317,7 @@ static block_t * ConvertPESBlock( demux_t *p_demux, ts_pes_es_t *p_es,
 /****************************************************************************
  * fanouts current block to all subdecoders / shared pid es
  ****************************************************************************/
-static void SendDataChain( demux_t *p_demux, ts_pes_es_t *p_es, block_t *p_chain )
+static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, block_t *p_chain )
 {
     while( p_chain )
     {
@@ -1325,7 +1325,7 @@ static void SendDataChain( demux_t *p_demux, ts_pes_es_t *p_es, block_t *p_chain
         p_chain = p_block->p_next;
         p_block->p_next = NULL;
 
-        ts_pes_es_t *p_es_send = p_es;
+        ts_es_t *p_es_send = p_es;
         if( p_es_send->i_next_block_flags )
         {
             p_block->i_flags |= p_es_send->i_next_block_flags;
@@ -1337,7 +1337,7 @@ static void SendDataChain( demux_t *p_demux, ts_pes_es_t *p_es, block_t *p_chain
             if( p_es_send->p_program->b_selected )
             {
                 /* Send a copy to each extra es */
-                ts_pes_es_t *p_extra_es = p_es_send->p_extraes;
+                ts_es_t *p_extra_es = p_es_send->p_extraes;
                 while( p_extra_es )
                 {
                     if( p_extra_es->id )
@@ -1390,7 +1390,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
     bool b_pes_scrambling = false;
     const es_mpeg4_descriptor_t *p_mpeg4desc = NULL;
 
-    assert(pid->type == TYPE_PES);
+    assert(pid->type == TYPE_STREAM);
 
     const int i_max = block_ChainExtract( p_pes, header, 34 );
     if ( i_max < 4 )
@@ -1413,7 +1413,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
         p_pes->i_flags &= ~BLOCK_FLAG_SCRAMBLED;
     }
 
-    ts_pes_es_t *p_es = pid->u.p_pes->p_es;
+    ts_es_t *p_es = pid->u.p_stream->p_es;
 
     if( ParsePESHeader( VLC_OBJECT(p_demux), (uint8_t*)&header, i_max, &i_skip,
                         &i_dts, &i_pts, &i_stream_id, &b_pes_scrambling ) == VLC_EGENERIC )
@@ -1517,15 +1517,15 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
 
             if( p_es->id && (p_pmt->pcr.i_current > -1 || p_pmt->pcr.b_disable) )
             {
-                if( pid->u.p_pes->prepcr.p_head )
+                if( pid->u.p_stream->prepcr.p_head )
                 {
                     /* Rebuild current output chain, appending any prepcr outqueue */
-                    block_ChainLastAppend( &pid->u.p_pes->prepcr.pp_last, p_block );
+                    block_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_block );
                     if( p_chain )
-                        block_ChainLastAppend( &pid->u.p_pes->prepcr.pp_last, p_chain );
-                    p_chain = pid->u.p_pes->prepcr.p_head;
-                    pid->u.p_pes->prepcr.p_head = NULL;
-                    pid->u.p_pes->prepcr.pp_last = &pid->u.p_pes->prepcr.p_head;
+                        block_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_chain );
+                    p_chain = pid->u.p_stream->prepcr.p_head;
+                    pid->u.p_stream->prepcr.p_head = NULL;
+                    pid->u.p_stream->prepcr.pp_last = &pid->u.p_stream->prepcr.p_head;
                     /* Then now output all data */
                     continue;
                 }
@@ -1563,17 +1563,17 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
                 }
 
                 /* METADATA in PES */
-                if( pid->u.p_pes->i_stream_type == 0x15 && i_stream_id == 0xbd )
+                if( pid->u.p_stream->i_stream_type == 0x15 && i_stream_id == 0xbd )
                 {
                     ProcessMetadata( p_demux->out, p_es->metadata.i_format, p_pmt->i_number,
                                      p_block->p_buffer, p_block->i_buffer );
                 }
                 else
                 /* SL in PES */
-                if( pid->u.p_pes->i_stream_type == 0x12 &&
+                if( pid->u.p_stream->i_stream_type == 0x12 &&
                     ((i_stream_id & 0xFE) == 0xFA) /* 0xFA || 0xFB */ )
                 {
-                    p_block = SLProcessPacketized( pid->u.p_pes, p_es, p_block );
+                    p_block = SLProcessPacketized( pid->u.p_stream, p_es, p_block );
                 }
                 else
                 /* Some codecs might need xform or AU splitting */
@@ -1588,14 +1588,14 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
                 if( !p_pmt->pcr.b_fix_done ) /* Not seen yet */
                     PCRFixHandle( p_demux, p_pmt, p_block );
 
-                block_ChainLastAppend( &pid->u.p_pes->prepcr.pp_last, p_block );
+                block_ChainLastAppend( &pid->u.p_stream->prepcr.pp_last, p_block );
 
                 /* PCR Seen and no es->id, cleanup current and prepcr blocks */
                 if( p_pmt->pcr.i_current > -1)
                 {
-                    block_ChainRelease( pid->u.p_pes->prepcr.p_head );
-                    pid->u.p_pes->prepcr.p_head = NULL;
-                    pid->u.p_pes->prepcr.pp_last = &pid->u.p_pes->prepcr.p_head;
+                    block_ChainRelease( pid->u.p_stream->prepcr.p_head );
+                    pid->u.p_stream->prepcr.p_head = NULL;
+                    pid->u.p_stream->prepcr.pp_last = &pid->u.p_stream->prepcr.p_head;
                 }
             }
         }
@@ -1609,7 +1609,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
 static bool PushPESBlock( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, bool b_unit_start )
 {
     bool b_ret = false;
-    ts_pes_t *p_pes = pid->u.p_pes;
+    ts_stream_t *p_pes = pid->u.p_stream;
 
     if ( b_unit_start && p_pes->gather.p_data )
     {
@@ -1744,7 +1744,7 @@ static mtime_t GetPCR( const block_t *p_pkt )
     return i_pcr;
 }
 
-static inline void UpdateESScrambledState( es_out_t *out, const ts_pes_es_t *p_es, bool b_scrambled )
+static inline void UpdateESScrambledState( es_out_t *out, const ts_es_t *p_es, bool b_scrambled )
 {
     for( ; p_es; p_es = p_es->p_next )
     {
@@ -1768,11 +1768,11 @@ static void UpdatePIDScrambledState( demux_t *p_demux, ts_pid_t *p_pid, bool b_s
     else
         p_pid->i_flags &= ~FLAG_SCRAMBLED;
 
-    if( p_pid->type == TYPE_PES )
-        UpdateESScrambledState( p_demux->out, p_pid->u.p_pes->p_es, b_scrambled );
+    if( p_pid->type == TYPE_STREAM )
+        UpdateESScrambledState( p_demux->out, p_pid->u.p_stream->p_es, b_scrambled );
 }
 
-static inline void FlushESBuffer( ts_pes_t *p_pes )
+static inline void FlushESBuffer( ts_stream_t *p_pes )
 {
     if( p_pes->gather.p_data )
     {
@@ -1802,26 +1802,26 @@ static void ReadyQueuesPostSeek( demux_t *p_demux )
         for( int j=0; j<p_pmt->e_streams.i_size; j++ )
         {
             ts_pid_t *pid = p_pmt->e_streams.p_elems[j];
-            ts_pes_t *p_pes = pid->u.p_pes;
+            ts_stream_t *p_pes = pid->u.p_stream;
 
-            if( pid->type != TYPE_PES )
+            if( pid->type != TYPE_STREAM )
                 continue;
 
-            for( ts_pes_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
+            for( ts_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
                 p_es->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
 
             pid->i_cc = 0xff;
 
-            if( pid->u.p_pes->prepcr.p_head )
+            if( pid->u.p_stream->prepcr.p_head )
             {
-                block_ChainRelease( pid->u.p_pes->prepcr.p_head );
-                pid->u.p_pes->prepcr.p_head = NULL;
-                pid->u.p_pes->prepcr.pp_last = &pid->u.p_pes->prepcr.p_head;
+                block_ChainRelease( pid->u.p_stream->prepcr.p_head );
+                pid->u.p_stream->prepcr.p_head = NULL;
+                pid->u.p_stream->prepcr.pp_last = &pid->u.p_stream->prepcr.p_head;
             }
 
-            ts_sections_processor_Reset( pid->u.p_pes->p_sections_proc );
+            ts_sections_processor_Reset( pid->u.p_stream->p_sections_proc );
 
-            FlushESBuffer( pid->u.p_pes );
+            FlushESBuffer( pid->u.p_stream );
         }
         p_pmt->pcr.i_current = -1;
     }
@@ -1873,8 +1873,8 @@ static int SeekToTime( demux_t *p_demux, const ts_pmt_t *p_pmt, int64_t i_scaled
 
             int i_pid = PIDGet( p_pkt );
             ts_pid_t *p_pid = GetPID(p_sys, i_pid);
-            if( i_pid != 0x1FFF && p_pid->type == TYPE_PES &&
-                ts_pes_Find_es( p_pid->u.p_pes, p_pmt ) &&
+            if( i_pid != 0x1FFF && p_pid->type == TYPE_STREAM &&
+                ts_stream_Find_es( p_pid->u.p_stream, p_pmt ) &&
                (p_pkt->p_buffer[1] & 0xC0) == 0x40 && /* Payload start but not corrupt */
                (p_pkt->p_buffer[3] & 0xD0) == 0x10    /* Has payload but is not encrypted */
             )
@@ -1970,8 +1970,8 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_
             if( *pi_pcr == -1 &&
                 (p_pkt->p_buffer[1] & 0xC0) == 0x40 && /* payload start */
                 (p_pkt->p_buffer[3] & 0xD0) == 0x10 && /* Has payload but is not encrypted */
-                p_pid->type == TYPE_PES &&
-                p_pid->u.p_pes->p_es->fmt.i_cat != UNKNOWN_ES
+                p_pid->type == TYPE_STREAM &&
+                p_pid->u.p_stream->p_es->fmt.i_cat != UNKNOWN_ES
               )
             {
                 b_pcrresult = false;
@@ -2111,7 +2111,7 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr )
             for( int j=0; j<p_pmt->e_streams.i_size; j++ )
             {
                 ts_pid_t *p_pid = p_pmt->e_streams.p_elems[j];
-                block_t *p_block = p_pid->u.p_pes->prepcr.p_head;
+                block_t *p_block = p_pid->u.p_stream->prepcr.p_head;
                 while( p_block && p_block->i_dts == VLC_TS_INVALID )
                     p_block = p_block->p_next;
 
@@ -2150,7 +2150,7 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr )
 static int IsVideoEnd( ts_pid_t *p_pid )
 {
     /* jump to near end of PES packet */
-    block_t *p = p_pid->u.p_pes->gather.p_data;
+    block_t *p = p_pid->u.p_stream->gather.p_data;
     if( !p || !p->p_next )
         return 0;
     while( p->p_next->p_next )
@@ -2175,11 +2175,11 @@ static void PCRCheckDTS( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr)
     {
         ts_pid_t *p_pid = p_pmt->e_streams.p_elems[i];
 
-        if( p_pid->type != TYPE_PES || SCRAMBLED(*p_pid) )
+        if( p_pid->type != TYPE_STREAM || SCRAMBLED(*p_pid) )
             continue;
 
-        ts_pes_t *p_pes = p_pid->u.p_pes;
-        ts_pes_es_t *p_es = p_pes->p_es;
+        ts_stream_t *p_pes = p_pid->u.p_stream;
+        ts_es_t *p_es = p_pes->p_es;
 
         if( p_pes->gather.p_data == NULL )
             continue;
@@ -2294,14 +2294,14 @@ int FindPCRCandidate( ts_pmt_t *p_pmt )
                 }
             }
 
-            if( p_pid->u.p_pes->p_es->fmt.i_cat == AUDIO_ES )
+            if( p_pid->u.p_stream->p_es->fmt.i_cat == AUDIO_ES )
             {
                 if( !p_cand )
                     p_cand = p_pid;
             }
-            else if ( p_pid->u.p_pes->p_es->fmt.i_cat == VIDEO_ES ) /* Otherwise prioritize video dts */
+            else if ( p_pid->u.p_stream->p_es->fmt.i_cat == VIDEO_ES ) /* Otherwise prioritize video dts */
             {
-                if( !p_cand || p_cand->u.p_pes->p_es->fmt.i_cat == AUDIO_ES )
+                if( !p_cand || p_cand->u.p_stream->p_es->fmt.i_cat == AUDIO_ES )
                     p_cand = p_pid;
             }
         }
@@ -2522,7 +2522,7 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
 {
     const bool b_unit_start = p_pkt->p_buffer[1]&0x40;
     bool b_ret = false;
-    ts_pes_t *p_pes = pid->u.p_pes;
+    ts_stream_t *p_pes = pid->u.p_stream;
 
     /* We have to gather it */
     p_pkt->p_buffer += i_skip;
@@ -2671,12 +2671,12 @@ static bool GatherSectionsData( demux_t *p_demux, ts_pid_t *p_pid, block_t *p_pk
 
     if( p_pkt->i_flags & BLOCK_FLAG_DISCONTINUITY )
     {
-        ts_sections_processor_Reset( p_pid->u.p_pes->p_sections_proc );
+        ts_sections_processor_Reset( p_pid->u.p_stream->p_sections_proc );
     }
 
     if( (p_pkt->i_flags & (BLOCK_FLAG_SCRAMBLED | BLOCK_FLAG_CORRUPTED)) == 0 )
     {
-        ts_sections_processor_Push( p_pid->u.p_pes->p_sections_proc, p_pkt->p_buffer );
+        ts_sections_processor_Push( p_pid->u.p_stream->p_sections_proc, p_pkt->p_buffer );
         b_ret = true;
     }
 
@@ -2711,7 +2711,7 @@ static bool PIDReferencedByProgram( const ts_pmt_t *p_pmt, uint16_t i_pid )
     return false;
 }
 
-static void DoCreateES( demux_t *p_demux, ts_pes_es_t *p_es, const ts_pes_es_t *p_parent_es )
+static void DoCreateES( demux_t *p_demux, ts_es_t *p_es, const ts_es_t *p_parent_es )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
@@ -2743,13 +2743,13 @@ void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid, bool b_create_delayed )
 
     if( pid && p_sys->es_creation == CREATE_ES )
     {
-        DoCreateES( p_demux, pid->u.p_pes->p_es, NULL );
+        DoCreateES( p_demux, pid->u.p_stream->p_es, NULL );
 
         /* Update the default program == first created ES group */
         if( p_sys->b_default_selection && p_sys->programs.i_size > 0)
         {
             p_sys->b_default_selection = false;
-            const int i_first_program = pid->u.p_pes->p_es->p_program->i_number;
+            const int i_first_program = pid->u.p_stream->p_es->p_program->i_number;
             if( p_sys->programs.p_elems[0] != i_first_program )
                 p_sys->programs.p_elems[0] = i_first_program;
             msg_Dbg( p_demux, "Default program is %d", i_first_program );
@@ -2763,7 +2763,7 @@ void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid, bool b_create_delayed )
         {
             ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
             for( int j=0; j<p_pmt->e_streams.i_size; j++ )
-                DoCreateES( p_demux, p_pmt->e_streams.p_elems[j]->u.p_pes->p_es, NULL );
+                DoCreateES( p_demux, p_pmt->e_streams.p_elems[j]->u.p_stream->p_es, NULL );
         }
     }
 }
diff --git a/modules/demux/mpeg/ts_pid.c b/modules/demux/mpeg/ts_pid.c
index 27779a04d8..64e6e79df7 100644
--- a/modules/demux/mpeg/ts_pid.c
+++ b/modules/demux/mpeg/ts_pid.c
@@ -202,10 +202,10 @@ bool PIDSetup( demux_t *p_demux, ts_pid_type_t i_type, ts_pid_t *pid, ts_pid_t *
                 return false;
             break;
 
-        case TYPE_PES:
+        case TYPE_STREAM:
             PIDReset( pid );
-            pid->u.p_pes = ts_pes_New( p_demux, p_parent->u.p_pmt );
-            if( !pid->u.p_pes )
+            pid->u.p_stream = ts_stream_New( p_demux, p_parent->u.p_pmt );
+            if( !pid->u.p_stream )
                 return false;
             break;
 
@@ -284,9 +284,9 @@ void PIDRelease( demux_t *p_demux, ts_pid_t *pid )
             pid->u.p_pmt = NULL;
             break;
 
-        case TYPE_PES:
-            ts_pes_Del( p_demux, pid->u.p_pes );
-            pid->u.p_pes = NULL;
+        case TYPE_STREAM:
+            ts_stream_Del( p_demux, pid->u.p_stream );
+            pid->u.p_stream = NULL;
             break;
 
         case TYPE_SI:
diff --git a/modules/demux/mpeg/ts_pid.h b/modules/demux/mpeg/ts_pid.h
index 58159cee49..c61256ae09 100644
--- a/modules/demux/mpeg/ts_pid.h
+++ b/modules/demux/mpeg/ts_pid.h
@@ -32,7 +32,7 @@ typedef enum
     TYPE_CAT,
     TYPE_PAT,
     TYPE_PMT,
-    TYPE_PES,
+    TYPE_STREAM,
     TYPE_SI,
     TYPE_PSIP,
 } ts_pid_type_t;
@@ -64,7 +64,7 @@ struct ts_pid_t
     {
         ts_pat_t    *p_pat;
         ts_pmt_t    *p_pmt;
-        ts_pes_t    *p_pes;
+        ts_stream_t    *p_stream;
         ts_si_t     *p_si;
         ts_psip_t   *p_psip;
     } u;
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index d1c81fd2ac..3516482b49 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -56,7 +56,7 @@
 
 #include <assert.h>
 
-static void PIDFillFormat( demux_t *, ts_pes_t *p_pes, int i_stream_type, ts_transport_type_t * );
+static void PIDFillFormat( demux_t *, ts_stream_t *p_pes, int i_stream_type, ts_transport_type_t * );
 static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt );
 static ts_standards_e ProbePMTStandard( const dvbpsi_pmt_t *p_dvbpsipmt );
 
@@ -370,7 +370,7 @@ static ts_standards_e ProbePMTStandard( const dvbpsi_pmt_t *p_dvbpsipmt )
     return TS_STANDARD_AUTO;
 }
 
-static void SetupAudioExtendedDescriptors( demux_t *p_demux, ts_pes_es_t *p_es,
+static void SetupAudioExtendedDescriptors( demux_t *p_demux, ts_es_t *p_es,
                                            const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     if( p_demux->p_sys->standard == TS_STANDARD_AUTO ||
@@ -415,11 +415,11 @@ static void SetupAudioExtendedDescriptors( demux_t *p_demux, ts_pes_es_t *p_es,
     }
 }
 
-static void SetupISO14496Descriptors( demux_t *p_demux, ts_pes_t *p_pes,
+static void SetupISO14496Descriptors( demux_t *p_demux, ts_stream_t *p_pes,
                                       const ts_pmt_t *p_pmt, const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     const dvbpsi_descriptor_t *p_dr = p_dvbpsies->p_first_descriptor;
-    ts_pes_es_t *p_es = p_pes->p_es;
+    ts_es_t *p_es = p_pes->p_es;
 
     while( p_dr )
     {
@@ -483,7 +483,7 @@ static void SetupISO14496Descriptors( demux_t *p_demux, ts_pes_t *p_pes,
     }
 }
 
-static void SetupMetadataDescriptors( demux_t *p_demux, ts_pes_es_t *p_es, const dvbpsi_pmt_es_t *p_dvbpsies )
+static void SetupMetadataDescriptors( demux_t *p_demux, ts_es_t *p_es, const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     const dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_dvbpsies, 0x26 );
     if( p_dr && p_dr->i_length >= 13 )
@@ -503,7 +503,7 @@ static void SetupMetadataDescriptors( demux_t *p_demux, ts_pes_es_t *p_es, const
     }
 }
 
-static void SetupAVCDescriptors( demux_t *p_demux, ts_pes_es_t *p_es, const dvbpsi_pmt_es_t *p_dvbpsies )
+static void SetupAVCDescriptors( demux_t *p_demux, ts_es_t *p_es, const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     const dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_dvbpsies, 0x28 );
     if( p_dr && p_dr->i_length >= 4 )
@@ -515,7 +515,7 @@ static void SetupAVCDescriptors( demux_t *p_demux, ts_pes_es_t *p_es, const dvbp
     }
 }
 
-static void SetupJ2KDescriptors( demux_t *p_demux, ts_pes_es_t *p_es, const dvbpsi_pmt_es_t *p_dvbpsies )
+static void SetupJ2KDescriptors( demux_t *p_demux, ts_es_t *p_es, const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     const dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_dvbpsies, 0x32 );
     if( p_dr && p_dr->i_length >= 24 )
@@ -556,7 +556,7 @@ static const char *const ppsz_teletext_type[] = {
  N_("Teletext subtitles: hearing impaired")
 };
 
-static void PMTSetupEsTeletext( demux_t *p_demux, ts_pes_t *p_pes,
+static void PMTSetupEsTeletext( demux_t *p_demux, ts_stream_t *p_pes,
                                 const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     es_format_t *p_fmt = &p_pes->p_es->fmt;
@@ -655,7 +655,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pes_t *p_pes,
     {
         for( unsigned i = 0; i < i_page; i++ )
         {
-            ts_pes_es_t *p_page_es;
+            ts_es_t *p_page_es;
 
             /* */
             if( i == 0 )
@@ -664,7 +664,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pes_t *p_pes,
             }
             else
             {
-                p_page_es = ts_pes_es_New( p_pes->p_es->p_program );
+                p_page_es = ts_es_New( p_pes->p_es->p_program );
                 if( !p_page_es )
                     break;
 
@@ -673,7 +673,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pes_t *p_pes,
                 free( p_page_es->fmt.psz_description );
                 p_page_es->fmt.psz_language = NULL;
                 p_page_es->fmt.psz_description = NULL;
-                ts_pes_Add_es( p_pes, p_page_es, true );
+                ts_stream_Add_es( p_pes, p_page_es, true );
             }
 
             /* */
@@ -693,7 +693,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pes_t *p_pes,
         }
     }
 }
-static void PMTSetupEsDvbSubtitle( demux_t *p_demux, ts_pes_t *p_pes,
+static void PMTSetupEsDvbSubtitle( demux_t *p_demux, ts_stream_t *p_pes,
                                    const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     es_format_t *p_fmt = &p_pes->p_es->fmt;
@@ -731,7 +731,7 @@ static void PMTSetupEsDvbSubtitle( demux_t *p_demux, ts_pes_t *p_pes,
     {
         for( int i = 0; i < p_sub->i_subtitles_number; i++ )
         {
-            ts_pes_es_t *p_subs_es;
+            ts_es_t *p_subs_es;
 
             /* */
             if( i == 0 )
@@ -740,7 +740,7 @@ static void PMTSetupEsDvbSubtitle( demux_t *p_demux, ts_pes_t *p_pes,
             }
             else
             {
-                p_subs_es = ts_pes_es_New( p_pes->p_es->p_program );
+                p_subs_es = ts_es_New( p_pes->p_es->p_program );
                 if( !p_subs_es )
                     break;
 
@@ -750,7 +750,7 @@ static void PMTSetupEsDvbSubtitle( demux_t *p_demux, ts_pes_t *p_pes,
                 p_subs_es->fmt.psz_language = NULL;
                 p_subs_es->fmt.psz_description = NULL;
 
-                ts_pes_Add_es( p_pes, p_subs_es, true );
+                ts_stream_Add_es( p_pes, p_subs_es, true );
             }
 
             /* */
@@ -901,7 +901,7 @@ explicit_config_too_short:
     msg_Err(demux, "Opus descriptor too short");
 }
 
-static void PMTSetupEs0x05PrivateData( demux_t *p_demux, ts_pes_es_t *p_es,
+static void PMTSetupEs0x05PrivateData( demux_t *p_demux, ts_es_t *p_es,
                                        const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     VLC_UNUSED(p_es);
@@ -922,7 +922,7 @@ static void PMTSetupEs0x05PrivateData( demux_t *p_demux, ts_pes_es_t *p_es,
     }
 }
 
-static void PMTSetupEs0x06( demux_t *p_demux, ts_pes_t *p_pes,
+static void PMTSetupEs0x06( demux_t *p_demux, ts_stream_t *p_pes,
                             const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     es_format_t *p_fmt = &p_pes->p_es->fmt;
@@ -1053,7 +1053,7 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pes_t *p_pes,
     }
 }
 
-static void PMTSetupEs0xEA( demux_t *p_demux, ts_pes_es_t *p_es,
+static void PMTSetupEs0xEA( demux_t *p_demux, ts_es_t *p_es,
                            const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     /* Registration Descriptor */
@@ -1075,7 +1075,7 @@ static void PMTSetupEs0xEA( demux_t *p_demux, ts_pes_es_t *p_es,
      * The packetizer will take care of that. */
 }
 
-static void PMTSetupEs0xD1( demux_t *p_demux, ts_pes_es_t *p_es,
+static void PMTSetupEs0xD1( demux_t *p_demux, ts_es_t *p_es,
                            const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     /* Registration Descriptor */
@@ -1093,7 +1093,7 @@ static void PMTSetupEs0xD1( demux_t *p_demux, ts_pes_es_t *p_es,
     p_fmt->i_codec = VLC_CODEC_DIRAC;
 }
 
-static void PMTSetupEs0xA0( demux_t *p_demux, ts_pes_es_t *p_es,
+static void PMTSetupEs0xA0( demux_t *p_demux, ts_es_t *p_es,
                            const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     /* MSCODEC sent by vlc */
@@ -1130,7 +1130,7 @@ static void PMTSetupEs0xA0( demux_t *p_demux, ts_pes_es_t *p_es,
     p_fmt->b_packetized = true;
 }
 
-static void PMTSetupEs0x83( const dvbpsi_pmt_t *p_pmt, ts_pes_es_t *p_es, int i_pid )
+static void PMTSetupEs0x83( const dvbpsi_pmt_t *p_pmt, ts_es_t *p_es, int i_pid )
 {
     /* WiDi broadcasts without registration on PMT 0x1, PCR 0x1000 and
      * with audio track pid being 0x1100..0x11FF */
@@ -1145,7 +1145,7 @@ static void PMTSetupEs0x83( const dvbpsi_pmt_t *p_pmt, ts_pes_es_t *p_es, int i_
         es_format_Init( &p_es->fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM );
 }
 
-static bool PMTSetupEsHDMV( demux_t *p_demux, ts_pes_es_t *p_es,
+static bool PMTSetupEsHDMV( demux_t *p_demux, ts_es_t *p_es,
                             const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     es_format_t *p_fmt = &p_es->fmt;
@@ -1201,7 +1201,7 @@ static bool PMTSetupEsHDMV( demux_t *p_demux, ts_pes_es_t *p_es,
     return true;
 }
 
-static bool PMTSetupEsRegistration( demux_t *p_demux, ts_pes_es_t *p_es,
+static bool PMTSetupEsRegistration( demux_t *p_demux, ts_es_t *p_es,
                                     const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     static const struct
@@ -1254,7 +1254,7 @@ static char *GetIso639AudioTypeDesc( uint8_t type )
     return strdup( audio_type[ --type ] );
 }
 
-static void PMTParseEsIso639( demux_t *p_demux, ts_pes_es_t *p_es,
+static void PMTParseEsIso639( demux_t *p_demux, ts_es_t *p_es,
                               const dvbpsi_pmt_es_t *p_dvbpsies )
 {
     /* get language descriptor */
@@ -1303,7 +1303,7 @@ static void PMTParseEsIso639( demux_t *p_demux, ts_pes_es_t *p_es,
     }
 }
 
-static void PIDFillFormat( demux_t *p_demux, ts_pes_t *p_pes,
+static void PIDFillFormat( demux_t *p_demux, ts_stream_t *p_pes,
                            int i_stream_type, ts_transport_type_t *p_datatype )
 {
     es_format_t *fmt = &p_pes->p_es->fmt;
@@ -1399,7 +1399,7 @@ static void FillPESFromDvbpsiES( demux_t *p_demux,
                                  const dvbpsi_pmt_es_t *p_dvbpsies,
                                  ts_pmt_registration_type_t registration_type,
                                  const ts_pmt_t *p_pmt,
-                                 ts_pes_t *p_pes )
+                                 ts_stream_t *p_pes )
 {
     ts_transport_type_t type_change = TS_TRANSPORT_PES;
     PIDFillFormat( p_demux, p_pes, p_dvbpsies->i_type, &type_change );
@@ -1634,7 +1634,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
     for( p_dvbpsies = p_dvbpsipmt->p_first_es; p_dvbpsies != NULL; p_dvbpsies = p_dvbpsies->p_next )
     {
         ts_pid_t *pespid = GetPID(p_sys, p_dvbpsies->i_pid);
-        if ( pespid->type != TYPE_PES && pespid->type != TYPE_FREE )
+        if ( pespid->type != TYPE_STREAM && pespid->type != TYPE_FREE )
         {
             msg_Warn( p_demux, " * PMT wants to create PES on pid %d used by non PES", pespid->i_pid );
             continue;
@@ -1659,10 +1659,10 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
                 msg_Dbg( p_demux, "    - ES descriptor tag 0x%x", p_dr->i_tag );
         }
 
-        const bool b_pid_inuse = ( pespid->type == TYPE_PES );
-        ts_pes_t *p_pes;
+        const bool b_pid_inuse = ( pespid->type == TYPE_STREAM );
+        ts_stream_t *p_pes;
 
-        if ( !PIDSetup( p_demux, TYPE_PES, pespid, pmtpid ) )
+        if ( !PIDSetup( p_demux, TYPE_STREAM, pespid, pmtpid ) )
         {
             msg_Warn( p_demux, "  * pid=%d type=0x%x %s (skipped)",
                       p_dvbpsies->i_pid, p_dvbpsies->i_type, psz_typedesc );
@@ -1672,7 +1672,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
         {
             if( b_pid_inuse ) /* pes will point to a temp */
             {
-                p_pes = ts_pes_New( p_demux, p_pmt );
+                p_pes = ts_stream_New( p_demux, p_pmt );
                 if( !p_pes )
                 {
                     PIDRelease( p_demux, pespid );
@@ -1681,7 +1681,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
             }
             else  /* pes will point to the new one allocated from PIDSetup */
             {
-                p_pes = pespid->u.p_pes;
+                p_pes = pespid->u.p_stream;
             }
         }
 
@@ -1718,7 +1718,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
         /* Now check and merge */
         if( b_pid_inuse ) /* We need to compare to the existing pes/es */
         {
-            ts_pes_es_t *p_existing_es = ts_pes_Find_es( pespid->u.p_pes, p_pmt );
+            ts_es_t *p_existing_es = ts_stream_Find_es( pespid->u.p_stream, p_pmt );
             if( p_existing_es )
             {
                 const es_format_t *ofmt = &p_existing_es->fmt;
@@ -1745,33 +1745,33 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
 
                 /* Check is we have any subtitles */
                 b_canreuse = b_canreuse &&
-                ( ts_pes_Count_es( p_pes->p_es->p_extraes, false, NULL ) ==
-                  ts_pes_Count_es( p_existing_es->p_extraes, false, NULL )
+                ( ts_Count_es( p_pes->p_es->p_extraes, false, NULL ) ==
+                  ts_Count_es( p_existing_es->p_extraes, false, NULL )
                 );
 
                 if( b_canreuse )
                 {
                     /* Just keep using previous es */
-                    ts_pes_Del( p_demux, p_pes );
+                    ts_stream_Del( p_demux, p_pes );
                 }
                 else
                 {
-                    ts_pes_es_t *p_new = ts_pes_Extract_es( p_pes, p_pmt );
-                    ts_pes_es_t *p_old = ts_pes_Extract_es( pespid->u.p_pes, p_pmt );
-                    ts_pes_Add_es( pespid->u.p_pes, p_new, false );
+                    ts_es_t *p_new = ts_stream_Extract_es( p_pes, p_pmt );
+                    ts_es_t *p_old = ts_stream_Extract_es( pespid->u.p_stream, p_pmt );
+                    ts_stream_Add_es( pespid->u.p_stream, p_new, false );
                     assert(p_old == p_existing_es);
-                    assert(ts_pes_Count_es(p_pes->p_es, false, NULL) == 0);
-                    ts_pes_Add_es( p_pes, p_old, false );
-                    ts_pes_Del( p_demux, p_pes );
+                    assert(ts_Count_es(p_pes->p_es, false, NULL) == 0);
+                    ts_stream_Add_es( p_pes, p_old, false );
+                    ts_stream_Del( p_demux, p_pes );
                 }
             }
             else /* There was no es for that program on that pid, merge in */
             {
-                assert(ts_pes_Count_es(pespid->u.p_pes->p_es, false, NULL)); /* Used by another program */
-                ts_pes_es_t *p_new = ts_pes_Extract_es( p_pes, p_pmt );
+                assert(ts_Count_es(pespid->u.p_stream->p_es, false, NULL)); /* Used by another program */
+                ts_es_t *p_new = ts_stream_Extract_es( p_pes, p_pmt );
                 assert( p_new );
-                ts_pes_Add_es( pespid->u.p_pes, p_new, false );
-                ts_pes_Del( p_demux, p_pes );
+                ts_stream_Add_es( pespid->u.p_stream, p_new, false );
+                ts_stream_Del( p_demux, p_pes );
             }
         }
         /* Nothing to do, pes is now just set */
@@ -1820,7 +1820,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
                 /* Set up EAS spu es */
                 if( p_pmt->e_streams.i_size )
                 {
-                    ts_pes_es_t *p_eas_es = ts_pes_es_New( p_pmt );
+                    ts_es_t *p_eas_es = ts_es_New( p_pmt );
                     if( likely(p_eas_es) )
                     {
                         p_eas_es->fmt.i_codec = VLC_CODEC_SCTE_18;
@@ -1830,7 +1830,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
                         p_eas_es->fmt.psz_description = strdup(SCTE18_DESCRIPTION);
                         if( p_psip->p_eas_es )
                         {
-                            ts_pes_es_t *p_next = p_psip->p_eas_es->p_next;
+                            ts_es_t *p_next = p_psip->p_eas_es->p_next;
                             p_psip->p_eas_es->p_next = p_eas_es;
                             p_eas_es->p_next = p_next;
                         }
@@ -1970,7 +1970,7 @@ int UserPmt( demux_t *p_demux, const char *psz_fmt )
             if( psz_arg )
                 *psz_arg++ = '\0';
 
-            if ( !PIDSetup( p_demux, TYPE_PES, pid, pmtpid ) )
+            if ( !PIDSetup( p_demux, TYPE_STREAM, pid, pmtpid ) )
                 continue;
 
             ARRAY_APPEND( p_pmt->e_streams, pid );
@@ -1978,7 +1978,7 @@ int UserPmt( demux_t *p_demux, const char *psz_fmt )
             if( p_pmt->i_pid_pcr <= 0 )
                 p_pmt->i_pid_pcr = i_pid;
 
-            es_format_t *fmt = &pid->u.p_pes->p_es->fmt;
+            es_format_t *fmt = &pid->u.p_stream->p_es->fmt;
 
             if( psz_arg && strlen( psz_arg ) == 4 )
             {
@@ -1999,7 +1999,7 @@ int UserPmt( demux_t *p_demux, const char *psz_fmt )
             else
             {
                 const int i_stream_type = strtol( psz_opt, NULL, 0 );
-                PIDFillFormat( p_demux, pid->u.p_pes, i_stream_type, &pid->u.p_pes->transport );
+                PIDFillFormat( p_demux, pid->u.p_stream, i_stream_type, &pid->u.p_stream->transport );
             }
 
             fmt->i_group = i_number;
@@ -2010,7 +2010,7 @@ int UserPmt( demux_t *p_demux, const char *psz_fmt )
             {
                 msg_Dbg( p_demux, "  * es pid=%d fcc=%4.4s", i_pid,
                          (char*)&fmt->i_codec );
-                pid->u.p_pes->p_es->id = es_out_Add( p_demux->out, fmt );
+                pid->u.p_stream->p_es->id = es_out_Add( p_demux->out, fmt );
                 p_sys->i_pmt_es++;
             }
         }
diff --git a/modules/demux/mpeg/ts_scte.c b/modules/demux/mpeg/ts_scte.c
index 0d9932b16a..1ea0b569a1 100644
--- a/modules/demux/mpeg/ts_scte.c
+++ b/modules/demux/mpeg/ts_scte.c
@@ -55,7 +55,7 @@ void SCTE18_Section_Callback( dvbpsi_t *p_handle, const dvbpsi_psi_section_t* p_
         if( i_priority != EAS_PRIORITY_HIGH && i_priority != EAS_PRIORITY_MAX )
             continue;
 
-        for( ts_pes_es_t *p_es = p_psip->p_eas_es; p_es; p_es = p_es->p_next )
+        for( ts_es_t *p_es = p_psip->p_eas_es; p_es; p_es = p_es->p_next )
         {
             if( !p_es->id && !(p_es->id = es_out_Add( p_demux->out, &p_es->fmt )) )
                 continue;
@@ -78,7 +78,7 @@ void SCTE27_Section_Callback( demux_t *p_demux,
                               void *p_pes_cb_data )
 {
     VLC_UNUSED(p_payloaddata); VLC_UNUSED(i_payloaddata);
-    ts_pes_t *p_pes = (ts_pes_t *) p_pes_cb_data;
+    ts_stream_t *p_pes = (ts_stream_t *) p_pes_cb_data;
     assert( p_pes->p_es->fmt.i_codec == VLC_CODEC_SCTE_27 );
     ts_pmt_t *p_pmt = p_pes->p_es->p_program;
     mtime_t i_date = p_pmt->pcr.i_current;
diff --git a/modules/demux/mpeg/ts_sl.c b/modules/demux/mpeg/ts_sl.c
index 60308a8be8..9ed958259a 100644
--- a/modules/demux/mpeg/ts_sl.c
+++ b/modules/demux/mpeg/ts_sl.c
@@ -51,11 +51,11 @@ const es_mpeg4_descriptor_t * GetMPEG4DescByEsId( const ts_pmt_t *pmt, uint16_t
     return NULL;
 }
 
-static ts_pes_es_t * GetPMTESBySLEsId( ts_pmt_t *pmt, uint16_t i_sl_es_id )
+static ts_es_t * GetPMTESBySLEsId( ts_pmt_t *pmt, uint16_t i_sl_es_id )
 {
     for( int i=0; i< pmt->e_streams.i_size; i++ )
     {
-        ts_pes_es_t *p_es = pmt->e_streams.p_elems[i]->u.p_pes->p_es;
+        ts_es_t *p_es = pmt->e_streams.p_elems[i]->u.p_stream->p_es;
         if( p_es->i_sl_es_id == i_sl_es_id )
             return p_es;
     }
@@ -155,7 +155,7 @@ void SLPackets_Section_Handler( demux_t *p_demux,
                                 void *p_pes_cbdata )
 {
     VLC_UNUSED(p_sectiondata); VLC_UNUSED(i_sectiondata);
-    ts_pes_t *p_pes = (ts_pes_t *) p_pes_cbdata;
+    ts_stream_t *p_pes = (ts_stream_t *) p_pes_cbdata;
     ts_pmt_t *p_pmt = p_pes->p_es->p_program;
 
     const es_mpeg4_descriptor_t *p_mpeg4desc = GetMPEG4DescByEsId( p_pmt, p_pes->p_es->i_sl_es_id );
@@ -177,7 +177,7 @@ void SLPackets_Section_Handler( demux_t *p_demux,
             for( int j = 0; j < ES_DESCRIPTOR_COUNT && p_od->es_descr[j].b_ok; j++ )
             {
                 p_mpeg4desc = &p_od->es_descr[j];
-                ts_pes_es_t *p_es = GetPMTESBySLEsId( p_pmt, p_mpeg4desc->i_es_id );
+                ts_es_t *p_es = GetPMTESBySLEsId( p_pmt, p_mpeg4desc->i_es_id );
                 es_format_t fmt;
                 es_format_Init( &fmt, UNKNOWN_ES, 0 );
                 fmt.i_id = p_es->fmt.i_id;
@@ -205,7 +205,7 @@ void SLPackets_Section_Handler( demux_t *p_demux,
     }
 }
 
-block_t * SLProcessPacketized( ts_pes_t *p_pes, ts_pes_es_t *p_es, block_t *p_block )
+block_t * SLProcessPacketized( ts_stream_t *p_pes, ts_es_t *p_es, block_t *p_block )
 {
     ts_pmt_t *p_pmt = p_es->p_program;
     const es_mpeg4_descriptor_t *p_desc = GetMPEG4DescByEsId( p_pmt, p_es->i_sl_es_id );
diff --git a/modules/demux/mpeg/ts_sl.h b/modules/demux/mpeg/ts_sl.h
index 009f118710..0d45b92c32 100644
--- a/modules/demux/mpeg/ts_sl.h
+++ b/modules/demux/mpeg/ts_sl.h
@@ -30,6 +30,6 @@ void SLPackets_Section_Handler( demux_t *p_demux,
 bool SetupISO14496LogicalStream( demux_t *, const decoder_config_descriptor_t *,
                                   es_format_t * );
 
-block_t * SLProcessPacketized( ts_pes_t *p_pes, ts_pes_es_t *p_es, block_t *p_block );
+block_t * SLProcessPacketized( ts_stream_t *, ts_es_t *, block_t * );
 
 #endif
diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index 7f8d4b09d4..30fe3153ed 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -162,9 +162,9 @@ void ts_pmt_Del( demux_t *p_demux, ts_pmt_t *pmt )
     free( pmt );
 }
 
-ts_pes_es_t * ts_pes_es_New( ts_pmt_t *p_program )
+ts_es_t * ts_es_New( ts_pmt_t *p_program )
 {
-    ts_pes_es_t *p_es = malloc( sizeof(*p_es) );
+    ts_es_t *p_es = malloc( sizeof(*p_es) );
     if( p_es )
     {
         p_es->p_program = p_program;
@@ -182,7 +182,7 @@ ts_pes_es_t * ts_pes_es_New( ts_pmt_t *p_program )
     return p_es;
 }
 
-static void ts_pes_es_Clean( demux_t *p_demux, ts_pes_es_t *p_es )
+static void ts_pes_es_Clean( demux_t *p_demux, ts_es_t *p_es )
 {
     if( p_es && p_es->id )
     {
@@ -194,9 +194,9 @@ static void ts_pes_es_Clean( demux_t *p_demux, ts_pes_es_t *p_es )
     es_format_Clean( &p_es->fmt );
 }
 
-void ts_pes_Add_es( ts_pes_t *p_pes, ts_pes_es_t *p_es, bool b_extra )
+void ts_stream_Add_es( ts_stream_t *p_pes, ts_es_t *p_es, bool b_extra )
 {
-    ts_pes_es_t **pp_es = (b_extra && p_pes->p_es) ?  /* Ensure extra has main es */
+    ts_es_t **pp_es = (b_extra && p_pes->p_es) ?  /* Ensure extra has main es */
                            &p_pes->p_es->p_extraes :
                            &p_pes->p_es;
     if( likely(!*pp_es) )
@@ -205,15 +205,15 @@ void ts_pes_Add_es( ts_pes_t *p_pes, ts_pes_es_t *p_es, bool b_extra )
     }
     else
     {
-        ts_pes_es_t *p_next = (*pp_es)->p_next;
+        ts_es_t *p_next = (*pp_es)->p_next;
         (*pp_es)->p_next = p_es;
         p_es->p_next = p_next;
     }
 }
 
-ts_pes_es_t * ts_pes_Find_es( ts_pes_t *p_pes, const ts_pmt_t *p_pmt )
+ts_es_t * ts_stream_Find_es( ts_stream_t *p_pes, const ts_pmt_t *p_pmt )
 {
-    for( ts_pes_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
+    for( ts_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
     {
         if( p_es->p_program == p_pmt )
             return p_es;
@@ -221,10 +221,10 @@ ts_pes_es_t * ts_pes_Find_es( ts_pes_t *p_pes, const ts_pmt_t *p_pmt )
     return NULL;
 }
 
-ts_pes_es_t * ts_pes_Extract_es( ts_pes_t *p_pes, const ts_pmt_t *p_pmt )
+ts_es_t * ts_stream_Extract_es( ts_stream_t *p_pes, const ts_pmt_t *p_pmt )
 {
-    ts_pes_es_t **pp_prev = &p_pes->p_es;
-    for( ts_pes_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
+    ts_es_t **pp_prev = &p_pes->p_es;
+    for( ts_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
     {
         if( p_es->p_program == p_pmt )
         {
@@ -237,22 +237,22 @@ ts_pes_es_t * ts_pes_Extract_es( ts_pes_t *p_pes, const ts_pmt_t *p_pmt )
     return NULL;
 }
 
-size_t ts_pes_Count_es( const ts_pes_es_t *p_es, bool b_active, const ts_pmt_t *p_pmt )
+size_t ts_Count_es( const ts_es_t *p_es, bool b_active, const ts_pmt_t *p_pmt )
 {
     size_t i=0;
     for( ; p_es; p_es = p_es->p_next )
     {
         i += ( b_active ) ? !!p_es->id : ( ( !p_pmt || p_pmt == p_es->p_program ) ? 1 : 0 );
-        i += ts_pes_Count_es( p_es->p_extraes, b_active, p_pmt );
+        i += ts_Count_es( p_es->p_extraes, b_active, p_pmt );
     }
     return i;
 }
 
-static void ts_pes_ChainDelete_es( demux_t *p_demux, ts_pes_es_t *p_es )
+static void ts_pes_ChainDelete_es( demux_t *p_demux, ts_es_t *p_es )
 {
     while( p_es )
     {
-        ts_pes_es_t *p_next = p_es->p_next;
+        ts_es_t *p_next = p_es->p_next;
         ts_pes_ChainDelete_es( p_demux, p_es->p_extraes );
         ts_pes_es_Clean( p_demux, p_es );
         free( p_es );
@@ -260,14 +260,14 @@ static void ts_pes_ChainDelete_es( demux_t *p_demux, ts_pes_es_t *p_es )
     }
 }
 
-ts_pes_t *ts_pes_New( demux_t *p_demux, ts_pmt_t *p_program )
+ts_stream_t *ts_stream_New( demux_t *p_demux, ts_pmt_t *p_program )
 {
     VLC_UNUSED(p_demux);
-    ts_pes_t *pes = malloc( sizeof( ts_pes_t ) );
+    ts_stream_t *pes = malloc( sizeof( ts_stream_t ) );
     if( !pes )
         return NULL;
 
-    pes->p_es = ts_pes_es_New( p_program );
+    pes->p_es = ts_es_New( p_program );
     if( !pes->p_es )
     {
         free( pes );
@@ -291,7 +291,7 @@ ts_pes_t *ts_pes_New( demux_t *p_demux, ts_pmt_t *p_program )
     return pes;
 }
 
-void ts_pes_Del( demux_t *p_demux, ts_pes_t *pes )
+void ts_stream_Del( demux_t *p_demux, ts_stream_t *pes )
 {
     ts_pes_ChainDelete_es( p_demux, pes->p_es );
 
diff --git a/modules/demux/mpeg/ts_streams.h b/modules/demux/mpeg/ts_streams.h
index 69a597198c..36e547ee1b 100644
--- a/modules/demux/mpeg/ts_streams.h
+++ b/modules/demux/mpeg/ts_streams.h
@@ -19,10 +19,10 @@
 #ifndef VLC_TS_STREAMS_H
 #define VLC_TS_STREAMS_H
 
-typedef struct ts_pes_es_t ts_pes_es_t;
+typedef struct ts_es_t ts_es_t;
 typedef struct ts_pat_t ts_pat_t;
 typedef struct ts_pmt_t ts_pmt_t;
-typedef struct ts_pes_t ts_pes_t;
+typedef struct ts_stream_t ts_stream_t;
 typedef struct ts_si_t  ts_si_t;
 typedef struct ts_psip_t ts_psip_t;
 
@@ -34,14 +34,14 @@ ts_pmt_t *ts_pat_Get_pmt( ts_pat_t *, uint16_t );
 ts_pmt_t *ts_pmt_New( demux_t * );
 void ts_pmt_Del( demux_t *, ts_pmt_t * );
 
-ts_pes_es_t * ts_pes_es_New( ts_pmt_t * );
-void ts_pes_Add_es( ts_pes_t *, ts_pes_es_t *, bool );
-ts_pes_es_t * ts_pes_Extract_es( ts_pes_t *, const ts_pmt_t * );
-ts_pes_es_t * ts_pes_Find_es( ts_pes_t *, const ts_pmt_t * );
-size_t ts_pes_Count_es( const ts_pes_es_t *, bool, const ts_pmt_t * );
+ts_es_t * ts_es_New( ts_pmt_t * );
+void ts_stream_Add_es( ts_stream_t *, ts_es_t *, bool );
+ts_es_t * ts_stream_Extract_es( ts_stream_t *, const ts_pmt_t * );
+ts_es_t * ts_stream_Find_es( ts_stream_t *, const ts_pmt_t * );
+size_t ts_Count_es( const ts_es_t *, bool, const ts_pmt_t * );
 
-ts_pes_t *ts_pes_New( demux_t *, ts_pmt_t * );
-void ts_pes_Del( demux_t *, ts_pes_t * );
+ts_stream_t *ts_stream_New( demux_t *, ts_pmt_t * );
+void ts_stream_Del( demux_t *, ts_stream_t * );
 
 ts_si_t *ts_si_New( demux_t * );
 void ts_si_Del( demux_t *, ts_si_t * );
diff --git a/modules/demux/mpeg/ts_streams_private.h b/modules/demux/mpeg/ts_streams_private.h
index ebb8f546c3..2db0d94ba7 100644
--- a/modules/demux/mpeg/ts_streams_private.h
+++ b/modules/demux/mpeg/ts_streams_private.h
@@ -76,15 +76,15 @@ struct ts_pmt_t
 
 };
 
-struct ts_pes_es_t
+struct ts_es_t
 {
     ts_pmt_t *p_program;
     es_format_t  fmt;
     es_out_id_t *id;
     uint16_t i_sl_es_id;
     int         i_next_block_flags;
-    ts_pes_es_t *p_extraes; /* Some private streams encapsulate several ES (eg. DVB subtitles) */
-    ts_pes_es_t *p_next; /* Next es on same pid from different pmt (shared pid) */
+    ts_es_t *p_extraes; /* Some private streams encapsulate several ES (eg. DVB subtitles) */
+    ts_es_t *p_next; /* Next es on same pid from different pmt (shared pid) */
     /* J2K stuff */
     uint8_t  b_interlaced;
     /* Metadata */
@@ -102,9 +102,9 @@ typedef enum
     TS_TRANSPORT_IGNORE
 } ts_transport_type_t;
 
-struct ts_pes_t
+struct ts_stream_t
 {
-    ts_pes_es_t *p_es;
+    ts_es_t *p_es;
 
     uint8_t i_stream_type;
 
@@ -155,7 +155,7 @@ struct ts_psip_t
 {
     dvbpsi_t       *handle;
     int             i_version;
-    ts_pes_es_t    *p_eas_es;
+    ts_es_t    *p_eas_es;
     ts_psip_context_t *p_ctx;
     /* Used to track list of active pid for eit/ett, to call PIDRelease on them.
        VCT table could have been used, but PIDSetup can fail, and we can't alter




More information about the vlc-commits mailing list