From 1e39fe66ad63138e9fa0be8f762af66e545c2e55 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Sun, 17 May 2020 15:51:09 +1000 Subject: [PATCH] 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: --- gst/imagefreeze/gstimagefreeze.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst/imagefreeze/gstimagefreeze.c b/gst/imagefreeze/gstimagefreeze.c index 7b8e4baad4..7a287a616f 100644 --- a/gst/imagefreeze/gstimagefreeze.c +++ b/gst/imagefreeze/gstimagefreeze.c @@ -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);