From ca96378ebf73ba23815f0492d34ad39d68d4110e Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 27 Apr 2015 21:14:02 -0300 Subject: [PATCH] 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 --- gst/camerabin2/gstdigitalzoom.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gst/camerabin2/gstdigitalzoom.c b/gst/camerabin2/gstdigitalzoom.c index 65669c995f..20c01be3c1 100644 --- a/gst/camerabin2/gstdigitalzoom.c +++ b/gst/camerabin2/gstdigitalzoom.c @@ -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); }