GstVaapiTexture

GstVaapiTexture — VA/GLX texture abstraction

Functions

Types and Values

Description

Functions

gst_vaapi_texture_new ()

GstVaapiTexture *
gst_vaapi_texture_new (GstVaapiDisplay *display,
                       guint target,
                       guint format,
                       guint width,
                       guint height);

Creates a texture with the specified dimensions, target and format . Note that only GL_TEXTURE_2D target and GL_RGBA or GL_BGRA formats are supported at this time.

The application shall maintain the live GL context itself.

Parameters

display

a GstVaapiDisplay

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the requested width, in pixels

 

height

the requested height, in pixels

 

Returns

the newly created GstVaapiTexture object


gst_vaapi_texture_new_wrapped ()

GstVaapiTexture *
gst_vaapi_texture_new_wrapped (GstVaapiDisplay *display,
                               guint id,
                               guint target,
                               guint format,
                               guint width,
                               guint height);

Creates a texture with the specified dimensions, target and format . Note that only GL_TEXTURE_2D target and GL_RGBA or GL_BGRA formats are supported at this time.

The size arguments width and height are only a suggestion. Should this be 0x0, then the actual size of the allocated texture storage would be either inherited from the original texture storage, if any and/or if possible, or derived from the VA surface in subsequent gst_vaapi_texture_put_surface() calls.

The application shall maintain the live GL context itself.

Parameters

display

a GstVaapiDisplay

 

texture_id

the foreign GL texture name to use

 

target

the target to which the texture is bound

 

format

the format of the pixel data

 

width

the suggested width, in pixels

 

height

the suggested height, in pixels

 

Returns

the newly created GstVaapiTexture object


gst_vaapi_texture_ref ()

GstVaapiTexture *
gst_vaapi_texture_ref (GstVaapiTexture *texture);

Atomically increases the reference count of the given texture by one.

Parameters

texture

a GstVaapiTexture

 

Returns

The same texture argument


gst_vaapi_texture_unref ()

void
gst_vaapi_texture_unref (GstVaapiTexture *texture);

Atomically decreases the reference count of the texture by one. If the reference count reaches zero, the texture will be free'd.

Parameters

texture

a GstVaapiTexture

 

gst_vaapi_texture_replace ()

void
gst_vaapi_texture_replace (GstVaapiTexture **old_texture_ptr,
                           GstVaapiTexture *new_texture);

Atomically replaces the texture texture held in old_texture_ptr with new_texture . This means that old_texture_ptr shall reference a valid texture. However, new_texture can be NULL.

Parameters

old_texture_ptr

a pointer to a GstVaapiTexture

 

new_texture

a GstVaapiTexture

 

gst_vaapi_texture_get_id ()

guint
gst_vaapi_texture_get_id (GstVaapiTexture *texture);

Returns the underlying texture id of the texture .

Parameters

texture

a GstVaapiTexture

 

Returns

the underlying texture id of the texture


gst_vaapi_texture_get_target ()

guint
gst_vaapi_texture_get_target (GstVaapiTexture *texture);

Returns the texture target type

Parameters

texture

a GstVaapiTexture

 

Returns

the texture target


gst_vaapi_texture_get_format ()

guint
gst_vaapi_texture_get_format (GstVaapiTexture *texture);

Returns the texture format

Parameters

texture

a GstVaapiTexture

 

Returns

the texture format


gst_vaapi_texture_get_width ()

guint
gst_vaapi_texture_get_width (GstVaapiTexture *texture);

Returns the texture width.

Parameters

texture

a GstVaapiTexture

 

Returns

the texture width, in pixels


gst_vaapi_texture_get_height ()

guint
gst_vaapi_texture_get_height (GstVaapiTexture *texture);

Returns the texture height.

Parameters

texture

a GstVaapiTexture

 

Returns

the texture height, in pixels.


gst_vaapi_texture_get_size ()

void
gst_vaapi_texture_get_size (GstVaapiTexture *texture,
                            guint *width_ptr,
                            guint *height_ptr);

Retrieves the dimensions of a GstVaapiTexture.

Parameters

texture

a GstVaapiTexture

 

width_ptr

return location for the width, or NULL

 

height_ptr

return location for the height, or NULL

 

gst_vaapi_texture_get_orientation_flags ()

guint
gst_vaapi_texture_get_orientation_flags
                               (GstVaapiTexture *texture);

Retrieves the texture memory layout flags, i.e. orientation.

Parameters

texture

a GstVaapiTexture

 

Returns

the GstVaapiTextureOrientationFlags.


gst_vaapi_texture_set_orientation_flags ()

void
gst_vaapi_texture_set_orientation_flags
                               (GstVaapiTexture *texture,
                                guint flags);

Reset the texture orientation flags to the supplied set of flags . This completely replaces the previously installed flags. So, should they still be needed, then they shall be retrieved first with gst_vaapi_texture_get_orientation_flags().

Parameters

texture

a GstVaapiTexture

 

flags

a bitmask of GstVaapiTextureOrientationFlags

 

gst_vaapi_texture_put_surface ()

gboolean
gst_vaapi_texture_put_surface (GstVaapiTexture *texture,
                               GstVaapiSurface *surface,
                               const GstVaapiRectangle *crop_rect,
                               guint flags);

Renders the surface into the àtexture. The flags specify how de-interlacing (if needed), color space conversion, scaling and other postprocessing transformations are performed.

Parameters

texture

a GstVaapiTexture

 

surface

a GstVaapiSurface

 

flags

postprocessing flags. See GstVaapiTextureRenderFlags

 

Returns

TRUE on success

Types and Values

GstVaapiTexture

typedef struct {
} GstVaapiTexture;

Base class for API-dependent textures.