From 2df1ab635aed5a26ae8613a309f2b09ec9de11eb Mon Sep 17 00:00:00 2001 From: John Zhao Date: Fri, 30 Mar 2018 16:39:35 +0800 Subject: [PATCH] Add get_video_name --- samples/uvc/camera.cc | 2 +- src/uvc/uvc-v4l2.cc | 8 ++++---- src/uvc/uvc.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/samples/uvc/camera.cc b/samples/uvc/camera.cc index 859d214..64dea2b 100644 --- a/samples/uvc/camera.cc +++ b/samples/uvc/camera.cc @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) { for (size_t i = 0; i < n; i++) { auto device = mynteye_devices[i]; - auto name = uvc::get_name(*device); + auto name = uvc::get_video_name(*device); auto vid = uvc::get_vendor_id(*device); auto pid = uvc::get_product_id(*device); LOG(INFO) << "index: " << i << ", name: " << name << ", vid: " << vid diff --git a/src/uvc/uvc-v4l2.cc b/src/uvc/uvc-v4l2.cc index 6df8972..11c6035 100644 --- a/src/uvc/uvc-v4l2.cc +++ b/src/uvc/uvc-v4l2.cc @@ -426,10 +426,6 @@ std::vector> query_devices( return devices; } -std::string get_name(const device &device) { - return device.dev_name; -} - int get_vendor_id(const device &device) { return device.vid; } @@ -438,6 +434,10 @@ int get_product_id(const device &device) { return device.pid; } +std::string get_video_name(const device &device) { + return device.dev_name; +} + void get_control( const device &device, const extension_unit &xu, uint8_t ctrl, void *data, int len) { diff --git a/src/uvc/uvc.h b/src/uvc/uvc.h index 46df787..d30b615 100644 --- a/src/uvc/uvc.h +++ b/src/uvc/uvc.h @@ -30,10 +30,11 @@ std::vector> query_devices( std::shared_ptr context); // Static device properties -std::string get_name(const device &device); int get_vendor_id(const device &device); int get_product_id(const device &device); +std::string get_video_name(const device &device); + // Access XU controls void get_control( const device &device, const extension_unit &xu, uint8_t ctrl, void *data,