analytics: objectdetectionoverlay: improve event handling

This change ensures that the `GST_EVENT_EOS`,
`GST_EVENT_FLUSH_START` and `GST_EVENT_FLUSH_STOP`
events are forwarded to the sink downstream.
The logging message for `GST_EVENT_FLUSH_START`
has also been fixed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8576>
This commit is contained in:
Denis Yuji Shimizu 2025-02-28 13:06:34 -03:00 committed by GStreamer Marge Bot
parent 356c1ff8e3
commit 51a3ef55c9

View file

@ -554,12 +554,14 @@ gst_object_detection_overlay_sink_event (GstBaseTransform * trans,
GST_INFO_OBJECT (overlay, "EOS");
overlay->eos = TRUE;
g_mutex_unlock (&overlay->stream_event_mutex);
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event);
break;
case GST_EVENT_FLUSH_START:
g_mutex_lock (&overlay->stream_event_mutex);
GST_INFO_OBJECT (overlay, "Flush stop");
GST_INFO_OBJECT (overlay, "Flush start");
overlay->flushing = TRUE;
g_mutex_unlock (&overlay->stream_event_mutex);
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event);
break;
case GST_EVENT_FLUSH_STOP:
g_mutex_lock (&overlay->stream_event_mutex);
@ -567,6 +569,7 @@ gst_object_detection_overlay_sink_event (GstBaseTransform * trans,
overlay->eos = FALSE;
overlay->flushing = FALSE;
g_mutex_unlock (&overlay->stream_event_mutex);
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event);
break;
default:
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->sink_event (trans, event);