[Live-devel] controlling the rtsp negotiation with custom event loop

Jeremiah Morrill Jeremiah.Morrill at econnect.tv
Thu Dec 17 09:58:27 PST 2015


>>I have an application that has its own event loop when manipulating/reading sockets

So it sounds like you would like to use your event loop with the live555 library.  I have some experience here.  I was able to get libuv event loop and live555 work together.  You should be able to do the same with whatever event loop you are using, but it most definitely do not want to do a naïve mash-up of two event loops.  Competing event loops would just cause unneeded CPU burning or event loop blocking.

From what I remember you will need/know:

1.)    A custom sub-class of the live555 task scheduler, eg BasicTaskScheduler?

2.)    Your own event-loop that supports a timer (execute a call-back at scheduled times).  This is to drive the live555’s “scheduledTasks”.

3.)    Event loop support for kicking up events for when a socket is read-ready, write-ready or error.  This is to drive callbacks for when sockets can be read or written to…or hit error state

4.)    Live555 already does async read-writes, so it’s best to let it execute the bsd socket code to read and write bytes

5.)    Dns resolving is still synchronous in this library, so you may want to resolve hostnames and pass the library a url such as “rtsp://192.168.x.x/” vs “rtsp://my_server/”

I have an example in the links below from a unfinished project.  Please note this code is not production ready and really just serves as an example, use at your own risk.


https://github.com/jmorrill/libuvxx/blob/master/libuvxx_rtsp/include/details/_uvxx_task_scheduler.hpp
https://github.com/jmorrill/libuvxx/blob/master/libuvxx_rtsp/src/details/_uvxx_task_scheduler.cpp





Sent from Mail<http://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20151217/c3a887f5/attachment.html>


More information about the live-devel mailing list