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

Immutable codec identity owned by Registry. More...

#include <StormByte/multimedia/codec.hxx>

Public Member Functions

 Codec (const Codec &other) noexcept=delete
 Copy is disabled; instances are unique in the registry.
 Codec (Codec &&other) noexcept
 Move constructor executed by the multimedia provider.
 ~Codec () noexcept
 Destroy the identity in the multimedia provider.
Codec & operator= (const Codec &other) noexcept=delete
 Copy assignment is disabled.
Codec & operator= (Codec &&other) noexcept
 Move assignment executed by the multimedia provider.
bool operator== (const Codec &other) const noexcept
 Identity equality (same registry slot).
bool operator!= (const Codec &other) const noexcept
 Identity inequality.
constexpr enum Type Type () const noexcept
 Media kind of this codec.
constexpr std::string_view Name () const noexcept
 StormByte codec name.
constexpr std::string_view Description () const noexcept
 Human description.
StormByte::Safe::Optional< enum SubtitleKind > SubtitleKind () const noexcept
 Classifies subtitle content independently of codec availability.
bool HasAccess (Access access) const noexcept
 Tests Read/Write flags.
bool HasAccess (Access access, const Features &need) const noexcept
 Tests access while preserving all requested features.
StormByte::Safe::Vector< EncoderInfo > Encoders (const Features &need={}) const
 Lists the available encoder implementations for this codec.
StormByte::Safe::Vector< DecoderInfo > Decoders (const Features &need={}) const
 Lists decoder implementations usable by this codec's backend.

Friends

class Registry
 Registry creates codec identities from static tables.

Detailed Description

Immutable codec identity owned by Registry.

Codec identity owned by the multimedia registry.

Immutable codec identity and implementation discovery.

Name() is the StormByte key. FFmpeg ids live only in the registry map.

Constructor & Destructor Documentation

◆ Codec() [1/2]

StormByte::Multimedia::Codec::Codec ( const Codec & other)
deletenoexcept

Copy is disabled; instances are unique in the registry.

Parameters
otherSource codec.

◆ Codec() [2/2]

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

Move constructor executed by the multimedia provider.

Parameters
otherSource codec.

◆ ~Codec()

StormByte::Multimedia::Codec::~Codec ( )
noexcept

Destroy the identity in the multimedia provider.

Member Function Documentation

◆ Decoders()

StormByte::Safe::Vector< DecoderInfo > StormByte::Multimedia::Codec::Decoders ( const Features & need = {}) const

Lists decoder implementations usable by this codec's backend.

Parameters
needInput capabilities required from each implementation; empty lists all.
Returns
Matching implementations with FFmpeg's unpinned default first, followed by table alternatives in stable preference order. Empty when no matching decoder is available.
Note
Names can pin the decoder, not the encoder. Each pin must match the source stream's codec id. Hardware-only and experimental decoders are excluded because the backend does not configure their prerequisites. This includes FFmpeg's native hardware-only av1 decoder even when its capability flags do not identify the hardware requirement. Unclassified generic and subtitle defaults have empty features and only satisfy empty requirements. Filtering never changes the unpinned backend default: pin the returned name to select a filtered alternative. Availability does not guarantee that damaged or unsupported input opens.

◆ Description()

std::string_view StormByte::Multimedia::Codec::Description ( ) const
inlineconstexprnoexcept

Human description.

Returns
View to a process-lifetime literal.

◆ Encoders()

StormByte::Safe::Vector< EncoderInfo > StormByte::Multimedia::Codec::Encoders ( const Features & need = {}) const

Lists the available encoder implementations for this codec.

Parameters
needFeatures each listed implementation must preserve; empty lists all.
Returns
Implementations ordered by preference. The first one is the implementation Multimedia picks when no encoder is pinned and need is the required feature set. Empty when the codec is not writable.
Note
Availability means the linked FFmpeg provides the encoder; hardware devices are not probed.

◆ HasAccess() [1/2]

bool StormByte::Multimedia::Codec::HasAccess ( Access access) const
noexcept

Tests Read/Write flags.

Parameters
accessFlags to test.
Returns
true if every bit in access is set.

◆ HasAccess() [2/2]

bool StormByte::Multimedia::Codec::HasAccess ( Access access,
const Features & need ) const
noexcept

Tests access while preserving all requested features.

Parameters
accessFlags to test; Read and Write are checked independently.
needFeatures required from a single implementation per direction.
Returns
true if the generic access flags are set and each requested direction has an available implementation whose table row covers need.
Note
Empty features are identical to HasAccess(access). Nonempty features use StormByte codec names and FFmpeg implementation names, never the generic FFmpeg codec-id fallback. Missing rows return false. This does not probe hardware devices, settings or container compatibility.

◆ Name()

std::string_view StormByte::Multimedia::Codec::Name ( ) const
inlineconstexprnoexcept

StormByte codec name.

Returns
View to a process-lifetime literal.

◆ operator!=()

bool StormByte::Multimedia::Codec::operator!= ( const Codec & other) const
noexcept

Identity inequality.

Parameters
otherOther codec.
Returns
true if they are different instances.

◆ operator=() [1/2]

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

Move assignment executed by the multimedia provider.

Parameters
otherSource codec.
Returns
*this.

◆ operator=() [2/2]

Codec & StormByte::Multimedia::Codec::operator= ( const Codec & other)
deletenoexcept

Copy assignment is disabled.

Parameters
otherSource codec.
Returns
*this.

◆ operator==()

bool StormByte::Multimedia::Codec::operator== ( const Codec & other) const
noexcept

Identity equality (same registry slot).

Parameters
otherOther codec.
Returns
true if both refer to the same instance.

◆ SubtitleKind()

StormByte::Safe::Optional< enum SubtitleKind > StormByte::Multimedia::Codec::SubtitleKind ( ) const
noexcept

Classifies subtitle content independently of codec availability.

Returns
Empty for non-subtitle codecs; Text, Bitmap or Unknown otherwise.
Note
Describes the format, not decoder output or OCR availability. Binary-packed text such as mov_text is Text, not Bitmap.

◆ Type()

enum Type StormByte::Multimedia::Codec::Type ( ) const
inlineconstexprnoexcept

Media kind of this codec.

Returns
Type value.

◆ Registry

friend class Registry
friend

Registry creates codec identities from static tables.


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