imagefreeze: Copy GstCapsFeatures to caps for source pad

Allows using imagefreeze with buffers in GLMemory. The following pipeline
works.

gst-launch-1.0 filesrc location=image.jpg ! jpegdec ! glupload ! \
imagefreeze ! glcolorconvert ! glimagesinkelement

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/594>
This commit is contained in:
Luke Yelavich 2020-05-17 15:51:09 +10:00 committed by GStreamer Merge Bot
parent 913e17e19e
commit 1e39fe66ad

View file

@ -282,8 +282,10 @@ gst_image_freeze_sink_setcaps (GstImageFreeze * self, GstCaps * caps)
for (i = 0; i < n; i++) {
GstCaps *candidate = gst_caps_new_empty ();
GstStructure *s = gst_structure_copy (gst_caps_get_structure (caps, i));
GstCapsFeatures *f =
gst_caps_features_copy (gst_caps_get_features (caps, i));
gst_caps_append_structure (candidate, s);
gst_caps_append_structure_full (candidate, s, f);
if (gst_structure_has_field_typed (s, "framerate", GST_TYPE_FRACTION) ||
gst_structure_fixate_field_nearest_fraction (s, "framerate", 25, 1)) {
gst_structure_get_fraction (s, "framerate", &fps_n, &fps_d);