GstVaapiContext

GstVaapiContext — VA context abstraction

Synopsis

                    GstVaapiContext;
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,
                                                         guint width,
                                                         guint 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);
GstVaapiSurfaceProxy * gst_vaapi_context_get_surface_proxy
                                                        (GstVaapiContext *context);
guint               gst_vaapi_context_get_surface_count (GstVaapiContext *context);
gboolean            gst_vaapi_context_apply_composition (GstVaapiContext *context,
                                                         GstVideoOverlayComposition *composition);

Description

Details

GstVaapiContext

typedef struct _GstVaapiContext GstVaapiContext;

A VA context wrapper.


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,
                                                         guint width,
                                                         guint 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_proxy ()

GstVaapiSurfaceProxy * gst_vaapi_context_get_surface_proxy
                                                        (GstVaapiContext *context);

Acquires a free surface, wrapped into a GstVaapiSurfaceProxy. The returned surface will be automatically released when the proxy is destroyed. So, it is enough to call gst_vaapi_surface_proxy_unref() after usage.

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_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