os/mm/devsound/sounddevbt/src/Plugin/HwDevice/Audio/MmfBtPcm16ToPcm16HwDevice.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) 2002-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 // src\plugin\Hwdevice\audio\MmfBtPcm16ToPcm16HwDevice.h
    15 // 
    16 //
    17 
    18 #ifndef __MMF_BT_PCM16_TO_PCM16_HW_DEVICE_H__
    19 #define __MMF_BT_PCM16_TO_PCM16_HW_DEVICE_H__
    20 #include <mmfbtswcodecwrapper.h>
    21 #include <mdasound.h>
    22 
    23 #include "../../../swcodecwrapper/mmfBtSwCodecDataPath.h"
    24 
    25 //note we need to keep this buffer at 8K as the tone utility expects 8K
    26 const TInt KPCM16ToPCM16BufferSize = 0x2000;
    27 const TInt KDevSoundMinFrameSize = 0x800; //2K
    28 const TInt KDevSoundMaxFrameSize = 0x4000;  //16K
    29 const TInt KDevSoundDeltaFrameSize = 0x800; //2K
    30 const TInt KDevSoundFramesPerSecond = 4;
    31 
    32 /*
    33 *
    34 * class CMMFPcm16ToPcm16HwDevice
    35 *
    36 */
    37 class CMMFPcm16ToPcm16HwDevice : public CMMFSwCodecWrapper
    38 	{
    39 public:
    40 	static  CMMFPcm16ToPcm16HwDevice* NewL();
    41 	virtual CMMFSwCodec& Codec();
    42 	~CMMFPcm16ToPcm16HwDevice(); 
    43 
    44 	TUint CalculateBufferSize();
    45 private:
    46 	void ConstructL();
    47 	};
    48 
    49 /*
    50 *
    51 * class CMMFPcm16ToPcm16Codec converts Pcm16 to pcm16
    52 *
    53 */
    54 class CMMFPcm16ToPcm16Codec : public CMMFSwCodec
    55 	{
    56 public:
    57 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& /*aSource*/, CMMFBuffer& /*aDest*/);
    58 //	virtual TUint SourceBufferSize() {return KPCM16ToPCM16BufferSize;};
    59 //	virtual TUint SinkBufferSize() {return KPCM16ToPCM16BufferSize;};
    60 	virtual TUint SourceBufferSize();
    61 	virtual TUint SinkBufferSize();
    62 	virtual TBool IsNullCodec() {return ETrue;};
    63 
    64 	void SetHwDevice(CMMFPcm16ToPcm16HwDevice* aHwDevice);
    65 private:
    66 	TUint iBufferSize;
    67 	CMMFPcm16ToPcm16HwDevice* iHwDevice;
    68 	};
    69 
    70 #endif //__MMF_BT_PCM16_TO_PCM16_HW_DEVICE_H__
    71