|
YODAU 1.0
YEAR OF THE DEPEND ADULT UNDERGARMENT
|
Represents a single video stream and its analytic connections. More...
#include <backend/include/stream.hpp>
Public Member Functions | |
| stream (std::string path, std::string name, const std::string &type_str={}, bool loop=true) | |
| Construct a stream description. | |
| stream (const stream &)=delete | |
| Non-copyable (streams manage shared connections / mutex). | |
| stream & | operator= (const stream &)=delete |
| Non-copyable (streams manage shared connections / mutex). | |
| stream (stream &&other) noexcept | |
| Move-construct a stream. | |
| stream & | operator= (stream &&other) noexcept |
| Move-assign a stream. | |
| std::string | get_name () const |
| Get logical stream name. | |
| std::string | get_path () const |
| Get stream path or URL. | |
| stream_type | get_type () const |
| Get the stream transport/source type. | |
| bool | is_looping () const |
| Whether the stream is configured to loop on exhaustion. | |
| void | dump (std::ostream &out, bool connections=false) const |
| Dump stream metadata to an output stream. | |
| void | activate (stream_pipeline pipeline=stream_pipeline::automatic) |
| Activate the stream in a pipeline. | |
| stream_pipeline | pipeline () const |
| Get current pipeline activity of the stream. | |
| void | deactivate () |
| Deactivate the stream. | |
| void | connect_line (line_ptr line) |
| Connect a geometric line to this stream. | |
| std::vector< std::string > | line_names () const |
| Get a list of names of all connected lines. | |
| std::vector< line_ptr > | lines_snapshot () const |
| Get a snapshot of all connected lines. | |
Static Public Member Functions | |
| static stream_type | identify (const std::string &path) |
| Identify stream type from a path/URL. | |
| static std::string | type_name (const stream_type type) |
| Convert a stream type to a canonical textual name. | |
| static std::string | pipeline_name (const stream_pipeline pipeline) |
| Convert a pipeline mode to its textual name. | |
Private Attributes | |
| std::string | name |
| Logical stream name. | |
| std::string | path |
| Path or URL to the stream source. | |
| stream_type | type |
| Detected or user-specified stream type. | |
| bool | loop { true } |
| Looping behavior for file streams. | |
| stream_pipeline | active { stream_pipeline::none } |
| Currently active pipeline mode. | |
| std::unordered_map< std::string, line_ptr > | lines |
| Connected lines keyed by their logical names. | |
| std::mutex | lines_mtx |
| Mutex guarding lines. | |
Represents a single video stream and its analytic connections.
A stream owns metadata about where it comes from (path, type), whether it should loop when exhausted, and which pipeline (if any) it is currently active in.
The stream also maintains a set of connected geometric lines (tripwires / ROIs), identified by their logical names.
Thread-safety:
Definition at line 64 of file stream.hpp.
| yodau::backend::stream::stream | ( | std::string | path, |
| std::string | name, | ||
| const std::string & | type_str = {}, | ||
| bool | loop = true ) |
Construct a stream description.
The actual stream_type is determined as:
path using identify().type_str is empty or matches detected type name, use the detected type.type_str as an explicit override. Unknown strings fall back to detection.| path | Stream path or URL. |
| name | Logical stream name/identifier. |
| type_str | Optional textual override ("local", "file", "rtsp", "http"). |
| loop | Whether file-based streams should loop on end-of-file. |
Definition at line 5 of file stream.cpp.
References active, yodau::backend::file, yodau::backend::http, yodau::backend::local, loop, yodau::backend::none, yodau::backend::rtsp, type, and type_name().

|
delete |
Non-copyable (streams manage shared connections / mutex).
|
noexcept |
Move-construct a stream.
Moves metadata and connected lines. The moved-from object remains valid but in an unspecified state.
Definition at line 30 of file stream.cpp.
References active, loop, stream(), and type.
Referenced by stream().


| void yodau::backend::stream::activate | ( | stream_pipeline | pipeline = stream_pipeline::automatic | ) |
Activate the stream in a pipeline.
This sets the current active pipeline mode.
| pipeline | Pipeline to activate in (default: automatic). |
Definition at line 129 of file stream.cpp.
References active.
| void yodau::backend::stream::connect_line | ( | line_ptr | line | ) |
Connect a geometric line to this stream.
The line is stored by its line::name. If line is null, the call is ignored.
| line | Shared pointer to an immutable line. |
Definition at line 139 of file stream.cpp.
| void yodau::backend::stream::deactivate | ( | ) |
Deactivate the stream.
Sets pipeline mode to stream_pipeline::none.
Definition at line 137 of file stream.cpp.
References active, and yodau::backend::none.
| void yodau::backend::stream::dump | ( | std::ostream & | out, |
| bool | connections = false ) const |
Dump stream metadata to an output stream.
If connections is true, also prints names of any connected lines.
| out | Output stream. |
| connections | Whether to include connected line names. |
Definition at line 106 of file stream.cpp.
| std::string yodau::backend::stream::get_name | ( | ) | const |
| std::string yodau::backend::stream::get_path | ( | ) | const |
| yodau::backend::stream_type yodau::backend::stream::get_type | ( | ) | const |
|
static |
Identify stream type from a path/URL.
Detection rules (as implemented):
| path | Stream path or URL. |
Definition at line 60 of file stream.cpp.
References yodau::backend::file, yodau::backend::http, yodau::backend::local, and yodau::backend::rtsp.
| bool yodau::backend::stream::is_looping | ( | ) | const |
Whether the stream is configured to loop on exhaustion.
Typically relevant for file streams.
Definition at line 104 of file stream.cpp.
References loop.
| std::vector< std::string > yodau::backend::stream::line_names | ( | ) | const |
Get a list of names of all connected lines.
Definition at line 147 of file stream.cpp.
| std::vector< yodau::backend::line_ptr > yodau::backend::stream::lines_snapshot | ( | ) | const |
Get a snapshot of all connected lines.
Returns a stable copy of shared pointers at the time of call.
Definition at line 154 of file stream.cpp.
Non-copyable (streams manage shared connections / mutex).
|
noexcept |
Move-assign a stream.
Safely swaps line connections under locks of both objects.
Definition at line 42 of file stream.cpp.
| yodau::backend::stream_pipeline yodau::backend::stream::pipeline | ( | ) | const |
Get current pipeline activity of the stream.
Definition at line 133 of file stream.cpp.
References active.
|
static |
Convert a pipeline mode to its textual name.
| pipeline | Pipeline kind. |
Definition at line 85 of file stream.cpp.
|
static |
Convert a stream type to a canonical textual name.
| type | Stream type. |
Definition at line 73 of file stream.cpp.
Referenced by stream().

|
private |
Currently active pipeline mode.
Definition at line 234 of file stream.hpp.
Referenced by activate(), deactivate(), operator=(), pipeline(), stream(), and stream().
|
private |
Connected lines keyed by their logical names.
Protected by lines_mtx.
Definition at line 241 of file stream.hpp.
|
mutableprivate |
Mutex guarding lines.
Definition at line 244 of file stream.hpp.
|
private |
Looping behavior for file streams.
Definition at line 231 of file stream.hpp.
Referenced by is_looping(), operator=(), stream(), and stream().
|
private |
Logical stream name.
Definition at line 222 of file stream.hpp.
|
private |
Path or URL to the stream source.
Definition at line 225 of file stream.hpp.
|
private |
Detected or user-specified stream type.
Definition at line 228 of file stream.hpp.
Referenced by get_type(), operator=(), stream(), and stream().