[Live-devel] raw PCM from TCP socket to RTP

Martin Wright mwright3 at slb.com
Fri May 4 07:37:03 PDT 2012


Hi Ross

I know you won't be able to debug my code but can you say if I'm going in the right direction or if there is anything obviously missing from this description?

I have written PCMSource.cpp, based on DeviceSource.cpp, in which createNew() creates a socket and connects to the remote endpoint, and doGetNextFrame() does the recv() and then calls deliverFrame() to do the memmove(fTo, receivedData).

PCMStreamServerMediaSubsession.cpp is based on WAVAudioFileServerMediaSubsession.cpp but the createNewStreamSource() can hardcode the bits/sample, sampling frequency and number of channels information that would normally come from the .wav file header.

These new files compile on CentOS 5.

Adding an extra section to testOnDemandRTSPServer.cpp to create a stream name allows me to enter the url and reproduce the speech from the original mp3 podcast I'm using to test this with VLC from a Win 7 workstation. Nice; the raw samples are being converted to a recognisable RTP stream. Unfortunately, I am only getting the first second of a minute's worth of audio data.

openRTSP -Q rtsp://134.32.45.50:8554/pcmAudioTest shows that a variable number of packets are being lost in a sequence of tests.

I haven't done anything with the TaskScheduler code. I have changed MediaSink.cpp to set OutPacketBuffer::maxSize appropriately for the amount of data I am sending.

Thanks
Martin

From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: 25 April 2012 15:45
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] DeviceSource.cpp socket implementation

I'm wondering if anybody has a simple socket reading version of the testOnDemandRTSPServer program.

What you really mean to ask for is "a subclass of the 'OnDemandServerMediaSubsession' class that reads from a socket".  There is such a class that you can use as a model: "MPEG2TransportUDPServerMediaSubsession".  Note also how this is used in "testOnDemandRTSPServer".

If, however, you are asking about reading from a *stream* (i.e., TCP) socket, rather than from a datagram socket, then you should be able to convert the socket into a "FILE*" (assuming that you're not using Windoze), and instead use "WAVAudioFileServerMediaSubsession" as a model for your new "OnDemandServerMediaSubsession" subclass.

(Either way, you will need to write your own "OnDemandServerMediaSubsession" subclass.)

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/20120504/67b36542/attachment.html>


More information about the live-devel mailing list