# GstTaskPool

This object provides an abstraction for creating threads. The default implementation uses a regular GThreadPool to start tasks.

Subclasses can be made to create custom threads.

## GstTaskPool

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstTaskPool

The GstTaskPool object.

### Members

`object` (GstObject) –
No description available

### Class structure

#### GstTaskPoolClass

The GstTaskPoolClass object.

##### Fields

`parent_class` (GstObjectClass) –

the parent class structure

### Gst.TaskPoolClass

The Gst.TaskPoolClass object.

##### Attributes

`parent_class` (Gst.ObjectClass) –

the parent class structure

### Gst.TaskPoolClass

The Gst.TaskPoolClass object.

##### Attributes

`parent_class` (Gst.ObjectClass) –

the parent class structure

## Gst.TaskPool

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.TaskPool

The Gst.TaskPool object.

### Members

`object` (Gst.Object) –
No description available

## Gst.TaskPool

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.TaskPool

The Gst.TaskPool object.

### Members

`object` (Gst.Object) –
No description available

### Constructors

#### gst_task_pool_new

    GstTaskPool *
    gst_task_pool_new ()

Create a new default task pool. The default task pool will use a regular GThreadPool for threads.

Returns ( [transfer: full] ) –

a new GstTaskPool. gst_object_unref after usage.

#### Gst.TaskPool.prototype.new

    function Gst.TaskPool.prototype.new(): {
        // javascript wrapper for 'gst_task_pool_new'
    }

Create a new default task pool. The default task pool will use a regular GThreadPool for threads.

Returns ( Gst.TaskPool ) –

a new Gst.TaskPool. Gst.Object.prototype.unref after usage.

#### Gst.TaskPool.new

    def Gst.TaskPool.new ():
        #python wrapper for 'gst_task_pool_new'

Create a new default task pool. The default task pool will use a regular GThreadPool for threads.

Returns ( Gst.TaskPool ) –

a new Gst.TaskPool. Gst.Object.unref after usage.

### Methods

#### gst_task_pool_cleanup

    gst_task_pool_cleanup (GstTaskPool * pool)

Wait for all tasks to be stopped. This is mainly used internally to ensure proper cleanup of internal data structures in test suites.

MT safe.

Parameters:

`pool` –

a GstTaskPool

#### Gst.TaskPool.prototype.cleanup

    function Gst.TaskPool.prototype.cleanup(): {
        // javascript wrapper for 'gst_task_pool_cleanup'
    }

Wait for all tasks to be stopped. This is mainly used internally to ensure proper cleanup of internal data structures in test suites.

MT safe.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

#### Gst.TaskPool.cleanup

    def Gst.TaskPool.cleanup (self):
        #python wrapper for 'gst_task_pool_cleanup'

Wait for all tasks to be stopped. This is mainly used internally to ensure proper cleanup of internal data structures in test suites.

MT safe.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

#### gst_task_pool_join

    gst_task_pool_join (GstTaskPool * pool,
                        gpointer id)

Join a task and/or return it to the pool. id is the id obtained from gst_task_pool_push.

Parameters:

`pool` –

a GstTaskPool

`id` –

the id

#### Gst.TaskPool.prototype.join

    function Gst.TaskPool.prototype.join(id: Object): {
        // javascript wrapper for 'gst_task_pool_join'
    }

Join a task and/or return it to the pool. id is the id obtained from Gst.TaskPool.prototype.push.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

`id` ( Object ) –

the id

#### Gst.TaskPool.join

    def Gst.TaskPool.join (self, id):
        #python wrapper for 'gst_task_pool_join'

Join a task and/or return it to the pool. id is the id obtained from Gst.TaskPool.push.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

`id` ( object ) –

the id

#### gst_task_pool_prepare

    gst_task_pool_prepare (GstTaskPool * pool,
                           GError ** error)

Prepare the taskpool for accepting gst_task_pool_push operations.

MT safe.

Parameters:

`pool` –

a GstTaskPool

`error` –

an error return location

#### Gst.TaskPool.prototype.prepare

    function Gst.TaskPool.prototype.prepare(): {
        // javascript wrapper for 'gst_task_pool_prepare'
    }

Prepare the taskpool for accepting Gst.TaskPool.prototype.push operations.

MT safe.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

#### Gst.TaskPool.prepare

    @raises(GLib.GError)
    def Gst.TaskPool.prepare (self):
        #python wrapper for 'gst_task_pool_prepare'

Prepare the taskpool for accepting Gst.TaskPool.push operations.

MT safe.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

#### gst_task_pool_push

    gpointer
    gst_task_pool_push (GstTaskPool * pool,
                        GstTaskPoolFunction func,
                        gpointer user_data,
                        GError ** error)

Start the execution of a new thread from pool.

Parameters:

`pool` –

a GstTaskPool

`func` ( [scope async] ) –

the function to call

`user_data` ( [closure] ) –

data to pass to func

`error` –

return location for an error

Returns ( [transfer: none][nullable] ) –

