From 27744683032d9c4d774650f184f565521c2ab108 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Tue, 10 Mar 2020 18:52:18 +0200 Subject: [PATCH] Fix for bad channel updates --- applications/gui/src/camera.cpp | 7 ++++--- applications/gui/src/src_window.cpp | 2 +- components/operators/src/depth.cpp | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/applications/gui/src/camera.cpp b/applications/gui/src/camera.cpp index c981c662c..a2b9ef5b8 100644 --- a/applications/gui/src/camera.cpp +++ b/applications/gui/src/camera.cpp @@ -433,10 +433,10 @@ void ftl::gui::Camera::_draw(std::vector<ftl::rgbd::FrameSet*> &fss) { void ftl::gui::Camera::update(int fsid, const ftl::codecs::Channels<0> &c) { if (!isVirtual() && ((1 << fsid) & fsmask_)) { - channels_ = c; - if (c.has(Channel::Depth)) { + channels_ += c; + //if (c.has(Channel::Depth)) { //channels_ += Channel::ColourNormals; - } + //} } } @@ -469,6 +469,7 @@ void ftl::gui::Camera::update(std::vector<ftl::rgbd::FrameSet*> &fss) { if ((size_t)fid_ >= fs->frames.size()) return; frame = &fs->frames[fid_]; + channels_ = frame->getChannels(); if (frame->hasChannel(Channel::Messages)) { msgs_.clear(); diff --git a/applications/gui/src/src_window.cpp b/applications/gui/src/src_window.cpp index fe3763252..b3b71fabf 100644 --- a/applications/gui/src/src_window.cpp +++ b/applications/gui/src/src_window.cpp @@ -248,7 +248,7 @@ bool SourceWindow::_processFrameset(ftl::rgbd::FrameSet &fs, bool fromstream) { ftl::codecs::Channels<0> channels; if (fromstream) channels = cstream->available(fs.id); - if ((*framesets_[fs.id]).frames.size() > 0) channels += (*framesets_[fs.id]).frames[0].getChannels(); + //if ((*framesets_[fs.id]).frames.size() > 0) channels += (*framesets_[fs.id]).frames[0].getChannels(); cam.second.camera->update(fs.id, channels); } ++cycle_; diff --git a/components/operators/src/depth.cpp b/components/operators/src/depth.cpp index b3a80080f..59b50a1fe 100644 --- a/components/operators/src/depth.cpp +++ b/components/operators/src/depth.cpp @@ -164,6 +164,7 @@ bool DepthChannel::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda rbuf_.resize(in.frames.size()); for (size_t i=0; i<in.frames.size(); ++i) { + if (!in.hasFrame(i)) continue; auto &f = in.frames[i]; if (!f.hasChannel(Channel::Depth) && f.hasChannel(Channel::Right)) { _createPipeline(); -- GitLab