appsink: factor out dequeue_object()

No semantic change, will be used to implement new event API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1046>
This commit is contained in:
Guillaume Desmottes 2021-02-19 14:45:08 +01:00
parent aba6bd7822
commit 457e33fee5

View file

@ -854,18 +854,16 @@ flushing:
}
static GstMiniObject *
dequeue_buffer (GstAppSink * appsink)
dequeue_object (GstAppSink * appsink)
{
GstAppSinkPrivate *priv = appsink->priv;
GstMiniObject *obj;
do {
obj = gst_queue_array_pop_head (priv->queue);
if (GST_IS_BUFFER (obj) || GST_IS_BUFFER_LIST (obj)) {
GST_DEBUG_OBJECT (appsink, "dequeued buffer/list %p", obj);
priv->num_buffers--;
break;
} else if (GST_IS_EVENT (obj)) {
GstEvent *event = GST_EVENT_CAST (obj);
@ -891,8 +889,24 @@ dequeue_buffer (GstAppSink * appsink)
default:
break;
}
gst_mini_object_unref (obj);
}
return obj;
}
static GstMiniObject *
dequeue_buffer (GstAppSink * appsink)
{
GstMiniObject *obj;
do {
obj = dequeue_object (appsink);
if (GST_IS_BUFFER (obj) || GST_IS_BUFFER_LIST (obj)) {
break;
}
gst_mini_object_unref (obj);
} while (TRUE);
return obj;