liveMedia/include/MP3AudioFileServerMediaSubsession.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-2012 Live Networks, Inc.  All rights reserved.
00018 // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s
00019 // on demand, from an MP3 audio file.
00020 // (Actually, any MPEG-1 or MPEG-2 audio file should work.)
00021 // C++ header
00022 
00023 #ifndef _MP3_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH
00024 #define _MP3_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH
00025 
00026 #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH
00027 #include "FileServerMediaSubsession.hh"
00028 #endif
00029 #ifndef _MP3_ADU_INTERLEAVING_HH
00030 #include "MP3ADUinterleaving.hh"
00031 #endif
00032 #ifndef _MP3_ADU_HH
00033 #include "MP3ADU.hh"
00034 #endif
00035 
00036 class MP3AudioFileServerMediaSubsession: public FileServerMediaSubsession{
00037 public:
00038   static MP3AudioFileServerMediaSubsession*
00039   createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource,
00040             Boolean generateADUs, Interleaving* interleaving);
00041       // Note: "interleaving" is used only if "generateADUs" is True,
00042       // (and a value of NULL means 'no interleaving')
00043 
00044 protected:
00045   MP3AudioFileServerMediaSubsession(UsageEnvironment& env,
00046                                     char const* fileName, Boolean reuseFirstSource,
00047                                     Boolean generateADUs,
00048                                     Interleaving* interleaving);
00049       // called only by createNew();
00050   virtual ~MP3AudioFileServerMediaSubsession();
00051 
00052   FramedSource* createNewStreamSourceCommon(FramedSource* baseMP3Source, unsigned mp3NumBytes, unsigned& estBitrate);
00053   void getBaseStreams(FramedSource* frontStream,
00054                       FramedSource*& sourceMP3Stream, ADUFromMP3Source*& aduStream/*if any*/);
00055 
00056 protected: // redefined virtual functions
00057   virtual void seekStreamSource(FramedSource* inputSource, double& seekNPT, double streamDuration, u_int64_t& numBytes);
00058   virtual void setStreamSourceScale(FramedSource* inputSource, float scale);
00059   virtual FramedSource* createNewStreamSource(unsigned clientSessionId,
00060                                               unsigned& estBitrate);
00061   virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock,
00062                                     unsigned char rtpPayloadTypeIfDynamic,
00063                                     FramedSource* inputSource);
00064   virtual void testScaleFactor(float& scale);
00065   virtual float duration() const;
00066 
00067 protected:
00068   Boolean fGenerateADUs;
00069   Interleaving* fInterleaving;
00070   float fFileDuration;
00071 };
00072 
00073 #endif

Generated on Thu May 17 07:11:45 2012 for live by  doxygen 1.5.2