Gst.TaskPool

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.TaskPool Gst.TaskPool Gst.Object->Gst.TaskPool

Subclasses:None

Methods

Inherited:Gst.Object (27), GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new ()
  cleanup ()
  join (id)
  prepare ()
  push (func, *user_data)

Virtual Methods

Inherited:Gst.Object (1), GObject.Object (7)
  do_cleanup ()
  do_join (id)
  do_prepare ()
  do_push (func, *user_data)

Properties

Inherited:Gst.Object (2)

Fields

Inherited:Gst.Object (1), GObject.Object (1)
Name Type Access Description
object Gst.Object r  
pool GLib.ThreadPool r  

Class Details

class Gst.TaskPool(**kwargs)
Bases:Gst.Object
Abstract:No
Structure:Gst.TaskPoolClass

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:Gst.TaskPool

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.

join(id)[source]
Parameters:id (object or None) – the id

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

prepare()[source]
Raises:GLib.Error

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

MT safe.

push(func, *user_data)[source]
Parameters:
Raises:

GLib.Error

Returns:

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

Return type:

object or None

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_join(id) virtual
Parameters:id (object or None) – the id

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

do_prepare() virtual

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

MT safe.

do_push(func, *user_data) virtual
Parameters:
Returns:

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

Return type:

object or None

Start the execution of a new thread from pool.