summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2013-05-22 13:05:56 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2013-06-05 09:56:52 +0800
commitf6329df946b06ab17942924f62ec5a59cef1346c (patch)
tree33ea43565d58367b366c134d7a675172f7a7e061
parent942a8ae66e20573facb26bf7892342d0e66de52a (diff)
va_android: allow app to specify which driver it wants to load
There is a platform which integrates two decode cores, and their drivers are sperated and independent. Application needs to know which driver it wants to use (e.g. H264 decode uses driver A, VP8 decode uses driver B) LIBVA_DRIVER_NAME has issues in one-process-multi-thread environment. This patch allows application to specify the driver name via vaGetDisplay: usage: 1. in normal case int android_display=0 vaGetDisplay((void *)&android_display) 2. specify driver name char driver_name[]="libva_driver_name=foo_drv_video.so" vaGetDisplay((void *)driver_name) Change-Id: I9f0f5ecb3565a25c1f6778093c80bb2fc24f24eb Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
-rw-r--r--va/android/va_android.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp
index e2edb92..3e220a6 100644
--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -116,7 +116,18 @@ static VAStatus va_DisplayContextGetDriverName (
}
drm_state->auth_type = VA_DRM_AUTH_CUSTOM;
- return VA_DRM_GetDriverName(ctx, driver_name);
+ if (driver_name == NULL)
+ return VA_STATUS_ERROR_UNKNOWN;
+
+ if (strncmp((char *)ctx->native_dpy, "libva_driver_name=", 18) == 0) {
+ *driver_name = strdup((char *)ctx->native_dpy + 18);
+ if (*driver_name == NULL)
+ return VA_STATUS_ERROR_ALLOCATION_FAILED;
+ else
+ return VA_STATUS_SUCCESS;
+ } else {
+ return VA_DRM_GetDriverName(ctx, driver_name);
+ }
}