obs-studio 二次封装(二): obs.lib源码分析

obs.lib导出函数列表在 obs.h文件中。如obs的初始化库函数 obs_startup(..)

/**
 * Initializes OBS
 *
 * @param  locale              The locale to use for modules
 * @param  module_config_path  Path to module config storage directory
 *                             (or NULL if none)
 * @param  store               The profiler name store for OBS to use or NULL
 */
EXPORT bool obs_startup(const char *locale, const char *module_config_path,
			profiler_name_store_t *store);

通过EXPORT导出函数,EXPORT定义如下:

#ifdef _MSC_VER
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif

如果想做快速封装,只需要把这个obs.h头文件和 obs.dll 、obs.lib导入到自己的工程中就可以调用obs.h暴露出来的函数。

当然最好理解原理,后面会从源码层面分析这些函数。

bool obs_startup(const char *locale, const char *module_config_path,
		 profiler_name_store_t *store)
{
	bool success;

	profile_start(obs_star

猜你喜欢

转载自blog.csdn.net/lcalqf/article/details/107678544