tsdemux: enable Chinese AVS video stream
authorAurélien Zanelli <aurelien.zanelli@parrot.com>
Tue, 24 Mar 2015 14:17:16 +0000 (15:17 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 2 Jun 2015 11:41:26 +0000 (12:41 +0100)
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

index 52ed207..5e54bec 100644 (file)
@@ -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);