os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/audiobufferprefilltestdevice.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 AUDIOBUFFERFILLTESTDEVICE_H
    17 #define AUDIOBUFFERFILLTESTDEVICE_H
    18 
    19 #include <mmf/server/mmfswcodecwrapper.h>
    20 #include <mmf/server/devsoundstandardcustominterfaces.h>
    21 
    22 
    23 class CMMFSampleBuffering : public CActive,
    24 							public MMMFSampleBuffering
    25 	{
    26 public:
    27 	//return Pointer to the CMMFSampleBuffering class
    28 	static CMMFSampleBuffering* NewL();
    29 
    30 	//Destructor
    31 	~CMMFSampleBuffering();
    32 
    33 	// from MMMFSampleBuffering
    34 	TInt MmsbEnableSampleBufferingBeforePlayback();
    35 	TInt MmsbDisableSampleBufferingBeforePlayback();
    36 	void MmsbNotifyPlayStarted(TRequestStatus& aStatus);
    37 	void MmsbCancelNotifyPlayStarted();
    38 
    39 	// from CActive
    40 	void RunL();
    41 	void DoCancel();
    42 
    43 private:
    44 	CMMFSampleBuffering();
    45 	void ConstructL();
    46 
    47 private:
    48 	RTimer iTimer;
    49 	TRequestStatus* iClientStatus;
    50 	};
    51 
    52 
    53 /*
    54 CSampleBufferingTestDevice
    55 
    56 Test hw device used by the
    57 TSU_MMF_DEVSOUND_CIU_SUITE unit test harness.
    58 */
    59 class CSampleBufferingTestDevice : public CMMFSwCodecWrapper,
    60 								   public MMMFSampleBuffering
    61 	{
    62 public:
    63 	static CMMFHwDevice* NewL();
    64 	virtual ~CSampleBufferingTestDevice();
    65 	virtual TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
    66 	virtual TInt Stop();
    67 	virtual TInt Pause();
    68 	virtual TInt Init(THwDeviceInitParams& aDevInfo);
    69 	virtual TAny* CustomInterface(TUid aInterfaceId);
    70 	virtual TInt ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr);
    71 	virtual TInt ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr);
    72 	virtual TInt SetConfig(TTaskConfig& aConfig);
    73 	virtual TInt StopAndDeleteCodec();
    74 	virtual TInt DeleteCodec();
    75 
    76 	// from CMMFSwCodecWrapper
    77 	virtual CMMFSwCodec& Codec();
    78 
    79 	// MMMFSampleBuffering
    80 	TInt MmsbEnableSampleBufferingBeforePlayback();
    81 	TInt MmsbDisableSampleBufferingBeforePlayback();
    82 	void MmsbNotifyPlayStarted(TRequestStatus& aStatus);
    83 	void MmsbCancelNotifyPlayStarted();
    84 
    85 private:
    86 	CSampleBufferingTestDevice();
    87 	void ConstructL();
    88 
    89 private:
    90 	CMMFSampleBuffering* iSampleBuffering;
    91 	};
    92 
    93 #endif