[Live-devel] relay the audio and video that coming from two ports

Ross Finlayson finlayson at live555.com
Sat Sep 29 13:10:59 PDT 2012


> 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.

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.,
- Create another "groupsock" object: "inputGroupsock2"
- From this, create another "FramedSource*": "source2"
- Create another "groupsock" object: "outputGroupsock2"
- From this, create another "MediaSink*": "sink2"
- Then call
	sink2->startPlaying(*source2, NULL, NULL);
This call can be before or after the original
	sink->startPlaying(*source, NULL, NULL);
but both must occur before the call to
	env->taskScheduler().doEventLoop();


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/20120929/d1f542f6/attachment.html>


More information about the live-devel mailing list