liveMedia/include/VorbisAudioRTPSink.hh

Go to the documentation of this file.
00001 /**********
00002 This library is free software; you can redistribute it and/or modify it under
00003 the terms of the GNU Lesser General Public License as published by the
00004 Free Software Foundation; either version 2.1 of the License, or (at your
00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT
00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009 FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
00010 more details.
00011 
00012 You should have received a copy of the GNU Lesser General Public License
00013 along with this library; if not, write to the Free Software Foundation, Inc.,
00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015 **********/
00016 // "liveMedia"
00017 // Copyright (c) 1996-2013 Live Networks, Inc.  All rights reserved.
00018 // RTP sink for Vorbis audio
00019 // C++ header
00020 
00021 #ifndef _VORBIS_AUDIO_RTP_SINK_HH
00022 #define _VORBIS_AUDIO_RTP_SINK_HH
00023 
00024 #ifndef _AUDIO_RTP_SINK_HH
00025 #include "AudioRTPSink.hh"
00026 #endif
00027 
00028 class VorbisAudioRTPSink: public AudioRTPSink {
00029 public:
00030   static VorbisAudioRTPSink* createNew(UsageEnvironment& env,
00031                                        Groupsock* RTPgs,
00032                                        u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency, unsigned numChannels,
00033                                        // The following headers provide the 'configuration' information, for the SDP description:
00034                                        u_int8_t* identificationHeader, unsigned identificationHeaderSize,
00035                                        u_int8_t* commentHeader, unsigned commentHeaderSize,
00036                                        u_int8_t* setupHeader, unsigned setupHeaderSize);
00037   static VorbisAudioRTPSink* createNew(UsageEnvironment& env,
00038                                        Groupsock* RTPgs,
00039                                        u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency, unsigned numChannels,
00040                                        char const* configStr);
00041     // an optional variant of "createNew()" that takes a Base-64-encoded 'configuration' string,
00042     // rather than the raw configuration headers. as parameter.
00043 protected:
00044   VorbisAudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs,
00045                      u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency, unsigned numChannels,
00046                      u_int8_t* identificationHeader, unsigned identificationHeaderSize,
00047                      u_int8_t* commentHeader, unsigned commentHeaderSize,
00048                      u_int8_t* setupHeader, unsigned setupHeaderSize,
00049                      u_int32_t identField = 0xFACADE);
00050         // called only by createNew()
00051 
00052   virtual ~VorbisAudioRTPSink();
00053 
00054 private: // redefined virtual functions:
00055   virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line
00056 
00057   virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
00058                                       unsigned char* frameStart,
00059                                       unsigned numBytesInFrame,
00060                                       struct timeval framePresentationTime,
00061                                       unsigned numRemainingBytes);
00062   virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart,
00063                                                  unsigned numBytesInFrame) const;
00064   virtual unsigned specialHeaderSize() const;
00065   virtual unsigned frameSpecificHeaderSize() const;
00066 #endif
00067 
00068 private:
00069   u_int32_t fIdent; // "Ident" field used by this stream.  (Only the low 24 bits of this are used.)
00070   char* fFmtpSDPLine;
00071 };

Generated on Mon Apr 29 13:28:01 2013 for live by  doxygen 1.5.2