From a72d10ca0ed086f8812af8aa83a1dbe087c8789c Mon Sep 17 00:00:00 2001 From: Yan Yin Date: Tue, 31 Jul 2012 18:22:48 +0800 Subject: [PATCH] utils: add string_of_VADisplayAttributeType() helper. Signed-off-by: Gwenole Beauchesne --- gst-libs/gst/vaapi/gstvaapiutils.c | 36 ++++++++++++++++++++++++++++++++++++ gst-libs/gst/vaapi/gstvaapiutils.h | 5 +++++ 2 files changed, 41 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c index 8d5aecc..41682a9 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.c +++ b/gst-libs/gst/vaapi/gstvaapiutils.c @@ -166,6 +166,42 @@ const char *string_of_VAEntrypoint(VAEntrypoint entrypoint) return ""; } +/* Return a string representation of a VADisplayAttributeType */ +const char * +string_of_VADisplayAttributeType(VADisplayAttribType attribute_type) +{ + switch (attribute_type) { +#define MAP(attribute_type) \ + STRCASEP(VADisplayAttrib, attribute_type) + MAP(Brightness); + MAP(Contrast); + MAP(Hue); + MAP(Saturation); + MAP(BackgroundColor); +#if !VA_CHECK_VERSION(0,34,0) + MAP(DirectSurface); +#endif + MAP(Rotation); + MAP(OutofLoopDeblock); +#if VA_CHECK_VERSION(0,31,1) && !VA_CHECK_VERSION(0,34,0) + MAP(BLEBlackMode); + MAP(BLEWhiteMode); + MAP(BlueStretch); + MAP(SkinColorCorrection); +#endif + MAP(CSCMatrix); + MAP(BlendColor); + MAP(OverlayAutoPaintColorKey); + MAP(OverlayColorKey); + MAP(RenderMode); + MAP(RenderDevice); + MAP(RenderRect); +#undef MAP + default: break; + } + return ""; +} + /** * from_GstVaapiSurfaceRenderFlags: * @flags: the #GstVaapiSurfaceRenderFlags diff --git a/gst-libs/gst/vaapi/gstvaapiutils.h b/gst-libs/gst/vaapi/gstvaapiutils.h index 9ee74f1..644fd58 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.h +++ b/gst-libs/gst/vaapi/gstvaapiutils.h @@ -68,6 +68,11 @@ const char *string_of_VAProfile(VAProfile profile); G_GNUC_INTERNAL const char *string_of_VAEntrypoint(VAEntrypoint entrypoint); +/* Return a string representation of a VADisplayAttributeType */ +G_GNUC_INTERNAL +const char * +string_of_VADisplayAttributeType(VADisplayAttribType attribute_type); + G_GNUC_INTERNAL guint from_GstVaapiSurfaceRenderFlags(guint flags); -- 2.7.4