AV module

FormatRegistry

Singleton registry of available media container formats for encoding and decoding.

#include <icy/av/formatregistry.h>

class FormatRegistry

Defined in src/av/include/icy/av/formatregistry.h:26

Public Methods

ReturnNameDescription
FormatRegistry
~FormatRegistry virtual noexcept
Format &get virtualReturn the format with the given display name. Throws std::runtime_error if no format with that name is registered.
Format &getByID virtualReturn the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered.
Format &getOrDefault virtualReturn the format with the given name, or the default format if not found.
Format &getDefault virtualIf a default has been specified it will be returned, other the format with the highest priority will take precedence.
voidregisterFormat virtualRegisters the given media format overriding existing media formats of the same name.
boolunregisterFormat virtualUnregisters the media format matching the given name.
voidsetDefault virtualSets the default fallback media format.
boolexists virtual
voidclear virtualRemove all registered formats and clear the default.
FormatListformats virtual const

FormatRegistry

FormatRegistry()

Defined in src/av/include/icy/av/formatregistry.h:32


~FormatRegistry

virtual noexcept

virtual ~FormatRegistry() noexcept

Defined in src/av/include/icy/av/formatregistry.h:33


get

virtual

virtual Format & get(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:38

Return the format with the given display name. Throws std::runtime_error if no format with that name is registered.

Parameters

ParameterTypeDescription
namestd::string_viewThe display name to look up.

getByID

virtual

virtual Format & getByID(std::string_view id)

Defined in src/av/include/icy/av/formatregistry.h:43

Return the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered.

Parameters

ParameterTypeDescription
idstd::string_viewThe short format ID to look up.

getOrDefault

virtual

virtual Format & getOrDefault(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:47

Return the format with the given name, or the default format if not found.

Parameters

ParameterTypeDescription
namestd::string_viewThe display name to look up.

getDefault

virtual

virtual Format & getDefault()

Defined in src/av/include/icy/av/formatregistry.h:52

If a default has been specified it will be returned, other the format with the highest priority will take precedence.


registerFormat

virtual

virtual void registerFormat(const Format & format)

Defined in src/av/include/icy/av/formatregistry.h:56

Registers the given media format overriding existing media formats of the same name.


unregisterFormat

virtual

virtual bool unregisterFormat(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:60

Unregisters the media format matching the given name.


setDefault

virtual

virtual void setDefault(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:63

Sets the default fallback media format.


exists

virtual

virtual bool exists(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:67

Returns

True if a format with the given display name is registered.

Parameters

ParameterTypeDescription
namestd::string_viewThe display name to check.

clear

virtual

virtual void clear()

Defined in src/av/include/icy/av/formatregistry.h:70

Remove all registered formats and clear the default.


formats

virtual const

virtual FormatList formats() const

Defined in src/av/include/icy/av/formatregistry.h:73

Returns

A snapshot copy of all registered formats.

Public Static Methods

ReturnNameDescription
FormatRegistry &instance staticReturn the singleton FormatRegistry instance.

instance

static

static FormatRegistry & instance()

Defined in src/av/include/icy/av/formatregistry.h:30

Return the singleton FormatRegistry instance.

Private Attributes

ReturnNameDescription
FormatList_formats
std::string_default
std::mutex_mutex

_formats

FormatList _formats

Type: FormatList

Defined in src/av/include/icy/av/formatregistry.h:84


_default

std::string _default

Defined in src/av/include/icy/av/formatregistry.h:85


_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/formatregistry.h:86

Private Methods

ReturnNameDescription
FormatRegistryDeleted constructor.
FormatRegistry &operator=Deleted assignment operator.
FormatRegistryDeleted constructor.
FormatRegistry &operator=Deleted assignment operator.
Format &findByName
Format &defaultLocked

FormatRegistry

FormatRegistry(const FormatRegistry &) = delete

Defined in src/av/include/icy/av/formatregistry.h:76

Deleted constructor.


operator=

FormatRegistry & operator=(const FormatRegistry &) = delete

Defined in src/av/include/icy/av/formatregistry.h:77

Deleted assignment operator.


FormatRegistry

FormatRegistry(FormatRegistry &&) = delete

Defined in src/av/include/icy/av/formatregistry.h:78

Deleted constructor.


operator=

FormatRegistry & operator=(FormatRegistry &&) = delete

Defined in src/av/include/icy/av/formatregistry.h:79

Deleted assignment operator.


findByName

Format & findByName(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:81


defaultLocked

Format & defaultLocked()

Defined in src/av/include/icy/av/formatregistry.h:82