live555 asynchronous rtsp client [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this questiondid someone managed to get live555 rtsp client work asyncronously and wants to share the knowledge o开发者_Go百科r better... code.
The main difference between synchronous and asynchronous in the live555 API is that you must now specify a handler in an RTSP request. Your handler will be called from the live555 eventloop once the DESCRIBE request has completed.
In RTSPClient.hh responseHandler is defined as:
typedef void (responseHandler)(RTSPClient* rtspClient,
int resultCode, char* resultString);
When your handler is called, live555 will give you the following information:
The RTSP client on which the command was issued -> this allows you to subsequently call the next RTSP method.
The result code which is 0 on success, positive if an RTSP error code was returned by the server, and negative if some network/socket error occurred.
Use this info to decide how to proceed in your handler. Have a look at RTSPClient.hh where all of this is explained.
E.g. This means that when you want to call the sendDescribeCommand method:
unsigned sendDescribeCommand(responseHandler* responseHandler,
Authenticator* authenticator = NULL);
You must specify which handler (of signature responseHandler) will be called once the DESCRIBE has been completed. In your handler you must then decide based on the result code, whether you want to do a SETUP (again specifying a handler) or terminate (if some error occurred).
As jenseb suggested the openRTSP client provides a very good starting point.
精彩评论