diff options
author | Thiago Santos <ts.santos@osg.samsung.com> | 2014-07-23 13:55:06 -0300 |
---|---|---|
committer | Thiago Santos <ts.santos@osg.samsung.com> | 2014-07-23 13:58:26 -0300 |
commit | 65676a2f15293b3f19275dc69c66b3bf83572c4b (patch) | |
tree | 77e918df034b97388bf4f6ab3fbe32cae544a24c /gst/camerabin2 | |
parent | 19d5be4c3a584a55f1099782608fc00ad5e0f14d (diff) | |
download | gstreamer-plugins-bad-65676a2f15293b3f19275dc69c66b3bf83572c4b.tar.gz |
wrappercamerabinsrc: only flush buffers if renegotiation is needed
This avoid extra overhead when taking sequential pictures that woudln't
need renegotiation
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index b25b8ad10..a62627aef 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -830,14 +830,15 @@ start_image_capture (GstWrapperCameraBinSrc * self) * setting it back to PLAYING will work. This is more a workaround then a * solution to buffer reclaiming. */ pad = gst_element_get_static_pad (self->src_vid_src, "src"); - peer = gst_pad_get_peer (pad); - gst_object_unref (pad); - gst_pad_send_event (peer, gst_event_new_flush_start ()); - gst_element_set_state (self->src_vid_src, GST_STATE_READY); - gst_pad_send_event (peer, gst_event_new_flush_stop (TRUE)); - gst_object_unref (peer); - if (self->image_renegotiate) { + + peer = gst_pad_get_peer (pad); + gst_object_unref (pad); + gst_pad_send_event (peer, gst_event_new_flush_start ()); + gst_element_set_state (self->src_vid_src, GST_STATE_READY); + gst_pad_send_event (peer, gst_event_new_flush_stop (TRUE)); + gst_object_unref (peer); + /* clean capsfilter caps so they don't interfere here */ g_object_set (self->src_filter, "caps", NULL, NULL); if (self->src_zoom_filter) |