One decoded access unit. More...
#include <StormByte/multimedia/pipeline/frame.hxx>


Public Types | |
| using | PointerType = StormByte::Safe::Shared<Frame> |
| Base-heap shared owner of a frame; keep its providers loaded. | |
Public Member Functions | |
Construction | |
| Frame () | |
| Empty frame. | |
| Frame (int track, enum StormByte::Multimedia::Type type, enum Producer producer, StormByte::Buffer::FIFO payload, StormByte::Safe::Optional< Property::Duration > pts, StormByte::Safe::Optional< Property::Duration > duration, StormByte::Safe::Optional< Property::Video > video, StormByte::Safe::Vector< class SideData > attachments, StormByte::Safe::Optional< Property::Audio > audio, std::uint64_t serial, std::uint64_t part) | |
| Builds a frame from supplied media bytes and properties. | |
| Frame (const Frame &other) | |
| Copy. | |
| Frame (Frame &&other) noexcept | |
| Move constructor. | |
| ~Frame () noexcept override | |
| Destructor. | |
| Frame & | operator= (const Frame &other) |
| Copy assignment. | |
| Frame & | operator= (Frame &&other) noexcept |
| Move assignment. | |
Timing and identity | |
| const StormByte::Safe::Optional< Property::Duration > & | Pts () const noexcept |
| Presentation timestamp on the stream clock. | |
| const StormByte::Safe::Optional< Property::Duration > & | Dts () const noexcept |
| Decode timestamp on the stream clock. | |
| const StormByte::Safe::Optional< Property::Duration > & | Duration () const noexcept |
| Frame duration on the stream clock. | |
| const StormByte::Safe::Optional< StormByte::Safe::String > & | Language () const noexcept |
| Stream language tag copied from File metadata. | |
| const StormByte::Safe::Optional< StormByte::Safe::String > & | Title () const noexcept |
| Stream title tag copied from File metadata. | |
Lineage | |
| const StormByte::Safe::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 StormByte::Safe::Optional< Property::Video > & | Video () const noexcept |
| Video properties (includes HDR10 when set). | |
| const StormByte::Safe::Optional< Property::Audio > & | Audio () const noexcept |
| Audio properties (layout, rate, channels). | |
| const StormByte::Safe::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. | |
| StormByte::ByteSize | BufferingWeight () const noexcept |
| Estimates the retained media payload weight for queue accounting. | |
| 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 |
| Allows the backend holder to access the frame's media storage. | |
| class | Decoder |
| Allows the decoder to populate decoded media and metadata. | |
| class | Encoder |
| Allows the encoder to access the backend frame. | |
| class | Filter::FFmpeg |
| Allows FFmpeg filters to update decoded media and metadata. | |
| Decoder & | operator>> (Decoder &decoder, Frame &frame) noexcept |
| Allows the extraction operator to fill a frame from a decoder. | |
| Frame & | operator>> (Frame &frame, Encoder &encoder) noexcept |
| Allows the insertion operator to submit a frame to an encoder. | |
Additional Inherited Members | |
| Protected Types inherited from StormByte::Safe::Clonable< Item > | |
| typedef SmartPointer | PointerType |
| Item (const Item &other) noexcept=default | |
| Copy constructor. | |
| Item (Item &&other) noexcept=default | |
| Move constructor. | |
| Item & | operator= (const Item &other) noexcept=default |
| Copy assignment. | |
| Item & | operator= (Item &&other) noexcept=default |
| Move assignment. | |
| Protected Member Functions inherited from StormByte::Safe::Clonable< Item > | |
| constexpr | Clonable ()=default |
| constexpr Clonable & | operator= (const Clonable &)=default |
| virtual constexpr | ~Clonable () noexcept=default |
| Static Protected Member Functions inherited from StormByte::Safe::Clonable< Item > | |
| static PointerType | MakePointer (Args &&... args) |
One decoded access unit.
One picture or one block of decoded samples, consumed by process and analytics filters and Encoder. Provides pixels or samples, timestamps and the stream tags the decoder copied across.
Copies and Clone share media buffers rather than duplicating pixels or samples. Metadata accessors borrow their wrappers until this frame is modified or destroyed. Safe optional arrow access returns a read-only snapshot for the current full expression, not a stable pointer into the frame.
Base-heap shared owner of a frame; keep its providers loaded.
Empty frame.
Item::Type is StormByte::Multimedia::Type::Unknown. Item::Track is -1. Item::Kind is Kind::Frame.
| StormByte::Exception | If safe metadata storage cannot be allocated. |
| StormByte::Multimedia::Pipeline::Frame::Frame | ( | int | track, |
| enum StormByte::Multimedia::Type | type, | ||
| enum Producer | producer, | ||
| StormByte::Buffer::FIFO | payload, | ||
| StormByte::Safe::Optional< Property::Duration > | pts, | ||
| StormByte::Safe::Optional< Property::Duration > | duration, | ||
| StormByte::Safe::Optional< Property::Video > | video, | ||
| StormByte::Safe::Vector< class SideData > | attachments, | ||
| StormByte::Safe::Optional< Property::Audio > | audio, | ||
| std::uint64_t | serial, | ||
| std::uint64_t | part ) |
Builds a frame from supplied media bytes and properties.
| track | Origin container stream index. |
| type | Media of this unit (Video, Audio or Subtitle). |
| producer | Step that created this unit. |
| payload | Owned sample / plane bytes. |
| pts | Presentation timestamp, if known. |
| duration | Frame duration, if known. |
| video | Video properties, if this is a video frame. |
| attachments | Raw side-data blobs. |
| audio | Audio properties, if this is an audio frame. |
| serial | Lineage id born at the demuxer for this origin track. |
| part | Sub-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.
| StormByte::Exception | If safe metadata storage cannot be allocated. |
| StormByte::Multimedia::Pipeline::Frame::Frame | ( | const Frame & | other | ) |
Copy.
Metadata and FIFO handle are copied; the libav frame is referenced (av_frame_ref).
| other | Source frame. |
Not a deep copy of planes. Clone uses this constructor. Filter::FFmpeg::Save still emits a new frame when a filter paints.
| StormByte::Exception | If safe metadata storage cannot be copied. |
| std::bad_alloc | If the private backend holder cannot be allocated. |
|
noexcept |
Move constructor.
| other | Frame to take. |
Container-safe: other becomes the empty sentinel (Item::Type Unknown, track -1, no media). ~Frame on a moved-from object is a no-op.
|
overridenoexcept |
Destructor.
|
inlinenoexcept |
Raw side data captured at receive.
Read-only.
|
inlinenoexcept |
Audio properties (layout, rate, channels).
|
noexcept |
|
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.
|
inlinenoexcept |
Frame duration on the stream clock.
|
inlinenoexcept |
Copy assignment.
Same as the copy constructor.
| other | Source frame. |
| StormByte::Exception | If safe metadata storage cannot be copied. |
| std::bad_alloc | If the private backend holder cannot be allocated. |
Move assignment.
| other | Frame to take. |
Same as the move constructor: other is left empty.
|
inlinenoexcept |
Sub-id inside Serial when one demuxed unit yields several frames.
Downstream stages copy this value. It is not a pipe-wide counter.
|
inlinenoexcept |
Payload already materialised, or empty.
|
noexcept |
Payload.
Materializes decoded media bytes on first access.
Materialization preserves the decoded media. Filtering that replaces the media invalidates the previously materialized bytes.
|
inlinenoexcept |
Presentation timestamp on the stream clock.
|
inlinenoexcept |
Monotonic lineage id assigned when the unit enters the pipe.
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.
|
inlinenoexcept |
|
inlinenoexcept |
Video properties (includes HDR10 when set).
|
friend |
Allows the backend holder to access the frame's media storage.
|
friend |
Allows the decoder to populate decoded media and metadata.
|
friend |
Allows the encoder to access the backend frame.
|
friend |
Allows FFmpeg filters to update decoded media and metadata.