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

Fix for bad atomic init

parent f806ba71
No related branches found
No related tags found
1 merge request!212Major refactor of frame streaming
Pipeline #18137 canceled
...@@ -178,9 +178,9 @@ void Receiver::setStream(ftl::stream::Stream *s) { ...@@ -178,9 +178,9 @@ void Receiver::setStream(ftl::stream::Stream *s) {
if (frame.state.getLeft().width == 0) { if (frame.state.getLeft().width == 0) {
LOG(WARNING) << "Missing calibration, skipping frame"; LOG(WARNING) << "Missing calibration, skipping frame";
frame.frame.reset(); //frame.frame.reset();
frame.completed.clear(); //frame.completed.clear();
return; //return;
} }
// TODO: Have multiple builders for different framesets. // TODO: Have multiple builders for different framesets.
......
...@@ -9,7 +9,7 @@ using ftl::codecs::definition_t; ...@@ -9,7 +9,7 @@ using ftl::codecs::definition_t;
using ftl::codecs::device_t; using ftl::codecs::device_t;
using ftl::codecs::codec_t; using ftl::codecs::codec_t;
Sender::Sender(nlohmann::json &config) : ftl::Configurable(config), stream_(nullptr), do_inject_(ATOMIC_FLAG_INIT) { Sender::Sender(nlohmann::json &config) : ftl::Configurable(config), stream_(nullptr) {
//do_inject_ = false; //do_inject_ = false;
} }
...@@ -42,6 +42,7 @@ class VectorBuffer2 { ...@@ -42,6 +42,7 @@ class VectorBuffer2 {
}; };
void Sender::_injectCalibration(const ftl::rgbd::FrameSet &fs, int ix) { void Sender::_injectCalibration(const ftl::rgbd::FrameSet &fs, int ix) {
LOG(INFO) << "INJECT CALIBRATION";
ftl::codecs::StreamPacket spkt = { ftl::codecs::StreamPacket spkt = {
4, 4,
fs.timestamp, fs.timestamp,
...@@ -168,8 +169,8 @@ void Sender::post(const ftl::rgbd::FrameSet &fs) { ...@@ -168,8 +169,8 @@ void Sender::post(const ftl::rgbd::FrameSet &fs) {
if (enc) { if (enc) {
// FIXME: Timestamps may not always be aligned to interval. // FIXME: Timestamps may not always be aligned to interval.
if (do_inject || fs.timestamp % (10*ftl::timer::getInterval()) == 0) enc->reset(); //if (do_inject || fs.timestamp % (10*ftl::timer::getInterval()) == 0) enc->reset();
//if (do_inject) enc->reset(); if (do_inject) enc->reset();
try { try {
enc->encode(frame.get<cv::cuda::GpuMat>(c), 0, [this,&spkt](const ftl::codecs::Packet &pkt){ enc->encode(frame.get<cv::cuda::GpuMat>(c), 0, [this,&spkt](const ftl::codecs::Packet &pkt){
stream_->post(spkt, pkt); stream_->post(spkt, pkt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment