Gst.TaskPool¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
object |
r |
||
pool |
r |
Class Details¶
- class Gst.TaskPool(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
This object provides an abstraction for creating threads. The default implementation uses a regular
GLib.ThreadPool
to start tasks.Subclasses can be made to create custom threads.
- classmethod new()[source]¶
- Returns:
a new
Gst.TaskPool
.Gst.Object.unref
() after usage.- Return type:
Create a new default task pool. The default task pool will use a regular
GLib.ThreadPool
for threads.
- cleanup()[source]¶
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.
- dispose_handle(id)[source]¶
-
Dispose of the handle returned by
Gst.TaskPool.push
(). This does not need to be called with the default implementation as the default #GstTaskPoolClass::push implementation always returnsNone
. This does not need to be called either when callingGst.TaskPool.join
(), but should be called when joining is not necessary, butGst.TaskPool.push
() returned a non-None
value.This method should only be called with the same self instance that provided id.
New in version 1.20.
- join(id)[source]¶
-
Join a task and/or return it to the pool. id is the id obtained from
Gst.TaskPool.push
(). The default implementation does nothing, as the default #GstTaskPoolClass::push implementation always returnsNone
.This method should only be called with the same self instance that provided id.
- prepare()[source]¶
- Raises:
Prepare the taskpool for accepting
Gst.TaskPool.push
() operations.MT safe.
- push(func, *user_data)[source]¶
- Parameters:
func (
Gst.TaskPoolFunction
) – the function to call
- Raises:
- Returns:
a pointer that should be used for the
Gst.TaskPool.join
function. This pointer can beNone
, you must check error to detect errors. If the pointer is notNone
andGst.TaskPool.join
() is not used, callGst.TaskPool.dispose_handle
() instead.- Return type:
Start the execution of a new thread from self.
- do_cleanup() virtual¶
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.
- do_dispose_handle(id) virtual¶
-
Dispose of the handle returned by
Gst.TaskPool.push
(). This does not need to be called with the default implementation as the default #GstTaskPoolClass::push implementation always returnsNone
. This does not need to be called either when callingGst.TaskPool.join
(), but should be called when joining is not necessary, butGst.TaskPool.push
() returned a non-None
value.This method should only be called with the same pool instance that provided id.
New in version 1.20.
- do_join(id) virtual¶
-
Join a task and/or return it to the pool. id is the id obtained from
Gst.TaskPool.push
(). The default implementation does nothing, as the default #GstTaskPoolClass::push implementation always returnsNone
.This method should only be called with the same pool instance that provided id.
- do_prepare() virtual¶
Prepare the taskpool for accepting
Gst.TaskPool.push
() operations.MT safe.
- do_push(func, *user_data) virtual¶
- Parameters:
func (
Gst.TaskPoolFunction
) – the function to call
- Returns:
a pointer that should be used for the
Gst.TaskPool.join
function. This pointer can beNone
, you must check error to detect errors. If the pointer is notNone
andGst.TaskPool.join
() is not used, callGst.TaskPool.dispose_handle
() instead.- Return type:
Start the execution of a new thread from pool.