GstVaapiVideoPool

GstVaapiVideoPool — Video object pool abstraction

Synopsis

struct              GstVaapiVideoPool;
struct              GstVaapiVideoPoolClass;
GstVaapiDisplay *   gst_vaapi_video_pool_get_display    (GstVaapiVideoPool *pool);
GstCaps *           gst_vaapi_video_pool_get_caps       (GstVaapiVideoPool *pool);
gpointer            gst_vaapi_video_pool_get_object     (GstVaapiVideoPool *pool);
void                gst_vaapi_video_pool_put_object     (GstVaapiVideoPool *pool,
                                                         gpointer object);
gboolean            gst_vaapi_video_pool_add_object     (GstVaapiVideoPool *pool,
                                                         gpointer object);
gboolean            gst_vaapi_video_pool_add_objects    (GstVaapiVideoPool *pool,
                                                         GPtrArray *objects);
guint               gst_vaapi_video_pool_get_capacity   (GstVaapiVideoPool *pool);
void                gst_vaapi_video_pool_set_capacity   (GstVaapiVideoPool *pool,
                                                         guint capacity);
guint               gst_vaapi_video_pool_get_size       (GstVaapiVideoPool *pool);
gboolean            gst_vaapi_video_pool_reserve        (GstVaapiVideoPool *pool,
                                                         guint n);

Object Hierarchy

  GObject
   +----GstVaapiVideoPool
         +----GstVaapiImagePool
         +----GstVaapiSurfacePool

Properties

  "capacity"                 guint                 : Read / Write
  "caps"                     gpointer              : Read / Write / Construct Only
  "display"                  GstVaapiDisplay*      : Read / Write / Construct Only

Description

Details

struct GstVaapiVideoPool

struct GstVaapiVideoPool;

A pool of lazily allocated video objects. e.g. surfaces, images.


struct GstVaapiVideoPoolClass

struct GstVaapiVideoPoolClass {
    void     (*set_caps)    (GstVaapiVideoPool *pool, GstCaps *caps);
    gpointer (*alloc_object)(GstVaapiVideoPool *pool, GstVaapiDisplay *display);
};

A pool base class used to hold video objects. e.g. surfaces, images.

set_caps ()

virtual function for notifying the subclass of the negotiated caps

alloc_object ()

virtual function for allocating a video pool object

gst_vaapi_video_pool_get_display ()

GstVaapiDisplay *   gst_vaapi_video_pool_get_display    (GstVaapiVideoPool *pool);

Retrieves the GstVaapiDisplay the pool is bound to. The pool owns the returned object and it shall not be unref'ed.

pool :

a GstVaapiVideoPool

Returns :

the GstVaapiDisplay the pool is bound to

gst_vaapi_video_pool_get_caps ()

GstCaps *           gst_vaapi_video_pool_get_caps       (GstVaapiVideoPool *pool);

Retrieves the GstCaps the pool was created with. The pool owns the returned object and it shall not be unref'ed.

pool :

a GstVaapiVideoPool

Returns :

the GstCaps the pool was created with

gst_vaapi_video_pool_get_object ()

gpointer            gst_vaapi_video_pool_get_object     (GstVaapiVideoPool *pool);

Retrieves a new object from the pool, or allocates a new one if none was found. The pool holds a reference on the returned object and thus shall be released through gst_vaapi_video_pool_put_object() when it's no longer needed.

pool :

a GstVaapiVideoPool

Returns :

a possibly newly allocated object, or NULL on error

gst_vaapi_video_pool_put_object ()

void                gst_vaapi_video_pool_put_object     (GstVaapiVideoPool *pool,
                                                         gpointer object);

Pushes the object back into the pool. The object shall be obtained from the pool through gst_vaapi_video_pool_get_object(). Calling this function with an arbitrary object yields undefined behaviour.

pool :

a GstVaapiVideoPool

object :

the object to add back to the pool

gst_vaapi_video_pool_add_object ()

gboolean            gst_vaapi_video_pool_add_object     (GstVaapiVideoPool *pool,
                                                         gpointer object);

Adds the object to the pool. The pool then holds a reference on the object. This operation does not change the capacity of the pool.

pool :

a GstVaapiVideoPool

object :

the object to add to the pool

Returns :

TRUE on success.

gst_vaapi_video_pool_add_objects ()

gboolean            gst_vaapi_video_pool_add_objects    (GstVaapiVideoPool *pool,
                                                         GPtrArray *objects);

Adds the objects to the pool. The pool then holds a reference on the objects. This operation does not change the capacity of the pool and is just a wrapper around gst_vaapi_video_pool_add_object().

pool :

a GstVaapiVideoPool

objects :

a GPtrArray of objects

Returns :

TRUE on success.

gst_vaapi_video_pool_get_capacity ()

guint               gst_vaapi_video_pool_get_capacity   (GstVaapiVideoPool *pool);

Returns the maximum number of objects in the pool. i.e. the maximum number of objects that can be returned by gst_vaapi_video_pool_get_object().

pool :

a GstVaapiVideoPool

Returns :

the capacity of the pool

gst_vaapi_video_pool_set_capacity ()

void                gst_vaapi_video_pool_set_capacity   (GstVaapiVideoPool *pool,
                                                         guint capacity);

Sets the maximum number of objects that can be allocated in the pool.

pool :

a GstVaapiVideoPool

capacity :

the maximal capacity of the pool

gst_vaapi_video_pool_get_size ()

guint               gst_vaapi_video_pool_get_size       (GstVaapiVideoPool *pool);

Returns the number of free objects available in the pool.

pool :

a GstVaapiVideoPool

Returns :

number of free objects in the pool

gst_vaapi_video_pool_reserve ()

gboolean            gst_vaapi_video_pool_reserve        (GstVaapiVideoPool *pool,
                                                         guint n);

Pre-allocates up to n objects in the pool. If n is less than or equal to the number of free and used objects in the pool, this call has no effect. Otherwise, it is a request for allocation of additional objects.

pool :

a GstVaapiVideoPool

n :

the number of objects to pre-allocate

Returns :

TRUE on success

Property Details

The "capacity" property

  "capacity"                 guint                 : Read / Write

The maximum number of objects in the pool.

Default value: 0


The "caps" property

  "caps"                     gpointer              : Read / Write / Construct Only

The video object capabilities.


The "display" property

  "display"                  GstVaapiDisplay*      : Read / Write / Construct Only

The GstVaapiDisplay this pool is bound to.