[Live-devel] Vorbis implementation

Ross Finlayson finlayson at live555.com
Mon Nov 26 04:07:57 PST 2007


>Hello,
>I want to stream vorbis file through RTP using Live555. In order to 
>testMP3Streamer, I guess that my target is to implement 
>VorbisRTPSink class and VorbisFileSource class. And some questions 
>in this connection:
>1) VorbisRTPSink. Is these correct:
>    unsigned VorbisAudioRTPSink::specialHeaderSize() const {
>        return 4;
>    }

Yes.

>    unsigned VorbisAudioRTPSink::frameSpecificHeaderSize() const {
>        return 2;
>    }

This depends.  Is the 2-byte "length" field in each Vorbis payload 
'packet' already present in the source data?  If so, then you should 
*not* redefine "frameSpecificHeaderSize()" (so that it will continue 
to return 0), because the data that you'll read from the source will 
already contain the length field.

If, however, the 2-byte "length" field is *not* present in the source 
data, then you will have to add it yourself (in your 
"doSpecialFrameHandling()" implementation, by calling 
"setFrameSpecificHeaderBytes(ptr, 2)")


>2) VorbisRTPSink. What should I write in doSpecialFrameHandling()? 
>Is this a place where I should fill vorbis payload header?

Yes, this is where you will fill in the 4-byte Payload Header, by 
calling "setSpecialHeaderWord()".

You should examine the existing "MultiFramedRTPSink" subclasses, to 
see how "doSpecialFrameHandling()" is implemented for various RTP 
payload formats.


>3) VorbisRTPSink. Is there other functions which I should to implement?

I don't think so, no.


>4) I have no any ideas about redefinition of FrameFileSource class. 
>Could you explain me please what should I do in the first place and 
>what after?

I'm sorry, I can't help you here, because I don't know anything about 
the file format that you'll be reading.  If your audio frames are all 
fixed size (with the size known in advance), then you might not need 
to define a new class - just use "ByteStreamFileSource", with an 
appropriate non-zero "preferredFrameSize" parameter.  If, however, 
your audio frames are variable-sized, then you will have to define a 
new class.  You may be able to use the existing "*AudioFileSource" 
classes as a model.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list