summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ashley <bugzilla@ashley-family.net>2013-08-30 11:48:51 +0100
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-04 13:34:00 +0200
commit61153a5ac231141e4395b9f0bb28a26fa808a098 (patch)
tree4a505faf5d48cb3ece1a1d0a0c0c939eba5f1b77
parent690ca42e6e099e36063494face393725edd42ee8 (diff)
avcodecmap: exclude avc3 stream format from AV_CODEC_ID_H264HEADmaster
As part of the changes to support the "avc3" variant of the ISO-BMFF (see bug #702004) a new stream-format has been created (video/x-h264, stream-format="avc3", alignment="au") that requires changes to gstavcodecmap to exclude this format because avdec_h264 expects the SPS and PPS to be in the codec_data. Amendment 2 of ISO/IEC 14496-15 (AVC file format) is defining a new structure for fragmented MP4 called "avc3". The principal difference between AVC1 and AVC3 is the location of the codec initialisation data (e.g. SPS, PPS). In AVC1 this data is placed in the initial MOOV box (moov.trak.mdia.minf.stbl.stsd.avc1) but in AVC3 this data goes in the first sample of every fragment. https://bugzilla.gnome.org/show_bug.cgi?id=702004
-rw-r--r--ext/libav/gstavcodecmap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
index 395ea36..1a2f515 100644
--- a/ext/libav/gstavcodecmap.c
+++ b/ext/libav/gstavcodecmap.c
@@ -1142,6 +1142,19 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps =
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-h264",
"alignment", G_TYPE_STRING, "au", NULL);
+ if (!encode) {
+ GValue arr = { 0, };
+ GValue item = { 0, };
+ g_value_init (&arr, GST_TYPE_LIST);
+ g_value_init (&item, G_TYPE_STRING);
+ g_value_set_string (&item, "avc");
+ gst_value_list_append_value (&arr, &item);
+ g_value_set_string (&item, "byte-stream");
+ gst_value_list_append_value (&arr, &item);
+ g_value_unset (&item);
+ gst_caps_set_value (caps, "stream-format", &arr);
+ g_value_unset (&arr);
+ }
break;
case AV_CODEC_ID_INDEO5: