plugin: Add global codec to UI Handler map

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-07-07 13:42:39 +02:00
parent dbdf915a07
commit 8fb69d6870
2 changed files with 21 additions and 0 deletions
+16
View File
@@ -36,6 +36,22 @@ std::list<std::function<void()>> obsffmpeg::initializers;
std::list<std::function<void()>> obsffmpeg::finalizers;
// Codec to Handler mapping.
static std::map<std::string, std::shared_ptr<obsffmpeg::ui::handler>> codec_to_handler_map;
void obsffmpeg::register_codec_handler(std::string codec, std::shared_ptr<obsffmpeg::ui::handler> handler)
{
codec_to_handler_map.emplace(codec, handler);
}
std::shared_ptr<obsffmpeg::ui::handler> obsffmpeg::find_codec_handler(std::string codec)
{
auto found = codec_to_handler_map.find(codec);
if (found == codec_to_handler_map.end())
return nullptr;
return found->second;
}
static std::map<AVCodec*, std::shared_ptr<encoder::generic_factory>> generic_factories;
MODULE_EXPORT bool obs_module_load(void)