win-dshow: Move module loading to separate file

The main module code was originally all packed in to the win-dshow.cpp
file, which isn't exactly ideal or clean if one wants to add other
things to the module as a whole.
master
jp9000 2014-12-19 07:53:15 -08:00
parent 67587fbced
commit bbff0eeeb9
3 changed files with 14 additions and 6 deletions

View File

@ -9,6 +9,7 @@ set(win-dshow_HEADERS
set(win-dshow_SOURCES set(win-dshow_SOURCES
win-dshow.cpp win-dshow.cpp
dshow-plugin.cpp
ffmpeg-decode.c) ffmpeg-decode.c)
set(libdshowcapture_SOURCES set(libdshowcapture_SOURCES

View File

@ -0,0 +1,12 @@
#include <obs-module.h>
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("win-dshow", "en-US")
extern void RegisterDShowSource();
bool obs_module_load(void)
{
RegisterDShowSource();
return true;
}

View File

@ -1538,9 +1538,6 @@ static obs_properties_t *GetDShowProperties(void *)
return ppts; return ppts;
} }
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("win-dshow", "en-US")
void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param) void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param)
{ {
int obs_type = LOG_DEBUG; int obs_type = LOG_DEBUG;
@ -1560,7 +1557,7 @@ void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param)
UNUSED_PARAMETER(param); UNUSED_PARAMETER(param);
} }
bool obs_module_load(void) void RegisterDShowSource()
{ {
SetLogCallback(DShowModuleLogCallback, nullptr); SetLogCallback(DShowModuleLogCallback, nullptr);
@ -1577,6 +1574,4 @@ bool obs_module_load(void)
info.get_defaults = GetDShowDefaults; info.get_defaults = GetDShowDefaults;
info.get_properties = GetDShowProperties; info.get_properties = GetDShowProperties;
obs_register_source(&info); obs_register_source(&info);
return true;
} }