From 666fe5fdfb2d7fb093707af7aa5f7d9f7d7d596d Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 21 Jul 2019 11:45:47 +0200 Subject: [PATCH] plugin: Add function to check for UI handlers --- source/plugin.cpp | 6 ++++++ source/plugin.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/source/plugin.cpp b/source/plugin.cpp index 43d9d68..fac96a7 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -54,6 +54,12 @@ std::shared_ptr obsffmpeg::find_codec_handler(std::strin return found->second; } +bool obsffmpeg::has_codec_handler(std::string codec) +{ + auto found = codec_to_handler_map.find(codec); + return (found != codec_to_handler_map.end()); +} + static std::map> generic_factories; MODULE_EXPORT bool obs_module_load(void) diff --git a/source/plugin.hpp b/source/plugin.hpp index cf4b75b..2c57f81 100644 --- a/source/plugin.hpp +++ b/source/plugin.hpp @@ -31,6 +31,8 @@ namespace obsffmpeg { std::shared_ptr find_codec_handler(std::string codec); + bool has_codec_handler(std::string codec); + } // namespace obsffmpeg MODULE_EXPORT bool obs_module_load(void);