GstVaapiContext

GstVaapiContext — VA context abstraction

Synopsis

struct              GstVaapiContext;
struct              GstVaapiContextClass;
GstVaapiContext *   gst_vaapi_context_new               (GstVaapiDisplay *display,
                                                         GstVaapiProfile profile,
                                                         GstVaapiEntrypoint entrypoint,
                                                         guint width,
                                                         guint height);
gboolean            gst_vaapi_context_reset             (GstVaapiContext *context,
                                                         GstVaapiProfile profile,
                                                         GstVaapiEntrypoint entrypoint,
                                                         unsigned int width,
                                                         unsigned int height);
GstVaapiID          gst_vaapi_context_get_id            (GstVaapiContext *context);
GstVaapiProfile     gst_vaapi_context_get_profile       (GstVaapiContext *context);
gboolean            gst_vaapi_context_set_profile       (GstVaapiContext *context,
                                                         GstVaapiProfile profile);
GstVaapiEntrypoint  gst_vaapi_context_get_entrypoint    (GstVaapiContext *context);
void                gst_vaapi_context_get_size          (GstVaapiContext *context,
                                                         guint *pwidth,
                                                         guint *pheight);
GstVaapiSurface *   gst_vaapi_context_get_surface       (GstVaapiContext *context);
guint               gst_vaapi_context_get_surface_count (GstVaapiContext *context);
void                gst_vaapi_context_put_surface       (GstVaapiContext *context,
                                                         GstVaapiSurface *surface);
GstVaapiSurface *   gst_vaapi_context_find_surface_by_id
                                                        (GstVaapiContext *context,
                                                         GstVaapiID id);
gboolean            gst_vaapi_context_apply_composition (GstVaapiContext *context,
                                                         GstVideoOverlayComposition *composition);

Object Hierarchy

  GObject
   +----GstVaapiObject
         +----GstVaapiContext

Properties

  "entrypoint"               guint                 : Read / Write / Construct Only
  "height"                   guint                 : Read / Write / Construct Only
  "profile"                  guint                 : Read / Write
  "width"                    guint                 : Read / Write / Construct Only

Description

Details

struct GstVaapiContext

struct GstVaapiContext;

A VA context wrapper.


struct GstVaapiContextClass

struct GstVaapiContextClass {
};

A VA context wrapper class.


gst_vaapi_context_new ()

GstVaapiContext *   gst_vaapi_context_new               (GstVaapiDisplay *display,
                                                         GstVaapiProfile profile,
                                                         GstVaapiEntrypoint entrypoint,
                                                         guint width,
                                                         guint height);

Creates a new GstVaapiContext with the specified codec profile and entrypoint.

display :

a GstVaapiDisplay

profile :

a GstVaapiProfile

entrypoint :

a GstVaapiEntrypoint

width :

coded width from the bitstream

height :

coded height from the bitstream

Returns :

the newly allocated GstVaapiContext object

gst_vaapi_context_reset ()

gboolean            gst_vaapi_context_reset             (GstVaapiContext *context,
                                                         GstVaapiProfile profile,
                                                         GstVaapiEntrypoint entrypoint,
                                                         unsigned int width,
                                                         unsigned int height);

Resets context to the specified codec profile and entrypoint. The surfaces will be reallocated if the coded size changed.

context :

a GstVaapiContext

profile :

a GstVaapiProfile

entrypoint :

a GstVaapiEntrypoint

width :

coded width from the bitstream

height :

coded height from the bitstream

Returns :

TRUE on success

gst_vaapi_context_get_id ()

GstVaapiID          gst_vaapi_context_get_id            (GstVaapiContext *context);

Returns the underlying VAContextID of the context.

context :

a GstVaapiContext

Returns :

the underlying VA context id

gst_vaapi_context_get_profile ()

GstVaapiProfile     gst_vaapi_context_get_profile       (GstVaapiContext *context);

Returns the VA profile used by the context.

context :

a GstVaapiContext

Returns :

the VA profile used by the context

gst_vaapi_context_set_profile ()

gboolean            gst_vaapi_context_set_profile       (GstVaapiContext *context,
                                                         GstVaapiProfile profile);

Sets the new profile to use with the context. If profile matches the previous profile, this call has no effect. Otherwise, the underlying VA context is recreated, while keeping the previously allocated surfaces.

context :

a GstVaapiContext

profile :

the new GstVaapiProfile to use

Returns :

TRUE on success

gst_vaapi_context_get_entrypoint ()

GstVaapiEntrypoint  gst_vaapi_context_get_entrypoint    (GstVaapiContext *context);

Returns the VA entrypoint used by the context

context :

a GstVaapiContext

Returns :

the VA entrypoint used by the context

gst_vaapi_context_get_size ()

void                gst_vaapi_context_get_size          (GstVaapiContext *context,
                                                         guint *pwidth,
                                                         guint *pheight);

Retrieves the size of the surfaces attached to context.

context :

a GstVaapiContext

pwidth :

return location for the width, or NULL

pheight :

return location for the height, or NULL

gst_vaapi_context_get_surface ()

GstVaapiSurface *   gst_vaapi_context_get_surface       (GstVaapiContext *context);

Acquires a free surface. The returned surface but be released with gst_vaapi_context_put_surface(). This function returns NULL if there is no free surface available in the pool. The surfaces are pre-allocated during context creation though.

context :

a GstVaapiContext

Returns :

a free surface, or NULL if none is available

gst_vaapi_context_get_surface_count ()

guint               gst_vaapi_context_get_surface_count (GstVaapiContext *context);

Retrieves the number of free surfaces left in the pool.

context :

a GstVaapiContext

Returns :

the number of free surfaces available in the pool

gst_vaapi_context_put_surface ()

void                gst_vaapi_context_put_surface       (GstVaapiContext *context,
                                                         GstVaapiSurface *surface);

Releases a surface acquired by gst_vaapi_context_get_surface().

context :

a GstVaapiContext

surface :

the GstVaapiSurface to release

gst_vaapi_context_find_surface_by_id ()

GstVaapiSurface *   gst_vaapi_context_find_surface_by_id
                                                        (GstVaapiContext *context,
                                                         GstVaapiID id);

Finds VA surface by id in the list of surfaces attached to the context.

context :

a GstVaapiContext

id :

the VA surface id to find

Returns :

the matching GstVaapiSurface object, or NULL if none was found

gst_vaapi_context_apply_composition ()

gboolean            gst_vaapi_context_apply_composition (GstVaapiContext *context,
                                                         GstVideoOverlayComposition *composition);

Applies video composition planes to all surfaces bound to context. This helper function resets any additional subpictures the user may have associated himself. A NULL composition will also clear all the existing subpictures.

context :

a GstVaapiContext

composition :

a GstVideoOverlayComposition

Returns :

TRUE if all composition planes could be applied, FALSE otherwise

Property Details

The "entrypoint" property

  "entrypoint"               guint                 : Read / Write / Construct Only

The decoder entrypoint.

Default value: 0


The "height" property

  "height"                   guint                 : Read / Write / Construct Only

The height of the decoded surfaces.

Allowed values: <= G_MAXLONG

Default value: 0


The "profile" property

  "profile"                  guint                 : Read / Write

The profile used for decoding.

Default value: 0


The "width" property

  "width"                    guint                 : Read / Write / Construct Only

The width of decoded surfaces.

Allowed values: <= G_MAXLONG

Default value: 0