StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Multimedia::Stream Class Reference

Public media stream snapshot. More...

#include <StormByte/multimedia/stream.hxx>

Public Types

using Properties
 Safe video and audio property snapshots, respectively.

Public Member Functions

 Stream ()
 Constructs an empty stream snapshot.
 Stream (const Stream &other)
 Copy constructor.
 Stream (Stream &&other) noexcept
 Move constructor.
 ~Stream () noexcept
 Destructor.
Stream & operator= (const Stream &other)
 Copies a snapshot and its borrowed codec.
Stream & operator= (Stream &&other) noexcept
 Transfers a snapshot and its borrowed codec.
int Index () const noexcept
 Container stream index (avformat).
const class Codec & Codec () const
 Codec of this stream.
Type Type () const noexcept
 Media kind of the codec.
const Metadata::Stream & Metadata () const noexcept
 Per-stream tags captured at Open.
const StormByte::Safe::Optional< Property::Duration > & Duration () const noexcept
 Stream duration.
const StormByte::Safe::Optional< Property::Video > & Video () const noexcept
 Video properties when this stream is video.
const StormByte::Safe::Optional< Property::Audio > & Audio () const noexcept
 Audio properties when this stream is audio.

Friends

class File

Detailed Description

Public media stream snapshot.

Multimedia stream facade.

One media stream: registry Codec, duration, properties and tags.

Copies share the same Codec instance. The Codec outlives every Stream. Default construction creates an empty stream with index -1 and Unknown type. Codec() throws for an empty stream. Copies retain a borrowed registry codec. Base, Multimedia and the registry must outlive all snapshots and callbacks.

Member Typedef Documentation

◆ Properties

Initial value:

Safe video and audio property snapshots, respectively.

Note
At most one optional is populated for a probed stream.

Constructor & Destructor Documentation

◆ Stream() [1/3]

StormByte::Multimedia::Stream::Stream ( )

Constructs an empty stream snapshot.

Exceptions
StormByte::ExceptionSafe storage initialization failed.

◆ Stream() [2/3]

StormByte::Multimedia::Stream::Stream ( const Stream & other)

Copy constructor.

Parameters
otherSnapshot to copy.
Exceptions
StormByte::ExceptionSafe storage copying failed.

◆ Stream() [3/3]

StormByte::Multimedia::Stream::Stream ( Stream && other)
noexcept

Move constructor.

Parameters
otherSnapshot to take.

◆ ~Stream()

StormByte::Multimedia::Stream::~Stream ( )
noexcept

Destructor.

Member Function Documentation

◆ Audio()

const StormByte::Safe::Optional< Property::Audio > & StormByte::Multimedia::Stream::Audio ( ) const
noexcept

Audio properties when this stream is audio.

Returns
Borrowed Safe optional, empty when audio properties are unavailable.
Note
Arrow access yields a temporary read-only snapshot, not retained storage.

◆ Codec()

const class Codec & StormByte::Multimedia::Stream::Codec ( ) const

Codec of this stream.

Returns
Registry codec.
Exceptions
StormByte::Multimedia::ExceptionThis snapshot is empty.

◆ Duration()

const StormByte::Safe::Optional< Property::Duration > & StormByte::Multimedia::Stream::Duration ( ) const
noexcept

Stream duration.

Returns
Duration, or empty if unknown.

Header value from Open, or a value filled by File::Duration() after a packet scan. Empty if it cannot be determined.

◆ Index()

int StormByte::Multimedia::Stream::Index ( ) const
inlinenoexcept

Container stream index (avformat).

Not the position in File::Streams().

Returns
Index used by packets and Decoder.

◆ Metadata()

const Metadata::Stream & StormByte::Multimedia::Stream::Metadata ( ) const
inlinenoexcept

Per-stream tags captured at Open.

Returns
Metadata snapshot.

◆ operator=() [1/2]

Stream & StormByte::Multimedia::Stream::operator= ( const Stream & other)

Copies a snapshot and its borrowed codec.

Parameters
otherSnapshot to copy.
Returns
*this.
Exceptions
StormByte::ExceptionSafe storage copying failed.

◆ operator=() [2/2]

Stream & StormByte::Multimedia::Stream::operator= ( Stream && other)
noexcept

Transfers a snapshot and its borrowed codec.

Parameters
otherSnapshot to take.
Returns
*this.

◆ Type()

Type StormByte::Multimedia::Stream::Type ( ) const
noexcept

Media kind of the codec.

Returns
Audio, Video, Subtitle, Attachment or Unknown.

◆ Video()

const StormByte::Safe::Optional< Property::Video > & StormByte::Multimedia::Stream::Video ( ) const
noexcept

Video properties when this stream is video.

Returns
Borrowed Safe optional, empty when video properties are unavailable.
Note
Arrow access yields a temporary read-only snapshot, not retained storage.

◆ File

friend class File
friend

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