mpegtsdemux: added VC1, EAC3 and LPCM related to blueray/hdmv

This commit is contained in:
Josep Torra 2009-08-07 19:00:23 +02:00
parent da95f4a873
commit 1a9b54b781
2 changed files with 62 additions and 31 deletions

View File

@ -147,39 +147,52 @@
* 0x0F-0x7F ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved * 0x0F-0x7F ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved
* 0x80-0xFF User Private * 0x80-0xFF User Private
*/ */
#define ST_RESERVED 0x00 #define ST_RESERVED 0x00
#define ST_VIDEO_MPEG1 0x01 #define ST_VIDEO_MPEG1 0x01
#define ST_VIDEO_MPEG2 0x02 #define ST_VIDEO_MPEG2 0x02
#define ST_AUDIO_MPEG1 0x03 #define ST_AUDIO_MPEG1 0x03
#define ST_AUDIO_MPEG2 0x04 #define ST_AUDIO_MPEG2 0x04
#define ST_PRIVATE_SECTIONS 0x05 #define ST_PRIVATE_SECTIONS 0x05
#define ST_PRIVATE_DATA 0x06 #define ST_PRIVATE_DATA 0x06
#define ST_MHEG 0x07 #define ST_MHEG 0x07
#define ST_DSMCC 0x08 #define ST_DSMCC 0x08
#define ST_H222_1 0x09 #define ST_H222_1 0x09
/* later extensions */ /* later extensions */
#define ST_AUDIO_AAC 0x0f #define ST_AUDIO_AAC 0x0f
#define ST_VIDEO_MPEG4 0x10 #define ST_VIDEO_MPEG4 0x10
#define ST_VIDEO_H264 0x1b #define ST_VIDEO_H264 0x1b
/* Un-official Dirac extension */ /* Un-official Dirac extension */
#define ST_VIDEO_DIRAC 0xd1 #define ST_VIDEO_DIRAC 0xd1
/* private stream types */ /* private stream types */
#define ST_PS_AUDIO_AC3 0x81 #define ST_PS_AUDIO_AC3 0x81
#define ST_PS_AUDIO_DTS 0x8a #define ST_PS_AUDIO_DTS 0x8a
#define ST_PS_AUDIO_LPCM 0x8b #define ST_PS_AUDIO_LPCM 0x8b
#define ST_PS_DVD_SUBPICTURE 0xff #define ST_PS_DVD_SUBPICTURE 0xff
/* Blu-ray PGS subpictures */ /* Blu-ray related */
#define ST_BD_AUDIO_LPCM 0x80
#define ST_BD_AUDIO_AC3 0x81
#define ST_BD_AUDIO_DTS 0x82
#define ST_BD_AUDIO_AC3_TRUE_HD 0x83
#define ST_BD_AUDIO_AC3_PLUS 0x84
#define ST_BD_AUDIO_DTS_HD 0x85
#define ST_BD_PGS_SUBPICTURE 0x90 #define ST_BD_PGS_SUBPICTURE 0x90
#define ST_BD_IGS 0x91
#define ST_BD_SUBTITLE 0x92
#define ST_BD_SECONDARY_AC3_PLUS 0xa1
#define ST_BD_SECONDARY_DTS_HD 0xa2
/* VC1 extension */
#define ST_VIDEO_VC1 0xea
/* HDV AUX stream mapping /* HDV AUX stream mapping
* 0xA0 ISO/IEC 61834-11 * 0xA0 ISO/IEC 61834-11
* 0xA1 ISO/IEC 61834-11 * 0xA1 ISO/IEC 61834-11
*/ */
#define ST_HDV_AUX_A 0xa0 #define ST_HDV_AUX_A 0xa0
#define ST_HDV_AUX_V 0xa1 #define ST_HDV_AUX_V 0xa1
/* Un-official time-code stream */ /* Un-official time-code stream */
#define ST_PS_TIMECODE 0xd2 #define ST_PS_TIMECODE 0xd2
@ -202,16 +215,16 @@
/* sync:4 == 00xx ! pts:3 ! 1 ! pts:15 ! 1 | pts:15 ! 1 */ /* sync:4 == 00xx ! pts:3 ! 1 ! pts:15 ! 1 | pts:15 ! 1 */
#define READ_TS(data, target, lost_sync_label) \ #define READ_TS(data, target, lost_sync_label) \
if ((*data & 0x01) != 0x01) goto lost_sync_label; \ if ((*data & 0x01) != 0x01) goto lost_sync_label; \
target = ((guint64) (*data++ & 0x0E)) << 29; \ target = ((guint64) (*data++ & 0x0E)) << 29; \
target |= ((guint64) (*data++ )) << 22; \ target |= ((guint64) (*data++ )) << 22; \
if ((*data & 0x01) != 0x01) goto lost_sync_label; \ if ((*data & 0x01) != 0x01) goto lost_sync_label; \
target |= ((guint64) (*data++ & 0xFE)) << 14; \ target |= ((guint64) (*data++ & 0xFE)) << 14; \
target |= ((guint64) (*data++ )) << 7; \ target |= ((guint64) (*data++ )) << 7; \
if ((*data & 0x01) != 0x01) goto lost_sync_label; \ if ((*data & 0x01) != 0x01) goto lost_sync_label; \
target |= ((guint64) (*data++ & 0xFE)) >> 1; target |= ((guint64) (*data++ & 0xFE)) >> 1;
/* some extra GstFlowReturn values used internally */ /* some extra GstFlowReturn values used internally */
#define GST_FLOW_NEED_MORE_DATA -100 #define GST_FLOW_NEED_MORE_DATA -100
#define GST_FLOW_LOST_SYNC -101 #define GST_FLOW_LOST_SYNC -101
#endif /* __GST_MPEG_DEFS_H__ */ #endif /* __GST_MPEG_DEFS_H__ */

