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

Use timeout exceptions

parent 70b65674
Branches
No related tags found
1 merge request!358Updates to SDK and alternative fusion
Pipeline #33804 passed
...@@ -42,10 +42,12 @@ void PipelineImpl::submit(const voltu::FramePtr &frame) ...@@ -42,10 +42,12 @@ void PipelineImpl::submit(const voltu::FramePtr &frame)
} }
} }
bool PipelineImpl::waitCompletion(int timeout) bool PipelineImpl::waitCompletion(int timeout, bool except)
{ {
int count = timeout / 5; int count = timeout / 5;
while (!ready_ && --count >= 0) std::this_thread::sleep_for(std::chrono::milliseconds(5)); while (!ready_ && --count >= 0) std::this_thread::sleep_for(std::chrono::milliseconds(5));
if (!ready_) throw voltu::exceptions::Timeout();
return ready_; return ready_;
} }
......
...@@ -16,7 +16,7 @@ public: ...@@ -16,7 +16,7 @@ public:
void submit(const voltu::FramePtr &frame) override; void submit(const voltu::FramePtr &frame) override;
bool waitCompletion(int timeout) override; bool waitCompletion(int timeout, bool except) override;
voltu::OperatorPtr appendOperator(voltu::OperatorId id) override; voltu::OperatorPtr appendOperator(voltu::OperatorId id) override;
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
* @param timeout Millisecond timeout, or 0 for non-blocking check. * @param timeout Millisecond timeout, or 0 for non-blocking check.
* @return True if completed * @return True if completed
*/ */
PY_API virtual bool waitCompletion(int timeout) = 0; PY_API virtual bool waitCompletion(int timeout, bool except=false) = 0;
/** /**
* @brief Add an operator to this pipeline. * @brief Add an operator to this pipeline.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// Bump these for each release // Bump these for each release
#define VOLTU_VERSION_MAJOR 0 // For API incompatible changes #define VOLTU_VERSION_MAJOR 0 // For API incompatible changes
#define VOLTU_VERSION_MINOR 3 // For binary compatibility and extensions #define VOLTU_VERSION_MINOR 4 // For binary compatibility and extensions
#define VOLTU_VERSION_PATCH 0 // Binary compatible internal fixes #define VOLTU_VERSION_PATCH 0 // Binary compatible internal fixes
#define VOLTU_VERSION ((VOLTU_VERSION_MAJOR*10000) + (VOLTU_VERSION_MINOR*100) + VOLTU_VERSION_PATCH) #define VOLTU_VERSION ((VOLTU_VERSION_MAJOR*10000) + (VOLTU_VERSION_MINOR*100) + VOLTU_VERSION_PATCH)
......
...@@ -91,7 +91,7 @@ int main(int argc, char **argv) ...@@ -91,7 +91,7 @@ int main(int argc, char **argv)
for (int i=0; i<frameno; ++i) for (int i=0; i<frameno; ++i)
{ {
room->waitNextFrame(5000); room->waitNextFrame(5000, true);
room->getFrame(); room->getFrame();
} }
auto frame = room->getFrame(); auto frame = room->getFrame();
...@@ -108,7 +108,7 @@ int main(int argc, char **argv) ...@@ -108,7 +108,7 @@ int main(int argc, char **argv)
op1->property("mls_iterations")->setInt(iters); op1->property("mls_iterations")->setInt(iters);
pipe->submit(frame); pipe->submit(frame);
pipe->waitCompletion(3000); pipe->waitCompletion(3000, true);
auto imgset = frame->getImageSet(display_channel); auto imgset = frame->getImageSet(display_channel);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment