From 2a76c996ebe5fbc43d261f4f257166d847a84d65 Mon Sep 17 00:00:00 2001 From: Banks T Date: Thu, 24 Oct 2019 23:28:21 -0400 Subject: [PATCH] Use VID/PID detection for PS3Eye (#1977) --- cscore/src/main/native/linux/UsbCameraImpl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cscore/src/main/native/linux/UsbCameraImpl.cpp b/cscore/src/main/native/linux/UsbCameraImpl.cpp index ae36e789dd..6bed48677d 100644 --- a/cscore/src/main/native/linux/UsbCameraImpl.cpp +++ b/cscore/src/main/native/linux/UsbCameraImpl.cpp @@ -1192,8 +1192,14 @@ void UsbCameraImpl::SetQuirks() { wpi::StringRef desc = GetDescription(descbuf); m_lifecam_exposure = desc.endswith("LifeCam HD-3000") || desc.endswith("LifeCam Cinema (TM)"); - m_ps3eyecam_exposure = - desc.endswith("Camera-B4.04.27.1") || desc.endswith("Camera-B4.09.24.1"); + + int deviceNum = GetDeviceNum(m_path.c_str()); + if (deviceNum >= 0) { + int vendorId, productId; + if (GetVendorProduct(deviceNum, &vendorId, &productId)) { + m_ps3eyecam_exposure = vendorId == 0x2000 && productId == 0x0145; + } + } } void UsbCameraImpl::SetProperty(int property, int value, CS_Status* status) {