[Live-devel] Two liveMedia components sharing Groupsock. Shutting down one stops the other

Ross Finlayson finlayson at live555.com
Thu Aug 6 12:31:22 PDT 2015


> I have implemented a multicast out component using SimpleRTPSink and RTCPInstance, and a multicast in component using SimpleRTPSource and RTCPInstance. When the multicast in component is receiving from a multicast out component on the same device, I have them share Groupsocks for RTP and RTCP.
> 
> The issue I'm having is when I go to shutdown one component, it seems to stop the other component. The code tracks how many components own the Groupsock, so I know the Groupsock isn't being deleted.
> 
> Say for example I'm shutting down the multicast out component like so:
> 
> rtp_sink->stopPlaying();
> Medium::close(framed_source);
> Medium::close(rtcp_instance);
> Medium::close(rtp_sink);
> 
> This will cause the multicast in component to stop working and stop receiving any more streams

The reason for this is that a “RTCPInstance” - even when used only in concert with a “RTPSink” - both sends *and receives* packets.  Therefore, closing the “RTCPInstance” object caused the LIVE555 library to turn off background read handling on the ‘groupsock’.

However, I have just released a new version (2015.08.06) of the “LIVE555 Streaming Media” code that will prevent the “RTCPInstance” destructor from turning off background read handling on the ‘groupsock’ if it is being shared with a “RTPSource” - i.e., if RTP and RTCP are being multiplexed, with all packets being initially received by the “RTPSource”.

This new version should allow you to close the “RTCPInstance”, while allowing incoming RTP packets to still get handled by the “RTPSource”.

Note, however, that this will work *only if* you have a *single* “RTCPInstance” object for both your input and output components, rather than separate “RTCPInstance” objects for each.  I.e., you will need to create your “RTPSource” and “RTPSink” objects (in either order), and then create a (single) “RTCPInstance” that takes both your “RTPSource” and “RTPSink” objects as parameter (to “RTCPInstance::createNew()”).

Then, when closing the “RTCPInstance”, you must do so before closing *either of* the “RTPSource” or “RTPSink” instances.  (And, of course, you must close the “RTCPInstance” only once.)

This should let you do what you’re trying to do (though I’m not sure why you’re trying to do it…).

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

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


More information about the live-devel mailing list