mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
imagefreeze: Only set caps if they do not match current caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1311>
This commit is contained in:
parent
21d7bd09ce
commit
3f49b21b80
1 changed files with 7 additions and 3 deletions
|
@ -232,7 +232,7 @@ gst_image_freeze_sink_setcaps (GstImageFreeze * self, GstCaps * caps)
|
|||
gboolean ret = FALSE;
|
||||
GstStructure *s;
|
||||
gint fps_n, fps_d;
|
||||
GstCaps *othercaps, *intersection;
|
||||
GstCaps *othercaps, *intersection, *pad_current_caps;
|
||||
guint i, n;
|
||||
GstPad *pad;
|
||||
|
||||
|
@ -245,8 +245,12 @@ gst_image_freeze_sink_setcaps (GstImageFreeze * self, GstCaps * caps)
|
|||
if (self->negotiated_framerate) {
|
||||
gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, self->fps_n,
|
||||
self->fps_d, NULL);
|
||||
GST_DEBUG_OBJECT (pad, "Setting caps %" GST_PTR_FORMAT, caps);
|
||||
gst_pad_set_caps (self->srcpad, caps);
|
||||
pad_current_caps = gst_pad_get_current_caps (self->srcpad);
|
||||
if (pad_current_caps && !gst_caps_is_equal (caps, pad_current_caps)) {
|
||||
GST_DEBUG_OBJECT (pad, "Setting caps %" GST_PTR_FORMAT, caps);
|
||||
gst_pad_set_caps (self->srcpad, caps);
|
||||
}
|
||||
gst_caps_unref (pad_current_caps);
|
||||
gst_caps_unref (caps);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue