00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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:
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:
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
00112