From: U. Artie Eoff Date: Fri, 7 Feb 2020 19:20:11 +0000 (-0800) Subject: libs: utils: map GstVideoColorRange to VAAPI VPP X-Git-Tag: 1.19.3~503^2~261 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9542d55efb2680dec81d11e7200f4479cf346427;p=platform%2Fupstream%2Fgstreamer.git libs: utils: map GstVideoColorRange to VAAPI VPP --- diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c index 925510d..33c1372 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.c +++ b/gst-libs/gst/vaapi/gstvaapiutils.c @@ -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; + } +} diff --git a/gst-libs/gst/vaapi/gstvaapiutils.h b/gst-libs/gst/vaapi/gstvaapiutils.h index b2c0867..3159132 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.h +++ b/gst-libs/gst/vaapi/gstvaapiutils.h @@ -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 */