isomp4/qtmux: accept video/x-h264, stream-format=avc3
authorMathieu Duponchelle <mathieu@centricular.com>
Fri, 6 Aug 2021 21:36:48 +0000 (23:36 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 20 Aug 2021 00:16:43 +0000 (00:16 +0000)
The main difference between avc1 and avc3 is that avc3 is allowed
to contain in-band SPS / PPS. In practice decoders will always use
in-band parameter sets anyway, but it is cleaner to explicitly
advertise it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1047>

gst/isomp4/gstqtmux.c
gst/isomp4/gstqtmuxmap.c

index d93d066..eb55e80 100644 (file)
@@ -6321,12 +6321,22 @@ gst_qt_mux_video_sink_set_caps (GstQTMuxPad * qtpad, GstCaps * caps)
             "output might not play in Apple QuickTime (try global-headers?)");
     }
   } else if (strcmp (mimetype, "video/x-h264") == 0) {
+    const gchar *stream_format;
+
     if (!codec_data) {
       GST_WARNING_OBJECT (qtmux, "no codec_data in h264 caps");
       goto refuse_caps;
     }
 
-    entry.fourcc = FOURCC_avc1;
+    stream_format = gst_structure_get_string (structure, "stream-format");
+
+    if (!g_strcmp0 (stream_format, "avc")) {
+      entry.fourcc = FOURCC_avc1;
+    } else if (!g_strcmp0 (stream_format, "avc3")) {
+      entry.fourcc = FOURCC_avc3;
+    } else {
+      g_assert_not_reached ();
+    }
 
     ext_atom = build_btrt_extension (0, qtpad->avg_bitrate, qtpad->max_bitrate);
     if (ext_atom != NULL)
index 7fa741a..143b217 100644 (file)
@@ -60,7 +60,7 @@
 
 #define H264_CAPS \
   "video/x-h264, " \
-  "stream-format = (string) avc, " \
+  "stream-format = (string) { avc, avc3 }, " \
   "alignment = (string) au, " \
   COMMON_VIDEO_CAPS