mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
digitalzoom: change videocrop parameters before passing caps event
Avoids one extra uneeded renegotiation if the elements are already configured to their final property values when the caps event goes through. Also avoids hitting bug https://bugzilla.gnome.org/show_bug.cgi?id=748344
This commit is contained in:
parent
239cb53e06
commit
ca96378ebf
1 changed files with 4 additions and 6 deletions
|
@ -212,21 +212,19 @@ gst_digital_zoom_sink_event (GstPad * sink, GstObject * parent,
|
|||
|
||||
if (is_caps) {
|
||||
gst_event_parse_caps (event, &caps);
|
||||
gst_caps_ref (caps);
|
||||
g_object_get (self->capsfilter, "caps", &old_caps, NULL);
|
||||
g_object_set (self->capsfilter, "caps", caps, NULL);
|
||||
gst_digital_zoom_update_crop (self, caps);
|
||||
}
|
||||
|
||||
ret = gst_pad_event_default (sink, parent, event);
|
||||
|
||||
if (is_caps) {
|
||||
if (ret)
|
||||
gst_digital_zoom_update_crop (self, caps);
|
||||
else
|
||||
if (!ret) {
|
||||
gst_digital_zoom_update_crop (self, old_caps);
|
||||
g_object_set (self->capsfilter, "caps", old_caps, NULL);
|
||||
}
|
||||
|
||||
if (caps)
|
||||
gst_caps_unref (caps);
|
||||
if (old_caps)
|
||||
gst_caps_unref (old_caps);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue