StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Multimedia::Pipeline::Demuxer Class Referencefinal

Reads interleaved compressed packets from the Plan reader. More...

#include <StormByte/multimedia/pipeline/demuxer.hxx>

Inheritance diagram for StormByte::Multimedia::Pipeline::Demuxer:
Collaboration diagram for StormByte::Multimedia::Pipeline::Demuxer:

Public Member Functions

 operator bool () const noexcept
 true if open, not failed and not at EOF.
Lifecycle
 Demuxer (StormByte::Safe::Shared< StormByte::Logger::Log > log)
 Demuxer.
 Demuxer (StormByte::Safe::Shared< StormByte::Logger::Log > log, StormByte::Safe::Shared< class Progress > progress)
 Launch with a clock already used by duration resolution.
 Demuxer (const Demuxer &other)=delete
 Copy constructor.
 Demuxer (Demuxer &&other) noexcept=delete
 Move constructor.
 ~Demuxer () noexcept override
 Destructor.
Demuxer & operator= (const Demuxer &other)=delete
 Copy assignment.
Demuxer & operator= (Demuxer &&other) noexcept=delete
 Move assignment.
Source
bool Eof () const noexcept
 Whether the last read hit EOF.
StormByte::Safe::Optional< Property::Duration > Position () const
 Presentation time of the last emitted packet.
Progress::Pointer Progress () const noexcept
 Job clock for this tube (measure, analytics, All).
Public Member Functions inherited from StormByte::Multimedia::Pipeline::Step
 Step (const Step &other)=delete
 Copy construction is disabled.
 Step (Step &&other) noexcept=delete
 Move construction is disabled.
virtual ~Step () noexcept
 Destructor.
Step & operator= (const Step &other)=delete
 Copy assignment is disabled.
Step & operator= (Step &&other) noexcept=delete
 Move assignment is disabled.
void Wake () noexcept
 Notifies all waiters of this step.
StormByte::Safe::Shared< class Plan > Plan () const noexcept
 Bound job intention, if any.
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.
StormByte::Safe::Shared< const StageTelemetry > Telemetry () const
 Shared stage counters, retained independently of this Step.
StormByte::Buffer::QueueSnapshot QueueSnapshot (int track) const noexcept
 Reads effective queue limits and logical-byte accounting.
virtual bool Ready () const noexcept
 Whether this step can take work.
void Stop () noexcept
 Requests shutdown and notifies connected stages.
virtual StormByte::Size InputCeiling () const noexcept
 Maximum number of queued input items.
bool Failed () const noexcept
 Whether this step has failed.
StormByte::Safe::Optional< StormByte::Safe::String > Error () const
 Failure text.
void Fail (StormByte::Safe::String reason) noexcept
 Marks the stage as failed and notifies connected stages.
void Fail () noexcept
 Marks failure without storing a message or allocating.
STORMBYTE_FORCE_INLINE void Fail (const char *reason) noexcept
 Copies a null-terminated failure literal into Safe storage.
void Fail (std::string_view reason) noexcept
 Copies borrowed failure text before calling the DLL-safe overload.

Friends

class Backend::Pipeline::Demuxer
class Backend::Pipeline::Detail::Worker::Demux
class Decoder
class Filters
class Muxer
Decoder & operator>> (Demuxer &demuxer, Decoder &decoder)
 Binds one origin track of demuxer to decoder.
Demuxer & operator>> (class Plan &&plan, Demuxer &demuxer) noexcept
Demuxer & operator>> (StormByte::Safe::Shared< class Plan > plan, Demuxer &demuxer)
 Transfers a shared intention without slicing its dynamic type.
Muxer & operator>> (Demuxer &demuxer, Muxer &muxer)
 Binds demuxer as remux origin and forwards Plan attachments.
Remuxer & operator>> (Demuxer &demuxer, Remuxer &remuxer)
 Binds origin track remuxer.In() from demuxer onto remuxer.

Additional Inherited Members

Protected Member Functions inherited from StormByte::Multimedia::Pipeline::Step
bool Connect (Step &downstream) noexcept
 Registers a borrowed downstream stage and shares any bound plan.
bool WaitPlan () noexcept
 Waits interruptibly for the shared plan to enter Running.
Backend::Pipeline::Pipe & pipe () noexcept
const Backend::Pipeline::Pipe & pipe () const noexcept
 Step (StormByte::Safe::Shared< StormByte::Logger::Log > log, enum Producer name, Kinds receives, Kinds produces)
 Constructs a stage in State::Created.
void Emit (Item::PointerType item) noexcept
 Sends item to connected consumers.
Item::PointerType CloneItem (const Item &item) const
 Creates a distinct item through Item::Clone.
virtual void Wait () noexcept
 Waits until input is available, the stage fails or stops, or WakeNow.
virtual void AfterWait () noexcept
 Work on the waiting worker after Wait unblocks.
void Launch () noexcept
 Starts stage initialization and processing.
void Halt () noexcept
 Stops the stage and waits for execution to finish.
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
void Mount (StormByte::Safe::Unique< Backend::Pipeline::Pumper > pumper, StormByte::Safe::Unique< Backend::Pipeline::Worker > worker)
virtual StormByte::Safe::String Label () const
 Display name of this step.
Protected Attributes inherited from StormByte::Multimedia::Pipeline::Step
StormByte::Safe::Shared< StormByte::Logger::Log > m_log
 Scoped logger retained through Base-heap shared ownership.
enum Producer m_name
 UseLog leaf / default Label.
Kinds m_receives
 Receives.
Kinds m_produces
 Produces.

Detailed Description

Reads interleaved compressed packets from the Plan reader.

Only tracks listed in the bound Plan are emitted. Binding a second Plan fails the stage. Input comes from the Plan's seekable StormByte::Buffer::IO::BufferedLocationReader.

With Filter::ProcessTwoPasses filters, the required tracks are read for measurement first. Once measurement completes, the source is rewound and read again for the output pass.

Progress() returns a shared, read-only progress handle that remains usable after the pipeline has been destroyed. It includes filtering and output progress for the same job.

Each packet receives a serial number within its origin track and part zero. This identifies source lineage, not frame count.

Constructor & Destructor Documentation

◆ Demuxer() [1/4]

Demuxer.

Launches; Setup waits for a Plan.

Parameters
logShared logger. Empty pointer means no log.

◆ Demuxer() [2/4]

Launch with a clock already used by duration resolution.

Parameters
logShared logger.
progressShared job clock; empty creates a fresh clock.

◆ Demuxer() [3/4]

Copy constructor.

Parameters
otherSource demuxer.

◆ Demuxer() [4/4]

Move constructor.

Parameters
otherDemuxer to take.

◆ ~Demuxer()

StormByte::Multimedia::Pipeline::Demuxer::~Demuxer ( )
overridenoexcept

Destructor.

Step::Join Halt s before backends die.

Member Function Documentation

◆ Eof()

bool StormByte::Multimedia::Pipeline::Demuxer::Eof ( ) const
noexcept

Whether the last read hit EOF.

Returns
true at end of source of the Process pass.

Measurement end-of-file is cleared before the output pass.

◆ operator bool()

StormByte::Multimedia::Pipeline::Demuxer::operator bool ( ) const
explicitnoexcept

true if open, not failed and not at EOF.

Returns
Open and readable.

◆ operator=() [1/2]

Demuxer & StormByte::Multimedia::Pipeline::Demuxer::operator= ( const Demuxer & other)
delete

Copy assignment.

Parameters
otherSource demuxer.
Returns
*this.

◆ operator=() [2/2]

Demuxer & StormByte::Multimedia::Pipeline::Demuxer::operator= ( Demuxer && other)
deletenoexcept

Move assignment.

Parameters
otherDemuxer to take.
Returns
*this.

◆ Position()

StormByte::Safe::Optional< Property::Duration > StormByte::Multimedia::Pipeline::Demuxer::Position ( ) const

Presentation time of the last emitted packet.

Returns
Pts, or empty until a packet with Pts arrives.

◆ Progress()

Progress::Pointer StormByte::Multimedia::Pipeline::Demuxer::Progress ( ) const
noexcept

Job clock for this tube (measure, analytics, All).

Not Demuxer-only: Filters and the Muxer write the same object. Shared so the user can keep it after the tube dies. No public setters.

Returns
Const shared handle. Never empty.

◆ Backend::Pipeline::Demuxer

friend class Backend::Pipeline::Demuxer
friend

◆ Backend::Pipeline::Detail::Worker::Demux

friend class Backend::Pipeline::Detail::Worker::Demux
friend

◆ Decoder

friend class Decoder
friend

◆ Filters

friend class Filters
friend

◆ Muxer

friend class Muxer
friend

◆ operator>> [1/5]

Demuxer & operator>> ( class Plan && plan,
Demuxer & demuxer )
friend

◆ operator>> [2/5]

Decoder & operator>> ( Demuxer & demuxer,
Decoder & decoder )
friend

Binds one origin track of demuxer to decoder.

Parameters
demuxerOrigin demuxer.
decoderDestination decoder.
Returns
decoder.

◆ operator>> [3/5]

Muxer & operator>> ( Demuxer & demuxer,
Muxer & muxer )
friend

Binds demuxer as remux origin and forwards Plan attachments.

Required when any remux track is reserved. Without it the muxer cannot clone origin codec parameters. Also shares the tube Progress clock. Does not open the writer during connection. There is no file >> muxer and no muxer >> path.

Parameters
demuxerOrigin demuxer. Must outlive header write.
muxerDestination.
Returns
muxer.

◆ operator>> [4/5]

Remuxer & operator>> ( Demuxer & demuxer,
Remuxer & remuxer )
friend

Binds origin track remuxer.In() from demuxer onto remuxer.

Parameters
demuxerOrigin demuxer.
remuxerDestination remuxer.
Returns
remuxer.

◆ operator>> [5/5]

Demuxer & operator>> ( StormByte::Safe::Shared< class Plan > plan,
Demuxer & demuxer )
friend

Transfers a shared intention without slicing its dynamic type.

Parameters
planProvider-created intention owner.
demuxerDestination stage.
Returns
Destination stage.

The documentation for this class was generated from the following file: