mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
gst/: Don't queue buffers in basesink when we are flushing.
Original commit message from CVS: * gst/base/gstbasesink.c: (gst_basesink_finish_preroll), (gst_basesink_chain_unlocked), (gst_basesink_activate): * gst/gstminiobject.c: (gst_mini_object_get_type), (gst_mini_object_free): * gst/gstpad.c: (gst_pad_accept_caps), (gst_pad_query), (gst_pad_push), (gst_pad_push_event): * gst/gstqueue.c: (gst_queue_change_state): Don't queue buffers in basesink when we are flushing. Unref buffer when flushing in basesink. Flush queue when going to READY Unref buffer when _push() returns an error. Don't free MiniObject instance when refcount is incremented in _finalize() so that we can recover objects.
This commit is contained in:
parent
1c175ed067
commit
576b2181d8
7 changed files with 37 additions and 10 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2005-05-17 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/base/gstbasesink.c: (gst_basesink_finish_preroll),
|
||||
(gst_basesink_chain_unlocked), (gst_basesink_activate):
|
||||
* gst/gstminiobject.c: (gst_mini_object_get_type),
|
||||
(gst_mini_object_free):
|
||||
* gst/gstpad.c: (gst_pad_accept_caps), (gst_pad_query),
|
||||
(gst_pad_push), (gst_pad_push_event):
|
||||
* gst/gstqueue.c: (gst_queue_change_state):
|
||||
Don't queue buffers in basesink when we are flushing.
|
||||
Unref buffer when flushing in basesink.
|
||||
Flush queue when going to READY
|
||||
Unref buffer when _push() returns an error.
|
||||
Don't free MiniObject instance when refcount is incremented
|
||||
in _finalize() so that we can recover objects.
|
||||
|
||||
2005-05-17 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* docs/manual/advanced-schedulers.xml:
|
||||
|
|
|
@ -446,14 +446,14 @@ gst_basesink_finish_preroll (GstBaseSink * basesink, GstPad * pad,
|
|||
gst_element_commit_state (GST_ELEMENT (basesink));
|
||||
GST_STATE_UNLOCK (basesink);
|
||||
|
||||
gst_basesink_preroll_queue_push (basesink, pad, buffer);
|
||||
|
||||
GST_LOCK (pad);
|
||||
usable = !GST_RPAD_IS_FLUSHING (pad) && GST_RPAD_IS_ACTIVE (pad);
|
||||
GST_UNLOCK (pad);
|
||||
if (!usable)
|
||||
goto unusable;
|
||||
|
||||
gst_basesink_preroll_queue_push (basesink, pad, buffer);
|
||||
|
||||
if (basesink->need_preroll)
|
||||
goto still_queueing;
|
||||
|
||||
|
@ -695,6 +695,7 @@ gst_basesink_chain_unlocked (GstPad * pad, GstBuffer * buf)
|
|||
case PREROLL_PLAYING:
|
||||
return gst_basesink_handle_buffer (basesink, buf);
|
||||
case PREROLL_FLUSHING:
|
||||
gst_buffer_unref (buf);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
|
|
|
@ -46,7 +46,7 @@ static gchar *gst_value_mini_object_lcopy (const GValue * value,
|
|||
GType
|
||||
gst_mini_object_get_type (void)
|
||||
{
|
||||
static GType _gst_mini_object_type;
|
||||
static GType _gst_mini_object_type = 0;
|
||||
|
||||
if (!_gst_mini_object_type) {
|
||||
GTypeValueTable value_table = {
|
||||
|
@ -178,6 +178,9 @@ gst_mini_object_free (GstMiniObject * mini_object)
|
|||
mo_class = GST_MINI_OBJECT_GET_CLASS (mini_object);
|
||||
mo_class->finalize (mini_object);
|
||||
|
||||
/* if the refcount is still 0 we can really free the
|
||||
* object, else the finalize method recycled the object */
|
||||
if (g_atomic_int_get (&mini_object->refcount) == 0)
|
||||
g_type_free_instance ((GTypeInstance *) mini_object);
|
||||
}
|
||||
|
||||
|
|
|
@ -2902,6 +2902,7 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer)
|
|||
/* ERROR recovery here */
|
||||
not_linked:
|
||||
{
|
||||
gst_buffer_unref (buffer);
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"pushing, but it was not linked");
|
||||
GST_UNLOCK (pad);
|
||||
|
@ -2909,6 +2910,7 @@ not_linked:
|
|||
}
|
||||
not_active:
|
||||
{
|
||||
gst_buffer_unref (buffer);
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"pushing, but it was inactive");
|
||||
GST_UNLOCK (pad);
|
||||
|
@ -2916,6 +2918,7 @@ not_active:
|
|||
}
|
||||
flushing:
|
||||
{
|
||||
gst_buffer_unref (buffer);
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"pushing, but pad was flushing");
|
||||
GST_UNLOCK (pad);
|
||||
|
@ -2923,12 +2926,14 @@ flushing:
|
|||
}
|
||||
not_negotiated:
|
||||
{
|
||||
gst_buffer_unref (buffer);
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"pushing buffer but peer did not accept");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
no_function:
|
||||
{
|
||||
gst_buffer_unref (buffer);
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"pushing, but not chainhandler");
|
||||
GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
|
||||
|
@ -3132,6 +3137,7 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
|
|||
/* ERROR handling */
|
||||
not_linked:
|
||||
{
|
||||
gst_event_unref (event);
|
||||
GST_UNLOCK (pad);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -906,12 +906,12 @@ gst_queue_change_state (GstElement * element)
|
|||
|
||||
switch (GST_STATE_TRANSITION (element)) {
|
||||
case GST_STATE_NULL_TO_READY:
|
||||
break;
|
||||
case GST_STATE_READY_TO_PAUSED:
|
||||
GST_QUEUE_MUTEX_LOCK;
|
||||
gst_queue_locked_flush (queue);
|
||||
GST_QUEUE_MUTEX_UNLOCK;
|
||||
break;
|
||||
case GST_STATE_READY_TO_PAUSED:
|
||||
break;
|
||||
case GST_STATE_PAUSED_TO_PLAYING:
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -446,14 +446,14 @@ gst_basesink_finish_preroll (GstBaseSink * basesink, GstPad * pad,
|
|||
gst_element_commit_state (GST_ELEMENT (basesink));
|
||||
GST_STATE_UNLOCK (basesink);
|
||||
|
||||
gst_basesink_preroll_queue_push (basesink, pad, buffer);
|
||||
|
||||
GST_LOCK (pad);
|
||||
usable = !GST_RPAD_IS_FLUSHING (pad) && GST_RPAD_IS_ACTIVE (pad);
|
||||
GST_UNLOCK (pad);
|
||||
if (!usable)
|
||||
goto unusable;
|
||||
|
||||
gst_basesink_preroll_queue_push (basesink, pad, buffer);
|
||||
|
||||
if (basesink->need_preroll)
|
||||
goto still_queueing;
|
||||
|
||||
|
@ -695,6 +695,7 @@ gst_basesink_chain_unlocked (GstPad * pad, GstBuffer * buf)
|
|||
case PREROLL_PLAYING:
|
||||
return gst_basesink_handle_buffer (basesink, buf);
|
||||
case PREROLL_FLUSHING:
|
||||
gst_buffer_unref (buf);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
|
|
|
@ -906,12 +906,12 @@ gst_queue_change_state (GstElement * element)
|
|||
|
||||
switch (GST_STATE_TRANSITION (element)) {
|
||||
case GST_STATE_NULL_TO_READY:
|
||||
break;
|
||||
case GST_STATE_READY_TO_PAUSED:
|
||||
GST_QUEUE_MUTEX_LOCK;
|
||||
gst_queue_locked_flush (queue);
|
||||
GST_QUEUE_MUTEX_UNLOCK;
|
||||
break;
|
||||
case GST_STATE_READY_TO_PAUSED:
|
||||
break;
|
||||
case GST_STATE_PAUSED_TO_PLAYING:
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue