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

Bug fix for builder callback

parent 44224f9e
No related branches found
No related tags found
No related merge requests found
Pipeline #18783 passed
......@@ -124,6 +124,15 @@ size_t Builder::size() {
}
void Builder::onFrameSet(const std::function<bool(ftl::rgbd::FrameSet &)> &cb) {
if (!cb) {
main_id_.cancel();
return;
}
if (main_id_.id() != -1) {
main_id_.cancel();
}
// 3. Issue IO retrieve ad compute jobs before finding a valid
// frame at required latency to pass to callback.
main_id_ = ftl::timer::add(ftl::timer::kTimerMain, [this,cb](int64_t ts) {
......
......@@ -25,6 +25,7 @@ Receiver::~Receiver() {
//if (stream_) {
// stream_->onPacket(nullptr);
//}
builder_.onFrameSet(nullptr);
}
......
......@@ -215,5 +215,7 @@ TEST_CASE( "Receiver generating onFrameSet" ) {
}
ftl::timer::stop(true);
//while (ftl::pool.n_idle() != ftl::pool.size()) std::this_thread::sleep_for(std::chrono::milliseconds(10));
delete receiver;
//ftl::config::cleanup();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment