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

Reconstruct files

parent 5498836b
No related branches found
No related tags found
No related merge requests found
Pipeline #29426 passed
...@@ -83,10 +83,13 @@ static void run(ftl::Configurable *root) { ...@@ -83,10 +83,13 @@ static void run(ftl::Configurable *root) {
pipeline->append<ftl::operators::ArUco>("aruco")->value("enabled", false); pipeline->append<ftl::operators::ArUco>("aruco")->value("enabled", false);
}); });
bool has_file = false;
// Add sources here // Add sources here
if (root->getConfig().contains("sources")) { if (root->getConfig().contains("sources")) {
for (const auto &s : root->getConfig()["sources"]) { for (const auto &s : root->getConfig()["sources"]) {
ftl::URI uri(s); ftl::URI uri(s);
if (uri.getScheme() == ftl::URI::scheme_t::SCHEME_FILE) has_file = true;
uri.setAttribute("group", group_name); uri.setAttribute("group", group_name);
feed->add(uri); feed->add(uri);
} }
...@@ -99,6 +102,7 @@ static void run(ftl::Configurable *root) { ...@@ -99,6 +102,7 @@ static void run(ftl::Configurable *root) {
for (auto &x : *paths) { for (auto &x : *paths) {
if (x != "") { if (x != "") {
ftl::URI uri(x); ftl::URI uri(x);
if (uri.getScheme() == ftl::URI::scheme_t::SCHEME_FILE) has_file = true;
uri.setAttribute("group", group_name); uri.setAttribute("group", group_name);
feed->add(uri); feed->add(uri);
} }
...@@ -123,6 +127,9 @@ static void run(ftl::Configurable *root) { ...@@ -123,6 +127,9 @@ static void run(ftl::Configurable *root) {
feed->startStreaming(filter); feed->startStreaming(filter);
// Just do whatever jobs are available // Just do whatever jobs are available
if (has_file) {
ftl::timer::start(true);
} else {
while (ftl::running) { while (ftl::running) {
auto f = ftl::pool.pop(); auto f = ftl::pool.pop();
if (f) { if (f) {
...@@ -131,6 +138,7 @@ static void run(ftl::Configurable *root) { ...@@ -131,6 +138,7 @@ static void run(ftl::Configurable *root) {
std::this_thread::sleep_for(std::chrono::milliseconds(10)); std::this_thread::sleep_for(std::chrono::milliseconds(10));
} }
} }
}
//nsrc_handle.cancel(); //nsrc_handle.cancel();
feed->stopRecording(); feed->stopRecording();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment