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

Don't decode unwanted frames

parent c72b9119
No related branches found
No related tags found
2 merge requests!127Implements #196 stream capturing,!125Resolves #159 proxy of sources
Pipeline #15244 passed
...@@ -248,18 +248,13 @@ void NetSource::_recvPacket(short ttimeoff, const ftl::codecs::StreamPacket &spk ...@@ -248,18 +248,13 @@ void NetSource::_recvPacket(short ttimeoff, const ftl::codecs::StreamPacket &spk
const ftl::rgbd::Channel chan = host_->getChannel(); const ftl::rgbd::Channel chan = host_->getChannel();
int rchan = spkt.channel & 0x1; int rchan = spkt.channel & 0x1;
// Ignore any unwanted second channel
if (chan == ftl::rgbd::Channel::None && rchan > 0) {
LOG(INFO) << "Unwanted channel";
//return;
// TODO: Allow decode to be skipped
}
NetFrame &frame = queue_.getFrame(spkt.timestamp, cv::Size(params_.width, params_.height), CV_8UC3, (isFloatChannel(chan) ? CV_32FC1 : CV_8UC3)); NetFrame &frame = queue_.getFrame(spkt.timestamp, cv::Size(params_.width, params_.height), CV_8UC3, (isFloatChannel(chan) ? CV_32FC1 : CV_8UC3));
// Update frame statistics // Update frame statistics
frame.tx_size += pkt.data.size(); frame.tx_size += pkt.data.size();
// Ignore any unwanted second channel
if (!(chan == ftl::rgbd::Channel::None && rchan > 0)) {
_createDecoder(rchan, pkt); _createDecoder(rchan, pkt);
auto *decoder = (rchan == 0) ? decoder_c1_ : decoder_c2_; auto *decoder = (rchan == 0) ? decoder_c1_ : decoder_c2_;
if (!decoder) { if (!decoder) {
...@@ -268,6 +263,9 @@ void NetSource::_recvPacket(short ttimeoff, const ftl::codecs::StreamPacket &spk ...@@ -268,6 +263,9 @@ void NetSource::_recvPacket(short ttimeoff, const ftl::codecs::StreamPacket &spk
} }
decoder->decode(pkt, (rchan == 0) ? frame.channel1 : frame.channel2); decoder->decode(pkt, (rchan == 0) ? frame.channel1 : frame.channel2);
} else {
//LOG(INFO) << "Unwanted frame";
}
// Apply colour correction to chunk // Apply colour correction to chunk
//ftl::rgbd::colourCorrection(tmp_rgb, gamma_, temperature_); //ftl::rgbd::colourCorrection(tmp_rgb, gamma_, temperature_);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment