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

One decoded access unit. More...

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

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

Public Types

using PointerType = std::shared_ptr< Frame >
 

Public Member Functions

Timing and identity
const std::optional< Property::Duration > & Pts () const noexcept
 Presentation timestamp on the stream clock.
 
const std::optional< Property::Duration > & Dts () const noexcept
 Decode timestamp on the stream clock.
 
const std::optional< Property::Duration > & Duration () const noexcept
 Frame duration on the stream clock.
 
const std::optional< std::string > & Language () const noexcept
 Stream language tag copied from File metadata.
 
const std::optional< std::string > & Title () const noexcept
 Stream title tag copied from File metadata.
 
Lineage
const std::optional< std::uint64_t > & Serial () const noexcept
 Monotonic lineage id assigned when the unit enters the pipe.
 
std::uint64_t Part () const noexcept
 Sub-id inside Serial when one demuxed unit yields several frames.
 
Properties
const std::optional< Property::Video > & Video () const noexcept
 Video properties (includes HDR10 when set).
 
const std::optional< Property::Audio > & Audio () const noexcept
 Audio properties (layout, rate, channels).
 
const std::vector< class SideData > & Attachments () const noexcept
 Raw side data captured at receive.
 
Payload
StormByte::Buffer::FIFO & Payload () noexcept
 Payload.
 
const StormByte::Buffer::FIFO & Payload () const noexcept
 Payload already materialised, or empty.
 
- Public Member Functions inherited from StormByte::Multimedia::Pipeline::Item
Kind Kind () const noexcept
 Whether this unit is a frame or a packet.
 
enum StormByte::Multimedia::Type Type () const noexcept
 Media of this access unit.
 
int Track () const noexcept
 Origin track index.
 
enum Producer Producer () const noexcept
 Stage that created this unit.
 
virtual ~Item () noexcept=default
 Destructor.
 

Friends

class Backend::Pipeline::Frame
 
class Decoder
 
class Encoder
 
class Filter::FFmpeg
 
Decoderoperator>> (Decoder &decoder, Frame &frame) noexcept
 
Frameoperator>> (Frame &frame, Encoder &encoder) noexcept
 

Construction

 Frame () noexcept
 Empty frame.
 
 Frame (int track, enum StormByte::Multimedia::Type type, enum Producer producer, StormByte::Buffer::FIFO payload, std::optional< Property::Duration > pts, std::optional< Property::Duration > duration, std::optional< Property::Video > video, std::vector< class SideData > attachments, std::optional< Property::Audio > audio, std::uint64_t serial, std::uint64_t part) noexcept
 Builds a frame without a backend buffer.
 
 Frame (Frame &&other) noexcept
 Move constructor.
 
 ~Frame () noexcept override
 Destructor.
 
Frameoperator= (Frame &&other) noexcept
 Move assignment.
 

Additional Inherited Members

- Protected Member Functions inherited from StormByte::Multimedia::Pipeline::Item
 Item (const Item &other) noexcept=default
 Copy constructor.
 
 Item (Item &&other) noexcept=default
 Move constructor.
 
Itemoperator= (const Item &other) noexcept=default
 Copy assignment.
 
Itemoperator= (Item &&other) noexcept=default
 Move assignment.
 

Detailed Description

One decoded access unit.

In libav that is an AVFrame: one picture or one block of samples after decode. In Multimedia it is what process and analytics filters, and Encoder, see — pixels or samples, timestamps and the stream tags the decoder copied across.

See also
Item
Packet

Member Typedef Documentation

◆ PointerType

Constructor & Destructor Documentation

◆ Frame() [1/3]

◆ Frame() [2/3]

StormByte::Multimedia::Pipeline::Frame::Frame ( int  track,
enum StormByte::Multimedia::Type  type,
enum Producer  producer,
StormByte::Buffer::FIFO  payload,
std::optional< Property::Duration pts,
std::optional< Property::Duration duration,
std::optional< Property::Video video,
std::vector< class SideData attachments,
std::optional< Property::Audio audio,
std::uint64_t  serial,
std::uint64_t  part 
)
noexcept

Builds a frame without a backend buffer.

Parameters
trackOrigin container stream index.
typeMedia of this unit (Video, Audio or Subtitle).
producerStep that created this unit.
payloadOwned sample / plane bytes.
ptsPresentation timestamp, if known.
durationFrame duration, if known.
videoVideo properties, if this is a video frame.
attachmentsRaw side-data blobs.
audioAudio properties, if this is an audio frame.
serialLineage id born at the demuxer for this origin track.
partSub-id inside serial. Zero when the demuxed unit did not split.

