mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
glfilter: advertise resize in the caps negotiation properly
This commit is contained in:
parent
3d9020e564
commit
56253d8dce
1 changed files with 35 additions and 1 deletions
|
@ -707,6 +707,36 @@ done:
|
|||
return othercaps;
|
||||
}
|
||||
|
||||
/* copies the given caps */
|
||||
static GstCaps *
|
||||
gst_gl_filter_caps_remove_size (GstCaps * caps)
|
||||
{
|
||||
GstStructure *st;
|
||||
GstCapsFeatures *f;
|
||||
gint i, n;
|
||||
GstCaps *res;
|
||||
|
||||
res = gst_caps_new_empty ();
|
||||
|
||||
n = gst_caps_get_size (caps);
|
||||
for (i = 0; i < n; i++) {
|
||||
st = gst_caps_get_structure (caps, i);
|
||||
f = gst_caps_get_features (caps, i);
|
||||
|
||||
/* If this is already expressed by the existing caps
|
||||
* skip this structure */
|
||||
if (i > 0 && gst_caps_is_subset_structure_full (res, st, f))
|
||||
continue;
|
||||
|
||||
st = gst_structure_copy (st);
|
||||
gst_structure_remove_fields (st, "width", "height", NULL);
|
||||
|
||||
gst_caps_append_structure_full (res, st, gst_caps_features_copy (f));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_gl_filter_set_caps_features (const GstCaps * caps,
|
||||
const gchar * feature_name)
|
||||
|
@ -751,9 +781,13 @@ gst_gl_filter_transform_caps (GstBaseTransform * bt,
|
|||
|
||||
result = gst_caps_merge (gl_caps, result);
|
||||
}
|
||||
tmp = result;
|
||||
GST_DEBUG_OBJECT (bt, "transfer returned caps %" GST_PTR_FORMAT, tmp);
|
||||
|
||||
tmp = gst_gl_filter_caps_remove_size (result);
|
||||
gst_caps_unref (result);
|
||||
result = tmp;
|
||||
GST_DEBUG_OBJECT (bt, "size removal returned caps %" GST_PTR_FORMAT, tmp);
|
||||
|
||||
if (direction == GST_PAD_SRC) {
|
||||
result =
|
||||
gst_gl_color_convert_transform_caps (filter->context, direction, tmp,
|
||||
|
|
Loading…
Reference in a new issue