View File

@ -119,7 +119,10 @@ enum
"mpegversion = (int) { 1, 2, 4 }, " \ "mpegversion = (int) { 1, 2, 4 }, " \
"systemstream = (boolean) FALSE; " \ "systemstream = (boolean) FALSE; " \
"video/x-h264;" \ "video/x-h264;" \
"video/x-dirac" \ "video/x-dirac;" \
"video/x-wmv," \
"wmvversion = (int) 3, " \
"format = (fourcc) WVC1" \
) )
#define AUDIO_CAPS \ #define AUDIO_CAPS \
@ -133,8 +136,9 @@ enum
"dynamic_range = (int) [ 0, 255 ], " \ "dynamic_range = (int) [ 0, 255 ], " \
"emphasis = (boolean) { FALSE, TRUE }, " \ "emphasis = (boolean) { FALSE, TRUE }, " \
"mute = (boolean) { FALSE, TRUE }; " \ "mute = (boolean) { FALSE, TRUE }; " \
"audio/x-ac3;" \ "audio/x-ac3; audio/x-eac3;" \
"audio/x-dts" \ "audio/x-dts;" \
"audio/x-private1-lpcm" \
) )
/* Can also use the subpicture pads for text subtitles? */ /* Can also use the subpicture pads for text subtitles? */
@ -556,6 +560,7 @@ gst_mpegts_stream_is_video (GstMpegTSStream * stream)
case ST_VIDEO_MPEG2: case ST_VIDEO_MPEG2:
case ST_VIDEO_MPEG4: case ST_VIDEO_MPEG4:
case ST_VIDEO_H264: case ST_VIDEO_H264:
case ST_VIDEO_VC1:
return TRUE; return TRUE;
case ST_VIDEO_DIRAC: case ST_VIDEO_DIRAC:
return gst_mpegts_is_dirac_stream (stream); return gst_mpegts_is_dirac_stream (stream);
@ -652,10 +657,18 @@ gst_mpegts_demux_fill_stream (GstMpegTSStream * stream, guint8 id,
caps = gst_caps_new_simple ("video/x-dirac", NULL); caps = gst_caps_new_simple ("video/x-dirac", NULL);
} }
break; break;
case ST_PS_AUDIO_AC3: case ST_VIDEO_VC1:
template = klass->video_template;
name = g_strdup_printf ("video_%04x", stream->PID);
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 3,
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('W', 'V', 'C', '1'),
NULL);
break;
case ST_BD_AUDIO_AC3:
template = klass->audio_template; template = klass->audio_template;
name = g_strdup_printf ("audio_%04x", stream->PID); name = g_strdup_printf ("audio_%04x", stream->PID);
caps = gst_caps_new_simple ("audio/x-ac3", NULL); caps = gst_caps_new_simple ("audio/x-eac3", NULL);
break; break;
case ST_PS_AUDIO_DTS: case ST_PS_AUDIO_DTS:
template = klass->audio_template; template = klass->audio_template;
@ -667,6 +680,11 @@ gst_mpegts_demux_fill_stream (GstMpegTSStream * stream, guint8 id,
name = g_strdup_printf ("audio_%04x", stream->PID); name = g_strdup_printf ("audio_%04x", stream->PID);
caps = gst_caps_new_simple ("audio/x-lpcm", NULL); caps = gst_caps_new_simple ("audio/x-lpcm", NULL);
break; break;
case ST_BD_AUDIO_LPCM:
template = klass->audio_template;
name = g_strdup_printf ("audio_%04x", stream->PID);
caps = gst_caps_new_simple ("audio/x-private1-lpcm", NULL);
break;
case ST_PS_DVD_SUBPICTURE: case ST_PS_DVD_SUBPICTURE:
template = klass->subpicture_template; template = klass->subpicture_template;
name = g_strdup_printf ("subpicture_%04x", stream->PID); name = g_strdup_printf ("subpicture_%04x", stream->PID);