1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/WavDecodeUtility.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,70 @@
1.4 +// Copyright (c) 2003-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 +//
1.18 +
1.19 +class CWavDecodeUtility: public CBase
1.20 + {
1.21 +public:
1.22 + static CWavDecodeUtility* NewL(TDesC8& aBuffer);
1.23 + ~CWavDecodeUtility();
1.24 +
1.25 + inline TUint GetChannels(void) const {return iChannels;};
1.26 + inline TUint GetSampleRate(void) const {return iSampleRate;};
1.27 + inline TUint GetBitsPerSample(void) const {return iBitsPerSample;};
1.28 + inline TUint GetDataLength(void) const {return iDataLength;};
1.29 +
1.30 + inline TUint GetSamples(void) const {return iDataLength / (iChannels * iBitsPerSample / 8);};
1.31 +
1.32 +
1.33 +private:
1.34 + CWavDecodeUtility();
1.35 + void ConstructL(TDesC8& aBuffer);
1.36 + TUint16 Read16(const TUint8* aPtr);
1.37 + TUint32 Read32(const TUint8* aPtr);
1.38 + void FindRiffChunksL(void);
1.39 + void ProcessFormatHeaderL();
1.40 + void ReadChunk(TMdaRiffChunk* aChunk);
1.41 + void AssignChunkTo(TMdaRiffChunk* aAssignedChunk);
1.42 +
1.43 +private:
1.44 +// CMMFDataBuffer* iBuffer;
1.45 + TDesC8* iBuffer;
1.46 + const TUint8* iStartPtr;
1.47 + TUint iLastReadPosition;
1.48 + TBool iHasFactChunk;
1.49 + TMdaRiffChunk iCurrent;
1.50 + TMdaRiffChunk iFormatChunk;
1.51 + TMdaRiffChunk iFactChunk;
1.52 + TMdaRiffChunk iDataChunk;
1.53 + TUint iRiffChunkLength;
1.54 + TBool iFoundChunks;
1.55 + TBool iDone;
1.56 + TUint iStartPosition;
1.57 +
1.58 + TUint iCodecId;
1.59 + TUint iChannels;
1.60 + TUint iSampleRate;
1.61 + TUint iBlockAlign; //needed for correct IMA
1.62 + TUint iBitsPerSample;
1.63 +
1.64 + TUint iDataLength;
1.65 + TUint iAverageBytesPerSecond; //needed for correct IMA
1.66 + TUint iSamplesPerBlock;
1.67 +
1.68 + TUint iPos;
1.69 + TUint iClipLength;
1.70 +
1.71 + };
1.72 +
1.73 +