mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
wrappercamerabinsrc: only flush buffers if renegotiation is needed
This avoid extra overhead when taking sequential pictures that woudln't need renegotiation
This commit is contained in:
parent
19d5be4c3a
commit
65676a2f15
1 changed files with 8 additions and 7 deletions
|
@ -830,14 +830,15 @@ start_image_capture (GstWrapperCameraBinSrc * self)
|
||||||
* setting it back to PLAYING will work. This is more a workaround then a
|
* setting it back to PLAYING will work. This is more a workaround then a
|
||||||
* solution to buffer reclaiming. */
|
* solution to buffer reclaiming. */
|
||||||
pad = gst_element_get_static_pad (self->src_vid_src, "src");
|
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) {
|
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 */
|
/* clean capsfilter caps so they don't interfere here */
|
||||||
g_object_set (self->src_filter, "caps", NULL, NULL);
|
g_object_set (self->src_filter, "caps", NULL, NULL);
|
||||||
if (self->src_zoom_filter)
|
if (self->src_zoom_filter)
|
||||||
|
|
Loading…
Reference in a new issue