examples/SFExamples/oggvorbiscodec/src/VorbisEncoder/VorbisEncoderPlugIn.h

00001 // VorbisEncoderPlugIn.h
00002 //
00003 // Copyright (c) Symbian Software Ltd 2005-2008.  All rights reserved.
00004 //
00005 
00006 
00007 #ifndef VORBISENCODERPLUGIN_H
00008 #define VORBISENCODERPLUGIN_H
00009 
00010 // for the bitrate custom interface
00011 #include <mmf/server/devsoundstandardcustominterfaces.h>
00012 
00013 //This class is responsible for taking the input buffer and producing an encoded
00014 //Output buffer
00015 class CVorbisEncoderPlugIn : public CMMFSwCodec
00016     {
00017 public:
00018     static CVorbisEncoderPlugIn* NewL();
00019     virtual ~CVorbisEncoderPlugIn();
00020     //from CMMFSwCodec
00021     virtual TCodecProcessResult ProcessL
00022             (const CMMFBuffer& aSource, CMMFBuffer& aDest);
00023         virtual TUint SourceBufferSize();
00024     virtual TUint SinkBufferSize();
00025     TInt Configure(TInt aSampleRate, TInt aChannels);
00026     // required functions for bit rate management    
00027     void GetSupportedBitRatesL(RArray<TInt>& aSupportedBitRates);
00028     TInt BitRateL();
00029     void SetBitRateL(TInt aBitRate);
00030 private:
00031     CVorbisEncoderPlugIn();
00032     void ConstructL();
00033 private:
00034     CVorbisProcessor* iProc;
00035     };
00036 
00037 //This is a framework class which creates the Codec class above and supports the bitrate
00038 //custom interface
00039 class CVorbisEncoderPlugInWrapper : public CMMFSwCodecWrapper, public MMMFDevSoundCustomInterfaceBitRate
00040     {
00041 public:
00042     static CVorbisEncoderPlugInWrapper* NewL();
00043     virtual ~CVorbisEncoderPlugInWrapper();
00044     //from CMMFSwCodecWrapper
00045     TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
00046     TInt SetConfig(TTaskConfig& aConfig);
00047     //from CMMFSwCodecWrapper
00048     CMMFSwCodec& Codec();
00049     // from CMMFHwDevice
00050     TAny* CustomInterface(TUid aInterfaceId);
00051     //from MMMFDevSoundCustomInterfaceBitRate
00052     void GetSupportedBitRatesL(RArray<TInt>& aSupportedBitRates);
00053     TInt BitRateL();
00054     void SetBitRateL(TInt aBitRate);
00055 private:
00056     CVorbisEncoderPlugInWrapper();
00057     void ConstructL();
00058 private:
00059     CVorbisEncoderPlugIn* iDevice;
00060     TBool iCodecReturned; //flag recording if ownership of codec has been transeferred to client
00061     };
00062 
00063 #endif //VORBISENCODERPLUGIN_H

Generated by  doxygen 1.6.2