[Libva] [PATCH 4/5] API: backend: add VA display types.

Gwenole Beauchesne gb.devel at gmail.com
Mon Jul 2 09:25:23 PDT 2012


Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 va/android/va_android.cpp |    1 +
 va/glx/va_glx.c           |    1 +
 va/va_backend.h           |   18 +++++++++++++++++-
 va/x11/va_x11.c           |    1 +
 4 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp
index 24329fe..12d5f1c 100644
--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -223,6 +223,7 @@ VADisplay vaGetDisplay (
             pDisplayContext->vadpy_magic = VA_DISPLAY_MAGIC;          
 
             pDriverContext->native_dpy       = (void *)native_dpy;
+            pDriverContext->display_type     = VA_DISPLAY_ANDROID;
             pDisplayContext->pDriverContext  = pDriverContext;
             pDisplayContext->vaIsValid       = va_DisplayContextIsValid;
             pDisplayContext->vaDestroy       = va_DisplayContextDestroy;
diff --git a/va/glx/va_glx.c b/va/glx/va_glx.c
index 1812ef5..e03847e 100644
--- a/va/glx/va_glx.c
+++ b/va/glx/va_glx.c
@@ -98,6 +98,7 @@ VADisplay vaGetDisplayGLX(Display *native_dpy)
     if (!pDriverContextGLX)
         goto error;
 
+    pDriverContext->display_type  = VA_DISPLAY_GLX;
     pDisplayContextGLX->vaDestroy = pDisplayContext->vaDestroy;
     pDisplayContext->vaDestroy    = va_DisplayContextDestroy;
     pDisplayContext->opaque       = pDisplayContextGLX;
diff --git a/va/va_backend.h b/va/va_backend.h
index 522f606..472967a 100644
--- a/va/va_backend.h
+++ b/va/va_backend.h
@@ -38,6 +38,19 @@
 typedef struct VADriverContext *VADriverContextP;
 typedef struct VADisplayContext *VADisplayContextP;
 
+/** \brief VA display types. */
+enum {
+    /** \brief Mask to major identifier for VA display type */
+    VA_DISPLAY_MAJOR_MASK = 0xf0,
+
+    /** \brief VA/X11 API is used, through vaGetDisplay() entry-point */
+    VA_DISPLAY_X11      = 0x10,
+    /** \brief VA/GLX API is used, through vaGetDisplayGLX() entry-point */
+    VA_DISPLAY_GLX      = (VA_DISPLAY_X11 | (1 << 0)),
+    /** \brief VA/Android API is used, through vaGetDisplay() entry-point */
+    VA_DISPLAY_ANDROID  = 0x20,
+};
+
 struct VADriverVTable
 {
 	VAStatus (*vaTerminate) ( VADriverContextP ctx );
@@ -461,7 +474,10 @@ struct VADriverContext
      */
     struct VADriverVTableVPP *vtable_vpp;
 
-    unsigned long reserved[44];         /* reserve for future add-ins, decrease the subscript accordingly */
+    /** \brief VA display type. */
+    unsigned int        display_type;
+
+    unsigned long reserved[43];         /* reserve for future add-ins, decrease the subscript accordingly */
 };
 
 #define VA_DISPLAY_MAGIC 0x56414430 /* VAD0 */
diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c
index f81e30a..2aa579b 100644
--- a/va/x11/va_x11.c
+++ b/va/x11/va_x11.c
@@ -185,6 +185,7 @@ VADisplay vaGetDisplay (
 	  pDisplayContext->vadpy_magic = VA_DISPLAY_MAGIC;          
 
 	  pDriverContext->native_dpy       = (void *)native_dpy;
+          pDriverContext->display_type     = VA_DISPLAY_X11;
 	  pDisplayContext->pDriverContext  = pDriverContext;
 	  pDisplayContext->vaIsValid       = va_DisplayContextIsValid;
 	  pDisplayContext->vaDestroy       = va_DisplayContextDestroy;
-- 
1.7.9.5



More information about the Libva mailing list