Jelajahi Sumber

Remove version parameter from obs_module_load

Replaced by obs_get_version() API
jp9000 11 tahun lalu
induk
melakukan
f0ac19abba

+ 1 - 1
libobs/obs-internal.h

@@ -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);

+ 1 - 1
libobs/obs-module.c

@@ -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);

+ 1 - 2
libobs/obs-module.h

@@ -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);

+ 1 - 3
plugins/image-source/image-source.c

@@ -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;
 }
 

+ 1 - 2
plugins/linux-pulseaudio/linux-pulseaudio.c

@@ -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;

+ 1 - 2
plugins/linux-v4l2/linux-v4l2.c

@@ -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;
 }

+ 1 - 3
plugins/linux-xcomposite/plugin-main.cpp

@@ -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;
 

+ 1 - 2
plugins/linux-xshm/linux-xshm.c

@@ -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;
 }

+ 1 - 4
plugins/mac-avcapture/plugin-main.c

@@ -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;
 }
 

+ 1 - 3
plugins/mac-capture/plugin-main.c

@@ -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;
 }
 

+ 1 - 3
plugins/obs-ffmpeg/obs-ffmpeg.c

@@ -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;
 }
 

+ 1 - 4
plugins/obs-libfdk/obs-libfdk.c

@@ -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;
 }
 

+ 1 - 3
plugins/obs-outputs/obs-outputs.c

@@ -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;
 }
 

+ 1 - 3
plugins/obs-x264/obs-x264-plugin-main.c

@@ -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;
 }
 

+ 1 - 3
plugins/rtmp-services/rtmp-services-main.c

@@ -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;
 }
 

+ 1 - 3
plugins/win-capture/plugin-main.c

@@ -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;
 }
 

+ 1 - 3
plugins/win-dshow/win-dshow.cpp

@@ -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 = {};

+ 1 - 3
plugins/win-wasapi/plugin-main.cpp

@@ -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;

+ 1 - 3
test/test-input/test-input.c

@@ -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;
 }