Klasse TaskPool

Alle implementierten Schnittstellen:
PointerInterface
Bekannte direkte Unterklassen:
SharedTaskPool

public class TaskPool extends PropertyHolder
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.

https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html

  • Konstruktordetails

    • TaskPool

      public TaskPool(PointerContainer pointer)
    • TaskPool

      public TaskPool()
      Create a new default task pool. The default task pool will use a regular
      GThreadPool for threads.
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • cleanup

      public void 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.
    • disposeHandle

      public void disposeHandle(@Nullable Pointer id)
      Dispose of the handle returned by gst_task_pool_push(). This does
      not need to be called with the default implementation as the default
      #GstTaskPoolClass::push implementation always returns %NULL. This does not need to be
      called either when calling gst_task_pool_join(), but should be called
      when joining is not necessary, but gst_task_pool_push() returned a
      non-%NULL value.

      This method should only be called with the same @pool instance that provided
      @id.
      Parameter:
      id - the id
    • join

      public void join(@Nullable Pointer id)
      Join a task and/or return it to the pool. @id is the id obtained from
      gst_task_pool_push(). The default implementation does nothing, as the
      default #GstTaskPoolClass::push implementation always returns %NULL.

      This method should only be called with the same @pool instance that provided
      @id.
      Parameter:
      id - the id
    • prepare

      public void prepare() throws AllocationError
      Prepare the taskpool for accepting gst_task_pool_push() operations.

      MT safe.
      Löst aus:
      AllocationError
    • push

      public Pointer push(TaskPool.OnTaskPoolFunction func, @Nullable Pointer user_data) throws AllocationError
      Start the execution of a new thread from @pool.
      Parameter:
      func - the function to call
      user_data - data to pass to @func
      Gibt zurück:
      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. If the pointer is not %NULL and gst_task_pool_join() is not used, call gst_task_pool_dispose_handle() instead.
      Löst aus:
      AllocationError
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()