From 52d1355d87e6ac6fae7af81e0536d2bdb768f5e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aur=C3=A9lien=20Zanelli?= Date: Thu, 12 Jan 2017 17:45:35 +0100 Subject: [PATCH] qtmux: simplify video/x-h264 caps handling 'stream-format' and 'alignment' are defined in pad template caps so there is no need to check them again here. Also remove bitrate parsing from caps as bitrate in caps doesn't make sense but from tags, which is actually the case. https://bugzilla.gnome.org/show_bug.cgi?id=777181 --- gst/isomp4/gstqtmux.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 7d184eb..6b996bb 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -4190,36 +4190,13 @@ gst_qt_mux_video_sink_set_caps (GstQTPad * qtpad, GstCaps * caps) "output might not play in Apple QuickTime (try global-headers?)"); } } else if (strcmp (mimetype, "video/x-h264") == 0) { - /* check if we accept these caps */ - if (gst_structure_has_field (structure, "stream-format")) { - const gchar *format; - const gchar *alignment; - - format = gst_structure_get_string (structure, "stream-format"); - alignment = gst_structure_get_string (structure, "alignment"); - - if (strcmp (format, "avc") != 0 || alignment == NULL || - strcmp (alignment, "au") != 0) { - GST_WARNING_OBJECT (qtmux, "Rejecting h264 caps, qtmux only accepts " - "avc format with AU aligned samples"); - goto refuse_caps; - } - } else { - GST_WARNING_OBJECT (qtmux, "no stream-format field in h264 caps"); - goto refuse_caps; - } - if (!codec_data) { GST_WARNING_OBJECT (qtmux, "no codec_data in h264 caps"); goto refuse_caps; } entry.fourcc = FOURCC_avc1; - if (qtpad->avg_bitrate == 0) { - gint avg_bitrate = 0; - gst_structure_get_int (structure, "bitrate", &avg_bitrate); - qtpad->avg_bitrate = avg_bitrate; - } + ext_atom = build_btrt_extension (0, qtpad->avg_bitrate, qtpad->max_bitrate); if (ext_atom != NULL) ext_atom_list = g_list_prepend (ext_atom_list, ext_atom); -- 2.7.4