Remove version parameter from obs_module_load

Replaced by obs_get_version() API
master
jp9000 2014-07-27 12:42:43 -07:00
parent 59ea3becf2
commit f0ac19abba
19 changed files with 19 additions and 51 deletions

View File

@ -57,7 +57,7 @@ struct obs_module {
void *module;
bool loaded;
bool (*load)(uint32_t libobs_ver);
bool (*load)(void);
void (*unload)(void);
void (*set_locale)(const char *locale);
void (*free_locale)(void);

View File

@ -98,7 +98,7 @@ bool obs_init_module(obs_module_t module)
if (module->loaded)
return true;
module->loaded = module->load(LIBOBS_API_VER);
module->loaded = module->load();
if (!module->loaded)
blog(LOG_WARNING, "Failed to initialize module '%s'",
module->file);

View File

@ -48,11 +48,10 @@
* the sources/encoders/outputs/services for your module, or anything else that
* may need loading.
*
* @param libobs_ver The version of libobs.
* @return Return true to continue loading the module, otherwise
* false to indcate failure and unload the module
*/
MODULE_EXPORT bool obs_module_load(uint32_t libobs_version);
MODULE_EXPORT bool obs_module_load(void);
/** Optional: Called when the module is unloaded. */
MODULE_EXPORT void obs_module_unload(void);

View File

@ -123,11 +123,9 @@ static struct obs_source_info image_source_info = {
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("image-source", "en-US")
bool obs_module_load(uint32_t libobs_version)
bool obs_module_load(void)
{
obs_register_source(&image_source_info);
UNUSED_PARAMETER(libobs_version);
return true;
}

View File

@ -22,9 +22,8 @@ OBS_MODULE_USE_DEFAULT_LOCALE("linux-pulseaudio", "en-US")
extern struct obs_source_info pulse_input_capture;
extern struct obs_source_info pulse_output_capture;
bool obs_module_load(uint32_t obs_version)
bool obs_module_load(void)
{
UNUSED_PARAMETER(obs_version);
obs_register_source(&pulse_input_capture);
obs_register_source(&pulse_output_capture);
return true;

View File

@ -21,9 +21,8 @@ OBS_MODULE_USE_DEFAULT_LOCALE("linux-v4l2", "en-US")
extern struct obs_source_info v4l2_input;
bool obs_module_load(uint32_t obs_version)
bool obs_module_load(void)
{
UNUSED_PARAMETER(obs_version);
obs_register_source(&v4l2_input);
return true;
}

View File

@ -61,10 +61,8 @@ static const char* xcompcap_getname(void)
return obs_module_text("XCCapture");
}
bool obs_module_load(uint32_t libobs_version)
bool obs_module_load(void)
{
UNUSED_PARAMETER(libobs_version);
if (!XCompcapMain::init())
return false;

View File

@ -21,9 +21,8 @@ OBS_MODULE_USE_DEFAULT_LOCALE("linux-xshm", "en-US")
extern struct obs_source_info xshm_input;
bool obs_module_load(uint32_t obs_version)
bool obs_module_load(void)
{
UNUSED_PARAMETER(obs_version);
obs_register_source(&xshm_input);
return true;
}

View File

@ -5,12 +5,9 @@ OBS_MODULE_USE_DEFAULT_LOCALE("mac-avcapture", "en-US")
extern struct obs_source_info av_capture_info;
bool obs_module_load(uint32_t libobs_version)
bool obs_module_load(void)
{
UNUSED_PARAMETER(libobs_version);
obs_register_source(&av_capture_info);
return true;
}

View File

@ -7,13 +7,11 @@ extern struct obs_source_info coreaudio_input_capture_info;
extern struct obs_source_info coreaudio_output_capture_info;
extern struct obs_source_info display_capture_info;
bool obs_module_load(uint32_t libobs_version)
bool obs_module_load(void)
{
obs_register_source(&coreaudio_input_capture_info);
obs_register_source(&coreaudio_output_capture_info);
obs_register_source(&display_capture_info);
UNUSED_PARAMETER(libobs_version);
return true;
}

View File

@ -6,12 +6,10 @@ OBS_MODULE_USE_DEFAULT_LOCALE("obs-ffmpeg", "en-US")
extern struct obs_output_info ffmpeg_output;
extern struct obs_encoder_info aac_encoder_info;
bool obs_module_load(uint32_t obs_version)
bool obs_module_load(void)
{
obs_register_output(&ffmpeg_output);
obs_register_encoder(&aac_encoder_info);
UNUSED_PARAMETER(obs_version);
return true;
}

View File

@ -303,12 +303,9 @@ struct obs_encoder_info obs_libfdk_encoder = {
.audio_info = libfdk_audio_info
};
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
UNUSED_PARAMETER(libobs_ver);
obs_register_encoder(&obs_libfdk_encoder);
return true;
}

View File

@ -11,7 +11,7 @@ OBS_MODULE_USE_DEFAULT_LOCALE("obs-outputs", "en-US")
extern struct obs_output_info rtmp_output_info;
extern struct obs_output_info flv_output_info;
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
#ifdef _WIN32
WSADATA wsad;
@ -20,8 +20,6 @@ bool obs_module_load(uint32_t libobs_ver)
obs_register_output(&rtmp_output_info);
obs_register_output(&flv_output_info);
UNUSED_PARAMETER(libobs_ver);
return true;
}

View File

@ -5,11 +5,9 @@ OBS_MODULE_USE_DEFAULT_LOCALE("obs-x264", "en-US")
extern struct obs_encoder_info obs_x264_encoder;
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
obs_register_encoder(&obs_x264_encoder);
UNUSED_PARAMETER(libobs_ver);
return true;
}

View File

@ -8,12 +8,10 @@ OBS_MODULE_USE_DEFAULT_LOCALE("rtmp-services", "en-US")
extern struct obs_service_info rtmp_common_service;
extern struct obs_service_info rtmp_custom_service;
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
obs_register_service(&rtmp_common_service);
obs_register_service(&rtmp_custom_service);
UNUSED_PARAMETER(libobs_ver);
return true;
}

View File

@ -6,12 +6,10 @@ OBS_MODULE_USE_DEFAULT_LOCALE("win-capture", "en-US")
extern struct obs_source_info monitor_capture_info;
extern struct obs_source_info window_capture_info;
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
obs_register_source(&monitor_capture_info);
obs_register_source(&window_capture_info);
UNUSED_PARAMETER(libobs_ver);
return true;
}

View File

@ -1189,10 +1189,8 @@ void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param)
UNUSED_PARAMETER(param);
}
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
UNUSED_PARAMETER(libobs_ver);
SetLogCallback(DShowModuleLogCallback, nullptr);
obs_source_info info = {};

View File

@ -6,10 +6,8 @@ OBS_MODULE_USE_DEFAULT_LOCALE("win-wasapi", "en-US")
void RegisterWASAPIInput();
void RegisterWASAPIOutput();
bool obs_module_load(uint32_t libobs_ver)
bool obs_module_load(void)
{
UNUSED_PARAMETER(libobs_ver);
RegisterWASAPIInput();
RegisterWASAPIOutput();
return true;

View File

@ -6,12 +6,10 @@ extern struct obs_source_info test_random;
extern struct obs_source_info test_sinewave;
extern struct obs_source_info test_filter;
bool obs_module_load(uint32_t libobs_version)
bool obs_module_load(void)
{
obs_register_source(&test_random);
obs_register_source(&test_sinewave);
obs_register_source(&test_filter);
UNUSED_PARAMETER(libobs_version);
return true;
}