StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
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:
Collaboration diagram for StormByte::Multimedia::Pipeline::Decoder:

Public Member Functions

 Decoder (StormByte::Safe::Shared< StormByte::Logger::Log > log, int track, EncodeLook tag)
 Post-encode recon for Analytics.
 Decoder (StormByte::Safe::Shared< StormByte::Logger::Log > log, int track, RemuxLook tag)
 Post-remux recon for Analytics.
 Decoder (StormByte::Safe::Shared< StormByte::Logger::Log > log, int track, SourceLook tag)
 Packet-origin recon for Analytics (Demuxer remux stretch).
Lifecycle
 Decoder (StormByte::Safe::Shared< StormByte::Logger::Log > log, int track, DecoderFlags flags=DecoderFlags{})
 Decoder for one origin track.
 Decoder (const Decoder &other)=delete
 Copy constructor.
 Decoder (Decoder &&other) noexcept=delete
 Move constructor.
 ~Decoder () noexcept override
 Destructor.
Decoder & operator= (const Decoder &other)=delete
 Copy assignment.
Decoder & operator= (Decoder &&other) noexcept=delete
 Move assignment.
 operator bool () const noexcept
 true if open and not failed.
Track
int Index () const noexcept
 Bound origin track.
StormByte::Size InputCeiling () const noexcept override
 Maximum number of queued input packets.
const DecoderFlags & Flags () const noexcept
 Flags.
void Flags (DecoderFlags flags) noexcept
 Replaces flags (before demuxer >> decoder).
const StormByte::Safe::Optional< StormByte::Safe::String > & Language () const noexcept
 Stream language tag copied from the origin File.
const StormByte::Safe::Optional< StormByte::Safe::String > & Title () const noexcept
 Stream title tag copied from the origin File.
Implementation selection
const StormByte::Safe::Optional< StormByte::Safe::String > & Implementation () const noexcept
 Pinned FFmpeg decoder name, if any.
void Implementation (StormByte::Safe::String name) noexcept
 Pins an FFmpeg decoder name (before demuxer >> decoder).
DecodeAcceleration Acceleration () const noexcept
 Video decode acceleration policy, independent of encoder selection.
void Acceleration (DecodeAcceleration acceleration) noexcept
 Sets video decode acceleration before the decoder is wired.
const Features & Require () const noexcept
 Extra required Feature bits.
void Require (Features features) noexcept
 Replaces extra required Feature bits.
const Features & Capabilities () const noexcept
 Features of the opened implementation.
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.
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::Decoder
class Backend::Pipeline::Demuxer
class Backend::Pipeline::Detail::Worker::Decode
class Demuxer
class Filters
class Route
Decoder & operator>> (Demuxer &demuxer, Decoder &decoder)
 Binds one origin track of demuxer to decoder.

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

Decodes packets of one origin track into frames.

Each produced frame carries the serial number and decoding timestamp of its source packet. Parts distinguish frames from the same packet; serial numbers are not decoded-frame counts.

Filters can supply decoded pictures for analytics on compressed-packet connections. Source pictures identify Producer::Decoder; destination pictures identify the supplying Producer::Encoder or Producer::Remuxer.

Two-pass processing completes the measurement pass before decoding the source again for the output pass. Logging identifies the selected decoder and origin track; the supplied logger controls throttling.

Constructor & Destructor Documentation

◆ Decoder() [1/6]

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/6]

Copy constructor.

Parameters
otherSource decoder.

◆ Decoder() [3/6]

Move constructor.

Parameters
otherDecoder to take.

◆ ~Decoder()

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

Destructor.

Step::Join Halt s before backends die.

◆ Decoder() [4/6]

Post-encode recon for Analytics.

Parameters
logShared logger.
trackOrigin stream index (same as Encoder).
tagEncode-look tag.

Not callable from user code. Open does not wait for a Demuxer. The first Packet that carries codec parameters opens the backend. Produced frames are stamped Producer::Encoder. Label is Decoder(look encode).

◆ Decoder() [5/6]

Post-remux recon for Analytics.

Parameters
logShared logger.
trackOrigin stream index (same as Remuxer).
tagRemux-look tag.

Not callable from user code. Same open path as the encode-look constructor. Produced frames are stamped Producer::Remuxer. Label is Decoder(look remux).

◆ Decoder() [6/6]

Packet-origin recon for Analytics (Demuxer remux stretch).

Parameters
logShared logger.
trackOrigin stream index.
tagSource-look tag.

Not callable from user code. Same open path as the encode-look constructor (codecpar on first Packet). Produced frames keep Producer::Decoder.

Member Function Documentation

◆ Acceleration() [1/2]

DecodeAcceleration StormByte::Multimedia::Pipeline::Decoder::Acceleration ( ) const
inlinenoexcept

Video decode acceleration policy, independent of encoder selection.

Returns
Configured policy.

◆ Acceleration() [2/2]

void StormByte::Multimedia::Pipeline::Decoder::Acceleration ( DecodeAcceleration acceleration)
inlinenoexcept

Sets video decode acceleration before the decoder is wired.

Parameters
accelerationAuto attempts supported hardware then software; Software forces CPU decode.

◆ 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 StormByte::Safe::Optional< StormByte::Safe::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 ( StormByte::Safe::String name)
noexcept

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

Parameters
nameTable name. Empty explicitly selects automatic decoding, without inheriting a pin from the Plan.

◆ Index()

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

Bound origin track.

Returns
Track.

◆ InputCeiling()

StormByte::Size StormByte::Multimedia::Pipeline::Decoder::InputCeiling ( ) const
overridevirtualnoexcept

Maximum number of queued input packets.

Returns
Packet limit, or 0 if no input queue exists.

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

◆ Language()

const StormByte::Safe::Optional< StormByte::Safe::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 StormByte::Safe::Optional< StormByte::Safe::String > & StormByte::Multimedia::Pipeline::Decoder::Title ( ) const
inlinenoexcept

Stream title tag copied from the origin File.

Returns
Title, or empty.

◆ Backend::Pipeline::Decoder

friend class Backend::Pipeline::Decoder
friend

◆ Backend::Pipeline::Demuxer

friend class Backend::Pipeline::Demuxer
friend

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

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

◆ Demuxer

friend class Demuxer
friend

◆ Filters

friend class Filters
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: