SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
output_stream_poller_wrapper.hpp
1
2// output_stream_poller_wrapper.h
3// Created by Greg on 2/22/2024.
4// Copyright (C) 2024 Presage Security, Inc.
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 3 of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with this program; if not, write to the Free Software Foundation,
18// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21#pragma once
22// === standard library includes (if any) ===
23#include <optional>
24// === third-party includes (if any) ===
25#include <mediapipe/framework/output_stream_poller.h>
26#include <mediapipe/framework/calculator_graph.h>
27#include <absl/status/status.h>
28// === local includes (if any) ===
29
30namespace presage::smartspectra::container::output_stream_poller_wrapper {
31
33class OutputStreamPollerWrapper {
34public:
35 OutputStreamPollerWrapper() = default;
36 ~OutputStreamPollerWrapper() = default;
37
38 // Non-copyable - MediaPipe objects typically aren't copyable
39 OutputStreamPollerWrapper(const OutputStreamPollerWrapper&) = delete;
40 OutputStreamPollerWrapper& operator=(const OutputStreamPollerWrapper&) = delete;
41
42 // Movable
43 OutputStreamPollerWrapper(OutputStreamPollerWrapper&&) = default;
44 OutputStreamPollerWrapper& operator=(OutputStreamPollerWrapper&&) = default;
46 absl::Status Initialize(mediapipe::CalculatorGraph& graph, const std::string& stream_name);
48 mediapipe::OutputStreamPoller& Get();
49private:
50 std::optional<mediapipe::OutputStreamPoller> stream_poller_;
51};
52
53} // namespace presage::smartspectra::container::output_stream_poller_wrapper
absl::Status Initialize(mediapipe::CalculatorGraph &graph, const std::string &stream_name)
Definition output_stream_poller_wrapper.cpp:13
mediapipe::OutputStreamPoller & Get()
Definition output_stream_poller_wrapper.cpp:20