1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmresourcemgmt/mmresctrl/inc/mmrcadaptationproxy.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,147 @@
1.4 +// Copyright (c) 2007-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 +// mmrcserverphysicaladaptation.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef MMRCPHYSICALADAPTATION_H_
1.22 +#define MMRCPHYSICALADAPTATION_H_
1.23 +
1.24 +#include <e32std.h>
1.25 +#include <e32base.h>
1.26 +#include <a3f/a3fbase.h>
1.27 +#include <a3f/a3f_trace_utils.h>
1.28 +#include "mmrcclientserver.h"
1.29 +#include "maudiostreamadaptationobserver.h"
1.30 +
1.31 +class MLogicalChain;
1.32 +class MAudioContext;
1.33 +class CFourCCConvertor;
1.34 +class CMMRCServerSideAdaptationResponseAO;
1.35 +class CAudioStreamAdaptation;
1.36 +class CMMRCServerSession;
1.37 +
1.38 +//------------------------------------------------------------------------------------
1.39 +// CMMRCClientSideServerRequestToAdaptationAO
1.40 +//------------------------------------------------------------------------------------
1.41 +
1.42 +/**
1.43 +@internalComponent
1.44 +
1.45 +This class implements the proxy to the Physical adaptation.
1.46 +The main purpose of this class is to communicate with the physical resource manager.
1.47 +*/
1.48 +NONSHARABLE_CLASS( CMMRCClientSideServerRequestToAdaptationAO ): public CActive, public MAudioStreamAdaptationObserver
1.49 + {
1.50 +public:
1.51 + /**
1.52 + * Constructs, and returns a pointer to, a new CMMRCClientSideServerRequestToAdaptationAO object.
1.53 + * Leaves on failure.
1.54 + * @param CMMRCServerController& A reference on the MMRC Server controller
1.55 + * @return CMMRCClientSideServerRequestToAdaptationAO* A pointer to newly created utlitly object.
1.56 + */
1.57 + IMPORT_C static CMMRCClientSideServerRequestToAdaptationAO* NewL( );
1.58 +
1.59 + /**
1.60 + * Destructor.
1.61 + */
1.62 + ~CMMRCClientSideServerRequestToAdaptationAO( );
1.63 +
1.64 +public:
1.65 + void Initialize(CMMRCServerSession* aServerSession,
1.66 + CMMRCServerSideAdaptationResponseAO* aCallback,
1.67 + RThread* aClientThread,
1.68 + const CFourCCConvertor& aFourCCConvertor);
1.69 +
1.70 + void Service(TUint aRequestType);
1.71 +
1.72 + /**
1.73 + * Callback in case of timeout
1.74 + */
1.75 + void ResourceRequestAcknowledgmentTimeout( );
1.76 +
1.77 + // from MAudioStreamAdaptationObserver
1.78 + void PhysicalAdaptationEvent(TPhysicalEvent aEvent, TInt aError);
1.79 + void StateEvent(TInt aReason, TAudioState aNewState);
1.80 + void AddProcessingUnitComplete(TUid aType, TInt aError);
1.81 + void RemoveProcessingUnitComplete(TUid aType, TInt aError);
1.82 + void ProcessingFinished();
1.83 + void FlushComplete(TInt aError);
1.84 +
1.85 + //From CActive
1.86 + virtual void RunL();
1.87 + virtual void DoCancel();
1.88 +
1.89 +private:
1.90 + /**
1.91 + * By default Symbian 2nd phase constructor is private.
1.92 + * @param CMMRCServerController& A reference on the MMRC Server controller
1.93 + */
1.94 + CMMRCClientSideServerRequestToAdaptationAO( );
1.95 +
1.96 + void TidyUp();
1.97 +
1.98 + /**
1.99 + * By default Symbian 2nd phase constructor is private.
1.100 + */
1.101 + void ConstructL( );
1.102 +
1.103 +private:
1.104 + //owned
1.105 + CAudioStreamAdaptation* iStreamAdaptation;
1.106 +
1.107 + //not owned
1.108 + RThread* iClientThread;
1.109 + CMMRCServerSession* iServerSession;
1.110 + CMMRCServerSideAdaptationResponseAO* iMMRCServerSideAdaptationResponseAO;
1.111 +
1.112 + MLogicalChain* iLogicalChainRequested;
1.113 + MLogicalChain* iLogicalChainLastCommited;
1.114 + MAudioContext* iAudioContext;
1.115 + TInt iRequestsProcessed;
1.116 + TUint iRequestType;
1.117 + };
1.118 +
1.119 +//------------------------------------------------------------------------------------
1.120 +// CMMRCServerSideAdaptationResponseAO
1.121 +//------------------------------------------------------------------------------------
1.122 +
1.123 +/**
1.124 +@internalComponent
1.125 +
1.126 +*/
1.127 +NONSHARABLE_CLASS( CMMRCServerSideAdaptationResponseAO ) : public CActive
1.128 + {
1.129 +public:
1.130 + ~CMMRCServerSideAdaptationResponseAO();
1.131 + static CMMRCServerSideAdaptationResponseAO* NewL();
1.132 + void Initialize(CMMRCServerSession* aServerSession, RThread* iServerThread );
1.133 + void Service(TMMRCAdaptationToServerRequestResults aEvent, TInt aError);
1.134 + void StartAdaptationListening();
1.135 +private:
1.136 + CMMRCServerSideAdaptationResponseAO();
1.137 + void ConstructL( );
1.138 + void RunL( );
1.139 + void DoCancel( );
1.140 +
1.141 +private:
1.142 + //not owned
1.143 + CMMRCServerSession* iMMRCServerSession;
1.144 + RThread* iServerThread;
1.145 +
1.146 + TMMRCAdaptationToServerRequestResults iEvent;
1.147 + TInt iError;
1.148 + };
1.149 +
1.150 +#endif /*MMRCPHYSICALADAPTATION_H_*/