author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:28:06 +0300 | |
branch | RCL_3 |
changeset 41 | 755f0370535b |
parent 33 | bc78a40cd63c |
permissions | -rw-r--r-- |
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#ifndef MUSHENGMCESESSION_H |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#define MUSHENGMCESESSION_H |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
// USER |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "musengsession.h" |
33 | 24 |
#include "musengsessiondurationtimerobserver.h" |
25 |
||
26 |
// SYSTEM |
|
27 |
/* |
|
28 |
#include <mcesessionobserver.h> |
|
29 |
#include <mcestreamobserver.h> |
|
30 |
#include <mcertpobserver.h> |
|
31 |
#include <mcetransactiondatacontainer.h> |
|
32 |
*/ |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
|
33 | 34 |
/* |
35 |
class CMceManager; |
|
36 |
class CMceSession; |
|
37 |
*/ |
|
38 |
class CMusEngSessionDurationTimer; |
|
39 |
||
40 |
||
41 |
// CONSTANTS |
|
42 |
||
43 |
_LIT8( KMusEngAcceptContactHeader, |
|
44 |
"Accept-Contact: *;+g.3gpp.cs-voice; explicit" ); |
|
45 |
_LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs" ); |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// CLASS DECLARATION |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
/** |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
* Base class for Multimedia Sharing Engine MCE sessions, inherited by |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
* CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession. |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
* CMusEngMceSession encapsulates CMCESession and simplifies use of |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
* MCE Sessions to user interface. Also splits observers messy events |
33 | 55 |
* simplified commands like a SessionDisconnected. |
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
* |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
* @lib musengine.lib |
33 | 58 |
* @since S60 v3.2 |
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
*/ |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
class CMusEngMceSession : public CMusEngSession, |
33 | 61 |
public MMusEngSessionDurationTimerObserver |
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
{ |
33 | 63 |
|
64 |
public: |
|
65 |
||
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
/** |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
* Destructor |
33 | 68 |
* |
69 |
* @since S60 v3.2 |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
*/ |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
~CMusEngMceSession(); |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
|
33 | 74 |
public: // API FUNCTIONS |
75 |
||
76 |
/** |
|
77 |
* Terminates session. |
|
78 |
* @pre Session is established |
|
79 |
* @post Session is ready to be deleted |
|
80 |
* @leave KErrNotReady if precondition is not fullfilled |
|
81 |
* @since S60 v3.2 |
|
82 |
*/ |
|
83 |
IMPORT_C void TerminateL(); |
|
84 |
||
85 |
/** |
|
86 |
* Releases all this session internal observers. This function is needed |
|
87 |
* before we could get session store out of this session. |
|
88 |
* TODO: Is this function really needed? At least at the moment it is |
|
89 |
* not called from UI. -HR 21.8. |
|
90 |
* |
|
91 |
* @since S60 v3.2 |
|
92 |
*/ |
|
93 |
IMPORT_C void ReleaseInternalObservers(); |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
|
33 | 95 |
/** |
96 |
* Get session time return estabilished session time |
|
97 |
* |
|
98 |
* @since S60 v3.2 |
|
99 |
* @return TTime returns time if connection established else < 0 |
|
100 |
*/ |
|
101 |
IMPORT_C TTimeIntervalSeconds GetSessionTime() const; |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
|
33 | 103 |
/** |
104 |
* Returns current connection state |
|
105 |
* |
|
106 |
* @since S60 v3.2 |
|
107 |
* @return TBool returns current connection state |
|
108 |
*/ |
|
109 |
IMPORT_C TBool ConnectionActive() const; |
|
110 |
||
111 |
||
112 |
public: // VIRTUAL API |
|
113 |
||
114 |
// No virtual api |
|
115 |
||
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
|
33 | 117 |
public: // from CMusEngSession |
118 |
||
119 |
/** |
|
120 |
* Increases volume level by one |
|
121 |
* |
|
122 |
* @pre Session is ongoing |
|
123 |
* @since S60 v3.2 |
|
124 |
*/ |
|
125 |
IMPORT_C void VolumeUpL(); |
|
126 |
||
127 |
/** |
|
128 |
* Decreases volume level by one |
|
129 |
* |
|
130 |
* @pre Session is ongoing |
|
131 |
* @since S60 v3.2 |
|
132 |
*/ |
|
133 |
IMPORT_C void VolumeDownL(); |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
|
33 | 135 |
/** |
136 |
* Permission to draw on screen device. |
|
137 |
* |
|
138 |
* @pre Session is ongoing |
|
139 |
* @since S60 v3.2 |
|
140 |
*/ |
|
141 |
IMPORT_C void EnableDisplayL( TBool aEnable ); |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
|
33 | 143 |
/** |
144 |
* Implements virtual from CMusEngSession |
|
145 |
* |
|
146 |
* @pre Session is ongoing |
|
147 |
* @since S60 v3.2 |
|
148 |
*/ |
|
149 |
IMPORT_C void MuteL(); |
|
150 |
||
151 |
/** |
|
152 |
* Implements virtual from CMusEngSession |
|
153 |
* |
|
154 |
* @pre Session is ongoing |
|
155 |
* @since S60 v3.2 |
|
156 |
*/ |
|
157 |
IMPORT_C void UnmuteL(); |
|
158 |
||
159 |
||
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
protected: // CONSTRUCTORS |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
/** |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
* Constructor |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
* |
33 | 165 |
* @since S60 v3.2 |
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
*/ |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
CMusEngMceSession( const TRect& aRect ); |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
/** |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
* Second-phase constructor |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
* |
33 | 172 |
* @since S60 v3.2 |
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
*/ |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
void ConstructL(); |
33 | 175 |
|
176 |
||
177 |
protected: // HELPER FUNCTIONS |
|
178 |
||
179 |
/** |
|
180 |
* |
|
181 |
* @since S60 v3.2 |
|
182 |
*/ |
|
183 |
void RectChangedL(); |
|
184 |
||
185 |
/** |
|
186 |
* Sets session specific SDP line to a session |
|
187 |
* |
|
188 |
* @since S60 v3.2 |
|
189 |
*/ |
|
190 |
//void SetSessionSdpLinesL( CMceSession& aSession ); |
|
191 |
||
192 |
||
193 |
protected: // internal API |
|
194 |
||
195 |
/** |
|
196 |
* |
|
197 |
* @since S60 v3.2 |
|
198 |
*/ |
|
199 |
virtual TBool IsRtpcInactivityTimoutSupported(); |
|
200 |
||
201 |
||
202 |
private: // HELPER FUNCTIONS |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
|
33 | 204 |
/** |
205 |
* Start counting session time |
|
206 |
* |
|
207 |
* @since S60 v3.2 |
|
208 |
*/ |
|
209 |
void InitializeSessionTimer(); |
|
210 |
||
211 |
/** |
|
212 |
* Callback |
|
213 |
* |
|
214 |
* @since S60 v3.2 |
|
215 |
*/ |
|
216 |
void UpdateTimerEvent(); |
|
217 |
||
218 |
/** |
|
219 |
* |
|
220 |
* |
|
221 |
* @since S60 v3.2 |
|
222 |
*/ |
|
223 |
void DoMuteL( TBool aMute ); |
|
224 |
||
225 |
/** |
|
226 |
* Increases or decreases current volume of all speakers in session |
|
227 |
* structure by one. |
|
228 |
* @pre Current volume of all the speakers is less than MaxVolumeL() |
|
229 |
* and at least 1. |
|
230 |
*/ |
|
231 |
void ChangeVolumeByOneL( TBool aIncreaseVolume ); |
|
232 |
||
233 |
||
234 |
private: // Helpers |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
|
33 | 236 |
/** |
237 |
* Helper function to avoid three different traps. |
|
238 |
* Should be replaced when MCE supports different kind of method |
|
239 |
* detecting end of clip. |
|
240 |
* |
|
241 |
* @since S60 v3.2 |
|
242 |
*/ |
|
243 |
void CheckClipEndL(); |
|
244 |
||
245 |
||
246 |
public: // MEMBERS |
|
247 |
||
248 |
/** |
|
249 |
* Class for connecting to MCE server. |
|
250 |
* This class provides the connection to the MCE server and |
|
251 |
* provides functions |
|
252 |
* for setting observers for asynchronous events. |
|
253 |
* The user should create only one instance of this class. |
|
254 |
* |
|
255 |
* @since S60 v3.2 |
|
256 |
*/ |
|
257 |
//CMceManager* iManager; |
|
258 |
||
259 |
/** |
|
260 |
* Base class for MCE sessions, inherited by both CMCEInSession and |
|
261 |
* CMCEOutSession. * CMCESession represents peer-to-peer connection |
|
262 |
* made with remote terminal. This connection is also known as dialog |
|
263 |
* and it is set up using SIP INVITE method. The characteristics of the |
|
264 |
* session are defined by user of this class by attaching media streams |
|
265 |
* into the session. After the session has been succesfully established, |
|
266 |
* it can be later updated and must be finally terminated. If for any |
|
267 |
* reason instance of this class is deleted while in established state, |
|
268 |
* session is automatically terminated by MCE server. |
|
269 |
* |
|
270 |
* @since S60 v3.2 |
|
271 |
*/ |
|
272 |
//CMceSession* iSession; |
|
273 |
||
274 |
||
275 |
public: |
|
276 |
||
277 |
/** |
|
278 |
* It is assumed, that user has only one instance of this class. |
|
279 |
* The same instance is passed between MCE and user, but the data |
|
280 |
* inside of this container is just updated for each event. |
|
281 |
* |
|
282 |
* @since S60 v3.2 |
|
283 |
*/ |
|
284 |
//TMceTransactionDataContainer iTransactionDataContainer; |
|
285 |
||
286 |
/** |
|
287 |
* Session time. Acts simultaneously as RTCP inactivity timer. |
|
288 |
* |
|
289 |
* @since S60 v3.2 |
|
290 |
*/ |
|
291 |
TTime iStartTime; |
|
292 |
||
293 |
CMusEngSessionDurationTimer* iUpdateTimer; |
|
294 |
||
295 |
/** |
|
296 |
* Value indicating seconds gone since last received RTCP sender or |
|
297 |
* receiver report. Value 20 indicates RTCP inactivity timeout. |
|
298 |
*/ |
|
299 |
TInt iSecondsFromLastRtcpReport; |
|
300 |
TInt iDisplayEnabled; |
|
0
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
|
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
}; |
f0cf47e981f9
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
#endif //MUSHENGMCESESSION_H |