FormatRegistry
#include <icy/av/formatregistry.h>
class FormatRegistryDefined in src/av/include/icy/av/formatregistry.h:26
Public Methods
| Return | Name | Description |
|---|---|---|
FormatRegistry | ||
~FormatRegistry virtual noexcept | ||
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
~FormatRegistry
virtual noexcept
virtual ~FormatRegistry() noexceptDefined 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
| Parameter | Type | Description |
|---|---|---|
name | std::string_view | 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
| Parameter | Type | Description |
|---|---|---|
id | std::string_view | 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
| Parameter | Type | Description |
|---|---|---|
name | std::string_view | 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
| Parameter | Type | Description |
|---|---|---|
name | std::string_view | 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() 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
| Return | Name | Description |
|---|---|---|
FormatList | _formats | |
std::string | _default | |
std::mutex | _mutex |
_formats
FormatList _formatsType: FormatList
Defined 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 & | operator= | Deleted assignment operator. |
FormatRegistry | Deleted constructor. | |
FormatRegistry & | operator= | Deleted assignment operator. |
Format & | findByName | |
Format & | defaultLocked |
FormatRegistry
FormatRegistry(const FormatRegistry &) = deleteDefined in src/av/include/icy/av/formatregistry.h:76
Deleted constructor.
operator=
FormatRegistry & operator=(const FormatRegistry &) = deleteDefined in src/av/include/icy/av/formatregistry.h:77
Deleted assignment operator.
FormatRegistry
FormatRegistry(FormatRegistry &&) = deleteDefined in src/av/include/icy/av/formatregistry.h:78
Deleted constructor.
operator=
FormatRegistry & operator=(FormatRegistry &&) = deleteDefined 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()