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

Allow for frame buffer full problems

parent 47f2629f
No related branches found
No related tags found
No related merge requests found
Pipeline #14913 passed
...@@ -159,12 +159,12 @@ static void run(ftl::Configurable *root) { ...@@ -159,12 +159,12 @@ static void run(ftl::Configurable *root) {
group.addSource(in); group.addSource(in);
} }
stream->setLatency(4); // FIXME: This depends on source!? stream->setLatency(5); // FIXME: This depends on source!?
stream->run(); stream->run();
bool busy = false; bool busy = false;
group.setLatency(4); group.setLatency(5);
group.setName("ReconGroup"); group.setName("ReconGroup");
group.sync([splat,virt,&busy,&slave,&scene_A,&scene_B,&align](ftl::rgbd::FrameSet &fs) -> bool { group.sync([splat,virt,&busy,&slave,&scene_A,&scene_B,&align](ftl::rgbd::FrameSet &fs) -> bool {
//cudaSetDevice(scene->getCUDADevice()); //cudaSetDevice(scene->getCUDADevice());
......
...@@ -40,6 +40,8 @@ NetFrame &NetFrameQueue::getFrame(int64_t ts, const cv::Size &s, int c1type, int ...@@ -40,6 +40,8 @@ NetFrame &NetFrameQueue::getFrame(int64_t ts, const cv::Size &s, int c1type, int
if (f.timestamp == ts) return f; if (f.timestamp == ts) return f;
} }
int64_t oldest = ts;
// No match so find an empty slot // No match so find an empty slot
for (auto &f : frames_) { for (auto &f : frames_) {
if (f.timestamp == -1) { if (f.timestamp == -1) {
...@@ -51,11 +53,23 @@ NetFrame &NetFrameQueue::getFrame(int64_t ts, const cv::Size &s, int c1type, int ...@@ -51,11 +53,23 @@ NetFrame &NetFrameQueue::getFrame(int64_t ts, const cv::Size &s, int c1type, int
f.channel2.create(s, c2type); f.channel2.create(s, c2type);
return f; return f;
} }
oldest = (f.timestamp < oldest) ? f.timestamp : oldest;
} }
// No empty slot, so give a fatal error // No empty slot, so give a fatal error
for (auto &f : frames_) { for (auto &f : frames_) {
LOG(ERROR) << "Stale frame: " << f.timestamp << " - " << f.chunk_count; LOG(ERROR) << "Stale frame: " << f.timestamp << " - " << f.chunk_count;
// Force release of frame!
if (f.timestamp == oldest) {
f.timestamp = ts;
f.chunk_count = 0;
f.chunk_total = 0;
f.tx_size = 0;
f.channel1.create(s, c1type);
f.channel2.create(s, c2type);
return f;
}
} }
LOG(FATAL) << "Net Frame Queue not large enough: " << ts; LOG(FATAL) << "Net Frame Queue not large enough: " << ts;
// FIXME: (Nick) Could auto resize the queue. // FIXME: (Nick) Could auto resize the queue.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment