os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/sbcencodertestdevice.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef SBCENCODERTESTDEVICE_H
    17 #define SBCENCODERTESTDEVICE_H
    18 
    19 #include <mmf/server/mmfswcodecwrapper.h>
    20 #include <mmf/server/devsoundstandardcustominterfaces.h>
    21 
    22 
    23 /**
    24 *
    25 * CSbcEncoderTestDevice
    26 *
    27 * Test hw device used by the
    28 * TSU_MMF_DEVSOUND_CIU_SUITE unit test harness.
    29 */
    30 class CSbcEncoderTestDevice : public CMMFSwCodecWrapper, public MSbcEncoderIntfc
    31 	{
    32 public:
    33 	static CMMFHwDevice* NewL();
    34 	virtual ~CSbcEncoderTestDevice();
    35 	virtual TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
    36 	virtual TInt Stop();
    37 	virtual TInt Pause();
    38 	virtual TInt Init(THwDeviceInitParams& aDevInfo);
    39 	virtual TAny* CustomInterface(TUid aInterfaceId);
    40 	virtual TInt ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr);
    41 	virtual TInt ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr);
    42 	virtual TInt SetConfig(TTaskConfig& aConfig);
    43 	virtual TInt StopAndDeleteCodec();
    44 	virtual TInt DeleteCodec();
    45 
    46 	// from CMMFSwCodecWrapper
    47 	virtual CMMFSwCodec& Codec();
    48 
    49 	// from MSbcEncoderIntfc
    50 	virtual TInt GetSupportedSamplingFrequencies ( RArray<TUint>& aSamplingFrequencies );
    51 	virtual TInt GetSupportedChannelModes ( RArray<TSbcChannelMode>& aChannelModes );
    52 	virtual TInt GetSupportedNumOfSubbands ( RArray<TUint>& aNumOfSubbands ); 
    53 	virtual TInt GetSupportedAllocationMethods ( RArray<TSbcAllocationMethod>& aAllocationMethods );
    54 	virtual TInt GetSupportedNumOfBlocks ( RArray<TUint>& aNumOfBlocks );
    55 	
    56 	virtual TInt GetSupportedBitpoolRange (TUint& aMinSupportedBitpoolSize, TUint& aMaxSupportedBitpoolSize);
    57 	virtual void SetSamplingFrequency ( TUint aSamplingFrequency );
    58 	virtual void SetChannelMode (TSbcChannelMode aChannelMode );
    59 	virtual void SetNumOfSubbands ( TUint aNumOfSubbands );
    60 	virtual void SetNumOfBlocks ( TUint aNumOfBlocks );
    61 	virtual void SetAllocationMethod (TSbcAllocationMethod aAllocationMethod );
    62 	virtual void SetBitpoolSize (TUint aBitpoolSize );
    63 	virtual TInt ApplyConfig();
    64 	virtual TInt GetSamplingFrequency ( TUint& aSamplingFrequency );
    65 	virtual TInt GetChannelMode (TSbcChannelMode& aChannelMode );
    66 	virtual TInt GetNumOfSubbands ( TUint& aNumOfSubbands );
    67 	virtual TInt GetNumOfBlocks ( TUint& aNumOfBlocks );
    68 	virtual TInt GetAllocationMethod (TSbcAllocationMethod& aAllocationMethod );
    69 	virtual TInt GetBitpoolSize (TUint& aBitpoolSize );
    70 	
    71 private:
    72 	CSbcEncoderTestDevice();
    73 	void ConstructL();
    74 private:
    75 	TUint iSamplingFrequency;
    76 	TSbcChannelMode iChannelMode;
    77 	TUint iNumOfSubbands;
    78 	TUint iNumOfBlocks;
    79 	TSbcAllocationMethod iAllocMethod;
    80 	TUint iBitpoolSize;
    81 	TBool iApplyConfig;
    82 	};
    83 
    84 #endif