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

Sampsa Riikonen sampsa.riikonen at iki.fi
Fri Dec 18 05:46:20 PST 2015


Dear Jeremiah,

Thanks for sharing the code.  I think your suggestion is pretty close to 
what I want to do..  Let's see.

I was thinking how to port my code into using live555 and it all boils 
down to this:

Currently, I have a thread that listens to multiprocessing pipes and 
streaming sockets, i.e, in pseudo-C (select is the 
waiting-for-i/o-completion system call):

select(pipes, sockets, timeout)
After "select" is triggered: check pipes and/or pull packets out of 
sockets, etc.

I should do a simultaneous select call on the multiprocessing pipes of 
my own program and live555's event handling (live555 does its own select 
calls on sockets, I assume), I should do something like this:

select(pipes, live555 event, timeout)
After select is triggered: read message from pipe and/or do a 
SingleStep() in the live555 event handling.

To make this, I need something from live555 that tells me that a pending 
event/step has been completed .. after this I can "manually" do a 
SingleStep().

The thing is, that doing the event loop myself, I can listen to the 
pipes at the same time.

Any ideas on this matter are appreciated..!

Regards,

Sampsa



On 17.12.2015 19:58, Jeremiah Morrill wrote:
>
> >>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
>
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel

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


More information about the live-devel mailing list