## GstVaapiSubpicture

GstVaapiSubpicture — VA subpicture abstraction

## Functions

GstVaapiSubpicture * | gst_vaapi_subpicture_new ()
GstVaapiSubpicture * | gst_vaapi_subpicture_new_from_overlay_rectangle ()
GstVaapiID | gst_vaapi_subpicture_get_id ()
guint | gst_vaapi_subpicture_get_flags ()
gfloat | gst_vaapi_subpicture_get_global_alpha ()
gboolean | gst_vaapi_subpicture_set_global_alpha ()
GstVaapiImage * | gst_vaapi_subpicture_get_image ()
gboolean | gst_vaapi_subpicture_set_image ()

## Types and Values

| GstVaapiSubpicture

## Object Hierarchy

## Description

## Functions

### gst_vaapi_subpicture_new ()

    GstVaapiSubpicture *
    gst_vaapi_subpicture_new (GstVaapiImage *image,
                              guint flags);

Creates a new GstVaapiSubpicture with `image` as source pixels. The newly created object holds a reference on `image` .

#### Parameters

image | a GstVaapiImage |
flags | GstVaapiSubpictureFlags, or zero |

#### Returns

the newly allocated GstVaapiSubpicture object

### gst_vaapi_subpicture_new_from_overlay_rectangle ()

    GstVaapiSubpicture *
    gst_vaapi_subpicture_new_from_overlay_rectangle
                                   (GstVaapiDisplay *display,
                                    GstVideoOverlayRectangle *rect);

Helper function that creates a new GstVaapiSubpicture from a GstVideoOverlayRectangle. A new GstVaapiImage is also created along the way and attached to the resulting subpicture. The subpicture holds a unique reference to the underlying image.

#### Parameters

display | a GstVaapiDisplay |
rect | a GstVideoOverlayRectangle |

#### Returns

the newly allocated GstVaapiSubpicture object

### gst_vaapi_subpicture_get_id ()

    GstVaapiID
    gst_vaapi_subpicture_get_id (GstVaapiSubpicture *subpicture);

Returns the underlying VASubpictureID of the `subpicture` .

#### Parameters

subpicture | a GstVaapiSubpicture |

#### Returns

the underlying VA subpicture id

### gst_vaapi_subpicture_get_flags ()

    guint
    gst_vaapi_subpicture_get_flags (GstVaapiSubpicture *subpicture);

Returns the `subpicture` flags.

#### Parameters

subpicture | a GstVaapiSubpicture |

#### Returns

the `subpicture` flags

### gst_vaapi_subpicture_get_global_alpha ()

    gfloat
    gst_vaapi_subpicture_get_global_alpha (GstVaapiSubpicture *subpicture);

Returns the value of global_alpha, set for this `subpicture` .

#### Parameters

subpicture | a GstVaapiSubpicture |

#### Returns

the global_alpha value of this `subpicture`

### gst_vaapi_subpicture_set_global_alpha ()

    gboolean
    gst_vaapi_subpicture_set_global_alpha (GstVaapiSubpicture *subpicture,
                                           gfloat global_alpha);

Sets the global_alpha value of `subpicture` . This function calls `vaSetSubpictureGlobalAlpha()` if the format of `subpicture` , i.e. the current VA driver supports it.

#### Parameters

subpicture | a GstVaapiSubpicture |
global_alpha | value for global-alpha (range: 0.0 to 1.0, inclusive) |

#### Returns

`TRUE` if global_alpha could be set, `FALSE` otherwise

### gst_vaapi_subpicture_get_image ()

    GstVaapiImage *
    gst_vaapi_subpicture_get_image (GstVaapiSubpicture *subpicture);

Returns the GstVaapiImage this `subpicture` is bound to.

#### Parameters

subpicture | a GstVaapiSubpicture |

#### Returns

the GstVaapiImage this `subpicture` is bound to

### gst_vaapi_subpicture_set_image ()

    gboolean
    gst_vaapi_subpicture_set_image (GstVaapiSubpicture *subpicture,
                                    GstVaapiImage *image);

Binds a new GstVaapiImage to the `subpicture` . The reference to the previous image is released and a new one is acquired on `image` .

#### Parameters

subpicture | a GstVaapiSubpicture |
image | a GstVaapiImage |

#### Returns

`TRUE` on success

## Types and Values

### GstVaapiSubpicture

    typedef struct _GstVaapiSubpicture GstVaapiSubpicture;

A VA subpicture wrapper