diff --git a/applications/gui/src/camera.hpp b/applications/gui/src/camera.hpp index e1b16583bc4b5fe33b791ea02addb8e5322bdcbe..15f373e9bc9834c9f1f16856c167c40e4eb8a7ee 100644 --- a/applications/gui/src/camera.hpp +++ b/applications/gui/src/camera.hpp @@ -33,6 +33,8 @@ class Camera { int width() const { return width_; } int height() const { return height_; } + int getFramesetId() const { return fsid_; } + void setPose(const Eigen::Matrix4d &p); void mouseMovement(int rx, int ry, int button); diff --git a/applications/gui/src/src_window.cpp b/applications/gui/src/src_window.cpp index 68369dfee50cb55a8a73403b996b727d731e3268..8ff47c31991dcd36d00196772bb70dd92a30a2bd 100644 --- a/applications/gui/src/src_window.cpp +++ b/applications/gui/src/src_window.cpp @@ -81,7 +81,7 @@ SourceWindow::SourceWindow(ftl::gui::Screen *screen) cycle_ = 0; receiver_->onFrameSet([this](ftl::rgbd::FrameSet &fs) { // Request the channels required by current camera configuration - interceptor_->select(fs.id, _aggregateChannels()); + interceptor_->select(fs.id, _aggregateChannels(fs.id)); /*if (fs.id > 0) { LOG(INFO) << "Got frameset: " << fs.id; @@ -201,14 +201,16 @@ void SourceWindow::stopRecordingVideo() { } } -ftl::codecs::Channels<0> SourceWindow::_aggregateChannels() { +ftl::codecs::Channels<0> SourceWindow::_aggregateChannels(int id) { ftl::codecs::Channels<0> cs = ftl::codecs::Channels<0>(Channel::Colour); for (auto cam : cameras_) { - if (cam.second.camera->isVirtual()) { - cs += Channel::Depth; - } else { - if (cam.second.camera->getChannel() != Channel::None) { - cs += cam.second.camera->getChannel(); + if (cam.second.camera->getFramesetId() == id) { + if (cam.second.camera->isVirtual()) { + cs += Channel::Depth; + } else { + if (cam.second.camera->getChannel() != Channel::None) { + cs += cam.second.camera->getChannel(); + } } } } diff --git a/applications/gui/src/src_window.hpp b/applications/gui/src/src_window.hpp index fccab65c35b00f0b6f99f9bb24bb15f5f04d57f1..6eb0236f7e6dec7826381282ef40225a2f0f88f1 100644 --- a/applications/gui/src/src_window.hpp +++ b/applications/gui/src/src_window.hpp @@ -79,7 +79,7 @@ class SourceWindow : public nanogui::Window { void _updateCameras(const std::vector<std::string> &netcams); void _createDefaultCameras(ftl::rgbd::FrameSet &fs, bool makevirtual); - ftl::codecs::Channels<0> _aggregateChannels(); + ftl::codecs::Channels<0> _aggregateChannels(int id); void _checkFrameSets(int id); };