From c77983d42bda0659040dbb6eed44b90548c49ba1 Mon Sep 17 00:00:00 2001 From: Noha Yassin <37175819+nohayassin@users.noreply.github.com> Date: Mon, 5 Apr 2021 14:12:32 +0300 Subject: [PATCH] support SR306 camera --- tools/benchmark/rs-benchmark.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/benchmark/rs-benchmark.cpp b/tools/benchmark/rs-benchmark.cpp index 23b7efb7932..9dcbd4dc159 100644 --- a/tools/benchmark/rs-benchmark.cpp +++ b/tools/benchmark/rs-benchmark.cpp @@ -237,11 +237,23 @@ int main(int argc, char** argv) try rs2::context ctx; auto list = ctx.query_devices(); auto dev = list.front(); + auto sensors = dev.query_sensors(); pipeline p; config cfg; + for (auto& s : sensors) + { + auto streams = s.get_stream_profiles(); + for (auto stream : streams) + { + if (stream.stream_type() == RS2_STREAM_COLOR) + { + cfg.enable_stream(RS2_STREAM_COLOR, RS2_FORMAT_YUYV, 30); + break; + } + } + } + cfg.enable_stream(RS2_STREAM_DEPTH); - if (std::string(dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID)) != "0AA3") // pid of sr306 - cfg.enable_stream(RS2_STREAM_COLOR, RS2_FORMAT_YUYV, 30); auto prof = p.start(cfg); auto name = dev.get_info(RS2_CAMERA_INFO_NAME); cout << "|**Device Name** |" << name << " |" << endl << endl;