os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfDevSoundServer.h
First public contribution.
1 // Copyright (c) 2004-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 __MMFDEVSOUNDSERVER_H__
17 #define __MMFDEVSOUNDSERVER_H__
22 #include <mmf/common/mmfipc.h>
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
24 #include <mmf/common/mmfipcserver.h>
26 #include "MmfAudioServer.h"
27 #include "MmfDevSoundServerStart.h"
30 Panic category and codes that MmfDevSoundServer raises on the client
33 _LIT(KMMFDevSoundClientPanicCategory, "DevSoundClient");
34 enum TMMFDevSoundClientPanicCodes
36 EMMFDevSoundPlayDataWithoutInitialize,
37 EMMFDevSoundRecordDataWithoutInitialize
40 class CMMFDevSoundServer; // declared here.
42 NONSHARABLE_CLASS( CMMFDevSoundServer ): public CMmfIpcServer
48 IMPORT_C static CMMFDevSoundServer* NewL(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
49 ~CMMFDevSoundServer();
50 CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
51 void IncrementSessionId();
52 void DecrementSessionId();
53 void SendEventToClient(TInt aSessionToAlert, TInt aSessionToBeLaunched);
54 void LaunchRequest(TInt aSessionId);
55 TInt DevSoundSessionId() {return iDevSoundSessionId;};
56 TBool CheckClientCapabilities();
57 void SetClientCapabilitiesL(TThreadId aTid);
59 IMPORT_C static TInt StartThread(TAny* aParams);
63 CMMFDevSoundServer(CMMFAudioServer* aAudioServer, TProcessId& aClientPID);
65 static void RenamePrioritizeServer();
66 static void StartThreadL(TDevSoundServerStart& aStart);
67 class CDelayDevSoundShutDown : public CActive
71 static CDelayDevSoundShutDown* NewL();
72 ~CDelayDevSoundShutDown();
74 void SetDelay(TTimeIntervalMicroSeconds32 aDelay);
77 CDelayDevSoundShutDown();
89 TInt iDevSoundSessionId;
90 TInt iSessionToBeLaunched;
91 TProcessId iClientPID;
93 CDelayDevSoundShutDown* iDelayDevSoundShutDown;
94 CMMFAudioServer* iAudioServer;
97 GLDEF_C void PanicClient(const RMmfIpcMessage& aMessage, TMMFDevSoundClientPanicCodes aPanicCode);
103 Patchable constant for licencee to set devsound server thread priority
104 Licencees should ensure that the devsound server thread priority is equal to the system server priority for better responsiveness.
105 If SYMBIAN_CURB_SYSTEMSERVER_PRIORITIES is defined, setting devsound server thread priority to EPriorityAbsoluteHigh will ensure
106 devsound server's thread priority is set to system server's priority.
107 If the macro is unavailable it is recommended to use EPriorityAbsoluteRealTime1. Usage of EPriorityAbsoluteRealTime1 requires ProtServ capability.
108 The constant can be changed at ROM build time using patchdata OBY keyword.
110 IMPORT_C extern const TInt KDevsoundServerPriority;