|
StormByte C++ Library: Multimedia module 0.0.9999
StormByte-Multimedia is a StormByte library module for parsing configuration files
|
One stage with a Backend::Pipeline::Pipe (in / out). More...
#include <StormByte/multimedia/pipeline/step.hxx>


Classes | |
| class | Join |
| Last data member of every most-derived Step. More... | |
Public Member Functions | |
Lifecycle | |
| Step (const Step &other)=delete | |
| Step (Step &&other) noexcept=delete | |
| virtual | ~Step () noexcept |
| Destructor. | |
| Step & | operator= (const Step &other)=delete |
| Step & | operator= (Step &&other) noexcept=delete |
Sinks | |
| std::condition_variable & | Wake () noexcept |
| Consumer condition variable. | |
Plan | |
| const std::shared_ptr< class Plan > & | Plan () const noexcept |
| Bound job intention, if any. | |
Flow | |
| const Kinds & | Receives () const noexcept |
| Kinds this step consumes. | |
| const Kinds & | Produces () const noexcept |
| Kinds this step emits. | |
| State | Status () const noexcept |
| Current lifecycle value. | |
| virtual bool | Ready () const noexcept |
| Whether this step can take work. | |
| void | Stop () noexcept |
| Asks the worker to leave and closes all hoppers. | |
| virtual std::size_t | InputCeiling () const noexcept |
| Ceiling of this step's input hopper. | |
Failure | |
| bool | Failed () const noexcept |
| Whether this step has failed. | |
| const std::optional< std::string > & | Error () const noexcept |
| Failure text. | |
| void | Fail (std::string reason) noexcept |
| Marks Failed, closes all hoppers and wakes the worker. | |
Protected Member Functions | |
| Backend::Pipeline::Pipe & | pipe () noexcept |
| In / out hoppers of this stage. | |
| const Backend::Pipeline::Pipe & | pipe () const noexcept |
| In / out hoppers of this stage. | |
Construction | |
| Step (std::shared_ptr< StormByte::Logger::Log > log, enum Producer name, Kinds receives, Kinds produces) noexcept | |
| Step in State::Created. | |
Work | |
| void | Emit (Item::PointerType item) noexcept |
Write item to the Pipe (item >> pipe). | |
| Item::PointerType | CloneItem (const Item &item) const noexcept |
Deep-copies item through Item::Clone. | |
| void | Wait () noexcept |
| Sleeps on Wake until hopper Ready, Failed or Stopping. | |
| void | Launch () noexcept |
| Starts the pumper: Setup, Ready, Pump. | |
| void | Halt () noexcept |
| Stop and join the pumper. | |
| bool | Stopping () const noexcept |
| Worker must return (Stop, Halt or Fail). | |
| void | RecordWork (std::int64_t microseconds) noexcept |
| Adds one Process duration to the step summary. | |
| std::int64_t | LastWork () const noexcept |
| Duration of the last timed Process, or 0. | |
| void | DumpWork () noexcept |
| Writes min/max Process time at Debug. | |
| Backend::Pipeline::Host & | Face () noexcept |
| Owner surface for the Pumper and Worker. | |
| void | Mount (std::unique_ptr< Backend::Pipeline::Pumper > pumper, std::unique_ptr< Backend::Pipeline::Worker > worker) noexcept |
Takes ownership of pumper and binds worker. | |
Logging | |
| virtual std::string | Label () const noexcept |
| Display name of this step. | |
| virtual void | Log (StormByte::Logger::Level level, std::string_view message) noexcept |
| Writes one log line on the scoped module logger. | |
Protected Attributes | |
| std::shared_ptr< StormByte::Logger::Log > | m_log |
| enum Producer | m_name |
| UseLog leaf / default Label. | |
| Kinds | m_receives |
| Receives. | |
| Kinds | m_produces |
| Produces. | |
Friends | |
| class | Demuxer |
| class | Muxer |
| class | Remuxer |
| class | Route |
| class | Filters |
| Decoder & | operator>> (Demuxer &demuxer, Decoder &decoder) noexcept |
Binds one origin track of demuxer to decoder. | |
| Demuxer & | operator>> (class Plan &&plan, Demuxer &demuxer) noexcept |
Hands plan to demuxer. | |
| Encoder & | operator>> (Encoder &encoder, Muxer &muxer) noexcept |
Reserves encoder as an output track of muxer. | |
| Muxer & | operator>> (Demuxer &demuxer, Muxer &muxer) noexcept |
Binds demuxer as remux origin and forwards its attachments. | |
| Remuxer & | operator>> (Demuxer &demuxer, Remuxer &remuxer) noexcept |
Binds origin track remuxer.In() from demuxer onto remuxer. | |
| Remuxer & | operator>> (Remuxer &remuxer, Muxer &muxer) noexcept |
Reserves remuxer as an output track of muxer. | |
| Step & | operator>> (Step &from, Step &to) noexcept |
Shares Plan and binds every output hopper of from onto to. | |
One stage with a Backend::Pipeline::Pipe (in / out).
Owns a Pumper (thread + State) and exposes hoppers to that pumper through a private Host surface. Leaves Mount a concrete Pumper and Worker, then Launch.
Log lines use Scope StormByte/Multimedia/<Producer>. UseLog installs the module format and throttle. Volume is that Logger throttle, not a per-step counter.
Emit writes item >> pipe. Analytics looks are a Backend::Pipeline::Pipe::CloneTo on that Pipe, bound by Filters before the origin emits. Without CloneTo there is no clone.
|
delete |
|
deletenoexcept |
|
virtualnoexcept |
|
protectednoexcept |
Step in State::Created.
Sinks start at zero buckets.
|
protectednoexcept |
|
protectednoexcept |
Writes min/max Process time at Debug.
No-op if none.
|
protectednoexcept |
Write item to the Pipe (item >> pipe).
| item | Unit to emit. Empty is a no-op. |
Analytics clones, if any, happen inside the Pipe after Backend::Pipeline::Pipe::CloneTo.
|
noexcept |
Failure text.
|
protectednoexcept |
Owner surface for the Pumper and Worker.
|
noexcept |
Marks Failed, closes all hoppers and wakes the worker.
Bound neighbors unblock on hopper EoF. Does not join the worker; the worker may be the caller. Does not write a log line; the owner of the job logs Error.
| reason | Message. |
|
noexcept |
Whether this step has failed.
|
protectednoexcept |
|
virtualnoexcept |
Ceiling of this step's input hopper.
Leaves override this and return their private Ceiling. Bind sites call it after creating the destination bucket.
Reimplemented in StormByte::Multimedia::Pipeline::Decoder, StormByte::Multimedia::Pipeline::Encoder, StormByte::Multimedia::Pipeline::Muxer, and StormByte::Multimedia::Pipeline::Remuxer.
|
protectedvirtualnoexcept |
|
protectednoexcept |
Duration of the last timed Process, or 0.
|
protectednoexcept |
Starts the pumper: Setup, Ready, Pump.
Idempotent. No-op without a mounted pumper, or if the stage has already Failed or Stopped.
|
protectedvirtualnoexcept |
Writes one log line on the scoped module logger.
| level | StormByte::Logger::Level of this line. |
| message | Already-formatted text (caller may use std::format). Must not include the level name; Logger prints that. |
No-op when m_log is empty. Virtual so a leaf can re-expose it to its backend (friendship is not inherited). c is StormByte/Multimedia/<leaf>. There is no STMM component and no Logger group.
|
protectednoexcept |
Takes ownership of pumper and binds worker.
| pumper | Source, Through or Sink. Must not be empty. |
| worker | Stage body. Must not be empty. |
No-op if a pumper is already mounted. Does not Launch.
|
protectednoexcept |
In / out hoppers of this stage.
|
protectednoexcept |
In / out hoppers of this stage.
|
inlinenoexcept |
Bound job intention, if any.
|
inlinenoexcept |
Kinds this step emits.
|
virtualnoexcept |
Whether this step can take work.
Default: Status is Ready (Setup finished without Fail or Stop). Muxer also requires Muxer::Armed so header write and Pump do not start while operator>> is still reserving.
Reimplemented in StormByte::Multimedia::Pipeline::Muxer.
|
inlinenoexcept |
Kinds this step consumes.
|
protectednoexcept |
Adds one Process duration to the step summary.
| microseconds | Wall time of that Process call. |
|
noexcept |
Current lifecycle value.
|
noexcept |
Asks the worker to leave and closes all hoppers.
Neighbors unblock on hopper EoF. Does not join; the worker may be the caller. Idempotent. A mounted tube is not restarted after Stop.
|
protectednoexcept |
Worker must return (Stop, Halt or Fail).
|
protectednoexcept |
Sleeps on Wake until hopper Ready, Failed or Stopping.
|
noexcept |
Consumer condition variable.
|
friend |
|
friend |
|
friend |
Hands plan to demuxer.
Not a Step bind.
| plan | Intention (moved). |
| demuxer | Destination. |
demuxer.Stores the Plan on the Demuxer and wakes it. Does not call Plan::Check and does not bind hoppers.
Binds one origin track of demuxer to decoder.
| demuxer | Origin demuxer. |
| decoder | Destination decoder. |
decoder. Binds demuxer as remux origin and forwards its attachments.
Required when any remux track is reserved. Without it the muxer cannot clone origin codec parameters.
| demuxer | Origin demuxer. Must outlive header write. |
| muxer | Destination. |
muxer. Binds origin track remuxer.In() from demuxer onto remuxer.
| demuxer | Origin demuxer. |
| remuxer | Destination remuxer. |
remuxer. Reserves encoder as an output track of muxer.
| encoder | Live encoder. |
| muxer | Destination. |
encoder. Reserves remuxer as an output track of muxer.
| remuxer | Live remuxer. |
| muxer | Destination. |
remuxer.
|
friend |
|
friend |
|
protected |
Scoped module logger (ThreadedLog preferred)
|
protected |
UseLog leaf / default Label.
|
protected |
Produces.
|
protected |
Receives.