diff options
author | Austin Yuan <shengquan.yuan@intel.com> | 2009-08-25 00:35:05 +0800 |
---|---|---|
committer | Austin Yuan <shengquan.yuan@intel.com> | 2009-08-25 00:35:05 +0800 |
commit | 98ed754fa7ecf5848f9aeb56a6237ef415ff0a4d (patch) | |
tree | 3f6a65c4072bb2ef04a868cb438a9fb0da14c81c /src/va.c | |
parent | bb75774c4c34a9151eea4a819b2e2f5025ae6333 (diff) | |
parent | cd115fe21c3493f831dcb653c62d38e577bb6943 (diff) | |
download | libva30.tar.gz |
Merge branch 'test'libva30
Diffstat (limited to 'src/va.c')
-rw-r--r-- | src/va.c | 33 |
1 files changed, 10 insertions, 23 deletions
@@ -22,11 +22,10 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define _GNU_SOURCE 1 #include "va.h" #include "va_backend.h" -#include "va_version.h" - #include <assert.h> #include <stdarg.h> #include <stdio.h> @@ -40,13 +39,9 @@ #include "va_dricommon.h" -#define VA_STR_VERSION VA_BUILD_DATE VA_BUILD_GIT - -#define VA_MAJOR_VERSION 0 -#define VA_MINOR_VERSION 30 #define DRIVER_INIT_FUNC "__vaDriverInit_0_30" +#define DRIVER_INIT_FUNC_SDS "__vaDriverInit_0_30_sds" -#define DEFAULT_DRIVER_DIR "/usr/lib/dri/" #define DRIVER_EXTENSION "_drv_video.so" #define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) @@ -116,21 +111,8 @@ static Bool va_checkString(const char* value, char *variable) static VAStatus va_getDriverName(VADisplay dpy, char **driver_name) { VADisplayContextP pDisplayContext = (VADisplayContextP)dpy; - VADriverContextP ctx = CTX(dpy); - VAStatus ret; - ret = pDisplayContext->vaGetDriverName(pDisplayContext, driver_name); - if (ret == VA_STATUS_SUCCESS) - { - if (isDRI2Connected(ctx, driver_name)) - { - ret = VA_STATUS_SUCCESS; - } else if (isDRI1Connected(ctx, driver_name)) - { - ret = VA_STATUS_SUCCESS; - } - } - return ret; + return pDisplayContext->vaGetDriverName(pDisplayContext, driver_name); } static VAStatus va_openDriver(VADisplay dpy, char *driver_name) @@ -152,7 +134,7 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name) } if (!search_path) { - search_path = DEFAULT_DRIVER_DIR; + search_path = VA_DRIVERS_PATH; } search_path = strdup((const char *)search_path); @@ -185,6 +167,11 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name) init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC); if (!init_func) { + /* Then try SDS extensions (VDPAU and XvBA backends) */ + init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC_SDS); + } + if (!init_func) + { va_errorMessage("%s has no function %s\n", driver_path, DRIVER_INIT_FUNC); dlclose(handle); } @@ -347,7 +334,7 @@ VAStatus vaInitialize ( va_debug_trace = (getenv("LIBVA_DEBUG_TRACE") != NULL); - va_infoMessage("libva build on %s\n", VA_STR_VERSION); + va_infoMessage("libva version %s\n", VA_VERSION_S); vaStatus = va_getDriverName(dpy, &driver_name); va_infoMessage("va_getDriverName() returns %d\n", vaStatus); |