sl@0
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
|
sl@0
|
17 |
#ifndef MMFIMAADPCMTOPCM16CODEC_H
|
sl@0
|
18 |
#define MMFIMAADPCMTOPCM16CODEC_H
|
sl@0
|
19 |
|
sl@0
|
20 |
#include "MMFCodecBaseDefinitions.h"
|
sl@0
|
21 |
#include "MMFAudioCodecBase.h"
|
sl@0
|
22 |
#include <mmf/server/devsoundstandardcustominterfaces.h>
|
sl@0
|
23 |
|
sl@0
|
24 |
const TUint KMaxImaAdpcmBlockAlign = 2048;
|
sl@0
|
25 |
const TUint KImaAdpcmBitsPerSample = 4;
|
sl@0
|
26 |
|
sl@0
|
27 |
//mono so iImaAdpcmTo16Pcm constructed with 1 (mono)
|
sl@0
|
28 |
class CMMFImaAdPcmPcm16Codec : public CMMFCodec, public MMMFDevSoundCustomInterfaceFileBlockLength
|
sl@0
|
29 |
{
|
sl@0
|
30 |
public:
|
sl@0
|
31 |
static CMMFCodec* NewL(TAny* aInitParams);
|
sl@0
|
32 |
virtual ~CMMFImaAdPcmPcm16Codec();
|
sl@0
|
33 |
TCodecProcessResult ProcessL(const CMMFBuffer& aSrc, CMMFBuffer& aDst);
|
sl@0
|
34 |
void ConfigureL(TUid aConfigType, const TDesC8& aConfigData);
|
sl@0
|
35 |
// from MMMFDevSoundCustomInterfaceFileBlockLength
|
sl@0
|
36 |
void SetFileBlockLength(TUint aBlockAlign);
|
sl@0
|
37 |
protected:
|
sl@0
|
38 |
virtual TInt Extension_(TUint aExtensionId, TAny*& aExtPtr, TAny*);
|
sl@0
|
39 |
private:
|
sl@0
|
40 |
CMMFImaAdPcmPcm16Codec();
|
sl@0
|
41 |
void ConstructL(TAny* aInitParams);
|
sl@0
|
42 |
virtual void ResetL();
|
sl@0
|
43 |
|
sl@0
|
44 |
private:
|
sl@0
|
45 |
//owned by the Datapath
|
sl@0
|
46 |
const CMMFDataBuffer* iSrc;
|
sl@0
|
47 |
CMMFDataBuffer* iDst;
|
sl@0
|
48 |
|
sl@0
|
49 |
TUint iTempSrcBufferCount;
|
sl@0
|
50 |
TUint8* iTempSrcBufferPtr;
|
sl@0
|
51 |
TUint8 iTempSrcBuffer[KMaxImaAdpcmBlockAlign];
|
sl@0
|
52 |
TMMFImaAdpcmTo16PcmCodecOld iImaAdpcmTo16Pcm ;
|
sl@0
|
53 |
TUint iLastFrameNumber;
|
sl@0
|
54 |
|
sl@0
|
55 |
// allow configuring sample rate
|
sl@0
|
56 |
TUint iChannels;
|
sl@0
|
57 |
TUint iSamplesRate;
|
sl@0
|
58 |
TUint iSamplesPerBlock;
|
sl@0
|
59 |
TUint iBlockAlign;
|
sl@0
|
60 |
};
|
sl@0
|
61 |
|
sl@0
|
62 |
|
sl@0
|
63 |
#endif
|