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

Owns the filter chain of one origin track and two ends. More...

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

Public Member Functions

int Track () const noexcept
 Origin track.
 
RouteAdd (std::shared_ptr< Filter::FFmpeg > filter) noexcept
 Takes ownership of filter, hooks it and launches it.
 
template<typename T , typename... Args>
RouteAdd (Args &&... args) noexcept
 Constructs a leaf of type T on this track.
 
bool Idle () const noexcept
 Whether every owned worker has left Ready.
 
std::vector< Filter::ReportReports () const noexcept
 Reports of every kept filter.
 
Lifecycle
 Route (int track, std::shared_ptr< Step > origin, std::shared_ptr< Step > destination) noexcept
 Route for one origin track and its two ends.
 
 Route (const Route &other)=delete
 Copy constructor.
 
 Route (Route &&other) noexcept=delete
 Move constructor.
 
 ~Route () noexcept
 Destructor.
 
Routeoperator= (const Route &other)=delete
 Copy assignment.
 
Routeoperator= (Route &&other) noexcept=delete
 Move assignment.
 

Friends

class Filters
 

Detailed Description

Owns the filter chain of one origin track and two ends.

Advanced API. Construct origin and destination as std::shared_ptr<Step>. Multimedia recommends std::make_shared so the last owner destroys the Step.

Packet / BSF filters may sit between Demuxer and Remuxer. Frame / Process filters on that stretch fail at Close. Encode lanes use Frame and Packet filters between Decoder and Encoder.

Analytics is not a process node. Close wires Process from origin to destination. Frame origins Backend::Pipeline::Pipe::CloneTo the origin Pipe onto each Analytics (decode look). Packet origins spawn a Route-owned Decoder so Analytics still sees frames with Producer::Decoder. Destination packet producers spawn a look Decoder from a CloneTo of dest Out. The last Analytics Pipe Out is StormByte::Buffer::Sink::Drain.

Close is private: add Routes through Filters and call Filters::Close. CloneTo the origin before it emits.

Muxer closed is not the end of this Route. Wait Idle before Reports.

Constructor & Destructor Documentation

◆ Route() [1/3]

StormByte::Multimedia::Pipeline::Route::Route ( int  track,
std::shared_ptr< Step origin,
std::shared_ptr< Step destination 
)
noexcept

Route for one origin track and its two ends.

Parameters
trackOrigin stream index.
originProducer (Decoder / Demuxer). Must not be empty.
destinationConsumer (Encoder / Remuxer / Muxer). Must not be empty.

Both ends are real shared_ptr. The Step dies when the last Route, Transcoder lane or caller drops it.

◆ Route() [2/3]

StormByte::Multimedia::Pipeline::Route::Route ( const Route other)
delete

Copy constructor.

Parameters
otherSource route.

◆ Route() [3/3]

StormByte::Multimedia::Pipeline::Route::Route ( Route &&  other)
deletenoexcept

Move constructor.

Parameters
otherRoute to take.

◆ ~Route()

StormByte::Multimedia::Pipeline::Route::~Route ( )
noexcept

Destructor.

Halts owned filters and look Decoders while those objects are still complete.

Member Function Documentation

◆ Add() [1/2]

template<typename T , typename... Args>
Route & StormByte::Multimedia::Pipeline::Route::Add ( Args &&...  args)
inlinenoexcept

Constructs a leaf of type T on this track.

Template Parameters
TProcess, Packet or Analytics leaf.
ArgsConstructor arguments.
Parameters
argsForwarded to T.
Returns
*this.

◆ Add() [2/2]

Route & StormByte::Multimedia::Pipeline::Route::Add ( std::shared_ptr< Filter::FFmpeg filter)
noexcept

Takes ownership of filter, hooks it and launches it.

Parameters
filterProcess, Packet or Analytics leaf.
Returns
*this.

A leaf that is not Process, Packet or Analytics fails the filter. Launch starts the worker; the worker waits on the Pipe until Filters::Close binds a hopper.

◆ Idle()

bool StormByte::Multimedia::Pipeline::Route::Idle ( ) const
noexcept

Whether every owned worker has left Ready.

Returns
true when all filters and look Decoders are Stopped or Failed.

False while Analytics is still pairing looks. Wait this before Reports on a hand-built tube.

◆ operator=() [1/2]

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

Copy assignment.

Parameters
otherSource route.
Returns
*this.

◆ operator=() [2/2]

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

Move assignment.

Parameters
otherRoute to take.
Returns
*this.

◆ Reports()

std::vector< Filter::Report > StormByte::Multimedia::Pipeline::Route::Reports ( ) const
noexcept

Reports of every kept filter.

Returns
One entry per owned filter, in Add order.

Call after Idle.

◆ Track()

int StormByte::Multimedia::Pipeline::Route::Track ( ) const
noexcept

Origin track.

Returns
Stream index passed to the constructor.

Friends And Related Symbol Documentation

◆ Filters

friend class Filters
friend

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