mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
libs: add gst_vaapi_video_format_from_va_fourcc() helper.
Add gst_vaapi_video_format_from_va_fourcc() helper that converts from a VA fourcc value to a suitable GstVideoFormat.
This commit is contained in:
parent
53fc8bb4c7
commit
8ffe11a9df
2 changed files with 27 additions and 0 deletions
|
@ -286,6 +286,30 @@ gst_vaapi_video_format_to_caps(GstVideoFormat format)
|
||||||
return m ? gst_caps_from_string(m->caps_str) : NULL;
|
return m ? gst_caps_from_string(m->caps_str) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_vaapi_video_format_from_va_fourcc:
|
||||||
|
* @fourcc: a FOURCC value
|
||||||
|
*
|
||||||
|
* Converts a VA fourcc into the corresponding #GstVideoFormat. If no
|
||||||
|
* matching fourcc was found, then zero is returned.
|
||||||
|
*
|
||||||
|
* Return value: the #GstVideoFormat corresponding to the VA @fourcc
|
||||||
|
*/
|
||||||
|
GstVideoFormat
|
||||||
|
gst_vaapi_video_format_from_va_fourcc(guint32 fourcc)
|
||||||
|
{
|
||||||
|
const GstVideoFormatMap *m;
|
||||||
|
|
||||||
|
/* Note: VA fourcc values are now standardized and shall represent
|
||||||
|
a unique format. The associated VAImageFormat is just a hint to
|
||||||
|
determine RGBA component ordering */
|
||||||
|
for (m = gst_vaapi_video_formats; m->format; m++) {
|
||||||
|
if (m->va_format.fourcc == fourcc)
|
||||||
|
return m->format;
|
||||||
|
}
|
||||||
|
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_vaapi_video_format_from_va_format:
|
* gst_vaapi_video_format_from_va_format:
|
||||||
* @va_format: a #VAImageFormat
|
* @va_format: a #VAImageFormat
|
||||||
|
|
|
@ -46,6 +46,9 @@ gst_vaapi_video_format_from_caps(GstCaps *caps);
|
||||||
GstCaps *
|
GstCaps *
|
||||||
gst_vaapi_video_format_to_caps(GstVideoFormat format);
|
gst_vaapi_video_format_to_caps(GstVideoFormat format);
|
||||||
|
|
||||||
|
GstVideoFormat
|
||||||
|
gst_vaapi_video_format_from_va_fourcc(guint32 fourcc);
|
||||||
|
|
||||||
GstVideoFormat
|
GstVideoFormat
|
||||||
gst_vaapi_video_format_from_va_format(const VAImageFormat *va_format);
|
gst_vaapi_video_format_from_va_format(const VAImageFormat *va_format);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue