MP3FromPCM.hh

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) Massimo Cora' 2006 <maxcvs@email.it>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 
00020 #ifndef _MP3FROMPCM_HH_
00021 #define _MP3FROMPCM_HH_
00022 
00023 #ifndef _FRAMED_FILTER_HH
00024 #include "FramedFilter.hh"
00025 #endif
00026 
00027 
00028 #include "OStreamAudioEncoder.hh"
00029 
00031 #define AUDIO_BLOCK_SIZE 4096
00032 
00037 class MP3FromPCM : public FramedFilter
00038 {
00039 public:
00047         static MP3FromPCM* createNew( UsageEnvironment& env, FramedSource *audio_source );
00048 
00049         virtual ~MP3FromPCM ();
00050 protected:
00055         MP3FromPCM( UsageEnvironment& env, FramedSource *audio_source );
00056 
00057 private:                // functions
00061         virtual void doGetNextFrame();
00062 
00074         static void afterGettingFrame(void* clientData, unsigned frameSize,
00075                                 unsigned numTruncatedBytes,
00076                                 struct timeval presentationTime,
00077                                 unsigned durationInMicroseconds);
00078 
00083         void afterGettingFrame1(unsigned frameSize,
00084                           unsigned numTruncatedBytes,
00085                           struct timeval presentationTime,
00086                           unsigned durationInMicroseconds);
00087 
00091         char const* MIMEtype() const;
00092 
00093 private:                // data
00095         bool _initialized;
00096 
00098         OStreamAudioEncoder* _audio_encoder;
00099         
00104         FramedSource * _audio_source;
00105 
00107         unsigned char* _input_buffer;
00108         unsigned int _input_buffer_size;
00109 };
00110 
00111 #endif /* _MP3FROMPCM_HH_ */
00112 

Generated on Tue Dec 26 10:32:38 2006 for Omnimeeting by  doxygen 1.4.7