【Darwin学习笔记】之QTSSReflectorModule的Setup消息处理
2015-02-09 10:11
761 查看
Setup消息进入到DoSetup函数单独处理,处理流程如下:
【转载请注明出处】:http://blog.csdn.net/longlong530
1. 根据关键字qtssRTSPReqTransportMode判断是否为推模式,具体isPush值由Setup请求中的mode值有关,mode="receive" || mode="record"表示isPush为true。对应的解析函数为:void RTSPRequest::ParseModeSubHeader(StrPtrLen* inModeSubHeader)
2. 查询是否已经建立RTPSessionOutput。
1.1) 如果没有,且是从UI发来的标准RTSP客户端请求,那么
2) 如果已经存在输出会话,即直接调用。
3. 解析track ID,后面会根据这个track id来获取流信息
4. 如果是推流模式:
【转载请注明出处】:http://blog.csdn.net/longlong530
【转载请注明出处】:http://blog.csdn.net/longlong530
1. 根据关键字qtssRTSPReqTransportMode判断是否为推模式,具体isPush值由Setup请求中的mode值有关,mode="receive" || mode="record"表示isPush为true。对应的解析函数为:void RTSPRequest::ParseModeSubHeader(StrPtrLen* inModeSubHeader)
StrPtrLen theMode; theSubHeaderParser.ConsumeWord(&theMode); //mode="receive" || mode="record"表示isPush为true,即为推模式。 if ( theMode.EqualIgnoreCase(sReceiveMode) || theMode.EqualIgnoreCase(sRecordMode) ) { fTransportMode = qtssRTPTransportModeRecord; break; }
2. 查询是否已经建立RTPSessionOutput。
1.1) 如果没有,且是从UI发来的标准RTSP客户端请求,那么
//增加客户端输出管道(多路转发); RTPSessionOutput* theNewOutput = NEW RTPSessionOutput(inParams->inClientSession, theSession, sServerPrefs, sStreamCookieAttr ); theSession->AddOutput(theNewOutput,true); //将新建的RTPSessionOutput存储起来,key = sOutputAttr; (void)QTSS_SetValue(inParams->inClientSession, sOutputAttr, 0, &theNewOutput, sizeof(theNewOutput));1.2) 如果isPush = true,代表为Announce推流中的SETUP消息,那么
/* 根据前面Announce中存储于qtssRTSPReqLocalPath的路径读取sdp信息,调用DoSessionSetup创建或引用已存在的ReflectorSession<span style="font-family: Arial, Helvetica, sans-serif;">转发会话</span><span style="font-family: Arial, Helvetica, sans-serif;"> </span> */ theSession = DoSessionSetup(inParams, qtssRTSPReqFilePathTrunc,isPush,&foundSession);
2) 如果已经存在输出会话,即直接调用。
3. 解析track ID,后面会根据这个track id来获取流信息
char* theDigitStr = NULL; (void)QTSS_GetValueAsString(inParams->inRTSPRequest, qtssRTSPReqFileDigit, 0, &theDigitStr); QTSSCharArrayDeleter theDigitStrDeleter(theDigitStr);
4. 如果是推流模式:
//标识流转发的建立 theStreamInfo->fSetupToReceive = true; // This is an incoming data session. Set the Reflector Session in the ClientSession //设置转发会话的RTPSession字典的sClientBroadcastSessionAttr字段 theErr = QTSS_SetValue(inParams->inClientSession, sClientBroadcastSessionAttr, 0, &theSession, sizeof(theSession)); Assert(theErr == QTSS_NoErr); //设置ReflectorSession的fBroadcasterSession属性为inParams->inClientSession if (theSession != NULL) theSession->AddBroadcasterClientSession(inParams);
【转载请注明出处】:http://blog.csdn.net/longlong530
相关文章推荐
- 【Darwin学习笔记】之QTSSReflectorModule的Setup消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Setup消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Announce消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Describe消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Announce消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Describe消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Announce消息处理
- 【Darwin学习笔记】之QTSSReflectorModule的Describe消息处理
- C++ Primer 学习笔记_56_ 类和数据抽象 --消息处理演示示例
- OpenCV学习笔记14 OpenCV图像处理模块ImgProc Module. Image Processing(七)
- Akka学习笔记:Actor消息处理-请求和响应(2)
- VC++学习笔记之消息处理机制和窗口过程函数
- Android消息处理学习笔记
- SOAP消息的创建,传递,处理的学习笔记
- C++ Primer 学习笔记_56_类与数据抽象 -消息处理示例
- 第108讲:Akka中的Actor消息的处理、消息回复、消息转发学习笔记
- Android应用开发学习笔记之多线程与Handler消息处理机制
- POX学习笔记:POX接收OpenFlow消息的处理流程分析
- Android应用开发学习笔记之多线程与Handler消息处理机制
- OpenCV学习笔记9 OpenCV图像处理模块ImgProc Module. Image Processing(二)