summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Huang <d-huang@ti.com>2017-10-09 13:34:49 -0500
committerVishal Mahaveer <vishalm@ti.com>2017-10-09 16:35:31 -0500
commit80a676d1d09d50a94b5aeced9b984b439ed8fdca (patch)
treee1544833a2bc6e55c927b9aaeebd9baf5e89129a
parentcc4830c4cb4ee472ce17bc1c81609d8d40a0559c (diff)
downloaddra7xx-80a676d1d09d50a94b5aeced9b984b439ed8fdca.tar.gz
dra7xx: camera: Fix finding wrong videoxx device
V4LM2M searches to find the VPE device based on the device capabilities. There are other drivers that support the same capabilities as the VPE, so adding a driver name check to ensure we pick the correct device. Change-Id: I0ae43a28a4adc348a6efa25f02132d60c8acbfd1 Signed-off-by: David Huang <d-huang@ti.com>
-rw-r--r--camera/V4LCameraAdapter/V4LM2M.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/camera/V4LCameraAdapter/V4LM2M.cpp b/camera/V4LCameraAdapter/V4LM2M.cpp
index deb0637..d3556ac 100644
--- a/camera/V4LCameraAdapter/V4LM2M.cpp
+++ b/camera/V4LCameraAdapter/V4LM2M.cpp
@@ -78,6 +78,7 @@
#define DEVICE "/dev/videoxx"
#define DEVICE_PATH "/dev/"
#define DEVICE_NAME "videoxx"
+#define DRIVER_NAME "vpe"
/**< File descriptor for device */
@@ -406,6 +407,7 @@ char *detectM2MDevice()
int tempHandle = NULL;
int ret;
struct v4l2_capability cap;
+ char* driver;
memset((void*)&cap, 0, sizeof(v4l2_capability));
@@ -435,6 +437,15 @@ char *detectM2MDevice()
close(tempHandle);
continue;
}
+
+ driver = (char*) cap.driver;
+ //check driver name since non vpe drivers can match all of these other criteria.
+ if (strncmp(driver, DRIVER_NAME, 3) != 0) {
+ ALOGE("Error while checking driver: Not VPE");
+ close(tempHandle);
+ continue;
+ }
+
close(tempHandle);
strcpy(device, video_device_list[i]);
ALOGE("Found VPE M2M device %s!!!", device);