Skip to content
Snippets Groups Projects
Commit efe827d1 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

fix right channel streaming

parent 1c90b1f2
Branches
Tags
1 merge request!110Feature/121/vr
Pipeline #14410 failed
...@@ -496,7 +496,7 @@ void Streamer::_transmitPacket(StreamSource *src, const ftl::codecs::Packet &pkt ...@@ -496,7 +496,7 @@ void Streamer::_transmitPacket(StreamSource *src, const ftl::codecs::Packet &pkt
frame_no_, frame_no_,
static_cast<uint8_t>((chan & 0x1) | ((hasChan2) ? 0x2 : 0x0)) static_cast<uint8_t>((chan & 0x1) | ((hasChan2) ? 0x2 : 0x0))
}; };
LOG(INFO) << "codec:" << (int) pkt.codec;
// Lock to prevent clients being added / removed // Lock to prevent clients being added / removed
//SHARED_LOCK(src->mutex,lk); //SHARED_LOCK(src->mutex,lk);
auto c = src->clients.begin(); auto c = src->clients.begin();
......
...@@ -36,13 +36,19 @@ class VirtualImpl : public ftl::rgbd::detail::Source { ...@@ -36,13 +36,19 @@ class VirtualImpl : public ftl::rgbd::detail::Source {
LOG(ERROR) << "Unknown exception in render callback"; LOG(ERROR) << "Unknown exception in render callback";
} }
if (frame.hasChannel(Channel::Colour) && frame.hasChannel(Channel::Depth)) { if (frame.hasChannel(Channel::Colour)) {
frame.download(Channel::Colour + Channel::Depth); frame.download(Channel::Colour);
cv::swap(frame.get<cv::Mat>(Channel::Colour), rgb_); cv::swap(frame.get<cv::Mat>(Channel::Colour), rgb_);
cv::swap(frame.get<cv::Mat>(Channel::Depth), depth_);
LOG(INFO) << "Written: " << rgb_.cols;
} else { } else {
LOG(ERROR) << "Missing colour or depth frame in rendering"; LOG(ERROR) << "Channel 1 frame in rendering";
}
if ((host_->getChannel() != Channel::None) &&
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(); auto cb = host_->callback();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment