Live555 OpenRTSP客户端:如何正确删除当前的rtsp客户端并启动新的 [英] Live555 OpenRTSP Client : How to delete current rtsp client properly and start new One
问题描述
好吧
-
当我的OpenRtsp客户端失去与服务器的连接时,我将处置 旧客户端和其他参数,然后重新创建新客户端.
When my OpenRtsp Client lost connection with server, I dispose the old client and other parameters then re-create new client.
客户端成功发送选项,描述请求,但此后失败...我无法创建会话和订阅,因此出现访问冲突错误.
The Client send Options,Describe request successfully but failed after that... I can not able create Session and Subsesions so I got Access Violations errors..
如何正确重置旧的OpenRtspClient,以获取新的品牌" RTSPClient?
How to reset old OpenRtspClient properly so that get new "brand" RTSPClient?
我当前重置旧客户端的方法:
我只是修改playCommon类中的关机"方法.我没有发送拆解...
I just modify the "shutdown" method in playCommon class. I did not send Teardown...
...
void ResetOurClient(){
if (env != NULL) {
env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
}
closeMediaSinks();
Medium::close(session);
delete ourAuthenticator;
Medium::close(ourClient);
}
和我的ReStartCode:
void StartOurClient()
{
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
env = BasicUsageEnvironment::createNew(*scheduler);
char* streamURL = "XXXXXXXXX";
// Create our client object:
ourClient = createClient(*env, streamURL, verbosityLevel, progName);
if (ourClient == NULL) {
*env << "Failed to create " << clientProtocolName
<< " client: " << env->getResultMsg() << "\n";
shutdown();
}
if (sendOptionsRequest) {
// Begin by sending an "OPTIONS" command:
getOptions(continueAfterOPTIONS);
} else {
continueAfterOPTIONS(NULL, 0, NULL);
}
// All subsequent activity takes place within the event loop:
env->taskScheduler().doEventLoop(&continuesStream); // does not return
}
推荐答案
(Answered by the OP in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
OP写道:
在
setupstreams
方法中有一个静态变量setUpIter
...[MediaSubsessionIterator* setupIter = NULL;]
...因此使其成为全局非静态变量,并使其在ReStart
处成为NULL
Well there was a static variable
setUpIter
...[MediaSubsessionIterator* setupIter = NULL;]
insetupstreams
method...so make it global non-static variable and make itNULL
atReStart
这篇关于Live555 OpenRTSP客户端:如何正确删除当前的rtsp客户端并启动新的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!