From 688f2465adc461222a761123878ff3901678b69e Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Thu, 18 Jul 2019 10:15:17 +0300 Subject: [PATCH] Allow grab batch and bitrate setting --- components/rgbd-sources/include/ftl/rgbd/source.hpp | 2 +- components/rgbd-sources/src/source.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/rgbd-sources/include/ftl/rgbd/source.hpp b/components/rgbd-sources/include/ftl/rgbd/source.hpp index c11bc83fe..440f566ed 100644 --- a/components/rgbd-sources/include/ftl/rgbd/source.hpp +++ b/components/rgbd-sources/include/ftl/rgbd/source.hpp @@ -82,7 +82,7 @@ class Source : public ftl::Configurable { /** * Perform the hardware or virtual frame grab operation. */ - bool grab(); + bool grab(int N=-1, int B=-1); /** * Do any post-grab processing. This function diff --git a/components/rgbd-sources/src/source.cpp b/components/rgbd-sources/src/source.cpp index c2b5dc5a9..8747b60fb 100644 --- a/components/rgbd-sources/src/source.cpp +++ b/components/rgbd-sources/src/source.cpp @@ -222,14 +222,14 @@ void Source::reset() { impl_ = _createImplementation(); } -bool Source::grab() { +bool Source::grab(int N, int B) { UNIQUE_LOCK(mutex_,lk); if (!impl_ && stream_ != 0) { cudaSafeCall(cudaStreamSynchronize(stream_)); if (depth_.type() == CV_32SC1) depth_.convertTo(depth_, CV_32F, 1.0f / 1000.0f); stream_ = 0; return true; - } else if (impl_ && impl_->grab(-1,-1)) { + } else if (impl_ && impl_->grab(N,B)) { timestamp_ = impl_->timestamp_; impl_->rgb_.copyTo(rgb_); impl_->depth_.copyTo(depth_); -- GitLab