[Live-devel] RTSP customization

Juan Manuel Lopez Baio jmbaio at gmail.com
Wed Aug 23 19:06:59 PDT 2006


On 8/23/06, Victor Kozhuhov <vkozhuhov at gmx.net> wrote:
> Hello,
>
> I am writing a sort of custom RTSP server application, intended to stream
> specific media files on demand.
> When application starts, I have no idea about real file names, so I am
> unable to create ServerMediaSession objects and submit them to the server
> prior to event loop.
> It is possible to list the directory on startup, but its content may change
> in run time.
>
> Please let me know if the is an elegant way to update ServerMediaSessions
> table in run-time in some special case (for example, if request link is not
> listed)?

Funny, I am doing something _very_ similar.

>
> I found the following in August mail list digest:
> "You can add new "ServerMediaSession" objects to (or remove existing
> "ServerMediaSession" objects from) a running RTSPServer at any time.
> But you do this within the event loop - not using threads.  Please,
> everybody, read the FAQ! "
>

¡Ouch! Threads are exactly the solution I used, and for two weeks now
I've been trying it with very good results (I read the faq also, but
assumed if I kept all livemedia-related objects in its own thread
without sharing with objects of my own, there would be no problem).
The event loop is run in its own thread, and the main thread creates
the MediaSessions and adds them to the RTSPServer as needed.
There's not really mucho more to it, but if there is an actual danger
in this, I'll review it all.
So, well, I guess I'll be following this thread closely... :)



More information about the live-devel mailing list