|
1 /* |
|
2 * Copyright (c) 2006 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: Class is used for configuring media codecs. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMCCCODECINFORMATION_H |
|
22 #define MMCCCODECINFORMATION_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <e32des8.h> |
|
27 #include <e32svr.h> |
|
28 #include <mmf/common/mmfcontroller.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 |
|
32 class TMccCodecInfo; |
|
33 |
|
34 // CONSTANTS |
|
35 |
|
36 // Codec names used in SDP messages |
|
37 _LIT8( KPCMUSdpName, "PCMU" ); |
|
38 _LIT8( KPCMASdpName, "PCMA" ); |
|
39 _LIT8( KAMRSdpName, "AMR" ); |
|
40 _LIT8( KAMRWbSdpName, "AMR-WB" ); |
|
41 _LIT8( KILBCSdpName, "iLBC" ); |
|
42 _LIT8( KG729SdpName, "G729" ); |
|
43 _LIT8( KTelephoneEvent, "telephone-event" ); |
|
44 _LIT8( KRedSdpName, "red" ); |
|
45 _LIT8( KCnSdpName, "CN" ); |
|
46 _LIT8( KH263SdpName, "H263" ); |
|
47 _LIT8( KH2631998SdpName, "H263-1998" ); |
|
48 _LIT8( KH2632000SdpName, "H263-2000" ); |
|
49 _LIT8( KAVCSdpName, "H264" ); |
|
50 _LIT8( KAACSdpName, "AAC" ); |
|
51 _LIT8( KIlbcFmtp, "mode=" ); |
|
52 _LIT8( KSemicolonSpace, "; " ); |
|
53 _LIT8( KCommaSign, "," ); |
|
54 const TInt KPTimeFactor = 1000; |
|
55 |
|
56 // Maximum buffer length for SDP names |
|
57 const TInt KMaxSdpNameLength = 20; |
|
58 const TUint8 KMaxPacketrate = 10; |
|
59 const TInt KMaxFmtpLen( 120 ); // Change if this gets too small |
|
60 const TInt KMaxKeepAliveDataLen( 161 ); |
|
61 |
|
62 // Dynamic payload type limits, see RFC 3551 |
|
63 const TUint8 KMaxPayloadType = 127; |
|
64 const TUint8 KMinDynamicPT = 96; |
|
65 const TUint8 KPayloadTypeUndefined = 128; |
|
66 |
|
67 // Default payload types for codecs that use dynamic payload types |
|
68 const TUint8 KDefaultAmrNbPT = 96; |
|
69 const TUint8 KDefaultIlbcPT = 97; |
|
70 const TUint8 KDefaultDtmfPT = 98; |
|
71 const TUint8 KDefaultRedPT = 99; |
|
72 const TUint8 KDefaultAmrWbPT = 100; |
|
73 |
|
74 // Static payload types, see RFC 3551 |
|
75 const TUint8 KPcmuPayloadType = 0; |
|
76 const TUint8 KPcmaPayloadType = 8; |
|
77 const TUint8 KG729PayloadType = 18; |
|
78 const TUint8 KCnPayloadType = 13; |
|
79 const TUint8 KCnPayloadTypeReserved = 19; |
|
80 |
|
81 // Packet length constants, in milliseconds |
|
82 const TUint KMinPtime = 10; |
|
83 const TUint KDefaultPtime = 20; |
|
84 const TUint KMaxPtime = 200; |
|
85 |
|
86 // Max gen red count |
|
87 const TUint KMaxGenRedCount = 1; |
|
88 |
|
89 // Max config key length |
|
90 const TInt KMaxConfigKeyLen = 100; |
|
91 |
|
92 // FourCC values for different codecs supported by MCC |
|
93 |
|
94 // (' ', 'A', 'M', 'R') |
|
95 const TUint32 KMccFourCCIdAMRNB = 0x524d4120; |
|
96 |
|
97 // (' ', 'A', 'W', 'B') |
|
98 const TUint32 KMccFourCCIdAMRWB = 0x42574120; |
|
99 |
|
100 // ('G', '7', '1', '1') |
|
101 const TUint32 KMccFourCCIdG711 = 0x31313747; |
|
102 |
|
103 // ('G', '7', '2', '9') |
|
104 const TUint32 KMccFourCCIdG729 = 0x39323747; |
|
105 |
|
106 // ('i', 'L', 'B', 'C') |
|
107 const TUint32 KMccFourCCIdILBC = 0x43424c49; |
|
108 |
|
109 // ( 'D', 'T', 'M', 'F' ) |
|
110 const TUint32 KMccFourCCIdDTMF = 0x464d5444; |
|
111 |
|
112 // ( 'H', '2', '6', '3' ) |
|
113 const TUint32 KMccFourCCIdH263 = 0x461A1B1C; |
|
114 |
|
115 // ( 'H', '2', '6', '4' ) |
|
116 const TUint32 KMccFourCCIdAVC = 0x461A1BDD; |
|
117 |
|
118 // Red - not official |
|
119 const TUint32 KMccFourCCIdRed = 0x4DDDDDDD; |
|
120 |
|
121 // Comfort noise - not official |
|
122 const TUint32 KMccFourCCIdCN = 0x4DDDDDDE; |
|
123 |
|
124 |
|
125 // DATA TYPES |
|
126 /** |
|
127 * Codec mode |
|
128 */ |
|
129 typedef TUint TCodecMode; |
|
130 |
|
131 const TUint ENothing = 1; |
|
132 const TUint EPCMU = 2; |
|
133 const TUint EPCMA = 3; |
|
134 const TUint EBandwidthEfficient = 4; |
|
135 const TUint EOctetAligned = 5; |
|
136 const TUint EDTMFModeEvent = 6; |
|
137 const TUint EDTMFModeInband = 7; |
|
138 const TUint EDTMFModeTone = 8; |
|
139 const TUint EDTMFModeRedEvents = 9; |
|
140 |
|
141 /** |
|
142 * Algorithm used |
|
143 */ |
|
144 typedef TUint TAlgoUsed; |
|
145 |
|
146 const TUint ENoAlgoUsed = 1; |
|
147 const TUint EGenRedUsed = 2; |
|
148 const TUint EAmrFecUsed = 3; |
|
149 |
|
150 // FUNCTION PROTOTYPES |
|
151 |
|
152 // CLASS DECLARATION |
|
153 /** |
|
154 * Container class for the codec information. |
|
155 * |
|
156 * @lib mmccinterface.dll |
|
157 */ |
|
158 class CMccCodecInformation : public CBase |
|
159 { |
|
160 public: // Constructors and destructor |
|
161 |
|
162 /** |
|
163 * Destructor. |
|
164 */ |
|
165 virtual ~CMccCodecInformation(); |
|
166 |
|
167 protected: // New functions |
|
168 |
|
169 /** |
|
170 * C++ default constructor. |
|
171 */ |
|
172 CMccCodecInformation(); |
|
173 |
|
174 public: // New functions |
|
175 |
|
176 /** |
|
177 * Constructs a clone from this codec object. Note that the clone falls |
|
178 * back to given codec's default settings. |
|
179 * @return CMccCodecInformation Pointer to the newly created codec clone |
|
180 */ |
|
181 virtual CMccCodecInformation* CloneDefaultsL() = 0; |
|
182 |
|
183 /** |
|
184 * Constructs a clone from this codec object and copies the original |
|
185 * object's current settings to the newly created clone. |
|
186 * @return CMccCodecInformation Pointer to the newly created codec clone |
|
187 */ |
|
188 virtual CMccCodecInformation* CloneDetailedL() = 0; |
|
189 |
|
190 /** |
|
191 * Checks the codec values if signalling is needed. |
|
192 * @param aCandidate new codec to be checked |
|
193 * @return ETrue if signalling is needed |
|
194 */ |
|
195 virtual TBool RequireSignalling( const CMccCodecInformation& aCandidate ) const; |
|
196 |
|
197 public: // sets |
|
198 |
|
199 virtual void SetValues( TMccCodecInfo codecInfo ); |
|
200 |
|
201 virtual void GetValues( TMccCodecInfo& codecInfo ) const; |
|
202 |
|
203 /** |
|
204 * Type of the codec, like KUidMediaTypeAudio or KUidMediaTypeVideo. |
|
205 * @return type of the codec. |
|
206 */ |
|
207 virtual TUid Type() const; |
|
208 |
|
209 /** |
|
210 * Enable / Disable Voice Activity Detection. |
|
211 * @param aEnableVAD Boolean indicating whether to enable |
|
212 * Voice Activity Detection |
|
213 * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. |
|
214 */ |
|
215 virtual TInt EnableVAD( TBool aEnableVAD ) = 0; |
|
216 |
|
217 /** |
|
218 * Sets bitrate used with codec. |
|
219 * @param aBitrate New bitrate value |
|
220 * @return KErrNotSupported if codec doesn't support bitrate value |
|
221 * issued; otherwise KErrNone. |
|
222 */ |
|
223 virtual TInt SetBitrate( TUint aBitrate ) = 0; |
|
224 |
|
225 /** |
|
226 * Sets the sampling frequency. |
|
227 * @param aSamplingFreq Sampling frequency to be used |
|
228 * @return KErrNotSupported if codec doesn't support sampling frequency |
|
229 * issued; otherwise KErrNone. |
|
230 */ |
|
231 virtual TInt SetSamplingFreq( TUint32 aSamplingFreq ) = 0; |
|
232 |
|
233 /** |
|
234 * Sets the sdp name of the codec. |
|
235 * @param aSdpName sdp name of the codec. |
|
236 * @return KErrNotSupported if not allowed; otherwise KErrNone. |
|
237 */ |
|
238 virtual TInt SetSdpName( const TDesC8& aSdpName ) = 0; |
|
239 |
|
240 /** |
|
241 * Sets the payload type. |
|
242 * @param aPayloadType type identifier to be used for payload. |
|
243 * @return KErrNotSupported if not allowed; otherwise KErrNone. |
|
244 */ |
|
245 virtual TInt SetPayloadType( TUint8 aPayloadType ) = 0; |
|
246 |
|
247 /** |
|
248 * Sets the codec mode. |
|
249 * @param aMode Codec mode, eg. ULAW/ALAW, bandwidth eff / octet aligned |
|
250 * @return KErrNotSupported if codec doesnt' support codec mode |
|
251 * value issued; otherwise KErrNone. |
|
252 */ |
|
253 virtual TInt SetCodecMode( TCodecMode aCodecMode ) = 0; |
|
254 |
|
255 /** |
|
256 * Sets the allowed bitrates for the codec. |
|
257 * @param aBitrateMask bitrate mask. |
|
258 * @return KErrNotSupported if codec doesnt' support the bitrate mask |
|
259 * value issued; otherwise KErrNone. |
|
260 */ |
|
261 virtual TInt SetAllowedBitrates( TUint aBitrateMask ); |
|
262 |
|
263 /** |
|
264 * Sets the packet time |
|
265 * @param aPTime PacketTime. |
|
266 * @return One of the standard system-wide error codes. |
|
267 */ |
|
268 virtual TInt SetPTime( TUint aPTime ) = 0; |
|
269 |
|
270 /** |
|
271 * Sets max packet time |
|
272 * @param aMaxPTime Maximum PacketTime |
|
273 * @return One of the standard system-wide error codes. |
|
274 */ |
|
275 virtual TInt SetMaxPTime( TUint aMaxPTime ) = 0; |
|
276 |
|
277 /** |
|
278 * Set JitterBuffer Buffer length |
|
279 * @param aJitterBufBufferLength length for buffer |
|
280 * @return One of the standard system-wide error codes. |
|
281 */ |
|
282 virtual TInt SetJitterBufBufferLength( TUint aJitterBufBufferLength ); |
|
283 |
|
284 /** |
|
285 * Set JitterBuffer threshold |
|
286 * @param aJitterBufThreshold threshold value for buffer before playout starts |
|
287 * @return One of the standard system-wide error codes. |
|
288 */ |
|
289 virtual TInt SetJitterBufThreshold( TUint aJitterBufThreshold ); |
|
290 |
|
291 /** |
|
292 * Set JitterBuffer inactivity timeout in millisecounds |
|
293 * @param aJitterBufInactivityTimeOut timeout value for RTP inactivity |
|
294 * @return One of the standard system-wide error codes. |
|
295 */ |
|
296 virtual TInt SetJitterBufInactivityTimeOut( TUint aJitterBufInactivityTimeOut ); |
|
297 |
|
298 /** |
|
299 * Sets max bitrate |
|
300 * @param aMaxBitrate Maximum bitrate |
|
301 * @return One of the standard system-wide error codes. |
|
302 */ |
|
303 virtual TInt SetMaxBitrate( TUint aMaxBitrate ); |
|
304 |
|
305 /** |
|
306 * Sets average bitrate |
|
307 * @param aAverageBitrate average bitrate |
|
308 * @return One of the standard system-wide error codes. |
|
309 */ |
|
310 virtual TInt SetAverageBitrate( TUint aAverageBitrate ); |
|
311 |
|
312 /** |
|
313 * Sets framerate |
|
314 * @param aFramerate frame rate |
|
315 * @return One of the standard system-wide error codes. |
|
316 */ |
|
317 virtual TInt SetFramerate( TReal aFramerate ); |
|
318 |
|
319 /** |
|
320 * Sets height of the frame |
|
321 * @param aFrameHeight height of the frame |
|
322 * @return One of the standard system-wide error codes. |
|
323 */ |
|
324 virtual TInt SetFrameHeight( TUint aFrameHeight ); |
|
325 |
|
326 /** |
|
327 * Sets width of the frame |
|
328 * @param aFrameWidth width of the frame |
|
329 * @return One of the standard system-wide error codes. |
|
330 */ |
|
331 virtual TInt SetFrameWidth( TUint aFrameWidth ); |
|
332 |
|
333 /** |
|
334 * Set algorithm. |
|
335 * @param aAlgo codec specific algorithm to be used |
|
336 * @return One of the standard system-wide error codes. |
|
337 */ |
|
338 virtual TInt SetAlgo( TAlgoUsed aAlgo ); |
|
339 |
|
340 /** |
|
341 * Set redundancy count. |
|
342 * @param aRedCount count for redundancy |
|
343 * @return One of the standard system-wide error codes. |
|
344 */ |
|
345 virtual TInt SetRedCount( TUint aRedCount ); |
|
346 |
|
347 /** |
|
348 * Set redundancy payload type. |
|
349 * @param aRedPT payload type for redundancy |
|
350 * @return One of the standard system-wide error codes. |
|
351 */ |
|
352 virtual TInt SetRedundancyPT( TUint8 aRedPT ); |
|
353 |
|
354 /** |
|
355 * Set priority for media resource. |
|
356 * @param aPriority priority for media resource |
|
357 * @return One of the standard system-wide error codes. |
|
358 */ |
|
359 virtual void SetPriority( TInt aPriority ); |
|
360 |
|
361 /** |
|
362 * Set priority preference for media resource. |
|
363 * @param aPreference priority preference for media resource |
|
364 * @return One of the standard system-wide error codes. |
|
365 */ |
|
366 virtual void SetPriorityPreference(TInt aPreference ); |
|
367 |
|
368 /** |
|
369 * Set keep alive packets send timer value. |
|
370 * @param aTimerValue timer value in seconds for keep alive packets |
|
371 * @return One of the standard system-wide error codes. |
|
372 */ |
|
373 virtual TInt SetKeepAliveTimer( TUint8 aTimerValue ); |
|
374 |
|
375 /** |
|
376 * Set keep alive packets payload type. |
|
377 * @param aKeepAlivePT payload type for keep alive packets |
|
378 * @return One of the standard system-wide error codes. |
|
379 */ |
|
380 virtual TInt SetKeepAlivePT( TUint8 aKeepAlivePT ); |
|
381 |
|
382 /** |
|
383 * Set keep alive packets payload data. |
|
384 * @param aData payload data for keep alive packets |
|
385 * @return One of the standard system-wide error codes. |
|
386 */ |
|
387 virtual TInt SetKeepAliveData( const TDesC8& aData ); |
|
388 |
|
389 /** |
|
390 * Enable / Disable Comfort noise generation. |
|
391 * @param aComfortNoisePT Payloadtype value indicating what |
|
392 * payload type should be used for comfort noise. |
|
393 * KPayloadTypeUndefined can be used to turn comfor noise |
|
394 * generation off. |
|
395 * @return One of the standard system-wide error codes. |
|
396 */ |
|
397 virtual TInt SetComfortNoiseGeneration( TUint8 aComfortNoisePT ); |
|
398 |
|
399 |
|
400 /** |
|
401 * Set number of channels. Range between 1 to 8. Refer to RFC3551 4.1 |
|
402 * for interpretation of channels value. Default value is 1. |
|
403 * @return One of the standard system-wide error codes. |
|
404 */ |
|
405 virtual TInt SetChannels( TInt aNumOfChannels ); |
|
406 |
|
407 /** |
|
408 * Sets the upper limit on the usage of redundancy in milliseconds. |
|
409 * @param aMaxRed maximum redundancy |
|
410 * @return One of the standard system-wide error codes. |
|
411 */ |
|
412 virtual TInt SetMaxRed( TInt aMaxRed ); |
|
413 |
|
414 /** |
|
415 * Set encoder/decoder configuration key |
|
416 * @param aConfigKey, config key as Base64 encoded |
|
417 */ |
|
418 virtual void SetConfigKeyL( const TDesC8& aConfigKey ); |
|
419 |
|
420 /** |
|
421 * Sets preferred encoding device for uplink stream and preferred decoding |
|
422 * device for downlink stream. |
|
423 * @param aEncodingDecodingDevice |
|
424 */ |
|
425 virtual void SetPreferredEncodingDecodingDevice( |
|
426 TUid aEncodingDecodingDevice ); |
|
427 |
|
428 public: // get |
|
429 |
|
430 /** |
|
431 * Get VAD status. |
|
432 * @return Boolean indicating is VAD activated |
|
433 */ |
|
434 virtual TBool VAD( ) const; |
|
435 |
|
436 /** |
|
437 * Gets bitrate value used currently. |
|
438 * @return Bitrate value |
|
439 */ |
|
440 virtual TUint Bitrate( ) const; |
|
441 |
|
442 /** |
|
443 * Gets the bitrate mask |
|
444 * @return Bitrate mask |
|
445 */ |
|
446 virtual TUint AllowedBitrates() const; |
|
447 |
|
448 /** |
|
449 * Gets sampling frequency used currently. |
|
450 * @return Sampling frequency |
|
451 */ |
|
452 virtual TUint32 SamplingFreq( ) const; |
|
453 |
|
454 /** |
|
455 * Gets the sdp name. |
|
456 * @return Sdp name used |
|
457 */ |
|
458 virtual const TDesC8& SdpName() const; |
|
459 |
|
460 /** |
|
461 * Gets the payload type. |
|
462 * @return Payload type used |
|
463 */ |
|
464 virtual TUint8 PayloadType( ) const; |
|
465 |
|
466 /** |
|
467 * Gets the codec mode |
|
468 * @return Codec mode used |
|
469 */ |
|
470 virtual TCodecMode CodecMode( ) const; |
|
471 |
|
472 /** |
|
473 * Gets the packet time. |
|
474 * @return Packet Time. |
|
475 */ |
|
476 virtual TInt PTime( ) const; |
|
477 |
|
478 /** |
|
479 * Gets max packet time. |
|
480 * @return Max PacketTime. |
|
481 */ |
|
482 virtual TInt MaxPTime( ) const; |
|
483 |
|
484 /** |
|
485 * Gets the codec specific fmtp value for SDP. |
|
486 * @return Fmtp. |
|
487 */ |
|
488 virtual TDesC8& GetFmtpL( ); |
|
489 |
|
490 /** |
|
491 * Codec FourCC. |
|
492 * @return FourCC. |
|
493 */ |
|
494 virtual TUint32 FourCC( ) const; |
|
495 |
|
496 /** |
|
497 * Get HW FrameTime. |
|
498 * @return FrameTime in milliseconds |
|
499 */ |
|
500 virtual TInt FrameTime( ) const; |
|
501 |
|
502 /** |
|
503 * Get FrameSize. |
|
504 * @return FrameSize in bytes |
|
505 */ |
|
506 virtual TInt FrameSize( ) const; |
|
507 |
|
508 /** |
|
509 * Get Algorithm used. |
|
510 * @return FrameSize in bytes |
|
511 */ |
|
512 virtual TAlgoUsed Algo( ) const; |
|
513 |
|
514 /** |
|
515 * Get Redundancy Count. |
|
516 * @return Redundancy Count |
|
517 */ |
|
518 virtual TUint RedCount( ) const; |
|
519 |
|
520 /** |
|
521 * Get Redundancy PayloadType. |
|
522 * @return Redundancy PayloadType |
|
523 */ |
|
524 virtual TUint8 RedundancyPT( ) const; |
|
525 |
|
526 /** |
|
527 * Get JitterBuffer inactivity timeout |
|
528 * @return timeout time. |
|
529 */ |
|
530 virtual TUint JitterBufInactivityTimeOut() const; |
|
531 |
|
532 /** |
|
533 * Get JitterBuffer threshold |
|
534 * @return threshold. |
|
535 */ |
|
536 virtual TUint JitterBufThreshold() const; |
|
537 |
|
538 /** |
|
539 * Get JitterBuffer Buffer length |
|
540 * @return Buffer length. |
|
541 */ |
|
542 virtual TUint JitterBufBufferLength() const; |
|
543 |
|
544 /** |
|
545 * Gets max bitrate |
|
546 * @return Maximum bitrate. |
|
547 */ |
|
548 virtual TUint MaxBitrate() const; |
|
549 |
|
550 /** |
|
551 * Gets average bitrate |
|
552 * @return average bitrate. |
|
553 */ |
|
554 virtual TUint AverageBitrate() const; |
|
555 |
|
556 /** |
|
557 * Gets framerate |
|
558 * @return frame rate. |
|
559 */ |
|
560 virtual TReal Framerate() const; |
|
561 |
|
562 /** |
|
563 * Gets height of the frame |
|
564 * @return height of the frame. |
|
565 */ |
|
566 virtual TUint FrameHeight() const; |
|
567 |
|
568 /** |
|
569 * Gets width of the frame |
|
570 * @return width of the frame. |
|
571 */ |
|
572 virtual TUint FrameWidth() const; |
|
573 |
|
574 /** |
|
575 * Gets media priority |
|
576 * @return media priority. |
|
577 */ |
|
578 virtual TInt Priority( ) const; |
|
579 |
|
580 /** |
|
581 * Gets media priority preference |
|
582 * @return media priority preference. |
|
583 */ |
|
584 virtual TInt PriorityPreference( ) const; |
|
585 |
|
586 /** |
|
587 * Get keep alive packets send timer value. |
|
588 * @return keep alive packets send timer value. |
|
589 */ |
|
590 virtual TUint8 KeepAliveTimer() const; |
|
591 |
|
592 /** |
|
593 * Get keep alive packets payload type. |
|
594 * @return keep alive packets payload type. |
|
595 */ |
|
596 virtual TUint8 KeepAlivePT() const; |
|
597 |
|
598 /** |
|
599 * Get keep alive packets payload data. |
|
600 * @return keep alive packets payload data. |
|
601 */ |
|
602 virtual const TDesC8& KeepAliveData() const; |
|
603 |
|
604 /** |
|
605 * Get Comfort noise payload type value. |
|
606 * @return Payload type value indicating which |
|
607 * payload type is used for comfort noise generation. |
|
608 * If KPayloadTypeUndefined is returned, comfort |
|
609 * noise generation is disabled. |
|
610 */ |
|
611 virtual TUint8 ComfortNoiseGeneration() const; |
|
612 |
|
613 /** |
|
614 * Get number of channels. |
|
615 * @return One of the standard system-wide error codes. |
|
616 */ |
|
617 virtual TInt GetChannels( TInt& aNumOfChannels ) const; |
|
618 |
|
619 /** |
|
620 * Returns the maximum redundancy |
|
621 * @return maximum redundancy in milliseconds |
|
622 */ |
|
623 virtual TInt MaxRed() const; |
|
624 |
|
625 /** |
|
626 * Fills array with red payload types. |
|
627 * @param aRedPayloads |
|
628 */ |
|
629 virtual void RedPayloadsL( RArray<TUint>& aRedPayloads ) const; |
|
630 |
|
631 /** |
|
632 * Get encoder/decoder configuration key |
|
633 * @return key or NULL, ownership is transferred |
|
634 */ |
|
635 virtual HBufC8* ConfigKeyL() const; |
|
636 |
|
637 /** |
|
638 * Get preferred encoding device for uplink stream and preferred decoding |
|
639 * device for downlink stream. |
|
640 */ |
|
641 virtual TUid PreferredEncodingDecodingDevice() const; |
|
642 |
|
643 public: //Fmtp, set, parse and create fmtp string from internal attributes |
|
644 |
|
645 /** |
|
646 * Sets the fmtp attribute, i.e. iFmtpAttr == aFmtp |
|
647 * @param aFmtp Fmtp attribute |
|
648 * @return void |
|
649 */ |
|
650 virtual void SetFmtpAttrL( const TDesC8& aFmtp, TBool parseFmtp = ETrue ); |
|
651 |
|
652 /** |
|
653 * Parses the fmtp attributes, and updates the internal values |
|
654 * except the iFmtpAttr attribute |
|
655 * @param aFmtp Fmtp attribute |
|
656 * @return True if any param was updated |
|
657 */ |
|
658 virtual TBool ParseFmtpAttrL( const TDesC8& aFmtp ); |
|
659 |
|
660 /** |
|
661 * Creates the fmtp string from internal values |
|
662 * @return void |
|
663 */ |
|
664 virtual void CreateFmtpAttrListL(); |
|
665 |
|
666 /** |
|
667 * Creates the fmtp string from internal values and the given bitrates |
|
668 * @return void |
|
669 */ |
|
670 virtual void CreateFmtpAttrListL( const RArray<TUint>& aBitrates ); |
|
671 |
|
672 private: |
|
673 |
|
674 /** |
|
675 * Specifies the number of frame blocks, |
|
676 * that is the interval at which codec mode changes are allowed |
|
677 * @return One of the standard system-wide error codes. |
|
678 */ |
|
679 virtual TInt SetModeChangePeriod( const TInt aPeriod ); |
|
680 |
|
681 /** |
|
682 * Get specified number of frame blocks |
|
683 * @return One of the standard system-wide error codes. |
|
684 */ |
|
685 virtual TInt ModeChangePeriod( ) const; |
|
686 |
|
687 /** |
|
688 * Set boolean variable, which indicates change between two modes. |
|
689 * With default value 1 changes are only allowed to the |
|
690 * neighboring mode. |
|
691 * @return One of the standard system-wide error codes. |
|
692 */ |
|
693 virtual TInt SetModeChangeNeighbor( const TBool aNeighbor ); |
|
694 |
|
695 /** |
|
696 * Get boolean variable, which indicates change between two modes. |
|
697 * @return iNeighbor |
|
698 */ |
|
699 virtual TBool ModeChangeNeighbor( ) const; |
|
700 |
|
701 /** |
|
702 * Set boolean type frame CRC value. With value 1 CRC shall be |
|
703 * included in the payload, otherwise not. 1 also implies that |
|
704 * octet-alignet operation shall be used for the session. |
|
705 * @return One of the standard system-wide error codes. |
|
706 */ |
|
707 virtual TInt SetCrc( const TBool aCrc ); |
|
708 |
|
709 /** |
|
710 * Get boolean type CRC value. |
|
711 * @return iCrc |
|
712 */ |
|
713 virtual TBool GetCrc( ) const; |
|
714 |
|
715 /** |
|
716 * Set robust sorting on/off with boolean value. With value 1 |
|
717 * the payload SHALL employ robust sorting. Implies automatically |
|
718 * that octet-aligned operation SHALL be used for the session. |
|
719 * @return One of the standard system-wide error codes. |
|
720 */ |
|
721 virtual TInt SetRobustSorting( const TBool aRobust ); |
|
722 |
|
723 /** |
|
724 * Get boolean type robust sorting value |
|
725 * @return iRobust |
|
726 */ |
|
727 virtual TBool GetRobustSorting( ) const; |
|
728 |
|
729 /** |
|
730 * Set interleaving as unsigned integer. Number range is 0-63. |
|
731 * Indicates that frame-block level interleaving SHALL be |
|
732 * used for the session and it's value defines the max number of |
|
733 * frame-blocks allowed in interleaving group. Implies automatically |
|
734 * that octet-aligned operation SHALL be used. |
|
735 * @return One of the standard system-wide error codes. |
|
736 */ |
|
737 virtual TInt SetInterleaving( const TInt aFrameBlockCount ); |
|
738 |
|
739 /** |
|
740 * Get Interleaving value |
|
741 * @return iFrameBlockCount |
|
742 */ |
|
743 virtual TInt GetInterleaving() const; |
|
744 |
|
745 |
|
746 protected: // Data |
|
747 |
|
748 /** |
|
749 * Type of codec, like KUidMediaTypeAudio or KUidMediaTypeVideo |
|
750 */ |
|
751 TUid iType; |
|
752 |
|
753 /** |
|
754 * Enables or disables VAD (Voice Activity Detection) |
|
755 */ |
|
756 TBool iEnableVAD; |
|
757 |
|
758 /** |
|
759 * Sampling frequency used with codec |
|
760 */ |
|
761 TUint32 iSamplingFreq; |
|
762 |
|
763 /** |
|
764 * Sdp name used in SDP messages |
|
765 */ |
|
766 TBuf8<KMaxSdpNameLength> iSdpName; |
|
767 |
|
768 /** |
|
769 * Stream's packet time |
|
770 */ |
|
771 TUint iPTime; |
|
772 |
|
773 /** |
|
774 * Stream's max packet time |
|
775 */ |
|
776 TUint iMaxPTime; |
|
777 |
|
778 /** |
|
779 * Fmtp attribute |
|
780 */ |
|
781 HBufC8* iFmtpAttr; |
|
782 |
|
783 /** |
|
784 * Parsed fmtp attr |
|
785 */ |
|
786 TUint iParsedFmtp; |
|
787 |
|
788 /** |
|
789 * Stream's bit rate |
|
790 */ |
|
791 TUint iBitrate; |
|
792 |
|
793 /** |
|
794 * Bitrate mask, allowed modes |
|
795 */ |
|
796 TUint iBitrateMask; |
|
797 |
|
798 /** |
|
799 * Payload type |
|
800 */ |
|
801 TUint8 iPayloadType; |
|
802 |
|
803 /** |
|
804 * Codec mode ( e.g. PCMU, PCMA, Bandwidth efficient, octet aligned ) |
|
805 */ |
|
806 TCodecMode iCodecMode; |
|
807 |
|
808 /** |
|
809 * Local port |
|
810 */ |
|
811 TUint iStartMediaPort; |
|
812 |
|
813 /** |
|
814 * Codec FourCC |
|
815 */ |
|
816 TUint32 iFourCC; |
|
817 |
|
818 /** |
|
819 * FrameTime |
|
820 */ |
|
821 TInt iHwFrameTime; |
|
822 |
|
823 /** |
|
824 * FrameSize |
|
825 */ |
|
826 TInt iFrameSize; |
|
827 |
|
828 /** |
|
829 * Algorithm used |
|
830 */ |
|
831 TAlgoUsed iAlgoUsed; |
|
832 |
|
833 /** |
|
834 * Redundancy count |
|
835 */ |
|
836 TUint iRedCount; |
|
837 |
|
838 /** |
|
839 * Redundancy PayloadType |
|
840 */ |
|
841 TUint8 iRedundancyPT; |
|
842 |
|
843 /** |
|
844 * JitterBuffer InactivityTimeOut |
|
845 * |
|
846 * Used for talkburst |
|
847 * In millisecound when the sequence number should be zerod |
|
848 * after a talkburst |
|
849 * ( iJitterBufInactivityTimeOut / iHwFrameTime ) == InactivityEvent |
|
850 */ |
|
851 TUint iJitterBufInactivityTimeOut; |
|
852 |
|
853 /** |
|
854 * JitterBuffer threshold |
|
855 * |
|
856 * How many packets should be in the buffer |
|
857 * before they are played |
|
858 */ |
|
859 TUint iJitterBufThreshold; |
|
860 |
|
861 /** |
|
862 * JitterBuffer threshold |
|
863 * |
|
864 * How many packets the jitter buffer can hold |
|
865 */ |
|
866 TUint iJitterBufBufferLength; |
|
867 |
|
868 /** |
|
869 * Mode change period |
|
870 */ |
|
871 TInt iModeChangePeriod; |
|
872 |
|
873 /** |
|
874 * Mode change neighbor |
|
875 */ |
|
876 TBool iNeighbor; |
|
877 |
|
878 /** |
|
879 * Crc value |
|
880 */ |
|
881 TBool iCrc; |
|
882 |
|
883 /** |
|
884 * Robust sorting indicator |
|
885 */ |
|
886 TBool iRobust; |
|
887 |
|
888 /** |
|
889 * Interleaving value |
|
890 */ |
|
891 TInt iFrameBlockCount; |
|
892 |
|
893 /** |
|
894 * Number of channels |
|
895 */ |
|
896 TInt iNumOfChannels; |
|
897 |
|
898 /** |
|
899 * Payload type for comfort noise generation |
|
900 */ |
|
901 TUint8 iComfortNoiseGenerationPt; |
|
902 |
|
903 /** |
|
904 * MMF priority settings |
|
905 */ |
|
906 TInt iPriority; |
|
907 |
|
908 /** |
|
909 * MMF priority settings |
|
910 */ |
|
911 TInt iPriorityPreference; |
|
912 |
|
913 /** |
|
914 * Average bitrate used in codec |
|
915 */ |
|
916 TUint iAverageBitrate; |
|
917 |
|
918 /** |
|
919 * Max bitrate used in codec |
|
920 */ |
|
921 TUint iMaxBitrate; |
|
922 |
|
923 /** |
|
924 * Frame rate for video |
|
925 */ |
|
926 TReal iFramerate; |
|
927 |
|
928 /** |
|
929 * Horizontal resolution of video |
|
930 */ |
|
931 TUint iVideoWidth; |
|
932 |
|
933 /** |
|
934 * Vertical resolution of video |
|
935 */ |
|
936 TUint iVideoHeight; |
|
937 |
|
938 /** |
|
939 * Timer value for keep alive data |
|
940 */ |
|
941 TUint8 iKeepAliveTimer; |
|
942 |
|
943 /** |
|
944 * Payload type value for keep alive data |
|
945 */ |
|
946 TUint8 iKeepAlivePT; |
|
947 |
|
948 /** |
|
949 * Data for keep alive |
|
950 */ |
|
951 TBuf8<KMaxKeepAliveDataLen> iKeepAliveData; |
|
952 |
|
953 // MMF format encoder for the codec |
|
954 TUint32 iPayloadFormatEncoder; |
|
955 |
|
956 // MMF format decoder for the codec |
|
957 TUint32 iPayloadFormatDecoder; |
|
958 |
|
959 /** |
|
960 * Maximum redundancy in milliseconds |
|
961 */ |
|
962 TInt iMaxRed; |
|
963 |
|
964 /** |
|
965 * Encoder/decoder configuration key |
|
966 */ |
|
967 HBufC8* iConfigKey; |
|
968 |
|
969 /** |
|
970 * Encoder/decoder uid |
|
971 */ |
|
972 TUid iEncodingDecodingDevice; |
|
973 |
|
974 private: |
|
975 |
|
976 #ifdef TEST_EUNIT |
|
977 friend class UT_CMccCodecInformation; |
|
978 #endif |
|
979 }; |
|
980 |
|
981 #endif // MMCCCODECINFORMATION_H |
|
982 |
|
983 // End of File |