os/mm/devsound/sounddevbt/src/Plugin/HwDevice/Audio/MmfBtPcmU8ToPcm16HwDevice.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\MmfBtPcmU8ToPcm16HwDevice.h
    15 // 
    16 //
    17 
    18 #ifndef __MMF_BT_PCMU8_TO_PCM16_HW_DEVICE_H__
    19 #define __MMF_BT_PCMU8_TO_PCM16_HW_DEVICE_H__
    20 
    21 #include <mmfbtswcodecwrapper.h>
    22 #include "MmfBtAudioCodec.h"
    23 #include "MMFAudioU8ToS16PcmCodec.h"
    24 
    25 const TInt KPCMU8ToPCM16SourceBufferSize = 0x0800;
    26 const TInt KPCMU8ToPCM16SinkBufferSize   = 0x1000; //sink buffer length is twice source
    27 
    28 /*
    29 * 
    30 * class CMMFPcmU8ToPcm16HwDevice
    31 *
    32 */
    33 class CMMFPcmU8ToPcm16HwDevice : public CMMFSwCodecWrapper
    34 	{
    35 public:
    36 	static  CMMFPcmU8ToPcm16HwDevice* NewL();
    37 	virtual CMMFSwCodec& Codec();
    38     ~CMMFPcmU8ToPcm16HwDevice(); 
    39 private:
    40 	void ConstructL();
    41 	};
    42 
    43 /*
    44 *
    45 * class CMMFPcmU8ToPcm16Codec converts Pcm 8 unsigned to Pcm16
    46 *
    47 */
    48 class CMMFPcmU8ToPcm16Codec : public CMMFSwCodec
    49 	{
    50 public:
    51 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
    52 	virtual TUint SourceBufferSize() {return KPCMU8ToPCM16SourceBufferSize;};
    53 	virtual TUint SinkBufferSize() {return KPCMU8ToPCM16SinkBufferSize;};
    54 private:
    55 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
    56 private:
    57 	TMMFAudioU8ToS16PcmCodec iAudioU8ToS16Pcm ;
    58 	};
    59 
    60 #endif //__MMF_BT_PCMU8_TO_PCM16_HW_DEVICE_H__
    61