mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-15 11:55:32 +00:00
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:
parent
aba6bd7822
commit
457e33fee5
1 changed files with 44 additions and 30 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue