summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>2011-01-26 10:36:10 +0000
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>2011-01-26 10:36:10 +0000
commit8b2cc5ce175bb00ba59fbfa91452b2e922851d82 (patch)
treedd9aea6d2d2455d4193aca9583abc166df6fb711
parentfa378bd7fa05fbe97a773ea34ac552247ff74687 (diff)
Add compatibility glue with libva >= 1.0.8.
-rw-r--r--NEWS1
-rw-r--r--src/vdpau_driver.c42
-rw-r--r--src/vdpau_driver_template.h9
3 files changed, 38 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 3f57728..52aa0e7 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ vdpau-video NEWS -- summary of changes. 2010-12-DD
Copyright (C) 2009-2010 Splitted-Desktop Systems
Version 0.7.3 - DD.Dec.2010
+* Add compatibility glue with libva >= 1.0.8
* Fix possible crash when rendering multiple surfaces at once
* Fix build if no OpenGL header is available (libva >= 0.31.1)
* Fix VA/GLX build with upstream libva and newer OpenGL headers
diff --git a/src/vdpau_driver.c b/src/vdpau_driver.c
index d085a9a..a18f7d1 100644
--- a/src/vdpau_driver.c
+++ b/src/vdpau_driver.c
@@ -258,18 +258,6 @@ vdpau_common_Initialize(vdpau_driver_data_t *driver_data)
return VA_STATUS_SUCCESS;
}
-#define VA_INIT_VERSION_MAJOR VA_MAJOR_VERSION
-#define VA_INIT_VERSION_MINOR VA_MINOR_VERSION
-#define VA_INIT_VERSION_MICRO VA_MICRO_VERSION
-#define VA_INIT_VERSION_SDS VA_SDS_VERSION
-#define VA_INIT_GLX USE_GLX
-#include "vdpau_driver_template.h"
-
-VAStatus VA_DRIVER_INIT_FUNC(void *ctx)
-{
- return vdpau_Initialize_Current(ctx);
-}
-
#if VA_MAJOR_VERSION == 0 && VA_MINOR_VERSION == 31
#define VA_INIT_VERSION_MAJOR 0
#define VA_INIT_VERSION_MINOR 31
@@ -284,6 +272,13 @@ VAStatus VA_DRIVER_INIT_FUNC(void *ctx)
#define VA_INIT_GLX USE_GLX
#include "vdpau_driver_template.h"
+#define VA_INIT_VERSION_MAJOR 0
+#define VA_INIT_VERSION_MINOR 31
+#define VA_INIT_VERSION_MICRO 2
+#define VA_INIT_SUFFIX 0_31_2
+#define VA_INIT_GLX USE_GLX
+#include "vdpau_driver_template.h"
+
VAStatus __vaDriverInit_0_31(void *ctx)
{
VADriverContextP_0_31_0 const ctx0 = ctx;
@@ -291,9 +286,28 @@ VAStatus __vaDriverInit_0_31(void *ctx)
/* Assume a NULL display implies VA-API 0.31.1 struct with the
vtable_tpi field placed just after the vtable, thus replacing
original native_dpy field */
- if (!ctx0->native_dpy)
+ if (!ctx0->native_dpy) {
+ VADriverContextP_0_31_1 const ctx1 = ctx;
+ if (!ctx1->native_dpy) {
+ VADriverContextP_0_31_2 const ctx2 = ctx;
+ if (!ctx2->native_dpy)
+ return VA_STATUS_ERROR_INVALID_DISPLAY;
+ return vdpau_Initialize_0_31_2(ctx);
+ }
return vdpau_Initialize_0_31_1(ctx);
-
+ }
return vdpau_Initialize_0_31_0(ctx);
}
+#else
+#define VA_INIT_VERSION_MAJOR VA_MAJOR_VERSION
+#define VA_INIT_VERSION_MINOR VA_MINOR_VERSION
+#define VA_INIT_VERSION_MICRO VA_MICRO_VERSION
+#define VA_INIT_VERSION_SDS VA_SDS_VERSION
+#define VA_INIT_GLX USE_GLX
+#include "vdpau_driver_template.h"
+
+VAStatus VA_DRIVER_INIT_FUNC(void *ctx)
+{
+ return vdpau_Initialize_Current(ctx);
+}
#endif
diff --git a/src/vdpau_driver_template.h b/src/vdpau_driver_template.h
index 63f7217..a08bfed 100644
--- a/src/vdpau_driver_template.h
+++ b/src/vdpau_driver_template.h
@@ -206,6 +206,15 @@ struct VA_DRIVER_VTABLE {
VASurfaceStatus *status /* out */
);
+#if VA_INIT_CHECK_VERSION(0,31,2)
+ VAStatus (*vaQuerySurfaceError) (
+ VADriverContextP ctx,
+ VASurfaceID render_target,
+ VAStatus error_status,
+ void **error_info /*out*/
+ );
+#endif
+
VAStatus (*vaPutSurface) (
VA_DRIVER_CONTEXT_P ctx,
VASurfaceID surface,