<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><base href="x-msg://3241/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 10px; font-family: verdana; font-size: 10pt; "><div style="text-indent: 2em; ">I know that the testRelay program repeatedly reads from a UDP socket, and retransmits each packet's payload to a new (multicast or unicast) address and port. The data reading from the UDP socket contains audio and video data. Now I want to relay the RTSP consists of an audio and a video subsession.The RTSP sends audio and video data to the diffrent port,But the testRelay program can read data only from one port.What can I to do to relay the audio and video that coming from two ports.</div></div></blockquote><div><br></div></div>It's easy.  Simply model your application on the existing "testRelay" code, but duplicate the code that creates source and sink objects, and calls "startPlaying()".  I.e.,<div>- Create another "groupsock" object: "inputGroupsock2"</div><div>- From this, create another "FramedSource*": "source2"</div><div>- Create another "groupsock" object: "outputGroupsock2"</div><div>- From this, create another "MediaSink*": "sink2"</div><div>- Then call</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>sink2->startPlaying(*source2, NULL, NULL);</div><div>This call can be before or after the original</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>sink->startPlaying(*source, NULL, NULL);</div><div>but both must occur before the call to</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>env->taskScheduler().doEventLoop();</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>