Skip to content
Snippets Groups Projects
Commit 01ba93c2 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix missing check for no second chan in render

parent 9dac981c
No related branches found
No related tags found
2 merge requests!116Implements #133 point alignment,!114Ongoing #133 improvements
......@@ -23,6 +23,7 @@ void Splatter::renderChannel(
ftl::render::SplatParams &params, 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);
......
......@@ -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();
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment