mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
wrappercamerabinsrc: use the drain query instead of flush
The flush might clear any pending captures that are still in queues being processed while the drain query will wait for those to be properly done
This commit is contained in:
parent
5496fd3e75
commit
6fa077f465
1 changed files with 4 additions and 6 deletions
|
@ -833,18 +833,16 @@ start_image_capture (GstWrapperCameraBinSrc * self)
|
|||
|
||||
GST_DEBUG_OBJECT (self, "Starting image capture");
|
||||
|
||||
/* FIXME - V4L2 source will not close the device until all buffers have came
|
||||
* back. Flushing the pipeline, will ensure it's properly closed, and that
|
||||
* setting it back to PLAYING will work. This is more a workaround then a
|
||||
* solution to buffer reclaiming. */
|
||||
/* V4L2 source will not close the device until all buffers have came
|
||||
* back. Draining the pipeline, will ensure it's properly closed, and that
|
||||
* setting it back to PLAYING will work. */
|
||||
pad = gst_element_get_static_pad (self->src_vid_src, "src");
|
||||
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_pad_query (peer, gst_query_new_drain ());
|
||||
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 */
|
||||
|
|
Loading…
Reference in a new issue