GstVaapiImage

GstVaapiImage — VA image abstraction

Synopsis

#define             GST_VAAPI_IMAGE_FORMAT              (image)
#define             GST_VAAPI_IMAGE_WIDTH               (image)
#define             GST_VAAPI_IMAGE_HEIGHT              (image)
struct              GstVaapiImage;
struct              GstVaapiImageClass;
GstVaapiImage *     gst_vaapi_image_new                 (GstVaapiDisplay *display,
                                                         GstVaapiImageFormat format,
                                                         guint width,
                                                         guint height);
GstVaapiImage *     gst_vaapi_image_new_with_image      (GstVaapiDisplay *display,
                                                         VAImage *va_image);
GstVaapiID          gst_vaapi_image_get_id              (GstVaapiImage *image);
gboolean            gst_vaapi_image_get_image           (GstVaapiImage *image,
                                                         VAImage *va_image);
GstVaapiImageFormat gst_vaapi_image_get_format          (GstVaapiImage *image);
guint               gst_vaapi_image_get_width           (GstVaapiImage *image);
guint               gst_vaapi_image_get_height          (GstVaapiImage *image);
void                gst_vaapi_image_get_size            (GstVaapiImage *image,
                                                         guint *pwidth,
                                                         guint *pheight);
gboolean            gst_vaapi_image_is_linear           (GstVaapiImage *image);
gboolean            gst_vaapi_image_is_mapped           (GstVaapiImage *image);
gboolean            gst_vaapi_image_map                 (GstVaapiImage *image);
gboolean            gst_vaapi_image_unmap               (GstVaapiImage *image);
guint               gst_vaapi_image_get_plane_count     (GstVaapiImage *image);
guchar *            gst_vaapi_image_get_plane           (GstVaapiImage *image,
                                                         guint plane);
guint               gst_vaapi_image_get_pitch           (GstVaapiImage *image,
                                                         guint plane);
guint               gst_vaapi_image_get_data_size       (GstVaapiImage *image);
gboolean            gst_vaapi_image_get_buffer          (GstVaapiImage *image,
                                                         GstBuffer *buffer,
                                                         GstVaapiRectangle *rect);
gboolean            gst_vaapi_image_get_raw             (GstVaapiImage *image,
                                                         GstVaapiImageRaw *dst_image,
                                                         GstVaapiRectangle *rect);
gboolean            gst_vaapi_image_update_from_buffer  (GstVaapiImage *image,
                                                         GstBuffer *buffer,
                                                         GstVaapiRectangle *rect);

Object Hierarchy

  GObject
   +----GstVaapiObject
         +----GstVaapiImage

Properties

  "format"                   guint                 : Read / Write / Construct Only
  "height"                   guint                 : Read / Write / Construct Only
  "image"                    VAImage*              : Read / Write / Construct Only
  "width"                    guint                 : Read / Write / Construct Only

Description

Details

GST_VAAPI_IMAGE_FORMAT()

#define GST_VAAPI_IMAGE_FORMAT(image)   gst_vaapi_image_get_format(image)

Macro that evaluates to the GstVaapiImageFormat of image.

image :

a GstVaapiImage

GST_VAAPI_IMAGE_WIDTH()

#define GST_VAAPI_IMAGE_WIDTH(image)    gst_vaapi_image_get_width(image)

Macro that evaluates to the width of image.

image :

a GstVaapiImage

GST_VAAPI_IMAGE_HEIGHT()

#define GST_VAAPI_IMAGE_HEIGHT(image)   gst_vaapi_image_get_height(image)

Macro that evaluates to the height of image.

image :

a GstVaapiImage

struct GstVaapiImage

struct GstVaapiImage;

A VA image wrapper


struct GstVaapiImageClass

struct GstVaapiImageClass {
};

A VA image wrapper class


gst_vaapi_image_new ()

GstVaapiImage *     gst_vaapi_image_new                 (GstVaapiDisplay *display,
                                                         GstVaapiImageFormat format,
                                                         guint width,
                                                         guint height);

Creates a new GstVaapiImage with the specified format and dimensions.

display :

a GstVaapiDisplay

format :

a GstVaapiImageFormat

width :

the requested image width

height :

the requested image height

Returns :

the newly allocated GstVaapiImage object

gst_vaapi_image_new_with_image ()

GstVaapiImage *     gst_vaapi_image_new_with_image      (GstVaapiDisplay *display,
                                                         VAImage *va_image);

Creates a new GstVaapiImage from a foreign VA image. The image format and dimensions will be extracted from va_image. This function is mainly used by gst_vaapi_surface_derive_image() to bind a VA image to a GstVaapiImage object.

display :

a GstVaapiDisplay

va_image :

a VA image

Returns :

the newly allocated GstVaapiImage object

gst_vaapi_image_get_id ()

GstVaapiID          gst_vaapi_image_get_id              (GstVaapiImage *image);

Returns the underlying VAImageID of the image.

image :

a GstVaapiImage

Returns :

the underlying VA image id

gst_vaapi_image_get_image ()

gboolean            gst_vaapi_image_get_image           (GstVaapiImage *image,
                                                         VAImage *va_image);

Fills va_image with the VA image used internally.

image :

a GstVaapiImage

va_image :

a VA image

Returns :

TRUE on success

gst_vaapi_image_get_format ()

