mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-15 04:24:18 +00:00
Make sure FLUSH_STOP is sent so not to leave downstream flushing.
This commit is contained in:
parent
673459c711
commit
49b2a94644
2 changed files with 29 additions and 0 deletions
|
@ -653,6 +653,7 @@ gst_videomixer_reset (GstVideoMixer * mix)
|
||||||
}
|
}
|
||||||
|
|
||||||
mix->next_sinkpad = 0;
|
mix->next_sinkpad = 0;
|
||||||
|
mix->flush_stop_pending = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1341,6 +1342,11 @@ gst_videomixer_collected (GstCollectPads * pads, GstVideoMixer * mix)
|
||||||
if (G_UNLIKELY (mix->in_width == 0))
|
if (G_UNLIKELY (mix->in_width == 0))
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
|
|
||||||
|
if (g_atomic_int_compare_and_exchange (&mix->flush_stop_pending, TRUE, FALSE)) {
|
||||||
|
GST_DEBUG_OBJECT (mix, "pending flush stop");
|
||||||
|
gst_pad_push_event (mix->srcpad, gst_event_new_flush_stop ());
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (mix, "all pads are collected");
|
GST_LOG_OBJECT (mix, "all pads are collected");
|
||||||
GST_VIDEO_MIXER_STATE_LOCK (mix);
|
GST_VIDEO_MIXER_STATE_LOCK (mix);
|
||||||
|
|
||||||
|
@ -1548,10 +1554,30 @@ gst_videomixer_src_event (GstPad * pad, GstEvent * event)
|
||||||
else
|
else
|
||||||
mix->segment_position = 0;
|
mix->segment_position = 0;
|
||||||
mix->sendseg = TRUE;
|
mix->sendseg = TRUE;
|
||||||
|
|
||||||
|
if (flags & GST_SEEK_FLAG_FLUSH) {
|
||||||
|
gst_collect_pads_set_flushing (mix->collect, FALSE);
|
||||||
|
|
||||||
|
/* we can't send FLUSH_STOP here since upstream could start pushing data
|
||||||
|
* after we unlock mix->collect.
|
||||||
|
* We set flush_stop_pending to TRUE instead and send FLUSH_STOP after
|
||||||
|
* forwarding the seek upstream or from gst_videomixer_collected,
|
||||||
|
* whichever happens first.
|
||||||
|
*/
|
||||||
|
mix->flush_stop_pending = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (mix->collect);
|
GST_OBJECT_UNLOCK (mix->collect);
|
||||||
gst_videomixer_reset_qos (mix);
|
gst_videomixer_reset_qos (mix);
|
||||||
|
|
||||||
result = forward_event (mix, event);
|
result = forward_event (mix, event);
|
||||||
|
|
||||||
|
if (g_atomic_int_compare_and_exchange (&mix->flush_stop_pending,
|
||||||
|
TRUE, FALSE)) {
|
||||||
|
GST_DEBUG_OBJECT (mix, "pending flush stop");
|
||||||
|
gst_pad_push_event (mix->srcpad, gst_event_new_flush_stop ());
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_NAVIGATION:
|
case GST_EVENT_NAVIGATION:
|
||||||
|
@ -1587,6 +1613,7 @@ gst_videomixer_sink_event (GstPad * pad, GstEvent * event)
|
||||||
* and downstream (using our source pad, the bastard!).
|
* and downstream (using our source pad, the bastard!).
|
||||||
*/
|
*/
|
||||||
videomixer->sendseg = TRUE;
|
videomixer->sendseg = TRUE;
|
||||||
|
videomixer->flush_stop_pending = FALSE;
|
||||||
gst_videomixer_reset_qos (videomixer);
|
gst_videomixer_reset_qos (videomixer);
|
||||||
|
|
||||||
/* Reset pad state after FLUSH_STOP */
|
/* Reset pad state after FLUSH_STOP */
|
||||||
|
|
|
@ -116,6 +116,8 @@ struct _GstVideoMixer
|
||||||
BlendFunction blend;
|
BlendFunction blend;
|
||||||
FillCheckerFunction fill_checker;
|
FillCheckerFunction fill_checker;
|
||||||
FillColorFunction fill_color;
|
FillColorFunction fill_color;
|
||||||
|
|
||||||
|
gboolean flush_stop_pending;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstVideoMixerClass
|
struct _GstVideoMixerClass
|
||||||
|
|
Loading…
Reference in a new issue