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

Remove right channel encode for now

parent 699654ba
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
...@@ -165,7 +165,7 @@ static void run(ftl::Configurable *root) { ...@@ -165,7 +165,7 @@ static void run(ftl::Configurable *root) {
// TODO: Check the channel to see if it should be sent or not // TODO: Check the channel to see if it should be sent or not
switch (c) { switch (c) {
case Channel::Colour : case Channel::Colour :
case Channel::Colour2 : //case Channel::Colour2 :
case Channel::Depth : sender->post(fs, c); break; case Channel::Depth : sender->post(fs, c); break;
default: break; default: break;
} }
...@@ -175,6 +175,7 @@ static void run(ftl::Configurable *root) { ...@@ -175,6 +175,7 @@ static void run(ftl::Configurable *root) {
int stats_count = 0; int stats_count = 0;
int frames = 0; int frames = 0;
float latency = 0.0f; float latency = 0.0f;
int64_t stats_time = 0;
auto *pipeline = ftl::config::create<ftl::operators::Graph>(root, "pipeline"); auto *pipeline = ftl::config::create<ftl::operators::Graph>(root, "pipeline");
pipeline->append<ftl::operators::DetectAndTrack>("facedetection")->value("enabled", false); pipeline->append<ftl::operators::DetectAndTrack>("facedetection")->value("enabled", false);
...@@ -183,8 +184,11 @@ static void run(ftl::Configurable *root) { ...@@ -183,8 +184,11 @@ static void run(ftl::Configurable *root) {
bool busy = false; bool busy = false;
auto h = creator->onFrameSet([sender,&stats_count,&latency,&frames,pipeline,&busy](const ftl::data::FrameSetPtr &fs) { auto h = creator->onFrameSet([sender,&stats_count,&latency,&frames,&stats_time,pipeline,&busy](const ftl::data::FrameSetPtr &fs) {
if (busy) return true; if (busy) {
LOG(INFO) << "Frame drop due to pipeline: " << fs->timestamp();
return true;
}
busy = true; busy = true;
// TODO: Remove, this is debug code // TODO: Remove, this is debug code
...@@ -193,7 +197,7 @@ static void run(ftl::Configurable *root) { ...@@ -193,7 +197,7 @@ static void run(ftl::Configurable *root) {
} }
// Do all processing in another thread... // Do all processing in another thread...
ftl::pool.push([sender,&stats_count,&latency,&frames,pipeline,&busy,fs](int id) { ftl::pool.push([sender,&stats_count,&latency,&frames,&stats_time,pipeline,&busy,fs](int id) {
// Do pipeline here... // Do pipeline here...
pipeline->apply(*fs, *fs); pipeline->apply(*fs, *fs);
...@@ -206,10 +210,14 @@ static void run(ftl::Configurable *root) { ...@@ -206,10 +210,14 @@ static void run(ftl::Configurable *root) {
if (--stats_count <= 0) { if (--stats_count <= 0) {
latency /= float(frames); latency /= float(frames);
LOG(INFO) << "Frame rate: " << frames << ", Latency: " << latency; int64_t nowtime = ftl::timer::get_time();
stats_time = nowtime - stats_time;
float fps = float(frames) / (float(stats_time) / 1000.0f);
LOG(INFO) << "Frame rate: " << fps << ", Latency: " << latency;
stats_count = 20; stats_count = 20;
frames = 0; frames = 0;
latency = 0.0f; latency = 0.0f;
stats_time = nowtime;
} }
busy = false; busy = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment