## GstVideoFormat

GstVideoFormat — Video format helpers for VA-API

## Functions

const char * | gst_vaapi_video_format_to_string ()
GstVideoFormat | gst_vaapi_video_format_from_caps ()
GstVideoFormat | gst_vaapi_video_format_from_structure ()
GstVideoFormat | gst_vaapi_video_format_from_va_format ()
guint | gst_vaapi_video_format_get_chroma_type ()
guint | gst_vaapi_video_format_get_score ()
gboolean | gst_vaapi_video_format_is_rgb ()
gboolean | gst_vaapi_video_format_is_yuv ()
GstCaps * | gst_vaapi_video_format_to_caps ()
const VAImageFormat * | gst_vaapi_video_format_to_va_format ()

## Object Hierarchy

## Description

## Functions

### gst_vaapi_video_format_to_string ()

    const char *
    gst_vaapi_video_format_to_string (GstVideoFormat format);

Returns the string representation of the `format` argument.

#### Parameters

format | a GstVideoFormat |

#### Returns

string representation of `format` , or `NULL` if unknown or unsupported.

### gst_vaapi_video_format_from_caps ()

    GstVideoFormat
    gst_vaapi_video_format_from_caps (GstCaps *caps);

Converts `caps` into the corresponding GstVideoFormat. If the image format cannot be represented by GstVideoFormat, then zero is returned.

#### Parameters

caps | a GstCaps |

#### Returns

the GstVideoFormat describing the `caps`

### gst_vaapi_video_format_from_structure ()

    GstVideoFormat
    gst_vaapi_video_format_from_structure (GstStructure *structure);

Converts `structure` into the corresponding GstVideoFormat. If the image format cannot be represented by GstVideoFormat, then zero is returned.

#### Parameters

structure | a GstStructure |

#### Returns

the GstVideoFormat describing the `structure`

### gst_vaapi_video_format_from_va_format ()

    GstVideoFormat
    gst_vaapi_video_format_from_va_format (const VAImageFormat *va_format);

Converts a VA image format into the corresponding GstVideoFormat. If the image format cannot be represented by GstVideoFormat, then zero is returned.

#### Parameters

va_format | a VAImageFormat |

#### Returns

the GstVideoFormat describing the `va_format`

### gst_vaapi_video_format_get_chroma_type ()

    guint
    gst_vaapi_video_format_get_chroma_type
                                   (GstVideoFormat format);

Converts a GstVideoFormat into the corresponding GstVaapiChromaType format.

#### Parameters

format | a GstVideoFormat |

#### Returns

the GstVaapiChromaType format, or zero if no match was found.

### gst_vaapi_video_format_get_score ()

    guint
    gst_vaapi_video_format_get_score (GstVideoFormat format);

Determines how "native" is this `format` . The lower is the returned score, the best format this is for the underlying hardware.

#### Parameters

format | a GstVideoFormat |

#### Returns

the `format` score, or `G_MAXUINT` if none was found

### gst_vaapi_video_format_is_rgb ()

    gboolean
    gst_vaapi_video_format_is_rgb (GstVideoFormat format);

Checks whether the format is an RGB format.

#### Parameters

format | a GstVideoFormat |

#### Returns

`TRUE` if `format` is RGB format

### gst_vaapi_video_format_is_yuv ()

    gboolean
    gst_vaapi_video_format_is_yuv (GstVideoFormat format);

Checks whether the format is an YUV format.

#### Parameters

format | a GstVideoFormat |

#### Returns

`TRUE` if `format` is YUV format

### gst_vaapi_video_format_to_caps ()

    GstCaps *
    gst_vaapi_video_format_to_caps (GstVideoFormat format);

Converts a GstVideoFormat into the corresponding GstCaps. If no matching caps were found, `NULL` is returned.

#### Parameters

format | a GstVideoFormat |

#### Returns

the newly allocated GstCaps, or `NULL` if none was found

### gst_vaapi_video_format_to_va_format ()

    const VAImageFormat *
    gst_vaapi_video_format_to_va_format (GstVideoFormat format);

Converts a GstVideoFormat into the corresponding VA image format. If no matching VA image format was found, `NULL` is returned and this error must be reported to be fixed.

#### Parameters

format | a GstVideoFormat |

#### Returns

the VA image format, or `NULL` if none was found

## Types and Values