|
1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declares RVoIPAudioSession - client side interface to |
|
15 * VoIP server. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __VOIPAUDIOSESSION_H |
|
20 #define __VOIPAUDIOSESSION_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <mmfbase.h> |
|
24 #include <mmfutilities.h> //for TFourCC |
|
25 #include <voipaudiocommon.h> |
|
26 #include <voipdownlinkstream.h> |
|
27 #include <voipformatintfc.h> |
|
28 #include <voipjitterbufferintfc.h> |
|
29 #include "VoIPAudioClientServer.h" |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CVoIPFormatIntfc; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * RVoIPAudioSession API |
|
40 */ |
|
41 class RVoIPAudioSession : public RSessionBase |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * Opens a connection to the server. |
|
46 * @return KErrNone if successful connection created |
|
47 */ |
|
48 IMPORT_C TInt Connect(); |
|
49 /** |
|
50 * @return The server version this session can connct to |
|
51 */ |
|
52 IMPORT_C TVersion Version() const; |
|
53 /** |
|
54 * Close the session to the server |
|
55 */ |
|
56 IMPORT_C void Close(); |
|
57 |
|
58 // Downlink stream methods |
|
59 |
|
60 /** |
|
61 * ?description |
|
62 * |
|
63 * @since S60 v5.0 |
|
64 * @param none |
|
65 * @return TInt |
|
66 */ |
|
67 IMPORT_C TInt OpenDownlink(TMMFPrioritySettings aPriority); |
|
68 |
|
69 /** |
|
70 * ?description |
|
71 * |
|
72 * @since S60 v5.0 |
|
73 * @param none |
|
74 * @return TInt |
|
75 */ |
|
76 IMPORT_C TInt GetMaxVolume(); |
|
77 |
|
78 /** |
|
79 * ?description |
|
80 * |
|
81 * @since S60 v5.0 |
|
82 * @param none |
|
83 * @return TInt |
|
84 */ |
|
85 IMPORT_C TInt SetVolume(const TInt aVolume); |
|
86 |
|
87 /** |
|
88 * ?description |
|
89 * |
|
90 * @since S60 v5.0 |
|
91 * @param none |
|
92 * @return TInt |
|
93 */ |
|
94 IMPORT_C TInt GetVolume(); |
|
95 |
|
96 /** |
|
97 * ?description |
|
98 * |
|
99 * @since S60 v5.0 |
|
100 * @param const TMMFPrioritySettings |
|
101 * @param RArray<TUint32>& |
|
102 * @param TInt& |
|
103 * @return TInt |
|
104 */ |
|
105 IMPORT_C TInt GetSupportedDecoders(const TMMFPrioritySettings aPriority, |
|
106 RArray<TUint32>& aDecoders, TInt& aFrameSize); |
|
107 |
|
108 /** |
|
109 * ?description |
|
110 * |
|
111 * @since S60 v5.0 |
|
112 * @param none |
|
113 * @return TInt |
|
114 */ |
|
115 IMPORT_C TInt SetDecoder(const TUint32 aDecoder); |
|
116 |
|
117 /** |
|
118 * ?description |
|
119 * |
|
120 * @since S60 v5.0 |
|
121 * @param none |
|
122 * @return TInt |
|
123 */ |
|
124 IMPORT_C TInt SetAudioDevice( |
|
125 const CVoIPAudioDownlinkStream::TVoIPOutputDevice aDevice); |
|
126 |
|
127 /** |
|
128 * ?description |
|
129 * |
|
130 * @since S60 v5.0 |
|
131 * @param none |
|
132 * @return TInt |
|
133 */ |
|
134 IMPORT_C TInt GetAudioDevice( |
|
135 CVoIPAudioDownlinkStream::TVoIPOutputDevice& aDevice); |
|
136 |
|
137 /** |
|
138 * ?description |
|
139 * |
|
140 * @since S60 v5.0 |
|
141 * @param none |
|
142 * @return TInt |
|
143 */ |
|
144 IMPORT_C TInt StartDownlink(); |
|
145 |
|
146 /** |
|
147 * ?description |
|
148 * |
|
149 * @since S60 v5.0 |
|
150 * @param none |
|
151 * @return TInt |
|
152 */ |
|
153 IMPORT_C TInt StopDownlink(); |
|
154 |
|
155 /** |
|
156 * ?description |
|
157 * |
|
158 * @since S60 v5.0 |
|
159 * @param none |
|
160 * @return TInt |
|
161 */ |
|
162 IMPORT_C void CloseDownlink(); |
|
163 |
|
164 /** |
|
165 * ?description |
|
166 * |
|
167 * @since S60 v5.0 |
|
168 * @param TPtr8 |
|
169 * @param const TInt64 |
|
170 * @return TInt |
|
171 */ |
|
172 IMPORT_C TInt BufferFilled(TPtr8 aBuffer, const TUint aBufferSequence = 0); |
|
173 |
|
174 // Uplink stream methods |
|
175 |
|
176 /** |
|
177 * ?description |
|
178 * |
|
179 * @since S60 v5.0 |
|
180 * @param const TMMFPrioritySettings |
|
181 * @return TInt |
|
182 */ |
|
183 IMPORT_C TInt OpenUplink(const TMMFPrioritySettings aPriority); |
|
184 |
|
185 /** |
|
186 * ?description |
|
187 * |
|
188 * @since S60 v5.0 |
|
189 * @param none |
|
190 * @return TInt |
|
191 */ |
|
192 IMPORT_C TInt GetMaxGain(); |
|
193 |
|
194 /** |
|
195 * ?description |
|
196 * |
|
197 * @since S60 v5.0 |
|
198 * @param none |
|
199 * @return TInt |
|
200 */ |
|
201 IMPORT_C TInt SetGain(const TInt aGain); |
|
202 |
|
203 /** |
|
204 * ?description |
|
205 * |
|
206 * @since S60 v5.0 |
|
207 * @param none |
|
208 * @return TInt |
|
209 */ |
|
210 IMPORT_C TInt GetGain(); |
|
211 |
|
212 /** |
|
213 * ?description |
|
214 * |
|
215 * @since S60 v5.0 |
|
216 * @param const TMMFPrioritySettings |
|
217 * @param RArray<TUint32>& |
|
218 * @param TInt& |
|
219 * @return TInt |
|
220 */ |
|
221 IMPORT_C TInt GetSupportedEncoders(const TMMFPrioritySettings aPriority, |
|
222 RArray<TUint32>& aEncoders, TInt& aFrameSize); |
|
223 |
|
224 /** |
|
225 * ?description |
|
226 * |
|
227 * @since S60 v5.0 |
|
228 * @param none |
|
229 * @return TInt |
|
230 */ |
|
231 IMPORT_C TInt SetEncoder(const TUint32 aEncoder); |
|
232 |
|
233 /** |
|
234 * ?description |
|
235 * |
|
236 * @since S60 v5.0 |
|
237 * @param none |
|
238 * @return TInt |
|
239 */ |
|
240 IMPORT_C TInt StartUplink(); |
|
241 |
|
242 /** |
|
243 * ?description |
|
244 * |
|
245 * @since S60 v5.0 |
|
246 * @param none |
|
247 * @return TInt |
|
248 */ |
|
249 IMPORT_C TInt StopUplink(); |
|
250 |
|
251 /** |
|
252 * ?description |
|
253 * |
|
254 * @since S60 v5.0 |
|
255 * @param none |
|
256 * @return TInt |
|
257 */ |
|
258 IMPORT_C void CloseUplink(); |
|
259 |
|
260 /** |
|
261 * ?description |
|
262 * |
|
263 * @since S60 v5.0 |
|
264 * @param TPtr8 |
|
265 * @return TInt |
|
266 */ |
|
267 IMPORT_C TInt BufferEmptied(TPtr8 aBuffer); |
|
268 |
|
269 // Codec CI methods |
|
270 |
|
271 /** |
|
272 * ?description |
|
273 * |
|
274 * @since S60 v5.0 |
|
275 * @param TArray<TUint>& |
|
276 * @return void |
|
277 */ |
|
278 IMPORT_C void GetSupportedBitRatesL(RArray<TUint>& aArray); |
|
279 |
|
280 /** |
|
281 * ?description |
|
282 * |
|
283 * @since S60 v5.0 |
|
284 * @param const TUint |
|
285 * @return TInt |
|
286 */ |
|
287 IMPORT_C TInt SetBitRate(const TUint aBitrate); |
|
288 |
|
289 /** |
|
290 * ?description |
|
291 * |
|
292 * @since S60 v5.0 |
|
293 * @param TUint& |
|
294 * @return TInt |
|
295 */ |
|
296 IMPORT_C TInt GetBitRate(TUint& aBitrate); |
|
297 |
|
298 /** |
|
299 * ?description |
|
300 * |
|
301 * @since S60 v5.0 |
|
302 * @param TBool |
|
303 * @return TInt |
|
304 */ |
|
305 IMPORT_C TInt SetVAD(const TBool aVad); |
|
306 |
|
307 /** |
|
308 * ?description |
|
309 * |
|
310 * @since S60 v5.0 |
|
311 * @param TBool& |
|
312 * @return TInt |
|
313 */ |
|
314 IMPORT_C TInt GetVAD(TBool& aVad); |
|
315 |
|
316 /** |
|
317 * ?description |
|
318 * |
|
319 * @since S60 v5.0 |
|
320 * @param TBool& |
|
321 * @return TInt |
|
322 */ |
|
323 IMPORT_C TInt FrameModeRequiredForEC(TBool& aMode); |
|
324 |
|
325 /** |
|
326 * ?description |
|
327 * |
|
328 * @since S60 v5.0 |
|
329 * @param TBool |
|
330 * @return TInt |
|
331 */ |
|
332 IMPORT_C TInt SetFrameMode(const TBool aMode); |
|
333 |
|
334 /** |
|
335 * ?description |
|
336 * |
|
337 * @since S60 v5.0 |
|
338 * @param TBool& |
|
339 * @return TInt |
|
340 */ |
|
341 IMPORT_C TInt GetFrameMode(TBool& aMode); |
|
342 |
|
343 /** |
|
344 * ?description |
|
345 * |
|
346 * @since S60 v5.0 |
|
347 * @param none |
|
348 * @return TInt |
|
349 */ |
|
350 IMPORT_C TInt ConcealErrorForNextBuffer(); |
|
351 |
|
352 /** |
|
353 * ?description |
|
354 * |
|
355 * @since S60 v5.0 |
|
356 * @param TG711CodecMode |
|
357 * @return TInt |
|
358 */ |
|
359 IMPORT_C TInt SetMode(const CVoIPFormatIntfc::TG711CodecMode aMode); |
|
360 |
|
361 /** |
|
362 * ?description |
|
363 * |
|
364 * @since S60 v5.0 |
|
365 * @param TG711CodecMode& |
|
366 * @return TInt |
|
367 */ |
|
368 IMPORT_C TInt GetMode(CVoIPFormatIntfc::TG711CodecMode& aMode); |
|
369 |
|
370 /** |
|
371 * ?description |
|
372 * |
|
373 * @since S60 v5.0 |
|
374 * @param TILBCCodecMode |
|
375 * @return TInt |
|
376 */ |
|
377 IMPORT_C TInt SetMode(const CVoIPFormatIntfc::TILBCCodecMode aMode); |
|
378 |
|
379 /** |
|
380 * ?description |
|
381 * |
|
382 * @since S60 v5.0 |
|
383 * @param TILBCCodecMode& |
|
384 * @return TInt |
|
385 */ |
|
386 IMPORT_C TInt GetMode(CVoIPFormatIntfc::TILBCCodecMode& aMode); |
|
387 |
|
388 /** |
|
389 * ?description |
|
390 * |
|
391 * @since S60 v5.0 |
|
392 * @param TBool |
|
393 * @return TInt |
|
394 */ |
|
395 IMPORT_C TInt SetCNG(const TBool aCng); |
|
396 |
|
397 /** |
|
398 * ?description |
|
399 * |
|
400 * @since S60 v5.0 |
|
401 * @param TBool& |
|
402 * @return TInt |
|
403 */ |
|
404 IMPORT_C TInt GetCNG(TBool& aCng); |
|
405 |
|
406 /** |
|
407 * ?description |
|
408 * |
|
409 * @since S60 v5.0 |
|
410 * @param TBool |
|
411 * @return TInt |
|
412 */ |
|
413 IMPORT_C TInt SetPLC(const TBool aPlc); |
|
414 |
|
415 /** |
|
416 * ?description |
|
417 * |
|
418 * @since S60 v5.0 |
|
419 * @param TBool& |
|
420 * @return TInt |
|
421 */ |
|
422 IMPORT_C TInt GetPLC(TBool& aPlc); |
|
423 |
|
424 /** |
|
425 * ?description |
|
426 * |
|
427 * @since S60 v5.0 |
|
428 * @param none |
|
429 * @return TInt |
|
430 */ |
|
431 IMPORT_C TInt BadLsfNextBuffer(); |
|
432 |
|
433 /** |
|
434 * ?description |
|
435 * |
|
436 * @since S60 v5.0 |
|
437 * @param none |
|
438 * @return TInt |
|
439 */ |
|
440 IMPORT_C TInt OpenDTMFTonePlayer(); |
|
441 |
|
442 /** |
|
443 * ?description |
|
444 * |
|
445 * @since S60 v5.0 |
|
446 * @param none |
|
447 * @return TInt |
|
448 */ |
|
449 IMPORT_C TInt PlayDTMFTone(const TDesC& aTones); |
|
450 |
|
451 /** |
|
452 * ?description |
|
453 * |
|
454 * @since S60 v5.0 |
|
455 * @param none |
|
456 * @return TInt |
|
457 */ |
|
458 IMPORT_C TInt StopDTMFTonePlay(); |
|
459 |
|
460 /** |
|
461 * ?description |
|
462 * |
|
463 * @since S60 v5.0 |
|
464 * @param none |
|
465 * @return TInt |
|
466 */ |
|
467 IMPORT_C void CloseDTMFTonePlayer(); |
|
468 |
|
469 /** |
|
470 * ?description |
|
471 * |
|
472 * @since S60 v5.0 |
|
473 * @param none |
|
474 * @return TInt |
|
475 */ |
|
476 IMPORT_C TInt OpenRingTonePlayer(); |
|
477 |
|
478 /** |
|
479 * ?description |
|
480 * |
|
481 * @since S60 v5.0 |
|
482 * @param TDesC& |
|
483 * @return TInt |
|
484 */ |
|
485 IMPORT_C TInt OpenRingTonePlayer(const TDesC& aFileName); |
|
486 |
|
487 /** |
|
488 * ?description |
|
489 * |
|
490 * @since S60 v5.0 |
|
491 * @param RFile& |
|
492 * @return TInt |
|
493 */ |
|
494 IMPORT_C TInt OpenRingTonePlayer(const RFile& aFileHandle); |
|
495 |
|
496 /** |
|
497 * ?description |
|
498 * |
|
499 * @since S60 v5.0 |
|
500 * @param TDes& |
|
501 * @param TDes& |
|
502 * @return TInt |
|
503 */ |
|
504 IMPORT_C TInt OpenRingTonePlayer(const TDesC8& aDesData); |
|
505 |
|
506 /** |
|
507 * ?description |
|
508 * |
|
509 * @since S60 v5.0 |
|
510 * @param none |
|
511 * @return TInt |
|
512 */ |
|
513 IMPORT_C TInt PlayRingTone(); |
|
514 |
|
515 /** |
|
516 * ?description |
|
517 * |
|
518 * @since S60 v5.0 |
|
519 * @param none |
|
520 * @return TInt |
|
521 */ |
|
522 IMPORT_C TInt PauseRingTone(); |
|
523 |
|
524 /** |
|
525 * ?description |
|
526 * |
|
527 * @since S60 v5.0 |
|
528 * @param none |
|
529 * @return TInt |
|
530 */ |
|
531 IMPORT_C TInt ResumeRingTone(); |
|
532 |
|
533 /** |
|
534 * ?description |
|
535 * |
|
536 * @since S60 v5.0 |
|
537 * @param none |
|
538 * @return TInt |
|
539 */ |
|
540 IMPORT_C TInt StopRingTone(); |
|
541 |
|
542 /** |
|
543 * ?description |
|
544 * |
|
545 * @since S60 v5.0 |
|
546 * @param none |
|
547 * @return void |
|
548 */ |
|
549 IMPORT_C void CloseRingTonePlayer(); |
|
550 |
|
551 /** |
|
552 * ConfigureJitterBuffer |
|
553 * |
|
554 * @since S60 v5.0 |
|
555 * @param const TVoIPJBConfig& |
|
556 * @return TInt |
|
557 */ |
|
558 IMPORT_C TInt ConfigureJitterBuffer(const TVoIPJBConfig& aJbConfig); |
|
559 |
|
560 /** |
|
561 * ResetJitterBuffer |
|
562 * |
|
563 * @since S60 v5.0 |
|
564 * @param const TBool |
|
565 * @return TInt |
|
566 */ |
|
567 IMPORT_C TInt ResetJitterBuffer(const TBool aPlayTone); |
|
568 |
|
569 /** |
|
570 * DelayDown |
|
571 * |
|
572 * @since S60 v5.0 |
|
573 * @param none |
|
574 * @return TInt |
|
575 */ |
|
576 IMPORT_C TInt DelayDown(); |
|
577 |
|
578 /** |
|
579 * DelayUp |
|
580 * |
|
581 * @since S60 v5.0 |
|
582 * @param none |
|
583 * @return TInt |
|
584 */ |
|
585 IMPORT_C TInt DelayUp(); |
|
586 |
|
587 private: |
|
588 /** |
|
589 * PopulateArrayL |
|
590 * |
|
591 * @since S60 v5.0 |
|
592 * @param TVoIPAudioClientServerRequest |
|
593 * @param RArray<TUint32>& |
|
594 * @param TInt |
|
595 * @return void |
|
596 */ |
|
597 void PopulateArrayL(TVoIPAudioClientServerRequest aRequest, |
|
598 RArray<TUint32>& aDecoders, TInt aCount); |
|
599 |
|
600 TInt SendClientRequest(TVoIPAudioClientServerRequest aRequest, |
|
601 const TIpcArgs& aArgs) const; |
|
602 |
|
603 }; |
|
604 |
|
605 #endif // __VOIPAUDIOSESSION_H |
|
606 |
|
607 // End of file |