StormByte C++ Library: Multimedia module 0.0.9999
StormByte-Multimedia is a StormByte library module for parsing configuration files
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
StormByte::Multimedia::Pipeline::Demuxer Class Referencefinal

Reads interleaved packets from a File origin. More...

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

Inheritance diagram for StormByte::Multimedia::Pipeline::Demuxer:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Multimedia::Pipeline::Demuxer:
Collaboration graph
[legend]

Public Member Functions

 operator bool () const noexcept
 true if open, not failed and not at EOF.
 
Lifecycle
 Demuxer (std::shared_ptr< StormByte::Logger::Log > log) noexcept
 Demuxer.
 
 Demuxer (const Demuxer &other)=delete
 Copy constructor.
 
 Demuxer (Demuxer &&other) noexcept=delete
 Move constructor.
 
 ~Demuxer () noexcept override
 Destructor.
 
Demuxeroperator= (const Demuxer &other)=delete
 Copy assignment.
 
Demuxeroperator= (Demuxer &&other) noexcept=delete
 Move assignment.
 
Source
bool Eof () const noexcept
 Whether the last read hit EOF.
 
std::optional< Property::DurationPosition () const noexcept
 Presentation time of the last emitted packet.
 
- Public Member Functions inherited from StormByte::Multimedia::Pipeline::Step
 Step (const Step &other)=delete
 
 Step (Step &&other) noexcept=delete
 
virtual ~Step () noexcept
 Destructor.
 
Stepoperator= (const Step &other)=delete
 
Stepoperator= (Step &&other) noexcept=delete
 
std::condition_variable & Wake () noexcept
 Consumer condition variable.
 
const std::shared_ptr< class Plan > & Plan () const noexcept
 Bound job intention, if any.
 
const KindsReceives () const noexcept
 Kinds this step consumes.
 
const KindsProduces () 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.
 
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.
 

Friends

class Backend::Pipeline::Demuxer
 
class Backend::Pipeline::Detail::Worker::Demux
 
class Decoder
 
class Muxer
 
Decoderoperator>> (Demuxer &demuxer, Decoder &decoder) noexcept
 Binds one origin track of demuxer to decoder.
 
Demuxeroperator>> (class Plan &&plan, Demuxer &demuxer) noexcept
 Hands plan to demuxer.
 
Muxeroperator>> (Demuxer &demuxer, Muxer &muxer) noexcept
 Binds demuxer as remux origin and forwards its attachments.
 
Remuxeroperator>> (Demuxer &demuxer, Remuxer &remuxer) noexcept
 Binds origin track remuxer.In() from demuxer onto remuxer.
 

Additional Inherited Members

- Protected Member Functions inherited from StormByte::Multimedia::Pipeline::Step
Backend::Pipeline::Pipe & pipe () noexcept
 In / out hoppers of this stage.
 
const Backend::Pipeline::Pipe & pipe () const noexcept
 In / out hoppers of this stage.
 
 Step (std::shared_ptr< StormByte::Logger::Log > log, enum Producer name, Kinds receives, Kinds produces) noexcept
 Step in State::Created.
 
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.
 
virtual std::string Label () const noexcept
 Display name of this step.
 
- Protected Attributes inherited from StormByte::Multimedia::Pipeline::Step
std::shared_ptr< StormByte::Logger::Log > m_log
 
enum Producer m_name
 UseLog leaf / default Label.
 
Kinds m_receives
 Receives.
 
Kinds m_produces
 Produces.
 

Detailed Description

Reads interleaved packets from a File origin.

Reads interleaved compressed packets from the Plan origin.

Only tracks listed in the bound Plan enter the tube. An origin stream omitted from Plan::add is never pushed.

Notice: origin path at Setup, eof once. Debug: bind to a decoder and Process min/max at source EoF. LowLevel unit lines always; the shared logger throttles. Each Read+Emit is timed by the Source pumper.

Wrap assigns the next Packet::Serial for that origin track and Part zero. That id is pipe lineage, not an FFmpeg frame count.

Constructor & Destructor Documentation

◆ Demuxer() [1/3]

StormByte::Multimedia::Pipeline::Demuxer::Demuxer ( std::shared_ptr< StormByte::Logger::Log >  log)
explicitnoexcept

Demuxer.

Launches; Setup waits for a Plan.

Parameters
logShared logger. Empty pointer means no log.

◆ Demuxer() [2/3]

Copy constructor.

Parameters
otherSource demuxer.

◆ Demuxer() [3/3]

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.

◆ 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()

std::optional< Property::Duration > StormByte::Multimedia::Pipeline::Demuxer::Position ( ) const
noexcept

Presentation time of the last emitted packet.

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

Friends And Related Symbol Documentation

◆ 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

◆ Muxer

friend class Muxer
friend

◆ operator>> [1/4]

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

Hands plan to demuxer.

Not a Step bind.

Parameters
planIntention (moved).
demuxerDestination.
Returns
demuxer.

Stores the Plan on the Demuxer and wakes it. Does not call Plan::Check and does not bind hoppers.

◆ operator>> [2/4]

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

Binds one origin track of demuxer to decoder.

Parameters
demuxerOrigin demuxer.
decoderDestination decoder.
Returns
decoder.

◆ operator>> [3/4]

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

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.

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

◆ operator>> [4/4]

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

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

Parameters
demuxerOrigin demuxer.
remuxerDestination remuxer.
Returns
remuxer.

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