summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2020-02-07 11:20:11 -0800
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-02-08 10:07:58 +0000
commit9542d55efb2680dec81d11e7200f4479cf346427 (patch)
treed71c28f1d3aa31d4ca48c3f609450a87ac5b1ef5
parent33c80bccfe52d2ef45227bbea6d5e094019ec371 (diff)
libs: utils: map GstVideoColorRange to VAAPI VPP
-rw-r--r--gst-libs/gst/vaapi/gstvaapiutils.c21
-rw-r--r--gst-libs/gst/vaapi/gstvaapiutils.h4
2 files changed, 25 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c
index 925510d2..33c13724 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 b2c0867d..31591322 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 */