liveMedia/include/SimpleRTPSink.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-2008 Live Networks, Inc.  All rights reserved.
00018 // A simple RTP sink that packs frames into each outgoing
00019 //     packet, without any fragmentation or special headers.
00020 // C++ header
00021 
00022 #ifndef _SIMPLE_RTP_SINK_HH
00023 #define _SIMPLE_RTP_SINK_HH
00024 
00025 #ifndef _MULTI_FRAMED_RTP_SINK_HH
00026 #include "MultiFramedRTPSink.hh"
00027 #endif
00028 
00029 class SimpleRTPSink: public MultiFramedRTPSink {
00030 public:
00031   static SimpleRTPSink*
00032   createNew(UsageEnvironment& env, Groupsock* RTPgs,
00033             unsigned char rtpPayloadFormat,
00034             unsigned rtpTimestampFrequency,
00035             char const* sdpMediaTypeString,
00036             char const* rtpPayloadFormatName,
00037             unsigned numChannels = 1,
00038             Boolean allowMultipleFramesPerPacket = True,
00039             Boolean doNormalMBitRule = True);
00040   // "doNormalMBitRule" means: If the medium is video, set the RTP "M"
00041   // bit on each outgoing packet iff it contains the last (or only)
00042   // fragment of a frame.  (Otherwise, leave the "M" bit unset.)
00043 protected:
00044   SimpleRTPSink(UsageEnvironment& env, Groupsock* RTPgs,
00045                 unsigned char rtpPayloadFormat,
00046                 unsigned rtpTimestampFrequency,
00047                 char const* sdpMediaTypeString,
00048                 char const* rtpPayloadFormatName,
00049                 unsigned numChannels,
00050                 Boolean allowMultipleFramesPerPacket,
00051                 Boolean doNormalMBitRule);
00052         // called only by createNew()
00053 
00054   virtual ~SimpleRTPSink();
00055 
00056 protected: // redefined virtual functions
00057   virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
00058                                       unsigned char* frameStart,
00059                                       unsigned numBytesInFrame,
00060                                       struct timeval frameTimestamp,
00061                                       unsigned numRemainingBytes);
00062   virtual
00063   Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart,
00064                                          unsigned numBytesInFrame) const;
00065   virtual char const* sdpMediaType() const;
00066 
00067 private:
00068   char const* fSDPMediaTypeString;
00069   Boolean fAllowMultipleFramesPerPacket;
00070   Boolean fSetMBitOnLastFrames;
00071 };
00072 
00073 #endif

Generated on Tue Oct 7 15:38:09 2008 for live by  doxygen 1.5.2