diff --git a/plugins/win-dshow/CMakeLists.txt b/plugins/win-dshow/CMakeLists.txt index 824caca67..2dc878f78 100644 --- a/plugins/win-dshow/CMakeLists.txt +++ b/plugins/win-dshow/CMakeLists.txt @@ -9,6 +9,7 @@ set(win-dshow_HEADERS set(win-dshow_SOURCES win-dshow.cpp + dshow-plugin.cpp ffmpeg-decode.c) set(libdshowcapture_SOURCES diff --git a/plugins/win-dshow/dshow-plugin.cpp b/plugins/win-dshow/dshow-plugin.cpp new file mode 100644 index 000000000..0d19d53b2 --- /dev/null +++ b/plugins/win-dshow/dshow-plugin.cpp @@ -0,0 +1,12 @@ +#include + +OBS_DECLARE_MODULE() +OBS_MODULE_USE_DEFAULT_LOCALE("win-dshow", "en-US") + +extern void RegisterDShowSource(); + +bool obs_module_load(void) +{ + RegisterDShowSource(); + return true; +} diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index 6d94bc5dd..40232029c 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -1538,9 +1538,6 @@ static obs_properties_t *GetDShowProperties(void *) return ppts; } -OBS_DECLARE_MODULE() -OBS_MODULE_USE_DEFAULT_LOCALE("win-dshow", "en-US") - void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param) { int obs_type = LOG_DEBUG; @@ -1560,7 +1557,7 @@ void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param) UNUSED_PARAMETER(param); } -bool obs_module_load(void) +void RegisterDShowSource() { SetLogCallback(DShowModuleLogCallback, nullptr); @@ -1577,6 +1574,4 @@ bool obs_module_load(void) info.get_defaults = GetDShowDefaults; info.get_properties = GetDShowProperties; obs_register_source(&info); - - return true; }