wrappercamerabinsrc: avoid reseting caps to the same value

Reduces capture latency when the new caps are the same as the old
one, avoiding resetting the source state for a forced renegotiation.
This commit is contained in:
Oleksij Rempel (Alexey Fisher) 2012-03-20 17:32:00 -03:00 committed by Thiago Santos
parent 477aaba617
commit 79a74089d4

View file

@ -153,6 +153,18 @@ gst_wrapper_camera_bin_reset_video_src_caps (GstWrapperCameraBinSrc * self,
GST_DEBUG_OBJECT (self, "Resetting src caps to %" GST_PTR_FORMAT, caps);
if (self->src_vid_src) {
GstCaps *old_caps;
g_object_get (G_OBJECT (self->src_filter), "caps", &old_caps, NULL);
if (gst_caps_is_equal (caps, old_caps)) {
GST_DEBUG_OBJECT (self, "old and new caps are same, do not reset it");
if (old_caps)
gst_caps_unref (old_caps);
return;
}
if (old_caps)
gst_caps_unref (old_caps);
clock = gst_element_get_clock (self->src_vid_src);
base_time = gst_element_get_base_time (self->src_vid_src);