uvcsink: extract common code in idle_probe

The RECONFIGURE event has to be sent in streamon and streamoff. Extract the
common code to a separate branch to make it easier to understand.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4994>
This commit is contained in:
Michael Tretter 2023-07-19 10:38:40 +02:00 committed by GStreamer Marge Bot
parent 69c5529011
commit eac9f60608

View file

@ -407,16 +407,14 @@ static GstPadProbeReturn
gst_uvc_sink_sinkpad_idle_probe (GstPad * pad, gst_uvc_sink_sinkpad_idle_probe (GstPad * pad,
GstPadProbeInfo * info, GstUvcSink * self) GstPadProbeInfo * info, GstUvcSink * self)
{ {
if (self->streamon) { if (self->streamon || self->streamoff) {
gst_uvc_sink_create_buffer_peer_probe (self); gst_uvc_sink_create_buffer_peer_probe (self);
GST_DEBUG_OBJECT (self, "Send reconfigure");
gst_pad_push_event (self->sinkpad, gst_event_new_reconfigure ()); gst_pad_push_event (self->sinkpad, gst_event_new_reconfigure ());
} }
if (self->streamoff) { if (self->streamoff)
gst_uvc_sink_create_buffer_peer_probe (self);
gst_pad_push_event (self->sinkpad, gst_event_new_reconfigure ());
gst_uvc_sink_to_fakesink (self); gst_uvc_sink_to_fakesink (self);
}
return GST_PAD_PROBE_PASS; return GST_PAD_PROBE_PASS;
} }