16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 // USER |
19 // USER |
20 #include "musenglivesession.h" |
20 #include "musenglivesession.h" |
21 #include "musengsessionobserver.h" |
|
22 #include "musenglivesessionobserver.h" |
21 #include "musenglivesessionobserver.h" |
23 #include "musunittesting.h" |
22 //#include "musunittesting.h" |
24 #include "musengmceutils.h" |
23 //#include "musengmceutils.h" |
25 #include "musenglogger.h" |
|
26 #include "mussessionproperties.h" |
|
27 |
24 |
28 // SYSTEM |
25 // SYSTEM |
29 #include <mcemanager.h> |
26 /* |
30 #include <mcecamerasource.h> |
27 #include <mcecamerasource.h> |
31 #include <mcevideostream.h> |
28 #include <mcevideostream.h> |
32 #include <mcertpsink.h> |
29 #include <mcertpsink.h> |
33 #include <mcedisplaysink.h> |
30 #include <mcedisplaysink.h> |
34 #include <mcefilesink.h> |
|
35 #include <mcesession.h> |
31 #include <mcesession.h> |
36 #include <mcevideocodec.h> |
32 #include <mcevideocodec.h> |
37 #include <mceh263codec.h> |
33 */ |
38 #include <mceavccodec.h> |
34 |
39 |
35 |
40 |
36 |
41 // Names of AVC levels in string for config keys stored in CenRep |
37 // ----------------------------------------------------------------------------- |
42 _LIT8( KMusAvcBitrateLevel1, "AvcBrL1=" ); |
38 // |
43 _LIT8( KMusAvcBitrateLevel1b, "AvcBrL1b=" ); |
39 // ----------------------------------------------------------------------------- |
44 _LIT8( KMusAvcBitrateLevel1_1, "AvcBrL1_1=" ); |
40 // |
45 _LIT8( KMusAvcBitrateLevel1_2, "AvcBrL1_2=" ); |
41 EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL( |
46 _LIT8( KMusAvcBitrateLevel1_3, "AvcBrL1_3=" ); |
42 const TDesC& /*aFileName*/, |
47 _LIT8( KMusAvcBitrateLevel2, "AvcBrL2=" ); |
43 const TRect& aRect, |
48 |
44 MMusEngLiveSessionObserver* aSessionObserver, |
49 _LIT8( KMusEncoderInfoTokenizer, ";" ); |
45 TUint aSipProfileId ) |
50 |
46 { |
51 |
47 CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( |
52 const TInt KMaxDispName = 512; |
48 aSessionObserver, |
53 |
49 aRect, |
54 // ----------------------------------------------------------------------------- |
50 aSipProfileId ); |
55 // |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 CMusEngLiveSession* CMusEngLiveSession::NewL( |
|
59 const TDesC& aFileName, |
|
60 const TRect& aRect ) |
|
61 { |
|
62 CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect, |
|
63 aFileName ); |
|
64 CleanupStack::PushL( self ); |
51 CleanupStack::PushL( self ); |
65 self->ConstructL(); |
52 self->ConstructL(); |
66 CleanupStack::Pop( self ); |
53 CleanupStack::Pop( self ); |
67 return self; |
54 return self; |
68 } |
55 } |
87 // |
79 // |
88 // ----------------------------------------------------------------------------- |
80 // ----------------------------------------------------------------------------- |
89 // |
81 // |
90 CMusEngLiveSession::~CMusEngLiveSession() |
82 CMusEngLiveSession::~CMusEngLiveSession() |
91 { |
83 { |
92 delete iRemoteDisplayName; |
84 } |
93 } |
85 |
94 |
86 |
95 |
87 // ----------------------------------------------------------------------------- |
96 |
88 // |
97 // ----------------------------------------------------------------------------- |
89 // ----------------------------------------------------------------------------- |
98 // From MLcSession |
90 // |
99 // ----------------------------------------------------------------------------- |
91 EXPORT_C void CMusEngLiveSession::SetSessionObserver( |
100 // |
92 MMusEngLiveSessionObserver* aSessionObserver ) |
101 void CMusEngLiveSession::EstablishLcSessionL() |
93 { |
102 { |
94 } |
103 } |
95 |
104 |
96 |
105 // ----------------------------------------------------------------------------- |
97 // ----------------------------------------------------------------------------- |
106 // From MLcSession |
98 // |
107 // ----------------------------------------------------------------------------- |
99 // ----------------------------------------------------------------------------- |
108 // |
100 // |
109 MLcVideoPlayer* CMusEngLiveSession::LocalVideoPlayer() |
101 EXPORT_C TInt CMusEngLiveSession::CurrentZoomL() const |
110 { |
102 { |
111 return this; |
103 return iCurrentZoom; |
112 } |
104 } |
113 |
105 |
114 |
106 |
115 |
107 // ----------------------------------------------------------------------------- |
116 // ----------------------------------------------------------------------------- |
108 // |
117 // From MLcSession |
109 // ----------------------------------------------------------------------------- |
118 // ----------------------------------------------------------------------------- |
110 // |
119 // |
111 EXPORT_C TInt CMusEngLiveSession::MaxZoomL() const |
120 |
112 { |
121 const TDesC& CMusEngLiveSession::RemoteDisplayName() |
113 return iCurrentZoom; |
122 { |
114 } |
123 return *iRemoteDisplayName; |
115 |
124 } |
116 |
125 |
117 // ----------------------------------------------------------------------------- |
126 |
118 // |
127 |
119 // ----------------------------------------------------------------------------- |
128 |
120 // |
129 // ----------------------------------------------------------------------------- |
121 EXPORT_C TInt CMusEngLiveSession::MinZoomL() const |
130 // From MLcVideoPlayer |
122 { |
131 // ----------------------------------------------------------------------------- |
123 return iCurrentZoom; |
132 // |
124 } |
133 MLcVideoPlayer::TLcVideoPlayerState CMusEngLiveSession::LcVideoPlayerState() const |
125 |
134 { |
126 |
135 TLcVideoPlayerState vidPlayerState = MLcVideoPlayer::EUnavailable; |
127 // ----------------------------------------------------------------------------- |
136 return vidPlayerState; |
128 // |
137 } |
129 // ----------------------------------------------------------------------------- |
138 |
130 // |
139 // ----------------------------------------------------------------------------- |
131 EXPORT_C void CMusEngLiveSession::ZoomInL() |
140 // From MLcVideoPlayer |
132 { |
141 // ----------------------------------------------------------------------------- |
133 iCurrentZoom++; |
142 // |
134 } |
143 TBool CMusEngLiveSession::LcIsPlayingL() |
135 |
144 { |
136 |
145 return iPlaying; |
137 // ----------------------------------------------------------------------------- |
146 } |
138 // |
147 |
139 // ----------------------------------------------------------------------------- |
148 // ----------------------------------------------------------------------------- |
140 // |
149 // From MLcVideoPlayer |
141 EXPORT_C void CMusEngLiveSession::ZoomOutL() |
150 // ----------------------------------------------------------------------------- |
142 { |
151 // |
143 iCurrentZoom--; |
152 void CMusEngLiveSession::LcPlayL() |
144 } |
|
145 |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 EXPORT_C void CMusEngLiveSession::ZoomDefaultL() |
|
152 { |
|
153 } |
|
154 |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // Enable camera |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 EXPORT_C void CMusEngLiveSession::PlayL() |
153 { |
161 { |
154 iPlaying = ETrue; |
162 iPlaying = ETrue; |
155 } |
163 } |
156 |
164 |
157 // ----------------------------------------------------------------------------- |
165 |
158 // From MLcVideoPlayer |
166 // ----------------------------------------------------------------------------- |
159 // ----------------------------------------------------------------------------- |
167 // Disable camera |
160 // |
168 // ----------------------------------------------------------------------------- |
161 void CMusEngLiveSession::LcPauseL() |
169 // |
|
170 EXPORT_C void CMusEngLiveSession::PauseL() |
162 { |
171 { |
163 iPlaying = EFalse; |
172 iPlaying = EFalse; |
164 } |
173 } |
165 |
174 |
166 // ----------------------------------------------------------------------------- |
175 |
167 // From MLcVideoPlayer |
176 // ----------------------------------------------------------------------------- |
168 // ----------------------------------------------------------------------------- |
177 // |
169 // |
178 // ----------------------------------------------------------------------------- |
170 MLcWindow* CMusEngLiveSession::LcWindow() |
179 // |
171 { |
180 void CMusEngLiveSession::CompleteSessionStructureL() |
172 return this; |
181 { |
173 } |
182 } |
174 |
183 |
175 // ----------------------------------------------------------------------------- |
|
176 // From MLcVideoPlayer |
|
177 // ----------------------------------------------------------------------------- |
|
178 // |
|
179 MLcCameraControl* CMusEngLiveSession::LcCameraControl() |
|
180 { |
|
181 return this; |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // From MLcVideoPlayer |
|
186 // ----------------------------------------------------------------------------- |
|
187 // |
|
188 MLcFileControl* CMusEngLiveSession::LcSourceFile() |
|
189 { |
|
190 return NULL; |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // From MLcVideoPlayer |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
|
197 MLcFileControl* CMusEngLiveSession::LcDestinationFile() |
|
198 { |
|
199 return this; |
|
200 } |
|
201 |
|
202 // ----------------------------------------------------------------------------- |
|
203 // From MLcVideoPlayer |
|
204 // ----------------------------------------------------------------------------- |
|
205 // |
|
206 MLcAudioControl* CMusEngLiveSession::LcAudioControl() |
|
207 { |
|
208 return this; |
|
209 } |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // From MLcVideoPlayer |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 MLcZoomControl* CMusEngLiveSession::LcZoomControl() |
|
216 { |
|
217 return this; |
|
218 } |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // From MLcVideoPlayer |
|
222 // ----------------------------------------------------------------------------- |
|
223 // |
|
224 MLcBrightnessControl* CMusEngLiveSession::LcBrightnessControl() |
|
225 { |
|
226 return this; |
|
227 } |
|
228 |
|
229 // ----------------------------------------------------------------------------- |
|
230 // From MLcVideoPlayer |
|
231 // ----------------------------------------------------------------------------- |
|
232 // |
|
233 RPointerArray< MLcValueControl >& CMusEngLiveSession::LcExtensionControls() |
|
234 { |
|
235 return iValueControls; |
|
236 } |
|
237 |
|
238 // ----------------------------------------------------------------------------- |
|
239 // From MLcCameraControl |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 TInt CMusEngLiveSession::LcCameraCountL() |
|
243 { |
|
244 return 1; |
|
245 } |
|
246 |
|
247 // ----------------------------------------------------------------------------- |
|
248 // From MLcCameraControl |
|
249 // ----------------------------------------------------------------------------- |
|
250 // |
|
251 void CMusEngLiveSession::ToggleLcCameraL() |
|
252 { |
|
253 } |
|
254 |
|
255 // ----------------------------------------------------------------------------- |
|
256 // From MLcBrightnessControl |
|
257 // ----------------------------------------------------------------------------- |
|
258 // |
|
259 TInt CMusEngLiveSession::MinLcBrightnessL() |
|
260 { |
|
261 return iCurrentBrighness; |
|
262 } |
|
263 |
|
264 // ----------------------------------------------------------------------------- |
|
265 // From MLcBrightnessControl |
|
266 // ----------------------------------------------------------------------------- |
|
267 // |
|
268 TInt CMusEngLiveSession::MaxLcBrightnessL() |
|
269 { |
|
270 return iCurrentBrighness; |
|
271 } |
|
272 |
|
273 // ----------------------------------------------------------------------------- |
|
274 // From MLcBrightnessControl |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 TInt CMusEngLiveSession::LcBrightnessL() |
|
278 { |
|
279 return iCurrentBrighness; |
|
280 } |
|
281 |
|
282 // ----------------------------------------------------------------------------- |
|
283 // From MLcBrightnessControl |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 void CMusEngLiveSession::SetLcBrightnessL( TInt aValue ) |
|
287 { |
|
288 iCurrentBrighness = aValue; |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // From MLcBrightnessControl |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 void CMusEngLiveSession::IncreaseLcBrightnessL() |
|
296 { |
|
297 iCurrentBrighness++; |
|
298 } |
|
299 |
|
300 // ----------------------------------------------------------------------------- |
|
301 // From MLcBrightnessControl |
|
302 // ----------------------------------------------------------------------------- |
|
303 // |
|
304 void CMusEngLiveSession::DecreaseLcBrightnessL() |
|
305 { |
|
306 iCurrentBrighness--; |
|
307 } |
|
308 |
|
309 // ----------------------------------------------------------------------------- |
|
310 // From MLcZoomControl |
|
311 // ----------------------------------------------------------------------------- |
|
312 // |
|
313 TInt CMusEngLiveSession::MinLcZoomL() |
|
314 { |
|
315 return iCurrentZoom; |
|
316 } |
|
317 |
|
318 // ----------------------------------------------------------------------------- |
|
319 // From MLcZoomControl |
|
320 // ----------------------------------------------------------------------------- |
|
321 // |
|
322 TInt CMusEngLiveSession::MaxLcZoomL() |
|
323 { |
|
324 return iCurrentZoom; |
|
325 } |
|
326 |
|
327 // ----------------------------------------------------------------------------- |
|
328 // From MLcZoomControl |
|
329 // ----------------------------------------------------------------------------- |
|
330 // |
|
331 TInt CMusEngLiveSession::LcZoomValueL() |
|
332 { |
|
333 return iCurrentZoom; |
|
334 } |
|
335 |
|
336 // ----------------------------------------------------------------------------- |
|
337 // From MLcZoomControl |
|
338 // ----------------------------------------------------------------------------- |
|
339 // |
|
340 void CMusEngLiveSession::SetLcZoomValueL( TInt aValue ) |
|
341 { |
|
342 iCurrentZoom = aValue; |
|
343 } |
|
344 |
|
345 // ----------------------------------------------------------------------------- |
|
346 // From MLcZoomControl |
|
347 // ----------------------------------------------------------------------------- |
|
348 // |
|
349 void CMusEngLiveSession::LcZoomInL() |
|
350 { |
|
351 iCurrentZoom++; |
|
352 } |
|
353 |
|
354 // ----------------------------------------------------------------------------- |
|
355 // From MLcZoomControl |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 void CMusEngLiveSession::LcZoomOutL() |
|
359 { |
|
360 iCurrentZoom--; |
|
361 } |
|
362 |
|
363 // ----------------------------------------------------------------------------- |
|
364 // From MLcFileControl |
|
365 // ----------------------------------------------------------------------------- |
|
366 // |
|
367 void CMusEngLiveSession::EnableLcFileL( TBool aEnable ) |
|
368 { |
|
369 iFileEnabled = aEnable; |
|
370 } |
|
371 |
|
372 // ----------------------------------------------------------------------------- |
|
373 // From MLcFileControl |
|
374 // ----------------------------------------------------------------------------- |
|
375 // |
|
376 TBool CMusEngLiveSession::IsLcFileEnabled() |
|
377 { |
|
378 return iFileEnabled; |
|
379 } |
|
380 |
|
381 // ----------------------------------------------------------------------------- |
|
382 // From MLcFileControl |
|
383 // ----------------------------------------------------------------------------- |
|
384 // |
|
385 void CMusEngLiveSession::SetLcFileNameL( const TFileName& aFileName ) |
|
386 { |
|
387 iRecordedFile = aFileName; |
|
388 } |
|
389 |
|
390 // ----------------------------------------------------------------------------- |
|
391 // From MLcFileControl |
|
392 // ----------------------------------------------------------------------------- |
|
393 // |
|
394 TFileName& CMusEngLiveSession::LcFileName() |
|
395 { |
|
396 return iRecordedFile; |
|
397 } |
|
398 |
184 |
399 // ----------------------------------------------------------------------------- |
185 // ----------------------------------------------------------------------------- |
400 // |
186 // |
401 // ----------------------------------------------------------------------------- |
187 // ----------------------------------------------------------------------------- |
402 // |
188 // |
403 CMusEngLiveSession::CMusEngLiveSession( |
189 CMusEngLiveSession::CMusEngLiveSession( |
404 const TRect& aRect, |
190 MMusEngLiveSessionObserver* aSessionObserver, |
405 const TDesC& aRecordedFile ) |
191 const TRect& aRect, |
406 : CMusEngMceOutSession( aRect ), |
192 TUint aSipProfileId ) |
407 iRecordedFile( aRecordedFile ) |
193 :CMusEngMceOutSession( aRect, aSipProfileId ), |
408 { |
194 iDefaultZoomFactor( -1 ) |
409 } |
195 { |
410 |
196 } |
411 |
197 |
412 // ----------------------------------------------------------------------------- |
198 |
413 // |
199 // ----------------------------------------------------------------------------- |
414 // ----------------------------------------------------------------------------- |
200 // |
415 // |
201 // ----------------------------------------------------------------------------- |
416 void CMusEngLiveSession::ConstructL() |
202 // |
417 { |
203 void CMusEngLiveSession::ConstructL( /*const TDesC& aFileName*/ ) |
418 MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ConstructL()" ) |
204 { |
419 |
205 } |
420 CMusEngMceOutSession::ConstructL(); |
206 |
421 |
207 |
422 iRemoteDisplayName = HBufC::NewL( KMaxDispName ); |
208 |
423 |
209 |
424 MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ConstructL()" ) |
210 |
425 } |
211 |