Dts starts empty. Decoder stamps it from the packet that produced this frame. There is no public setter.

◆ Frame() [3/3]

Move constructor.

Parameters
otherFrame to take.

Container-safe: other becomes the empty sentinel (Item::Type Unknown, track -1, no backend). ~Frame on a moved-from object is a no-op. Copy stays private.

◆ ~Frame()

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

Destructor.

Member Function Documentation

◆ Attachments()

const std::vector< class SideData > & StormByte::Multimedia::Pipeline::Frame::Attachments ( ) const
inlinenoexcept

Raw side data captured at receive.

Read-only.

Returns
Blobs. MDM/CLL also appear in Video() HDR10 when the decoder could map them.

◆ Audio()

const std::optional< Property::Audio > & StormByte::Multimedia::Pipeline::Frame::Audio ( ) const
inlinenoexcept

Audio properties (layout, rate, channels).

Returns
Audio, or empty.

◆ Dts()

const std::optional< Property::Duration > & StormByte::Multimedia::Pipeline::Frame::Dts ( ) const
inlinenoexcept

Decode timestamp on the stream clock.

Copied by Decoder from the compressed packet that produced this frame. Empty when that packet had no Dts, or when the unit was not stamped. There is no public setter; friendship writes m_dts.

Returns
Dts, or empty.

◆ Duration()

const std::optional< Property::Duration > & StormByte::Multimedia::Pipeline::Frame::Duration ( ) const
inlinenoexcept

Frame duration on the stream clock.

Returns
Duration, or empty.

◆ Language()

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

Stream language tag copied from File metadata.

Returns
Language, or empty if the stream had none.

◆ operator=()

Frame & StormByte::Multimedia::Pipeline::Frame::operator= ( Frame &&  other)
noexcept

Move assignment.

Parameters
otherFrame to take.
Returns
*this.

Same as the move constructor: other is left empty.

◆ Part()

std::uint64_t StormByte::Multimedia::Pipeline::Frame::Part ( ) const
inlinenoexcept

Sub-id inside Serial when one demuxed unit yields several frames.

Returns
Zero when the unit did not split; 0, 1, … after a split.

Downstream stages copy this value. It is not a pipe-wide counter.

◆ Payload() [1/2]

const StormByte::Buffer::FIFO & StormByte::Multimedia::Pipeline::Frame::Payload ( ) const
inlinenoexcept

Payload already materialised, or empty.

Returns
FIFO. Does not pull planes out of the backend.

◆ Payload() [2/2]

StormByte::Buffer::FIFO & StormByte::Multimedia::Pipeline::Frame::Payload ( )
noexcept

Payload.

Materialises planes on first call if a backend frame is held.

Returns
FIFO.

After materialisation the backend stays alive; a later filter Save replaces it and this FIFO is cleared.

◆ Pts()

const std::optional< Property::Duration > & StormByte::Multimedia::Pipeline::Frame::Pts ( ) const
inlinenoexcept

Presentation timestamp on the stream clock.

Returns
Pts, or empty.

◆ Serial()

const std::optional< std::uint64_t > & StormByte::Multimedia::Pipeline::Frame::Serial ( ) const
inlinenoexcept

Monotonic lineage id assigned when the unit enters the pipe.

Returns
Serial born at the demuxer for this origin track; empty on the sentinel.

This is not a decoded-frame count and not an FFmpeg nb_frames / nb_read_frames figure. It identifies one demuxed access unit as it travels Demuxer → … → Muxer. Downstream stages copy it. Part distinguishes several frames born from the same serial.

◆ Title()

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

Stream title tag copied from File metadata.

Returns
Title, or empty if the stream had none.

◆ Video()

const std::optional< Property::Video > & StormByte::Multimedia::Pipeline::Frame::Video ( ) const
inlinenoexcept

Video properties (includes HDR10 when set).

Returns
Video, or empty.

Friends And Related Symbol Documentation

◆ Backend::Pipeline::Frame

friend class Backend::Pipeline::Frame
friend

◆ Decoder

friend class Decoder
friend

◆ Encoder

friend class Encoder
friend

◆ Filter::FFmpeg

friend class Filter::FFmpeg
friend

◆ operator>> [1/2]

Decoder & operator>> ( Decoder decoder,
Frame frame 
)
friend

◆ operator>> [2/2]

Frame & operator>> ( Frame frame,
Encoder encoder 
)
friend

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