[Live-devel] resending the describe command
sampsa
sampsa.riikonen at dasys.fi
Tue Aug 2 01:34:54 PDT 2016
Hello,
Let's consider a situation where an ip cam is initially offline, but
comes online, say, 30 secs. after the live555 process has started and
sent the (unsuccesfull) describe command.
In such cases, we'd need to resend the describe command.
I was trying the following solution in the "continueAfterDESCRIBE"
response handler:
void continueAfterDESCRIBE(RTSPClient* client, int resultCode, char*
resultString) {
UsageEnvironment& env = client->envir();
MediaSession* session;
double duration;
if (resultCode!=0) {
env << "could not get SDP info.. lets do this again\n";
// client->reset(); // Can't do this: reset method is protected!
client->sendDescribeCommand(continueAfterDESCRIBE);
// return;
}
env << "Got a SDP description:\n" << resultString << "\n";
session=MediaSession::createNew(env, resultString);
((MyRTSPClient*)client)->setCurrentSession(session);
((MyRTSPClient*)client)->resetSub();
if (session==NULL) {
env << "Empty media session! Let's do this again\n";
client->sendDescribeCommand(continueAfterDESCRIBE);
// return;
}
...
...
But it does not work. The output gives:
...Connection to server failed: No route to host
could not get SDP info.. lets do this again
Opening connection to 192.168.1.157, port 554...
Got a SDP description:
Connection to server failed: No route to host
And after that there is no more action. It seems that the RTSPClient
instance should be resetted somehow between the recursive
sendDescribeCommand calls, but the "reset" method is protected.
.. here it thinks that "Connection to server failed .." is an SDP string.
Any advice on how to do this right?
Regards,
Sampsa
More information about the live-devel
mailing list