Update contrib.
1 // Copyright (c) 2005-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMFBTSWCODECCONVERTDATAPATH_H__
17 #define __MMFBTSWCODECCONVERTDATAPATH_H__
22 #include "mmfBtSwCodecDataPath.h"
25 * Derived class for convert datapath internal to the Sw codec wrapper
28 class CMMFSwCodecConvertDataPath : public CMMFSwCodecDataPath
31 static CMMFSwCodecConvertDataPath* NewL();
32 virtual ~CMMFSwCodecConvertDataPath();
33 virtual TInt SetObserver(MMMFHwDeviceObserver &aHwObserver);
34 virtual TInt AddCodec(CMMFSwCodec& aCodec);
38 virtual void BufferFilledL(CMMFDataBuffer& aBuffer);
39 virtual void BufferEmptiedL(const CMMFDataBuffer& aBuffer);
40 virtual void SoundDeviceException(TInt aError);
41 virtual RMdaDevSound& Device();
42 void FillSourceBufferL();
43 void FillSinkBufferL();
44 void EmptySinkBufferL();
46 CMMFSwCodecConvertDataPath() {};
50 * Private class for the convert datapath that is an active object
51 * used to drive the conversion. This class performs the main data transfer
52 * between the source and the sink.
53 * This is done in a separate class as opposed to CMMFSwCodecConvertDataPath
54 * because the class needs to be an active object to avoid recursive call stacks
55 * in cases where the source and sink are not active objects - which is
56 * the case with descriptors. Making CMMFSwCodecConvertDataPath derive
57 * from CActive is less desirable as it would involve multiple inheretence
60 class CDataPathConverter : public CActive
71 CDataPathConverter(CMMFSwCodecConvertDataPath& aParent, TInt aPriority);
72 ~CDataPathConverter();
74 void BufferFilledL(CMMFDataBuffer& aBuffer);
75 void BufferEmptiedL(CMMFDataBuffer& aBuffer);
76 void ChangeConvertState(TConvertState aNewConvertState);
79 virtual TInt RunError(TInt aError);
80 virtual void DoCancel();
82 void FillSourceBufferL();
83 void FillSinkBufferL();
84 void EmptySinkBufferL();
86 TConvertState iConvertState;
87 CMMFSwCodecConvertDataPath& iParent;
88 CMMFDataBuffer* iSourceBuffer;
91 CDataPathConverter* iDataPathConverter;
92 CMMFDataBuffer* iSourceBuffer;
93 CMMFDataBuffer* iSinkBuffer;
94 TBool iNoMoreSourceData;
95 TUint iSinkBufferSize;
96 TUint iSourceBufferSize;
97 RMdaDevSound iDummyDevSound;//don't need a devsound for convert