精品文档---下载后可任意编辑DarwinStreamServer 是苹果公司开发的流媒体视频服务器
我们分析的代码基于版本
一、DSS 启动、初始化流程我们从 Server
tproj/main
cpp 入手,分析 DSS 加载 module 及和 module 交互的流程
(1)、DSS 在 fork 子进程后调用(2)、select_startevents 函数initialize the select() implementation of the event queue
(3)、QTSServer::Initialize 函数继续调用 QTSSModule、QTSServerPres、QTSSMessages、RTSPRequestInterface、 RTSPSessionInterface、RTPSessionInterface、RTPStream、RTSPSession、QTSSFile、QTSSUserProfile 等类的 Initialize 函数,进行 dictionary 的初始化
加载了第一个模块 QTSSErrorLogModule
this->()// set default IP addr& DNS name// begin listening,注意这里传的是 false 参数
this->(,fSrvrPrefs,inPortOverride)(4)、TaskThreadPool::AddThreads(numThreads)// numThreads 为 1到这里,第一个线程创建、运行、被添加到线程池里
在 startBroadcastRTSPSession 函数里,又调用 AddThreads 函数在线程池里添加了一个线程
(5)、TimeoutTask::Initialize()Start up the server's