[Live-devel] Best way to "signal" RTPSink to stop playing

Ben Rush ben at ben-rush.net
Fri Jun 24 12:25:55 PDT 2016


I'm using SimpleRTPSink to send audio to a client. Works great. I have it
setup like this:

        SimpleRTPSink* sink = SimpleRTPSink::createNew(this->envir(),
rtpGroupsock,
            payloadFormatCode, fSamplingFrequency,
            "audio", mimeType, fNumChannels);
.....
        RTCPInstance::createNew(this->envir(), _rtcpSock,
            estimatedSessionBandwidth, CNAME,
            sink, NULL /* we're a server */, False);

.....
        AudioInputDevice *audioSource =
AudioInputDevice::createNew(this->envir(), 0, bitsPerSample,
            numChannels, samplingFrequency);
        FramedSource* swappedSource =
EndianSwap16::createNew(this->envir(), audioSource);

        Boolean started = sink->startPlaying(*swappedSource, nullptr, sink);

I'm using the RTPSink/Source so I can implement two-way audio (full
duplex). What I'd like to do is properly shut things down when one or both
ends of the two-way audio disconnects or decides to not longer participate
in the call. What is the best way to do this using the Live555 libraries?

I know to actually STOP playing I just do sink->stopPlaying(); but I need
to know when to call this.

I'm still pretty green when it comes to RTP/RTCP, so I'm not sure if this
is something supported, or if I'm going to need to implement my own
communication channel (my own socket connection just for control).

I'm assuming that's what RTCPInstance affords me, though.

        RTCPInstance::createNew(this->envir(), _rtcpSock,
            estimatedSessionBandwidth, CNAME,
            sink, NULL /* we're a server */, False);

I see I have the ability to call sendBYE() via the RTCPInstance. Do I do
this from the client to initiate a shutdown with the sender?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20160624/59191498/attachment.html>


More information about the live-devel mailing list