GstVaapiImageFormat gst_vaapi_image_get_format          (GstVaapiImage *image);

Returns the GstVaapiImageFormat the image was created with.

image :

a GstVaapiImage

Returns :

the GstVaapiImageFormat

gst_vaapi_image_get_width ()

guint               gst_vaapi_image_get_width           (GstVaapiImage *image);

Returns the image width.

image :

a GstVaapiImage

Returns :

the image width, in pixels

gst_vaapi_image_get_height ()

guint               gst_vaapi_image_get_height          (GstVaapiImage *image);

Returns the image height.

image :

a GstVaapiImage

Returns :

the image height, in pixels.

gst_vaapi_image_get_size ()

void                gst_vaapi_image_get_size            (GstVaapiImage *image,
                                                         guint *pwidth,
                                                         guint *pheight);

Retrieves the dimensions of a GstVaapiImage.

image :

a GstVaapiImage

pwidth :

return location for the width, or NULL

pheight :

return location for the height, or NULL

gst_vaapi_image_is_linear ()

gboolean            gst_vaapi_image_is_linear           (GstVaapiImage *image);

Checks whether the image has data planes allocated from a single buffer and offsets into that buffer are in increasing order with the number of planes.

image :

a GstVaapiImage

Returns :

TRUE if image data planes are allocated from a single buffer

gst_vaapi_image_is_mapped ()

gboolean            gst_vaapi_image_is_mapped           (GstVaapiImage *image);

Checks whether the image is currently mapped or not.

image :

a GstVaapiImage

Returns :

TRUE if the image is mapped

gst_vaapi_image_map ()

gboolean            gst_vaapi_image_map                 (GstVaapiImage *image);

Maps the image data buffer. The actual pixels are returned by the gst_vaapi_image_get_plane() function.

image :

a GstVaapiImage

Returns :

TRUE on success

gst_vaapi_image_unmap ()

gboolean            gst_vaapi_image_unmap               (GstVaapiImage *image);

Unmaps the image data buffer. Pointers to pixels returned by gst_vaapi_image_get_plane() are then no longer valid.

image :

a GstVaapiImage

Returns :

TRUE on success

gst_vaapi_image_get_plane_count ()

guint               gst_vaapi_image_get_plane_count     (GstVaapiImage *image);

Retrieves the number of planes available in the image. The image must be mapped for this function to work properly.

image :

a GstVaapiImage

Returns :

the number of planes available in the image

gst_vaapi_image_get_plane ()

guchar *            gst_vaapi_image_get_plane           (GstVaapiImage *image,
                                                         guint plane);

Retrieves the pixels data to the specified plane. The image must be mapped for this function to work properly.

image :

a GstVaapiImage

plane :

the requested plane number

Returns :

the pixels data of the specified plane

gst_vaapi_image_get_pitch ()

guint               gst_vaapi_image_get_pitch           (GstVaapiImage *image,
                                                         guint plane);

Retrieves the line size (stride) of the specified plane. The image must be mapped for this function to work properly.

image :

a GstVaapiImage

plane :

the requested plane number

Returns :

the line size (stride) of the specified plane

gst_vaapi_image_get_data_size ()

guint               gst_vaapi_image_get_data_size       (GstVaapiImage *image);

Retrieves the underlying image data size. This function could be used to determine whether the image has a compatible layout with another image structure.

image :

a GstVaapiImage

Returns :

the whole image data size of the image

gst_vaapi_image_get_buffer ()

gboolean            gst_vaapi_image_get_buffer          (GstVaapiImage *image,
                                                         GstBuffer *buffer,
                                                         GstVaapiRectangle *rect);

Transfers pixels data contained in the image into the GstBuffer. Both image structures shall have the same format.

image :

a GstVaapiImage

buffer :

a GstBuffer

rect :

a GstVaapiRectangle expressing a region, or NULL for the whole image

Returns :

TRUE on success

gst_vaapi_image_get_raw ()

gboolean            gst_vaapi_image_get_raw             (GstVaapiImage *image,
                                                         GstVaapiImageRaw *dst_image,
                                                         GstVaapiRectangle *rect);

Transfers pixels data contained in the image into the GstVaapiImageRaw. Both image structures shall have the same format.

image :

a GstVaapiImage

dst_image :

a GstVaapiImageRaw

rect :

a GstVaapiRectangle expressing a region, or NULL for the whole image

Returns :

TRUE on success

gst_vaapi_image_update_from_buffer ()

gboolean            gst_vaapi_image_update_from_buffer  (GstVaapiImage *image,
                                                         GstBuffer *buffer,
                                                         GstVaapiRectangle *rect);

Transfers pixels data contained in the GstBuffer into the image. Both image structures shall have the same format.

image :

a GstVaapiImage

buffer :

a GstBuffer

rect :

a GstVaapiRectangle expressing a region, or NULL for the whole image

Returns :

TRUE on success

Property Details

The "format" property

  "format"                   guint                 : Read / Write / Construct Only

The GstVaapiImageFormat of the image

Default value: 0


The "height" property

  "height"                   guint                 : Read / Write / Construct Only

The image height.

Default value: 0


The "image" property

  "image"                    VAImage*              : Read / Write / Construct Only

The underlying VA image.


The "width" property

  "width"                    guint                 : Read / Write / Construct Only

The image width.

Default value: 0