1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/devsoundrefplugin/src/plugin/audio/MMFpcm16ToPcm16HwDevice.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,90 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// include\mmf\src\plugin\Hwdevice\audio\pcm16ToPcm16HwDevice.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __MMF_PCM16_TO_PCM16_HW_DEVICE_H__
1.22 +#define __MMF_PCM16_TO_PCM16_HW_DEVICE_H__
1.23 +#include <mmf/server/mmfswcodecwrapper.h>
1.24 +
1.25 +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER
1.26 + #include "mdasoundadapter.h"
1.27 +#else
1.28 + #include <mdasound.h>
1.29 +#endif
1.30 +
1.31 +#include "../../swcodecwrapper/mmfswaudioinput.h"
1.32 +
1.33 +#include "../../swcodecwrapper/mmfSwCodecDataPath.h"
1.34 +
1.35 +// for the bitrate custom interface
1.36 +#include <mmf/server/devsoundstandardcustominterfaces.h>
1.37 +
1.38 +//note we need to keep this buffer at 8K as the tone utility expects 8K
1.39 +const TInt KPCM16ToPCM16BufferSize = 0x2000;
1.40 +const TInt KDevSoundMinFrameSize = 0x800; //2K
1.41 +const TInt KDevSoundMaxFrameSize = 0x4000; //16K
1.42 +const TInt KDevSoundDeltaFrameSize = 0x800; //2K
1.43 +const TInt KDevSoundFramesPerSecond = 4;
1.44 +
1.45 +/*
1.46 +*
1.47 +* class CMMFPcm16ToPcm16HwDevice
1.48 +*
1.49 +*/
1.50 +class CMMFPcm16ToPcm16HwDevice : public CMMFSwCodecWrapper,
1.51 + public MMMFDevSoundCustomInterfaceBitRate
1.52 + {
1.53 +public:
1.54 + static CMMFPcm16ToPcm16HwDevice* NewL();
1.55 + virtual CMMFSwCodec& Codec();
1.56 + virtual TAny* CustomInterface(TUid aInterfaceId);
1.57 + ~CMMFPcm16ToPcm16HwDevice();
1.58 +
1.59 + TUint CalculateBufferSize();
1.60 +private:
1.61 + // from MMMFDevSoundCustomInterfaceBitRate
1.62 + virtual void GetSupportedBitRatesL(RArray<TInt>& aSupportedBitRates);
1.63 + virtual TInt BitRateL();
1.64 + virtual void SetBitRateL(TInt aBitRate);
1.65 +
1.66 + void BitRatesFromSampleRatesL(RArray<TInt>& aSupportedBitRates, const RArray<TInt>& aSupportedSampleRates);
1.67 +
1.68 + void ConstructL();
1.69 + };
1.70 +
1.71 +/*
1.72 +*
1.73 +* class CMMFPcm16ToPcm16Codec converts Pcm16 to pcm16
1.74 +*
1.75 +*/
1.76 +class CMMFPcm16ToPcm16Codec : public CMMFSwCodec
1.77 + {
1.78 +public:
1.79 + virtual TCodecProcessResult ProcessL(const CMMFBuffer& /*aSource*/, CMMFBuffer& /*aDest*/);
1.80 +// virtual TUint SourceBufferSize() {return KPCM16ToPCM16BufferSize;};
1.81 +// virtual TUint SinkBufferSize() {return KPCM16ToPCM16BufferSize;};
1.82 + virtual TUint SourceBufferSize();
1.83 + virtual TUint SinkBufferSize();
1.84 + virtual TBool IsNullCodec() {return ETrue;};
1.85 +
1.86 + void SetHwDevice(CMMFPcm16ToPcm16HwDevice* aHwDevice);
1.87 +private:
1.88 + TUint iBufferSize;
1.89 + CMMFPcm16ToPcm16HwDevice* iHwDevice;
1.90 + };
1.91 +
1.92 +#endif //__MMF_PCM16_TO_PCM16_HW_DEVICE_H__
1.93 +