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

Decodes packets of one origin track into frames. More...

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

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

Public Member Functions

Lifecycle
 Decoder (std::shared_ptr< StormByte::Logger::Log > log, int track, DecoderFlags flags=DecoderFlags{}) noexcept
 Decoder for one origin track.
 
 Decoder (const Decoder &other)=delete
 Copy constructor.
 
 Decoder (Decoder &&other) noexcept=delete
 Move constructor.
 
 ~Decoder () noexcept override
 Destructor.
 
Decoderoperator= (const Decoder &other)=delete
 Copy assignment.
 
Decoderoperator= (Decoder &&other) noexcept=delete
 Move assignment.
 
 operator bool () const noexcept
 true if open and not failed.
 
Track
int Index () const noexcept
 Bound origin track.
 
std::size_t InputCeiling () const noexcept override
 Ceiling of the decoder input hopper.
 
const DecoderFlagsFlags () const noexcept
 Flags.
 
void Flags (DecoderFlags flags) noexcept
 Replaces flags (before demuxer >> decoder).
 
const std::optional< std::string > & Language () const noexcept
 Stream language tag copied from the origin File.
 
const std::optional< std::string > & Title () const noexcept
 Stream title tag copied from the origin File.
 
Implementation selection
const std::optional< std::string > & Implementation () const noexcept
 Pinned FFmpeg decoder name, if any.
 
void Implementation (std::string name) noexcept
 Pins an FFmpeg decoder name (before demuxer >> decoder).
 
const FeaturesRequire () const noexcept
 Extra required Feature bits.
 
void Require (Features features) noexcept
 Replaces extra required Feature bits.
 
const FeaturesCapabilities () const noexcept
 Features of the opened implementation.
 
- 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.
 
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::Decoder
 
class Backend::Pipeline::Detail::Worker::Decode
 
class Demuxer
 
class Route
 
Decoderoperator>> (Demuxer &demuxer, Decoder &decoder) noexcept
 Binds one origin track of demuxer to decoder.
 

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.
 
- 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

Decodes packets of one origin track into frames.

Notice: opened implementation, once. LowLevel unit lines always; the shared logger throttles. The Through pumper times each Process; source EoF dumps min/max at Debug.

Lineage: StampLineage copies the last accepted packet Serial onto each produced frame and advances Part. Dts of that packet is copied onto Frame::Dts. That is pipe lineage, not a decoded-frame count.

Origin frames leave through Step::Emit (analytics tap clone, then process). Dest-look frames also Emit; their Producer is the stage that fed the look (Producer::Encoder or Producer::Remuxer). Source-look frames keep Producer::Decoder.

Label is Decoder(<implementation>) after Open pins a table row, otherwise Decoder(t=<origin index>). Look mode is Decoder(look encode|remux|src t=<index>).

Look modes are not public constructors. Filters builds them when Analytics needs pictures from a packet stretch. Those decoders have no Demuxer: they open from the first Packet's codec parameters. The public ctor never enters look mode.

Constructor & Destructor Documentation

◆ Decoder() [1/3]

StormByte::Multimedia::Pipeline::Decoder::Decoder ( std::shared_ptr< StormByte::Logger::Log >  log,
int  track,
DecoderFlags  flags = DecoderFlags{} 
)
explicitnoexcept

Decoder for one origin track.

Parameters
logShared logger. Empty pointer means no log.
trackOrigin stream index.
flagsHeuristics / future bits. Empty = passthrough.

Origin mode. Frames carry Producer::Decoder. Setup waits for demuxer >> decoder.

◆ Decoder() [2/3]

Copy constructor.

Parameters
otherSource decoder.

◆ Decoder() [3/3]

Move constructor.

Parameters
otherDecoder to take.

◆ ~Decoder()

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

Destructor.

Step::Join Halt s before backends die.

Member Function Documentation

◆ Capabilities()

const Features & StormByte::Multimedia::Pipeline::Decoder::Capabilities ( ) const
inlinenoexcept

Features of the opened implementation.

Returns
Mask.

◆ Flags() [1/2]

const DecoderFlags & StormByte::Multimedia::Pipeline::Decoder::Flags ( ) const
inlinenoexcept

Flags.

Returns
Mask.

◆ Flags() [2/2]

void StormByte::Multimedia::Pipeline::Decoder::Flags ( DecoderFlags  flags)
inlinenoexcept

Replaces flags (before demuxer >> decoder).

Parameters
flagsNew mask.

◆ Implementation() [1/2]

const std::optional< std::string > & StormByte::Multimedia::Pipeline::Decoder::Implementation ( ) const
inlinenoexcept

Pinned FFmpeg decoder name, if any.

Returns
Name, or empty before pin / auto-select.

◆ Implementation() [2/2]

void StormByte::Multimedia::Pipeline::Decoder::Implementation ( std::string  name)
noexcept

Pins an FFmpeg decoder name (before demuxer >> decoder).

Parameters
nameTable name. Empty clears the pin.

◆ Index()

int StormByte::Multimedia::Pipeline::Decoder::Index ( ) const
inlinenoexcept

Bound origin track.

Returns
Track.

◆ InputCeiling()

std::size_t StormByte::Multimedia::Pipeline::Decoder::InputCeiling ( ) const
inlineoverridevirtualnoexcept

Ceiling of the decoder input hopper.

Returns
Max queued packets. Never 0.

Reimplemented from StormByte::Multimedia::Pipeline::Step.

◆ Language()

const std::optional< std::string > & StormByte::Multimedia::Pipeline::Decoder::Language ( ) const
inlinenoexcept

Stream language tag copied from the origin File.

Returns
Language, or empty.

◆ operator bool()

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

true if open and not failed.

Returns
Open and not Failed.

◆ operator=() [1/2]

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

Copy assignment.

Parameters
otherSource decoder.
Returns
*this.

◆ operator=() [2/2]

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

Move assignment.

Parameters
otherDecoder to take.
Returns
*this.

◆ Require() [1/2]

const Features & StormByte::Multimedia::Pipeline::Decoder::Require ( ) const
inlinenoexcept

Extra required Feature bits.

Returns
Mask.

◆ Require() [2/2]

void StormByte::Multimedia::Pipeline::Decoder::Require ( Features  features)
inlinenoexcept

Replaces extra required Feature bits.

Parameters
featuresBits the chosen table row must have.

◆ Title()

const std::optional< std::string > & StormByte::Multimedia::Pipeline::Decoder::Title ( ) const
inlinenoexcept

Stream title tag copied from the origin File.

Returns
Title, or empty.

Friends And Related Symbol Documentation

◆ Backend::Pipeline::Decoder

friend class Backend::Pipeline::Decoder
friend

◆ Backend::Pipeline::Detail::Worker::Decode

friend class Backend::Pipeline::Detail::Worker::Decode
friend

◆ Demuxer

friend class Demuxer
friend

◆ operator>>

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

Binds one origin track of demuxer to decoder.

Parameters
demuxerOrigin demuxer.
decoderDestination decoder.
Returns
decoder.

◆ Route

friend class Route
friend

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