a pointer that should be used for the gst_task_pool_join function. This pointer can be NULL, you must check error to detect errors.

#### Gst.TaskPool.prototype.push

    function Gst.TaskPool.prototype.push(func: Gst.TaskPoolFunction, user_data: Object): {
        // javascript wrapper for 'gst_task_pool_push'
    }

Start the execution of a new thread from pool.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

`func` ( Gst.TaskPoolFunction ) –

the function to call

`user_data` ( Object ) –

data to pass to func

Returns ( Object ) –

a pointer that should be used for the gst_task_pool_join function. This pointer can be null, you must check error to detect errors.

#### Gst.TaskPool.push

    @raises(GLib.GError)
    def Gst.TaskPool.push (self, func, *user_data):
        #python wrapper for 'gst_task_pool_push'

Start the execution of a new thread from pool.

Parameters:

`pool` ( Gst.TaskPool ) –

a Gst.TaskPool

`func` ( Gst.TaskPoolFunction ) –

the function to call

`user_data` ( variadic ) –

data to pass to func

Returns ( object ) –

a pointer that should be used for the gst_task_pool_join function. This pointer can be None, you must check error to detect errors.

### Virtual Methods

#### cleanup

    cleanup (GstTaskPool * pool)

make sure all threads are stopped

Parameters:

`pool` –
No description available

#### vfunc_cleanup

    function vfunc_cleanup(pool: Gst.TaskPool): {
        // javascript implementation of the 'cleanup' virtual method
    }

make sure all threads are stopped

Parameters:

`pool` ( Gst.TaskPool ) –
No description available

#### do_cleanup

    def do_cleanup (pool):
        #python implementation of the 'cleanup' virtual method

make sure all threads are stopped

Parameters:

`pool` ( Gst.TaskPool ) –
No description available

#### join

    join (GstTaskPool * pool,
          gpointer id)

join a thread

Parameters:

`pool` –
No description available
`id` –
No description available

#### vfunc_join

    function vfunc_join(pool: Gst.TaskPool, id: Object): {
        // javascript implementation of the 'join' virtual method
    }

join a thread

Parameters:

`pool` ( Gst.TaskPool ) –
No description available
`id` ( Object ) –
No description available

#### do_join

    def do_join (pool, id):
        #python implementation of the 'join' virtual method

join a thread

Parameters:

`pool` ( Gst.TaskPool ) –
No description available
`id` ( object ) –
No description available

#### prepare

    prepare (GstTaskPool * pool,
             GError ** error)

prepare the threadpool

Parameters:

`pool` –
No description available
`error` –
No description available

#### vfunc_prepare

    function vfunc_prepare(pool: Gst.TaskPool): {
        // javascript implementation of the 'prepare' virtual method
    }

prepare the threadpool

Parameters:

`pool` ( Gst.TaskPool ) –
No description available

#### do_prepare

    def do_prepare (pool):
        #python implementation of the 'prepare' virtual method

prepare the threadpool

Parameters:

`pool` ( Gst.TaskPool ) –
No description available

#### push

    gpointer
    push (GstTaskPool * pool,
          GstTaskPoolFunction func,
          gpointer user_data,
          GError ** error)

start a new thread

Parameters:

`pool` –
No description available
`func` –
No description available
`user_data` –
No description available
`error` –
No description available
Returns –
No description available

#### vfunc_push

    function vfunc_push(pool: Gst.TaskPool, func: Gst.TaskPoolFunction, user_data: Object): {
        // javascript implementation of the 'push' virtual method
    }

start a new thread

Parameters:

`pool` ( Gst.TaskPool ) –
No description available
`func` ( Gst.TaskPoolFunction ) –
No description available
`user_data` ( Object ) –
No description available
Returns ( Object ) –
No description available

#### do_push

    def do_push (pool, func, *user_data):
        #python implementation of the 'push' virtual method

start a new thread

Parameters:

`pool` ( Gst.TaskPool ) –
No description available
`func` ( Gst.TaskPoolFunction ) –
No description available
`user_data` ( variadic ) –
No description available
Returns ( object ) –
No description available

## Function Macros

### GST_TASK_POOL_CAST

    #define GST_TASK_POOL_CAST(pool)       ((GstTaskPool*)(pool))

## Callbacks

### GstTaskPoolFunction

    (*GstTaskPoolFunction) (void* user_data)

Task function, see gst_task_pool_push.

Parameters:

`user_data` –

user data for the task function

### Gst.TaskPoolFunction

    function Gst.TaskPoolFunction(user_data: Object): {
        // javascript wrapper for 'GstTaskPoolFunction'
    }

Task function, see Gst.TaskPool.prototype.push.

Parameters:

`user_data` ( Object ) –

user data for the task function

### Gst.TaskPoolFunction

    def Gst.TaskPoolFunction (*user_data):
        #python wrapper for 'GstTaskPoolFunction'

Task function, see Gst.TaskPool.push.

Parameters:

`user_data` ( variadic ) –

user data for the task function

The results of the search are