<div dir="ltr">Awesome, so just to be clear, calling something like this: <br><br><div>const unsigned maxCNAMElen = 100;</div><div> unsigned char CNAME[maxCNAMElen + 1];</div><div> gethostname((char*)CNAME, maxCNAMElen);</div><div> CNAME[maxCNAMElen] = '\0'; // just in case</div><div><br></div><div> unsigned int destinationRtcpPortNumber = destinationRtpPortNumber + 1;</div><div> unsigned int ttl = 7;</div><div><br></div><div> /* struct in_addr destinationAddress;</div><div> destinationAddress.s_addr = our_inet_addr(destinationIP.c_str());*/</div><div> const Port destinationRtpPort(destinationRtpPortNumber);</div><div> const Port destinationRtcpPort(destinationRtcpPortNumber);</div><div><br></div><div> _rtpSock = new Groupsock(usageEnviroment, destinationAddress, destinationRtpPort, ttl);</div><div> _rtcpSock = new Groupsock(usageEnviroment, destinationAddress, destinationRtcpPort, ttl);</div><div><br></div><div> const int payloadFormatCode = 11;</div><div> const char* mimeType = "L16";</div><div> const int fSamplingFrequency = 44100;</div><div> const int fNumChannels = 1;</div><div><br></div><div> //return SimpleRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic, );</div><div> _sink = SimpleRTPSink::createNew(usageEnviroment, _rtcpSock,</div><div> payloadFormatCode, fSamplingFrequency,</div><div> "audio", mimeType, fNumChannels);</div><div><br></div><div> // Create (and start) a 'RTCP instance' for this RTP sink:</div><div> const unsigned estimatedSessionBandwidth = 5000; // in kbps; for RTCP b/w share</div><div><br></div><div> _rtcpInstance = RTCPInstance::createNew(usageEnviroment, _rtcpSock,</div><div> estimatedSessionBandwidth, CNAME,</div><div> _sink, NULL /* we're a server */, False);</div><div> //_rtcpInstance->setByeHandler(afterByeCalled, this); </div><div><br></div><div> unsigned char bitsPerSample = 16;</div><div> unsigned char numChannels = 1;</div><div> unsigned samplingFrequency = 44100;</div><div> unsigned granularityInMS = 20;</div><div><br></div><div> AudioInputDevice *source = AudioInputDevice::createNew(usageEnviroment, 1, bitsPerSample,</div><div> numChannels, samplingFrequency);</div><div> FramedSource* swappedSource = EndianSwap16::createNew(usageEnviroment, source);</div><div><br></div><div> char str[512]; </div><div><br></div><div> inet_ntop(AF_INET, &(destinationAddress.S_un.S_addr), str, sizeof(str)); </div><div><br></div><div> bool ret = _sink->startPlaying(*swappedSource, nullptr, _sink);<br><br>...from within afterGettingFrame() of my own MediaSink-derived class is perfectly acceptable (this is the body of a function called once to start sending RTP traffic back). <br><br>Correct? </div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jun 27, 2016 at 6:13 PM Ross Finlayson <<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, you can call any of these functions while you’re in the event loop. In fact, there’s no reason in principle why your “main()” function can’t just be nothing but a call to “doEventLoop()” - so that everything gets called from event handlers. (In practice, however, “main()” needs to do some initial setup to ensure that events start happening - before the call to “doEventLoop()”.)<br>
<br>
But once you’re in the event loop (and thus are handling events), you can call whatever functions you like.<br>
<br>
<br>
Ross Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/" rel="noreferrer" target="_blank">http://www.live555.com/</a><br>
<br>
<br>
_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" rel="noreferrer" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
</blockquote></div>