sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #ifndef MMFIMAADPCMTOPCM16CODEC_H sl@0: #define MMFIMAADPCMTOPCM16CODEC_H sl@0: sl@0: #include "MMFCodecBaseDefinitions.h" sl@0: #include "MMFAudioCodecBase.h" sl@0: #include sl@0: sl@0: const TUint KMaxImaAdpcmBlockAlign = 2048; sl@0: const TUint KImaAdpcmBitsPerSample = 4; sl@0: sl@0: //mono so iImaAdpcmTo16Pcm constructed with 1 (mono) sl@0: class CMMFImaAdPcmPcm16Codec : public CMMFCodec, public MMMFDevSoundCustomInterfaceFileBlockLength sl@0: { sl@0: public: sl@0: static CMMFCodec* NewL(TAny* aInitParams); sl@0: virtual ~CMMFImaAdPcmPcm16Codec(); sl@0: TCodecProcessResult ProcessL(const CMMFBuffer& aSrc, CMMFBuffer& aDst); sl@0: void ConfigureL(TUid aConfigType, const TDesC8& aConfigData); sl@0: // from MMMFDevSoundCustomInterfaceFileBlockLength sl@0: void SetFileBlockLength(TUint aBlockAlign); sl@0: protected: sl@0: virtual TInt Extension_(TUint aExtensionId, TAny*& aExtPtr, TAny*); sl@0: private: sl@0: CMMFImaAdPcmPcm16Codec(); sl@0: void ConstructL(TAny* aInitParams); sl@0: virtual void ResetL(); sl@0: sl@0: private: sl@0: //owned by the Datapath sl@0: const CMMFDataBuffer* iSrc; sl@0: CMMFDataBuffer* iDst; sl@0: sl@0: TUint iTempSrcBufferCount; sl@0: TUint8* iTempSrcBufferPtr; sl@0: TUint8 iTempSrcBuffer[KMaxImaAdpcmBlockAlign]; sl@0: TMMFImaAdpcmTo16PcmCodecOld iImaAdpcmTo16Pcm ; sl@0: TUint iLastFrameNumber; sl@0: sl@0: // allow configuring sample rate sl@0: TUint iChannels; sl@0: TUint iSamplesRate; sl@0: TUint iSamplesPerBlock; sl@0: TUint iBlockAlign; sl@0: }; sl@0: sl@0: sl@0: #endif