diff options
author | Oleksij Rempel (Alexey Fisher) <bug-track@fisher-privat.net> | 2012-03-20 17:32:00 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-03-20 20:11:30 -0300 |
commit | 79a74089d42508743b14abd8adeff6b9024d44e8 (patch) | |
tree | bf1df81616d77213b7a618063653448eb9c76fed | |
parent | 477aaba6176b7f910defc1245760a5d816cfafe4 (diff) |
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.
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 03f775f92..5185789b5 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -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); |