gst/: Small doc updates.

Original commit message from CVS:
* gst/gstbuffer.c:
* gst/gsttask.c: (gst_task_join):
Small doc updates.

* gst/gstpad.c: (gst_pad_activate_pull), (gst_pad_activate_push),
(gst_pad_stop_task):
When pad (de)activation failed for some reason, restore the old
activation mode and set the pad to flushing instead of assuming the
pad is deactivated.
If the _task_join() failed, reinstall the task on the pad so that it can
be stopped later and return an error.
This commit is contained in:
Wim Taymans 2006-08-14 07:35:09 +00:00
parent 86b76f4c22
commit 3254e4d752
5 changed files with 46 additions and 7 deletions

View file

@ -1,3 +1,17 @@
2006-08-14 Wim Taymans <wim@fluendo.com>
* gst/gstbuffer.c:
* gst/gsttask.c: (gst_task_join):
Small doc updates.
* gst/gstpad.c: (gst_pad_activate_pull), (gst_pad_activate_push),
(gst_pad_stop_task):
When pad (de)activation failed for some reason, restore the old
activation mode and set the pad to flushing instead of assuming the
pad is deactivated.
If the _task_join() failed, reinstall the task on the pad so that it can
be stopped later and return an error.
2006-08-11 Andy Wingo <wingo@pobox.com>
* configure.ac:

View file

@ -53,6 +53,10 @@
* Alternatively, use gst_buffer_new_and_alloc()
* to create a buffer with preallocated data of a given size.
*
* The data pointed to by the buffer can be retrieved with the GST_BUFFER_DATA()
* macro. The size of the data can be found with GST_BUFFER_SIZE(). For buffers
* of size 0, the data pointer is undefined (usually NULL) and should never be used.
*
* If an element knows what pad you will push the buffer out on, it should use
* gst_pad_alloc_buffer() instead to create a buffer. This allows downstream
* elements to provide special buffers to write in, like hardware buffers.
@ -107,7 +111,7 @@
* the refcount drops to 0, any data pointed to by GST_BUFFER_MALLOCDATA() will
* also be freed.
*
* Last reviewed on November 23th, 2005 (0.9.5)
* Last reviewed on August 11th, 2006 (0.10.10)
*/
#include "gst_private.h"

View file

@ -783,10 +783,12 @@ peer_failed:
}
failure:
{
GST_OBJECT_LOCK (pad);
GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in pull mode",
active ? "activate" : "deactivate");
pre_activate (pad, GST_ACTIVATE_NONE);
post_activate (pad, GST_ACTIVATE_NONE);
GST_PAD_SET_FLUSHING (pad);
GST_PAD_ACTIVATE_MODE (pad) = old;
GST_OBJECT_UNLOCK (pad);
return FALSE;
}
}
@ -879,10 +881,12 @@ deactivate_failed:
}
failure:
{
GST_OBJECT_LOCK (pad);
GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in push mode",
active ? "activate" : "deactivate");
pre_activate (pad, GST_ACTIVATE_NONE);
post_activate (pad, GST_ACTIVATE_NONE);
GST_PAD_SET_FLUSHING (pad);
GST_PAD_ACTIVATE_MODE (pad) = old;
GST_OBJECT_UNLOCK (pad);
return FALSE;
}
}
@ -4180,7 +4184,8 @@ gst_pad_stop_task (GstPad * pad)
GST_PAD_STREAM_LOCK (pad);
GST_PAD_STREAM_UNLOCK (pad);
gst_task_join (task);
if (!gst_task_join (task))
goto join_failed;
gst_object_unref (task);
@ -4193,6 +4198,20 @@ no_task:
GST_PAD_STREAM_LOCK (pad);
GST_PAD_STREAM_UNLOCK (pad);
/* this is not an error */
return TRUE;
}
join_failed:
{
/* this is bad, possibly the application tried to join the task from
* the task's thread. We install the task again so that it will be stopped
* again from the right thread next time hopefully. */
GST_OBJECT_LOCK (pad);
/* we can only install this task if there was no other task */
if (GST_PAD_TASK (pad) == NULL)
GST_PAD_TASK (pad) = task;
GST_OBJECT_UNLOCK (pad);
return FALSE;
}
}

View file

@ -522,6 +522,8 @@ gst_task_join (GstTask * task)
GST_DEBUG_OBJECT (task, "Joining task %p, thread %p", task, tself);
/* we don't use a real thread join here because we are using
* threadpools */
GST_OBJECT_LOCK (task);
if (tself == task->abidata.ABI.thread)
goto joining_self;

View file

@ -175,7 +175,7 @@
#define HAVE_WIN32 1
/* Define host CPU */
#define HOST_CPU "x86_64"
#define HOST_CPU "mos6502"
/* library dir */
#ifdef _DEBUG