[Live-devel] Retrieving media with RTSP/RTP
Němec Alexandr
a.nemec at atlas.cz
Wed Dec 30 00:28:35 PST 2009
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091230/eaa70170/attachment.html>
-------------- next part --------------
Dear all,
we have compiled the live media source code on Windows and are using it to retrieve media with RTSP/RTP. It runs very well and stable, however we have some questions as follows.
1. The first one is easy. We have compiled the openRTSP functionality to a library to be more flexible. Since a WSAStartup call is necessary on Windows, this is correctly done in the initializeWinsockIfNecessary call - the "f...ing lame comment" in the source code is so true :). Well, the obvious questions is where is the WSACleanup call? Well, there is a WSACleanup in initializeWinsockIfNecessary but only called when the winsock version is not found. So using live media on Windows should also require WSACleanup, which must be used in pair with WSAStartup. We solved this by removing the entire initializeWinsockIfNecessary and we are using a WSAStartup and WSACleanup calls outside the live media source code in our library.
2. The second one is more difficult. To be able to retrieve RTSP controlled streams from more than one RTSP server in one process we are using worker threads with separate usage of live media code. This works fine as we respect the threading quidelines described in FAQ. Now - the live media source code contains some exit commands that we are afraid of. What I mean - if there is a general problem in one of the threads and live media source code calls exit() as a reaction to this occurrence, the entire process exits including all other threads that did not cause the error. Since the process using the live media code can be responsible for more than just retrieving media, if live media calls exit, this can be a problem for the entire process. We would like to be able to continue the process and recover from such errors in another way than exiting the process to be more stable. Is it possible? Without good code knowledge we are not able to decide how dangerous the exit calls are for our process and what are the circumstances leading to exiting the process. Especially (there is only one exit command in each of the files below):
- the exit commands in AMRAudioRTPSource.cpp and QCELPAudioRTPSource.cpp - under which circumstances can this happen? There are exit calls after the sanity check on the parameters fails.
- the exit command in BasicTaskScheduler.cpp - if select fails, is it possible to "return" from SingleStep instead of "exit" the process?
- the exit command in FramedSource.cpp and MPEG1or2Demux.cpp - exit is called when the stream is read twice. Can this happen when using the live media code as is?
- the exit command in StreamParser.cpp - again, can this happen when using the source code as is? Is it possible to recover from this error in another way?
There are some other exit commands in MP3* files, but these are not as important for us to understand as the exit commands mentioned above.
Thanks for any comments and sorry for a long post.
Alex
More information about the live-devel
mailing list