devsound/devsoundrefplugin/src/plugin/audio/MmfPcm16toAlawhwDevice.h
changeset 0 79dd3e2336a0
equal deleted inserted replaced
-1:000000000000 0:79dd3e2336a0
       
     1 /*
       
     2 * Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MMF_PCM16_TO_ALAW_HW_DEVICE_H__
       
    19 #define __MMF_PCM16_TO_ALAW_HW_DEVICE_H__
       
    20 #include <mmf/server/mmfswcodecwrapper.h>
       
    21 #include "MMFAudioCodec.h"
       
    22 #include <mmfcodec/mmfaudiospcm16toalawcodec.h>
       
    23 
       
    24 const TInt KPCM16ToALawSrcBufferSize  = 0x2000;
       
    25 const TInt KPCM16ToAlawSinkBufferSize = 0x1000;
       
    26 
       
    27 /*
       
    28 *
       
    29 * class CMMFPcm16ToAlawHwDevice 
       
    30 *
       
    31 */
       
    32 class CMMFPcm16ToAlawHwDevice : public CMMFSwCodecWrapper
       
    33 	{
       
    34 public:
       
    35 	static  CMMFPcm16ToAlawHwDevice* NewL();
       
    36 	virtual CMMFSwCodec& Codec();
       
    37     ~CMMFPcm16ToAlawHwDevice(); 
       
    38 private:
       
    39 	void ConstructL();
       
    40 	};
       
    41 
       
    42 /*
       
    43 *
       
    44 * class CMMFPcm16ToALawCodec coverts PCM to ALaw
       
    45 *  
       
    46 */
       
    47 class CMMFPcm16ToALawCodec : public CMMFSwCodec
       
    48 	{
       
    49 public:
       
    50 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
       
    51 	virtual TUint SourceBufferSize() {return KPCM16ToALawSrcBufferSize;};
       
    52 	virtual TUint SinkBufferSize() {return KPCM16ToAlawSinkBufferSize;};
       
    53 private:
       
    54 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
       
    55 private:
       
    56 	TMMFAudioSPcm16ToAlawCodec  iPcm16ToALaw;
       
    57 	};
       
    58 
       
    59 #endif //__MMF_PCM16_TO_ALAW_HW_DEVICE_H__