Home
AV module

FormatRegistry

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

FormatRegistry

#include <icy/av/formatregistry.h>
class FormatRegistry

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

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

List of all members

NameKindOwner
FormatRegistryfunctionDeclared here
~FormatRegistryfunctionDeclared here
getfunctionDeclared here
getByIDfunctionDeclared here
getOrDefaultfunctionDeclared here
getDefaultfunctionDeclared here
registerFormatfunctionDeclared here
unregisterFormatfunctionDeclared here
setDefaultfunctionDeclared here
existsfunctionDeclared here
clearfunctionDeclared here
formatsfunctionDeclared here
instancefunctionDeclared here
_formatsvariableDeclared here
_defaultvariableDeclared here
_mutexvariableDeclared here
FormatRegistryfunctionDeclared here
operator=functionDeclared here
FormatRegistryfunctionDeclared here
operator=functionDeclared here
findByNamefunctionDeclared here
defaultLockedfunctionDeclared here

Public Methods

ReturnNameDescription
FormatRegistry
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


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

  • name The 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

  • id The 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

  • name The 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

  • name The 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

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.
FormatRegistryDeleted constructor.
Format &findByName
Format &defaultLocked

FormatRegistry

FormatRegistry(const FormatRegistry &) = delete

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

Deleted constructor.


FormatRegistry

FormatRegistry(FormatRegistry &&) = delete

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

Deleted constructor.


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