![]() |
SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
|
#include <file_ipc_stream_writer.hpp>
Public Types | |
| using | Base = ipc::IpcStreamWriter<TIntegrationMode> |
| using | BackgroundContainer |
| Public Types inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode > | |
| using | BackgroundContainer |
Public Member Functions | |
| FileIpcStreamWriter (const FileIpcConfiguration &configuration) | |
| absl::Status | WriteStatus (const presage::physiology::StatusValue &status) override |
| absl::Status | WriteCoreMetrics (const presage::physiology::MetricsBuffer &metrics, int64_t timestamp_us) override |
| absl::Status | WriteEdgeMetrics (const presage::physiology::Metrics &metrics, int64_t timestamp_us) override |
| absl::Status | WriteFrame (const cv::Mat &frame, int64_t timestamp_us) override |
| void | Close () override |
| bool | IsOperational () const override |
| absl::Status | Flush () override |
| Public Member Functions inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode > | |
| virtual absl::Status | SwapContainer (std::shared_ptr< BackgroundContainer > new_container) |
| const BackgroundContainer * | GetContainer () const |
Protected Member Functions | |
| absl::Status | Initialize () |
| absl::Status | WriteJsonLine (std::ofstream &stream, const std::string &json_data) |
| absl::Status | CompressFrameWithTurboJpeg (const cv::Mat &frame, std::vector< unsigned char > &jpeg_data) |
| Protected Member Functions inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode > | |
| virtual absl::Status | RegisterCallbacks () |
| virtual absl::Status | SendInitialStatus () |
| int64_t | GetCurrentTimestampUs () |
Static Protected Member Functions | |
| static std::string | BuildEnvelope (const std::string &type, const std::string &json_payload, int64_t timestamp_us) |
| static std::string | BuildStatusPayload (const presage::physiology::StatusValue &status) |
| static std::string | JsonEscape (const std::string &value) |
| static const google::protobuf::util::JsonPrintOptions & | GetJsonOptions () |
Additional Inherited Members | |
| Protected Attributes inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode > | |
| std::shared_ptr< BackgroundContainer > | container_ |
File-based implementation of IPC stream writer. Provides functionality for writing to files including:
|
staticprotected |
Build an envelope with type, timestamp, and payload.
|
staticprotected |
Build status payload with additional metadata.
|
overridevirtual |
Close the stream and release resources. After calling this, the writer should not be used again.
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.
|
protected |
Compress a frame using TurboJPEG.
| frame | The OpenCV Mat to compress |
| jpeg_data | Output vector for compressed JPEG data |
|
overridevirtual |
Flush any buffered data to the underlying stream. Some implementations may buffer data for performance.
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.
|
staticprotected |
Get or create the JSON print options (singleton).
|
protected |
Initialize file streams and directories. Called during construction.
|
overridevirtual |
Check if the writer is currently operational.
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.
|
staticprotected |
Escape a string for JSON.
|
overridevirtual |
Write core metrics to the stream.
| metrics | The core metrics buffer to write |
| timestamp_us | Timestamp in microseconds since epoch |
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.
|
overridevirtual |
Write edge metrics to the stream.
| metrics | The edge metrics to write |
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.
|
overridevirtual |
Write a video frame to the stream.
| frame | The video frame as an OpenCV Mat (RGB format expected) |
| timestamp_us | Timestamp in microseconds since epoch |
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.
|
protected |
Write a JSON line to a stream with optional locking.
|
overridevirtual |
Write a status value to the stream.
| status | The status value to write |
Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.