<div dir="ltr"><div><div><div><div><div><div><div>Hello all,<br><br></div>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:<br>
</div>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. <br></div>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.<br>
</div>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.<br>
<br></div>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?<br><br></div>Thanks for your help, in advance.<br>
<br></div>Regards,<br>Ehsan<br><br></div>