I just recently started developing some code to implement a simple
RTSP client.
I have been using the new RTSPClient implementation. (the one with
the non blocking sockets)
Below is an excerpt from my code:
rtspclient =
RTSPClient::createNew(*env,link,verbosity_level,app_name,tunnel);
*env << "created rtsp client\n";
RTSPClient::responseHandler *fun = &printOptions; //printOptions
prints the options response to stdout
cseq = rtspclient->sendOptionsCommand(fun,NULL);
*env << "Options Cseq = "<< cseq << "\n";
fun = &printDescribe;//printDescribe prints the sdp description to stdout
cseq = rtspclient->sendDescribeCommand(fun,NULL);
*env << "Describe Cseq = " << cseq << "\n";
env->taskScheduler().doEventLoop();
Now, I know that the last statement effectively terminates the
current thread of execution.
No it doesn't - it just moves the "current thread of execution" into
the event loop.
And that's exactly what should be happening. The handling of
incoming RTSP responses - and the subsequent calling of the response
handler function for each response - takes place within the event
loop. Note that LIVE555 applications are event-driven.
If you set the "verbosity_level" parameter to 1, you should see more
information about what's happening.
I notice, though, that you're trying to send 'pipelined' requests:
I.e., you're sending a "DESCRIBE" command before you receive a
response to the previous "OPTIONS" command. This is something that
RTSP allows, and which our RTSP client software supports (though it
has not been extensively tested yet). However, it's possible that
your server does not support it.
So, at least at first, I suggest that you don't try to pipeline
requests. In particular, I suggest that you move the call to
"doEventLoop()" after the call to "sendOptionsCommand()" (and then
move the call to "sendDescribeCommand()" to the end of the
"printOptions" response handler).
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel