[Live-devel] To use openRTSP in a multi-thread program

Ehsan Adeli eadeli at gmail.com
Sun Jan 5 04:41:56 PST 2014


Hello all,

I am trying to use the openRTSP code in my program and use it to record
from multiple sources at the same time. Therefore, I need to run each
instance in a separate thread. But openRTSP code is not thread safe (many
global variables). I will be left with three options:
1- To run openRTSP as a stand-alone process for each client stream. This
would not be efficient, and I would lose control over each openRTSP running
process.
2- To re-implement openRTSP with a same scheme as in testRTSPClient test
program. Creating my own StreamClientState, ourRTSPClient and DummySink
classes. But I would lose all the functionality implemented in openRTSP.
Implementing every one of them would be hard.
3- Try to make the current openRTSP implementation thread-safe, by defining
StreamClientState and putting all global variables in playcomm.cpp in that
class and trying to over ride RTSPClient used there. But the RTSPClient is
initiated in the HandlerServerForREGISTERCommand and finding the
correspondences is a bit hard.

Can any body help? Do you have any ideas how this could be done? Is it
possible to handle multi-threading in an easier way? Does the
'applicationName' variable here play a role?

Thanks for your help, in advance.

Regards,
Ehsan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140105/95a15419/attachment.html>


More information about the live-devel mailing list