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

Fix unwanted latency

parent 708d446b
No related branches found
No related tags found
1 merge request!338Resolves #375 full colour resolution
Pipeline #29318 failed
......@@ -197,10 +197,7 @@ static void run(ftl::Configurable *root) {
"clipping"
});
std::atomic_flag busy;
busy.clear();
auto h = creator->onFrameSet([sender,outstream,&stats_count,&latency,&frames,&stats_time,pipeline,&busy,&encodable,&previous_encodable](const ftl::data::FrameSetPtr &fs) {
auto h = creator->onFrameSet([sender,outstream,&stats_count,&latency,&frames,&stats_time,pipeline,&encodable,&previous_encodable](const ftl::data::FrameSetPtr &fs) {
// Decide what to encode here, based upon what remote users select
const auto sel = outstream->selectedNoExcept(fs->frameset());
......@@ -222,7 +219,7 @@ static void run(ftl::Configurable *root) {
fs->set(ftl::data::FSFlag::AUTO_SEND);
bool did_pipe = pipeline->apply(*fs, *fs, [fs,&frames,&latency,&busy]() {
bool did_pipe = pipeline->apply(*fs, *fs, [fs,&frames,&latency]() {
if (fs->hasAnyChanged(Channel::Depth)) fs->flush(Channel::Depth);
++frames;
latency += float(ftl::timer::get_time() - fs->timestamp());
......@@ -236,7 +233,7 @@ static void run(ftl::Configurable *root) {
// Do some encoding (eg. colour) whilst pipeline runs
ftl::pool.push([fs,&stats_count,&latency,&frames,&stats_time,&busy](int id){
ftl::pool.push([fs,&stats_count,&latency,&frames,&stats_time](int id){
if (fs->hasAnyChanged(Channel::Audio)) {
fs->flush(ftl::codecs::Channel::Audio);
}
......
......@@ -83,7 +83,6 @@ bool Graph::apply(FrameSet &in, FrameSet &out, const std::function<void()> &cb)
return false;
}
callback_ = cb;
valid_buffers_.clear();
for (auto &f : out.frames) {
......@@ -184,7 +183,6 @@ bool Graph::apply(Frame &in, Frame &out, const std::function<void()> &cb) {
}
valid_buffers_.clear();
callback_ = cb;
if (!out.hasOwn(Channel::Pipelines)) out.create<std::list<std::string>>(Channel::Pipelines);
auto pls = out.set<std::list<std::string>>(Channel::Pipelines);
......
......@@ -184,7 +184,9 @@ Feed::Feed(nlohmann::json &config, ftl::net::Universe*net) :
lk.unlock();
if (pipeline) pipeline->apply(*fs, *fs, [this,fs]() {
bool did_pipe = false;
if (pipeline) did_pipe = pipeline->apply(*fs, *fs, [this,fs]() {
SHARED_LOCK(mtx_, lk);
std::atomic_store(&latest_.at(fs->frameset()), fs);
......@@ -222,6 +224,10 @@ Feed::Feed(nlohmann::json &config, ftl::net::Universe*net) :
//lk.lock();
if (!did_pipe) {
LOG(WARNING) << "GUI Pipeline dropped";
}
return true;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment