os/mm/mmlibs/mmfw/src/Plugin/Codec/audio/MMFImaAdPcmToPcm16Codec.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 #ifndef MMFIMAADPCMTOPCM16CODEC_H
    18 #define MMFIMAADPCMTOPCM16CODEC_H
    19 
    20 #include "MMFCodecBaseDefinitions.h"
    21 #include "MMFAudioCodecBase.h"
    22 #include <mmf/server/devsoundstandardcustominterfaces.h>
    23 
    24 const TUint KMaxImaAdpcmBlockAlign = 2048;
    25 const TUint KImaAdpcmBitsPerSample = 4;
    26 
    27 //mono so iImaAdpcmTo16Pcm constructed with 1 (mono)
    28 class CMMFImaAdPcmPcm16Codec : public CMMFCodec, public MMMFDevSoundCustomInterfaceFileBlockLength
    29 	{
    30 public:
    31 	static CMMFCodec* NewL(TAny* aInitParams);
    32 	virtual ~CMMFImaAdPcmPcm16Codec();
    33 	TCodecProcessResult ProcessL(const CMMFBuffer& aSrc, CMMFBuffer& aDst);
    34 	void ConfigureL(TUid aConfigType, const TDesC8& aConfigData);
    35 	// from MMMFDevSoundCustomInterfaceFileBlockLength
    36 	void SetFileBlockLength(TUint aBlockAlign);
    37 protected:
    38 	virtual TInt Extension_(TUint aExtensionId, TAny*& aExtPtr, TAny*);	
    39 private:
    40 	CMMFImaAdPcmPcm16Codec();
    41 	void ConstructL(TAny* aInitParams);
    42 	virtual void ResetL();
    43 	
    44 private:
    45 	//owned by the Datapath
    46 	const CMMFDataBuffer* iSrc;
    47 	CMMFDataBuffer* iDst;
    48 
    49 	TUint iTempSrcBufferCount;
    50 	TUint8* iTempSrcBufferPtr;
    51 	TUint8 iTempSrcBuffer[KMaxImaAdpcmBlockAlign];
    52 	TMMFImaAdpcmTo16PcmCodecOld iImaAdpcmTo16Pcm ;
    53 	TUint iLastFrameNumber;
    54 	
    55 	// allow configuring sample rate
    56 	TUint iChannels;
    57 	TUint iSamplesRate;
    58 	TUint iSamplesPerBlock;
    59 	TUint iBlockAlign;
    60 	};
    61 
    62 
    63 #endif