[vlc-commits] demux: ts: rename transport type field
Francois Cartegnie
git at videolan.org
Sun Mar 6 23:37:23 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Mar 6 22:33:37 2016 +0100| [24f3724abc6ee8d54f40d5197d6c3fc1f1b8ab35] | committer: Francois Cartegnie
demux: ts: rename transport type field
and add ignored one, fully blacklist dsm cc
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=24f3724abc6ee8d54f40d5197d6c3fc1f1b8ab35
---
modules/demux/mpeg/ts.c | 10 +++++++---
modules/demux/mpeg/ts_psi.c | 23 +++++++++++++----------
modules/demux/mpeg/ts_streams.c | 2 +-
modules/demux/mpeg/ts_streams_private.h | 9 +++++----
4 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 5a3f4c0..f70844b 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2317,14 +2317,18 @@ static bool ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt )
return i_ret;
}
- if( pid->u.p_pes->data_type == TS_ES_DATA_TABLE_SECTION )
+ if( pid->u.p_pes->transport == TS_TRANSPORT_PES )
+ {
+ return GatherPESData( p_demux, pid, p_pkt, i_skip, b_unit_start );
+ }
+ else if( pid->u.p_pes->transport == TS_TRANSPORT_SECTIONS )
{
ts_sections_processor_Push( pid->u.p_pes->p_sections_proc, p_pkt );
return VLC_DEMUXER_SUCCESS;
}
- else
+ else // pid->u.p_pes->transport == TS_TRANSPORT_IGNORE
{
- return GatherPESData( p_demux, pid, p_pkt, i_skip, b_unit_start );
+ return VLC_DEMUXER_SUCCESS;
}
}
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 4aacec9..34d3334 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -54,7 +54,7 @@
#include <assert.h>
-static void PIDFillFormat( demux_t *, ts_pes_t *p_pes, int i_stream_type, ts_es_data_type_t * );
+static void PIDFillFormat( demux_t *, ts_pes_t *p_pes, int i_stream_type, ts_transport_type_t * );
static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt );
static int PATCheck( demux_t *p_demux, dvbpsi_pat_t *p_pat )
@@ -1189,7 +1189,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,
- int i_stream_type, ts_es_data_type_t *p_datatype )
+ int i_stream_type, ts_transport_type_t *p_datatype )
{
es_format_t *fmt = &p_pes->p_es->fmt;
switch( i_stream_type )
@@ -1227,7 +1227,7 @@ static void PIDFillFormat( demux_t *p_demux, ts_pes_t *p_pes,
break;
case 0x82: /* SCTE-27 (sub) */
es_format_Init( fmt, SPU_ES, VLC_CODEC_SCTE_27 );
- *p_datatype = TS_ES_DATA_TABLE_SECTION;
+ *p_datatype = TS_TRANSPORT_SECTIONS;
ts_sections_processor_Add( p_demux, &p_pes->p_sections_proc, 0xC6, 0x00,
SCTE27_Section_Callback, p_pes );
break;
@@ -1275,7 +1275,7 @@ static void FillPESFromDvbpsiES( demux_t *p_demux,
const ts_pmt_t *p_pmt,
ts_pes_t *p_pes )
{
- ts_es_data_type_t type_change = TS_ES_DATA_PES;
+ ts_transport_type_t type_change = TS_TRANSPORT_PES;
PIDFillFormat( p_demux, p_pes, p_dvbpsies->i_type, &type_change );
p_pes->i_stream_type = p_dvbpsies->i_type;
@@ -1299,23 +1299,26 @@ static void FillPESFromDvbpsiES( demux_t *p_demux,
if ( !b_registration_applied )
{
- p_pes->data_type = type_change; /* Only change type if registration has not changed meaning */
+ p_pes->transport = type_change; /* Only change type if registration has not changed meaning */
switch( p_dvbpsies->i_type )
{
case 0x05: /* Private data in sections */
- p_pes->data_type = TS_ES_DATA_TABLE_SECTION;
+ p_pes->transport = TS_TRANSPORT_SECTIONS;
break;
case 0x06:
/* Handle PES private data */
PMTSetupEs0x06( p_demux, p_pes, p_dvbpsies );
break;
- case 0x0b: /* DSM-CC */
- p_pes->data_type = TS_ES_DATA_TABLE_SECTION;
+ case 0x0a: /* DSM-CC */
+ case 0x0b:
+ case 0x0c:
+ case 0x0d:
+ p_pes->transport = TS_TRANSPORT_IGNORE;
break;
/* All other private or reserved types */
case 0x13: /* SL in sections */
- p_pes->data_type = TS_ES_DATA_TABLE_SECTION;
+ p_pes->transport = TS_TRANSPORT_SECTIONS;
//ft
case 0x0f:
case 0x10:
@@ -1809,7 +1812,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->data_type );
+ PIDFillFormat( p_demux, pid->u.p_pes, i_stream_type, &pid->u.p_pes->transport );
}
fmt->i_group = i_number;
diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index 9a082bc..379796e 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -270,7 +270,7 @@ ts_pes_t *ts_pes_New( demux_t *p_demux, ts_pmt_t *p_program )
return NULL;
}
pes->i_stream_type = 0;
- pes->data_type = TS_ES_DATA_PES;
+ pes->transport = TS_TRANSPORT_PES;
pes->i_data_size = 0;
pes->i_data_gathered = 0;
pes->p_data = NULL;
diff --git a/modules/demux/mpeg/ts_streams_private.h b/modules/demux/mpeg/ts_streams_private.h
index 5fbfbbd..a01068d 100644
--- a/modules/demux/mpeg/ts_streams_private.h
+++ b/modules/demux/mpeg/ts_streams_private.h
@@ -89,9 +89,10 @@ struct ts_pes_es_t
typedef enum
{
- TS_ES_DATA_PES,
- TS_ES_DATA_TABLE_SECTION
-} ts_es_data_type_t;
+ TS_TRANSPORT_PES,
+ TS_TRANSPORT_SECTIONS,
+ TS_TRANSPORT_IGNORE
+} ts_transport_type_t;
struct ts_pes_t
{
@@ -99,7 +100,7 @@ struct ts_pes_t
uint8_t i_stream_type;
- ts_es_data_type_t data_type;
+ ts_transport_type_t transport;
int i_data_size;
int i_data_gathered;
block_t *p_data;
More information about the vlc-commits
mailing list