summaryrefslogtreecommitdiffstats
path: root/gst/mpegdemux
diff options
context:
space:
mode:
authorJosep Torra <n770galaxy@gmail.com>2009-08-07 19:00:23 +0200
committerJosep Torra <n770galaxy@gmail.com>2009-08-07 19:00:23 +0200
commit1a9b54b7818b59786c524ff2604fd58cf926d3b7 (patch)
treea06aea6885962fa0dbc06387bcaa3b39187e2cf0 /gst/mpegdemux
parentda95f4a873624ab92ceec191f8b4ccc49247c3dd (diff)
downloadgst-plugins-bad-1a9b54b7818b59786c524ff2604fd58cf926d3b7.tar.gz
gst-plugins-bad-1a9b54b7818b59786c524ff2604fd58cf926d3b7.tar.bz2
gst-plugins-bad-1a9b54b7818b59786c524ff2604fd58cf926d3b7.zip
mpegtsdemux: added VC1, EAC3 and LPCM related to blueray/hdmv
Diffstat (limited to 'gst/mpegdemux')
-rw-r--r--gst/mpegdemux/gstmpegdefs.h65
-rw-r--r--gst/mpegdemux/gstmpegtsdemux.c28
2 files changed, 62 insertions, 31 deletions
diff --git a/gst/mpegdemux/gstmpegdefs.h b/gst/mpegdemux/gstmpegdefs.h
index 375f1dc0..40551137 100644
--- a/gst/mpegdemux/gstmpegdefs.h
+++ b/gst/mpegdemux/gstmpegdefs.h
@@ -147,39 +147,52 @@
* 0x0F-0x7F ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved
* 0x80-0xFF User Private
*/
-#define ST_RESERVED 0x00
-#define ST_VIDEO_MPEG1 0x01
-#define ST_VIDEO_MPEG2 0x02
-#define ST_AUDIO_MPEG1 0x03
-#define ST_AUDIO_MPEG2 0x04
-#define ST_PRIVATE_SECTIONS 0x05
-#define ST_PRIVATE_DATA 0x06
-#define ST_MHEG 0x07
-#define ST_DSMCC 0x08
-#define ST_H222_1 0x09
+#define ST_RESERVED 0x00
+#define ST_VIDEO_MPEG1 0x01
+#define ST_VIDEO_MPEG2 0x02
+#define ST_AUDIO_MPEG1 0x03
+#define ST_AUDIO_MPEG2 0x04
+#define ST_PRIVATE_SECTIONS 0x05
+#define ST_PRIVATE_DATA 0x06
+#define ST_MHEG 0x07
+#define ST_DSMCC 0x08
+#define ST_H222_1 0x09
/* later extensions */
-#define ST_AUDIO_AAC 0x0f
-#define ST_VIDEO_MPEG4 0x10
-#define ST_VIDEO_H264 0x1b
+#define ST_AUDIO_AAC 0x0f
+#define ST_VIDEO_MPEG4 0x10
+#define ST_VIDEO_H264 0x1b
/* Un-official Dirac extension */
-#define ST_VIDEO_DIRAC 0xd1
+#define ST_VIDEO_DIRAC 0xd1
/* private stream types */
-#define ST_PS_AUDIO_AC3 0x81
-#define ST_PS_AUDIO_DTS 0x8a
-#define ST_PS_AUDIO_LPCM 0x8b
+#define ST_PS_AUDIO_AC3 0x81
+#define ST_PS_AUDIO_DTS 0x8a
+#define ST_PS_AUDIO_LPCM 0x8b
#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_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
* 0xA0 ISO/IEC 61834-11
* 0xA1 ISO/IEC 61834-11
*/
-#define ST_HDV_AUX_A 0xa0
-#define ST_HDV_AUX_V 0xa1
+#define ST_HDV_AUX_A 0xa0
+#define ST_HDV_AUX_V 0xa1
/* Un-official time-code stream */
#define ST_PS_TIMECODE 0xd2
@@ -202,16 +215,16 @@
/* sync:4 == 00xx ! pts:3 ! 1 ! pts:15 ! 1 | pts:15 ! 1 */
#define READ_TS(data, target, lost_sync_label) \
if ((*data & 0x01) != 0x01) goto lost_sync_label; \
- target = ((guint64) (*data++ & 0x0E)) << 29; \
- target |= ((guint64) (*data++ )) << 22; \
+ target = ((guint64) (*data++ & 0x0E)) << 29; \
+ target |= ((guint64) (*data++ )) << 22; \
if ((*data & 0x01) != 0x01) goto lost_sync_label; \
- target |= ((guint64) (*data++ & 0xFE)) << 14; \
- target |= ((guint64) (*data++ )) << 7; \
+ target |= ((guint64) (*data++ & 0xFE)) << 14; \
+ target |= ((guint64) (*data++ )) << 7; \
if ((*data & 0x01) != 0x01) goto lost_sync_label; \
target |= ((guint64) (*data++ & 0xFE)) >> 1;
/* some extra GstFlowReturn values used internally */
-#define GST_FLOW_NEED_MORE_DATA -100
-#define GST_FLOW_LOST_SYNC -101
+#define GST_FLOW_NEED_MORE_DATA -100
+#define GST_FLOW_LOST_SYNC -101
#endif /* __GST_MPEG_DEFS_H__ */
diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c
index 7873266a..811646ee 100644
--- a/gst/mpegdemux/gstmpegtsdemux.c
+++ b/gst/mpegdemux/gstmpegtsdemux.c
@@ -119,7 +119,10 @@ enum
"mpegversion = (int) { 1, 2, 4 }, " \
"systemstream = (boolean) FALSE; " \
"video/x-h264;" \
- "video/x-dirac" \
+ "video/x-dirac;" \
+ "video/x-wmv," \
+ "wmvversion = (int) 3, " \
+ "format = (fourcc) WVC1" \
)
#define AUDIO_CAPS \
@@ -133,8 +136,9 @@ enum
"dynamic_range = (int) [ 0, 255 ], " \
"emphasis = (boolean) { FALSE, TRUE }, " \
"mute = (boolean) { FALSE, TRUE }; " \
- "audio/x-ac3;" \
- "audio/x-dts" \
+ "audio/x-ac3; audio/x-eac3;" \
+ "audio/x-dts;" \
+ "audio/x-private1-lpcm" \
)
/* 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_MPEG4:
case ST_VIDEO_H264:
+ case ST_VIDEO_VC1:
return TRUE;
case ST_VIDEO_DIRAC:
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);
}
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;
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;
case ST_PS_AUDIO_DTS:
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);
caps = gst_caps_new_simple ("audio/x-lpcm", NULL);
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:
template = klass->subpicture_template;
name = g_strdup_printf ("subpicture_%04x", stream->PID);