os/mm/mmresourcemgmt/mmresctrl/inc/mmrcadaptationproxy.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-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
// mmrcserverphysicaladaptation.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef MMRCPHYSICALADAPTATION_H_
sl@0
    19
#define MMRCPHYSICALADAPTATION_H_
sl@0
    20
sl@0
    21
#include <e32std.h>
sl@0
    22
#include <e32base.h>
sl@0
    23
#include <a3f/a3fbase.h>
sl@0
    24
#include <a3f/a3f_trace_utils.h>
sl@0
    25
#include "mmrcclientserver.h"
sl@0
    26
#include "maudiostreamadaptationobserver.h"
sl@0
    27
sl@0
    28
class MLogicalChain;
sl@0
    29
class MAudioContext;
sl@0
    30
class CFourCCConvertor;
sl@0
    31
class CMMRCServerSideAdaptationResponseAO;
sl@0
    32
class CAudioStreamAdaptation;
sl@0
    33
class CMMRCServerSession;
sl@0
    34
sl@0
    35
//------------------------------------------------------------------------------------
sl@0
    36
// CMMRCClientSideServerRequestToAdaptationAO
sl@0
    37
//------------------------------------------------------------------------------------
sl@0
    38
sl@0
    39
/**
sl@0
    40
@internalComponent
sl@0
    41
sl@0
    42
This class implements the proxy to the Physical adaptation.
sl@0
    43
The main purpose of this class is to communicate with the physical resource manager.
sl@0
    44
*/
sl@0
    45
NONSHARABLE_CLASS( CMMRCClientSideServerRequestToAdaptationAO ): public CActive, public MAudioStreamAdaptationObserver
sl@0
    46
	{
sl@0
    47
public:
sl@0
    48
	/**
sl@0
    49
	 * Constructs, and returns a pointer to, a new CMMRCClientSideServerRequestToAdaptationAO object.
sl@0
    50
	 * Leaves on failure.
sl@0
    51
	 * @param CMMRCServerController& A reference on the MMRC Server controller
sl@0
    52
	 * @return CMMRCClientSideServerRequestToAdaptationAO* A pointer to newly created utlitly object.
sl@0
    53
	 */
sl@0
    54
	IMPORT_C static CMMRCClientSideServerRequestToAdaptationAO* NewL( );
sl@0
    55
sl@0
    56
	/**
sl@0
    57
	 * Destructor.
sl@0
    58
	 */
sl@0
    59
	~CMMRCClientSideServerRequestToAdaptationAO( );
sl@0
    60
sl@0
    61
public:
sl@0
    62
	void Initialize(CMMRCServerSession* aServerSession,
sl@0
    63
					CMMRCServerSideAdaptationResponseAO* aCallback,
sl@0
    64
					RThread* aClientThread,
sl@0
    65
					const CFourCCConvertor& aFourCCConvertor);
sl@0
    66
sl@0
    67
	void Service(TUint aRequestType);
sl@0
    68
sl@0
    69
	/**
sl@0
    70
	 * Callback in case of timeout
sl@0
    71
	 */
sl@0
    72
	void ResourceRequestAcknowledgmentTimeout( );
sl@0
    73
sl@0
    74
	// from MAudioStreamAdaptationObserver
sl@0
    75
	void PhysicalAdaptationEvent(TPhysicalEvent aEvent, TInt aError);
sl@0
    76
	void StateEvent(TInt aReason, TAudioState aNewState);
sl@0
    77
	void AddProcessingUnitComplete(TUid aType, TInt aError);
sl@0
    78
	void RemoveProcessingUnitComplete(TUid aType, TInt aError);
sl@0
    79
	void ProcessingFinished();
sl@0
    80
	void FlushComplete(TInt aError);
sl@0
    81
sl@0
    82
	//From CActive
sl@0
    83
	virtual void RunL();
sl@0
    84
	virtual void DoCancel();
sl@0
    85
sl@0
    86
private:
sl@0
    87
	/**
sl@0
    88
	 * By default Symbian 2nd phase constructor is private.
sl@0
    89
	 * @param CMMRCServerController& A reference on the MMRC Server controller
sl@0
    90
	 */
sl@0
    91
	CMMRCClientSideServerRequestToAdaptationAO( );
sl@0
    92
sl@0
    93
	void TidyUp();
sl@0
    94
sl@0
    95
	/**
sl@0
    96
	 * By default Symbian 2nd phase constructor is private.
sl@0
    97
	 */
sl@0
    98
	void ConstructL( );
sl@0
    99
sl@0
   100
private:
sl@0
   101
	//owned
sl@0
   102
	CAudioStreamAdaptation* iStreamAdaptation;
sl@0
   103
sl@0
   104
	//not owned
sl@0
   105
	RThread* iClientThread;
sl@0
   106
	CMMRCServerSession* iServerSession;
sl@0
   107
	CMMRCServerSideAdaptationResponseAO* iMMRCServerSideAdaptationResponseAO;
sl@0
   108
sl@0
   109
	MLogicalChain* iLogicalChainRequested;
sl@0
   110
	MLogicalChain* iLogicalChainLastCommited;
sl@0
   111
	MAudioContext* iAudioContext;
sl@0
   112
	TInt iRequestsProcessed;
sl@0
   113
	TUint iRequestType;
sl@0
   114
	};
sl@0
   115
sl@0
   116
//------------------------------------------------------------------------------------
sl@0
   117
// CMMRCServerSideAdaptationResponseAO
sl@0
   118
//------------------------------------------------------------------------------------
sl@0
   119
sl@0
   120
/**
sl@0
   121
@internalComponent
sl@0
   122
sl@0
   123
*/
sl@0
   124
NONSHARABLE_CLASS( CMMRCServerSideAdaptationResponseAO ) : public CActive
sl@0
   125
	{
sl@0
   126
public:
sl@0
   127
	~CMMRCServerSideAdaptationResponseAO();
sl@0
   128
	static CMMRCServerSideAdaptationResponseAO* NewL();
sl@0
   129
	void Initialize(CMMRCServerSession* aServerSession, RThread* iServerThread );
sl@0
   130
	void Service(TMMRCAdaptationToServerRequestResults aEvent, TInt aError);
sl@0
   131
	void StartAdaptationListening();
sl@0
   132
private:
sl@0
   133
	CMMRCServerSideAdaptationResponseAO();
sl@0
   134
	void ConstructL( );
sl@0
   135
	void RunL( );
sl@0
   136
	void DoCancel( );
sl@0
   137
sl@0
   138
private:
sl@0
   139
	//not owned
sl@0
   140
	CMMRCServerSession* iMMRCServerSession;
sl@0
   141
	RThread* iServerThread;
sl@0
   142
sl@0
   143
	TMMRCAdaptationToServerRequestResults iEvent;
sl@0
   144
	TInt iError;
sl@0
   145
	};
sl@0
   146
sl@0
   147
#endif /*MMRCPHYSICALADAPTATION_H_*/