FormatRegistry
FormatRegistry
#include <icy/av/formatregistry.h>class FormatRegistryDefined in src/av/include/icy/av/formatregistry.h:26
Singleton registry of available media container formats for encoding and decoding.
List of all members
| Name | Kind | Owner |
|---|---|---|
FormatRegistry | function | Declared here |
~FormatRegistry | function | Declared here |
get | function | Declared here |
getByID | function | Declared here |
getOrDefault | function | Declared here |
getDefault | function | Declared here |
registerFormat | function | Declared here |
unregisterFormat | function | Declared here |
setDefault | function | Declared here |
exists | function | Declared here |
clear | function | Declared here |
formats | function | Declared here |
instance | function | Declared here |
_formats | variable | Declared here |
_default | variable | Declared here |
_mutex | variable | Declared here |
FormatRegistry | function | Declared here |
operator= | function | Declared here |
FormatRegistry | function | Declared here |
operator= | function | Declared here |
findByName | function | Declared here |
defaultLocked | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
FormatRegistry | ||
Format & | get virtual | Return the format with the given display name. Throws std::runtime_error if no format with that name is registered. |
Format & | getByID virtual | Return the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered. |
Format & | getOrDefault virtual | Return the format with the given name, or the default format if not found. |
Format & | getDefault virtual | If a default has been specified it will be returned, other the format with the highest priority will take precedence. |
void | registerFormat virtual | Registers the given media format overriding existing media formats of the same name. |
bool | unregisterFormat virtual | Unregisters the media format matching the given name. |
void | setDefault virtual | Sets the default fallback media format. |
bool | exists virtual | |
void | clear virtual | Remove all registered formats and clear the default. |
FormatList | formats 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
nameThe 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
idThe 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
nameThe 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
nameThe 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() constDefined in src/av/include/icy/av/formatregistry.h:73
Returns
A snapshot copy of all registered formats.
Public Static Methods
| Return | Name | Description |
|---|---|---|
FormatRegistry & | instance static | Return 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
_formats
FormatList _formatsDefined in src/av/include/icy/av/formatregistry.h:84
_default
std::string _defaultDefined in src/av/include/icy/av/formatregistry.h:85
_mutex
std::mutex _mutexDefined in src/av/include/icy/av/formatregistry.h:86
Private Methods
| Return | Name | Description |
|---|---|---|
FormatRegistry | Deleted constructor. | |
FormatRegistry | Deleted constructor. | |
Format & | findByName | |
Format & | defaultLocked |
FormatRegistry
FormatRegistry(const FormatRegistry &) = deleteDefined in src/av/include/icy/av/formatregistry.h:76
Deleted constructor.
FormatRegistry
FormatRegistry(FormatRegistry &&) = deleteDefined 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()