#include <icy/av/formatregistry.h>Singleton registry of available media container formats for encoding and decoding.
| 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 | #### Returns |
void | clear virtual | Remove all registered formats and clear the default. |
FormatList | formats virtual const | #### Returns |
FormatRegistry()virtual
virtual Format & get(std::string_view name)Return the format with the given display name. Throws std::runtime_error if no format with that name is registered.
name The display name to look up.virtual
virtual Format & getByID(std::string_view id)Return the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered.
id The short format ID to look up.virtual
virtual Format & getOrDefault(std::string_view name)Return the format with the given name, or the default format if not found.
name The display name to look up.virtual
virtual Format & getDefault()If a default has been specified it will be returned, other the format with the highest priority will take precedence.
virtual
virtual void registerFormat(const Format & format)Registers the given media format overriding existing media formats of the same name.
virtual
virtual bool unregisterFormat(std::string_view name)Unregisters the media format matching the given name.
virtual
virtual void setDefault(std::string_view name)Sets the default fallback media format.
virtual
virtual bool exists(std::string_view name)True if a format with the given display name is registered.
name The display name to check.virtual
virtual void clear()Remove all registered formats and clear the default.
virtual const
virtual FormatList formats() constA snapshot copy of all registered formats.
| Return | Name | Description |
|---|---|---|
FormatRegistry & | instance static | Return the singleton FormatRegistry instance. |
static
static FormatRegistry & instance()Return the singleton FormatRegistry instance.
FormatList _formatsstd::string _defaultstd::mutex _mutex| Return | Name | Description |
|---|---|---|
FormatRegistry | Deleted constructor. | |
FormatRegistry | Deleted constructor. | |
Format & | findByName | |
Format & | defaultLocked |
FormatRegistry(const FormatRegistry &) = deleteDeleted constructor.
FormatRegistry(FormatRegistry &&) = deleteDeleted constructor.
Format & findByName(std::string_view name)Format & defaultLocked()