encoding-profile: Remove some more fields from the caps when creating from discoverer...
authorSebastian Dröge <sebastian@centricular.com>
Fri, 8 Jul 2016 13:43:05 +0000 (16:43 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 8 Jul 2016 13:44:18 +0000 (16:44 +0300)
parsed, framed, stream-format and alignment are only relevant for parsers and
should not matter here. We still want to be able to use an encoder that can
only output byte-stream if the input was avc.

https://bugzilla.gnome.org/show_bug.cgi?id=768566

gst-libs/gst/pbutils/encoding-profile.c

index 5cd2541..0058c86 100644 (file)
@@ -1499,13 +1499,22 @@ add_stream_to_profile (GstEncodingContainerProfile * profile,
 
   caps = gst_discoverer_stream_info_get_caps (sinfo);
 
+  /* Should unify this with copy_and_clean_caps() */
   s = gst_caps_get_structure (caps, 0);
   if (gst_structure_has_field (s, "codec_data")
-      || gst_structure_has_field (s, "streamheader")) {
+      || gst_structure_has_field (s, "streamheader")
+      || gst_structure_has_field (s, "parsed")
+      || gst_structure_has_field (s, "framed")
+      || gst_structure_has_field (s, "stream-format")
+      || gst_structure_has_field (s, "alignment")) {
     caps = gst_caps_make_writable (caps);
     s = gst_caps_get_structure (caps, 0);
     gst_structure_remove_field (s, "codec_data");
     gst_structure_remove_field (s, "streamheader");
+    gst_structure_remove_field (s, "parsed");
+    gst_structure_remove_field (s, "framed");
+    gst_structure_remove_field (s, "stream-format");
+    gst_structure_remove_field (s, "alignment");
   }
 
   GST_LOG ("Stream: %" GST_PTR_FORMAT "\n", caps);