obs-studio源码阅读笔记二

跟着上篇提到的https://obsproject.com/docs/文档看一遍第一章OBS Studio Backend Design能对整个项目的总体框架有个印象了。
对主要的入口函数run_program注释如下:

static const char *run_program_init = "run_program_init";
static int run_program(fstream &logFile, int argc, char *argv[])
{
	int ret = -1;
	
	//这个是一个队列,暂时不知道干嘛的,搞的复杂些为了自动释放
	auto profilerNameStore = CreateNameStore();
	
	//这是实现退出函数时执行全局profiler释放操作
	//这个profiler模块是一个记录执行过程信息的模块,例如记录各种操作耗时等
	//,最后释放时会打印这些信息
	std::unique_ptr<void, decltype(ProfilerFree)>
		prof_release(static_cast<void*>(&ProfilerFree),
				ProfilerFree);

	profiler_start();
	profile_register_root(run_program_init, 0);

	//像是一个局部的profiler,构造函数里面记录了开始时间,可能会跟全局的进行
	//交互?现看到是析构时将信息写入全局profiler
	ScopeProfiler prof{run_program_init};

	//qt的api,作用如函数名
	QCoreApplication::addLibraryPath(".");

	//派生自QApplication,是qt的UI启动类
	OBSApp program(argc, argv, profilerNameStore.
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值