libs: utils: map GstVideoColorRange to VAAPI VPP

This commit is contained in:
U. Artie Eoff 2020-02-07 11:20:11 -08:00 committed by GStreamer Merge Bot
parent 33c80bccfe
commit 9542d55efb
2 changed files with 25 additions and 0 deletions

View file

@ -987,3 +987,24 @@ from_GstVideoColorimetry (const GstVideoColorimetry * const colorimetry)
return VAProcColorStandardExplicit;
}
/**
* from_GstVideoColorRange:
* @value: a #GstVideoColorRange
*
* VPP: maps the #GstVideoColorRange to the VA value.
*
* Returns: the VA color range.
**/
guint
from_GstVideoColorRange (const GstVideoColorRange value)
{
switch (value) {
case GST_VIDEO_COLOR_RANGE_0_255:
return VA_SOURCE_RANGE_FULL;
case GST_VIDEO_COLOR_RANGE_16_235:
return VA_SOURCE_RANGE_REDUCED;
default:
return VA_SOURCE_RANGE_UNKNOWN;
}
}

View file

@ -171,4 +171,8 @@ G_GNUC_INTERNAL
guint
from_GstVideoColorimetry (const GstVideoColorimetry *const colorimetry);
G_GNUC_INTERNAL
guint
from_GstVideoColorRange (const GstVideoColorRange value);
#endif /* GST_VAAPI_UTILS_H */