diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-04-24 12:35:08 +0200 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2009-05-12 00:27:38 +0200 |
commit | d2c5ea9a405299a4107f35c3b01df013aad9d3cc (patch) | |
tree | e71441000571348acb98a080739691022add7db6 /gst/gsttask.c | |
parent | 4cc2e05629fd035cdd420f0b7140348e06ce95ee (diff) | |
download | gstreamer-d2c5ea9a405299a4107f35c3b01df013aad9d3cc.tar.gz |
TaskPool: remove _set_func()
Remove the static function set on the TaskPool before _prepare() is called and
allow for assigning a function to a Task when we _push().
Update the examples
Diffstat (limited to 'gst/gsttask.c')
-rw-r--r-- | gst/gsttask.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gst/gsttask.c b/gst/gsttask.c index 3aec20ffd0..dc361b5bce 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -92,7 +92,7 @@ static void gst_task_class_init (GstTaskClass * klass); static void gst_task_init (GstTask * task); static void gst_task_finalize (GObject * object); -static void gst_task_func (GstTask * task, GstTaskClass * tclass); +static void gst_task_func (GstTask * task); static GStaticMutex pool_lock = G_STATIC_MUTEX_INIT; @@ -112,7 +112,6 @@ init_klass_pool (GstTaskClass * klass) gst_object_unref (klass->pool); } klass->pool = gst_task_pool_new (); - gst_task_pool_set_func (klass->pool, (GFunc) gst_task_func, klass); gst_task_pool_prepare (klass->pool, NULL); g_static_mutex_unlock (&pool_lock); } @@ -177,7 +176,7 @@ gst_task_finalize (GObject * object) } static void -gst_task_func (GstTask * task, GstTaskClass * tclass) +gst_task_func (GstTask * task) { GStaticRecMutex *lock; GThread *tself; @@ -564,7 +563,9 @@ start_task (GstTask * task) /* push on the thread pool, we remember the original pool because the user * could change it later on and then we join to the wrong pool. */ priv->pool_id = gst_object_ref (priv->pool); - priv->id = gst_task_pool_push (priv->pool_id, task, &error); + priv->id = + gst_task_pool_push (priv->pool_id, (GstTaskPoolFunction) gst_task_func, + task, &error); if (error != NULL) { g_warning ("failed to create thread: %s", error->message); |