From 633b4db556c7f9eaaa2819df6023013c533e2157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Zanelli?= Date: Tue, 24 Mar 2015 15:17:16 +0100 Subject: [PATCH] tsdemux: enable Chinese AVS video stream Chinese broadcaster encapsulate AVS video codec into MPEG2-TS. They use the stream_id 0x42 to identify AVS video streams. It should be noted that this id is currently within the ISO reserved range, hence it's utilisation is unofficial. https://bugzilla.gnome.org/show_bug.cgi?id=727731 --- gst/mpegtsdemux/tsdemux.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 52ed207d50..5e54bec5dc 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -205,6 +205,7 @@ struct _TSDemuxStream "video/x-h264,stream-format=(string)byte-stream," \ "alignment=(string)nal;" \ "video/x-dirac;" \ + "video/x-cavs;" \ "video/x-wmv," \ "wmvversion = (int) 3, " \ "format = (string) WVC1" \ @@ -1349,6 +1350,13 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, caps = gst_caps_new_empty_simple ("subpicture/x-dvd"); sparse = TRUE; break; + case 0x42: + /* hack for Chinese AVS video stream which use 0x42 as stream_id + * NOTE: this is unofficial and within the ISO reserved range. */ + template = gst_static_pad_template_get (&video_template); + name = g_strdup_printf ("video_%04x", bstream->pid); + caps = gst_caps_new_empty_simple ("video/x-cavs"); + break; default: GST_WARNING ("Non-media stream (stream_type:0x%x). Not creating pad", bstream->stream_type);