From 01ba93c2517ef8bb655b8f20a66fac439ef8862a Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Sat, 28 Sep 2019 09:18:28 +0300 Subject: [PATCH] Fix missing check for no second chan in render --- components/renderers/cpp/src/splat_render.cpp | 3 ++- components/rgbd-sources/src/streamer.cpp | 2 +- components/rgbd-sources/src/virtual.cpp | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/renderers/cpp/src/splat_render.cpp b/components/renderers/cpp/src/splat_render.cpp index a791c247b..2b1fb83e3 100644 --- a/components/renderers/cpp/src/splat_render.cpp +++ b/components/renderers/cpp/src/splat_render.cpp @@ -23,6 +23,7 @@ void Splatter::renderChannel( ftl::render::SplatParams ¶ms, ftl::rgbd::Frame &out, const Channel &channel, cudaStream_t stream) { + if (channel == Channel::None) return; cv::cuda::Stream cvstream = cv::cuda::StreamAccessor::wrapStream(stream); temp_.get<GpuMat>(Channel::Depth).setTo(cv::Scalar(0x7FFFFFFF), cvstream); temp_.get<GpuMat>(Channel::Depth2).setTo(cv::Scalar(0x7FFFFFFF), cvstream); @@ -211,7 +212,7 @@ bool Splatter::render(ftl::rgbd::VirtualSource *src, ftl::rgbd::Frame &out, cuda out.create<GpuMat>(Channel::Right, Format<uchar4>(camera.width, camera.height)); out.get<GpuMat>(Channel::Right).setTo(cv::Scalar(76,76,76), cvstream); renderChannel(params, out, Channel::Right, stream); - } else { + } else if (chan != Channel::None) { if (ftl::rgbd::isFloatChannel(chan)) { out.create<GpuMat>(chan, Format<float>(camera.width, camera.height)); out.get<GpuMat>(chan).setTo(cv::Scalar(0.0f), cvstream); diff --git a/components/rgbd-sources/src/streamer.cpp b/components/rgbd-sources/src/streamer.cpp index 676cf58cf..7a9118c9f 100644 --- a/components/rgbd-sources/src/streamer.cpp +++ b/components/rgbd-sources/src/streamer.cpp @@ -496,7 +496,7 @@ void Streamer::_transmitPacket(StreamSource *src, const ftl::codecs::Packet &pkt frame_no_, static_cast<uint8_t>((chan & 0x1) | ((hasChan2) ? 0x2 : 0x0)) }; - LOG(INFO) << "codec:" << (int) pkt.codec; + // Lock to prevent clients being added / removed //SHARED_LOCK(src->mutex,lk); auto c = src->clients.begin(); diff --git a/components/rgbd-sources/src/virtual.cpp b/components/rgbd-sources/src/virtual.cpp index 0e6db9738..016662695 100644 --- a/components/rgbd-sources/src/virtual.cpp +++ b/components/rgbd-sources/src/virtual.cpp @@ -47,8 +47,6 @@ class VirtualImpl : public ftl::rgbd::detail::Source { frame.hasChannel(host_->getChannel())) { frame.download(host_->getChannel()); cv::swap(frame.get<cv::Mat>(host_->getChannel()), depth_); - } else { - LOG(ERROR) << "Channel 2 frame in rendering"; } auto cb = host_->callback(); -- GitLab