JeVoisBase
1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
Share this page: |
|
|
|
|
|
|
Go to the documentation of this file.
23 jevois::Component(instance), itsBuf(bufsize), itsRunning(true)
40 std::this_thread::sleep_for(std::chrono::milliseconds(10));
42 {
LINFO(
"Waiting for " <<
absolutePath(filename::get()) <<
" to start loading..."); count = 0; }
50 itsRunning.store(
false);
58 {
return itsBuf.
pop(); }
65 cv::VideoCapture vcap(path);
66 if (vcap.isOpened() ==
false) { itsBuf.
push(cv::Mat());
LERROR(
"Could not open video file " << path);
return; }
69 while (itsRunning.load())
#define JEVOIS_WAIT_GET_FUTURE(f)
std::future< std::invoke_result_t< std::decay_t< Function >, std::decay_t< Args >... > > async(Function &&f, Args &&... args)
~BufferedVideoReader()
Virtual destructor for safe inheritance.
size_t filled_size() const
BufferedVideoReader(std::string const &instance, size_t bufsize=100)
Constructor.
virtual void postUninit() override
Uninit, wait on our run thread and swallow any exception.
cv::Mat get()
Get the next frame as a BGR cv::Mat, or an empty cv::Mat when the movie is finished.
std::filesystem::path absolutePath(std::filesystem::path const &path="")
virtual void postInit() override
Start the thread that loads, decodes and pushes the frames into our buffer.