|
1 /* |
|
2 * Copyright (c) 2002-2004 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: MCC CodecInformation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <AudioPreference.h> |
|
23 #include <delimitedpathsegment8.h> |
|
24 |
|
25 #include "mmcccodecinformation.h" |
|
26 #include "mccinternalcodecs.h" |
|
27 |
|
28 // EXTERNAL DATA STRUCTURES |
|
29 |
|
30 // EXTERNAL FUNCTION PROTOTYPES |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 const TUint KDefaultSamplingFreq = 8000; |
|
35 const TUint KDefaultBufferLength = 10; |
|
36 const TUint KDefaultBufferThreshold = 5; |
|
37 const TUint KDefaultPreference = EMdaPriorityPreferenceNone; |
|
38 const TUint KDefaultPriority = EMdaPriorityNormal; |
|
39 const TInt KDefaultModeChangePeriod = 1; |
|
40 |
|
41 |
|
42 // MACROS |
|
43 |
|
44 // LOCAL CONSTANTS AND MACROS |
|
45 |
|
46 // MODULE DATA STRUCTURES |
|
47 |
|
48 // LOCAL FUNCTION PROTOTYPES |
|
49 |
|
50 // FORWARD DECLARATIONS |
|
51 |
|
52 // ============================= LOCAL FUNCTIONS =============================== |
|
53 |
|
54 |
|
55 // ============================ MEMBER FUNCTIONS =============================== |
|
56 |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CMccCodecInformation::CMccCodecInformation |
|
60 // default constructor |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 CMccCodecInformation::CMccCodecInformation() : |
|
64 iType( KUidMediaTypeAudio ), |
|
65 iSamplingFreq( KDefaultSamplingFreq ), |
|
66 iMaxPTime( KMaxPtime ), |
|
67 iFmtpAttr( NULL ), |
|
68 iBitrateMask( 0 ), |
|
69 iRedCount( 0 ), |
|
70 iRedundancyPT( KMccPayloadTypeMax ), |
|
71 iJitterBufThreshold( KDefaultBufferThreshold ), |
|
72 iJitterBufBufferLength( KDefaultBufferLength ), |
|
73 iModeChangePeriod( KDefaultModeChangePeriod ), |
|
74 iNeighbor( EFalse ), |
|
75 iComfortNoiseGenerationPt( KPayloadTypeUndefined ), |
|
76 iPriority( KDefaultPriority ), |
|
77 iPriorityPreference( KDefaultPreference ), |
|
78 iAverageBitrate( 0 ), |
|
79 iMaxBitrate( 0 ), |
|
80 iFramerate( 0 ), |
|
81 iVideoWidth( 0 ), |
|
82 iVideoHeight( 0 ), |
|
83 iPayloadFormatEncoder( 0 ), |
|
84 iPayloadFormatDecoder( 0 ), |
|
85 iEncodingDecodingDevice( KNullUid ) |
|
86 { |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CMccCodecInformation::~CMccCodecInformation |
|
91 // Destructor |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 CMccCodecInformation::~CMccCodecInformation() |
|
95 { |
|
96 delete iFmtpAttr; |
|
97 delete iConfigKey; |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CMccCodecInformation::SetValues |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 void CMccCodecInformation::SetValues( TMccCodecInfo codecInfo ) |
|
105 { |
|
106 iType = codecInfo.iType; |
|
107 iSdpName = codecInfo.iSdpName; |
|
108 iSamplingFreq = codecInfo.iSamplingFreq; |
|
109 iBitrateMask = codecInfo.iBitrateMask; |
|
110 iJitterBufInactivityTimeOut = codecInfo.iJitterBufInactivityTimeOut; |
|
111 iJitterBufThreshold = codecInfo.iJitterBufThreshold; |
|
112 iJitterBufBufferLength = codecInfo.iJitterBufBufferLength; |
|
113 iModeChangePeriod = codecInfo.iModeChangePeriod; |
|
114 iNeighbor = codecInfo.iNeighbor; |
|
115 iComfortNoiseGenerationPt = codecInfo.iComfortNoiseGenerationPt; |
|
116 iPriority = codecInfo.iPriority.iPriority; |
|
117 iPriorityPreference = codecInfo.iPriority.iPref; |
|
118 iAverageBitrate = codecInfo.iAverageBitrate; |
|
119 iMaxBitrate = codecInfo.iMaxBitrate; |
|
120 iFramerate = codecInfo.iFramerate; |
|
121 iVideoWidth = codecInfo.iVideoWidth; |
|
122 iVideoHeight = codecInfo.iVideoHeight; |
|
123 iPayloadFormatEncoder = codecInfo.iPayloadFormatEncoder; |
|
124 iPayloadFormatDecoder = codecInfo.iPayloadFormatDecoder; |
|
125 |
|
126 iFourCC = codecInfo.iFourCC.FourCC(); |
|
127 iAlgoUsed = codecInfo.iAlgoUsed; |
|
128 iRedCount = codecInfo.iRedundancyCount; |
|
129 iRedundancyPT = codecInfo.iRedundantPayload; |
|
130 SetBitrate( codecInfo.iBitrate ); // Some codecs have special behavior |
|
131 iCodecMode = codecInfo.iCodecMode; |
|
132 iEnableVAD = codecInfo.iEnableDTX; |
|
133 iMaxPTime = codecInfo.iMaxPtime; |
|
134 iPTime = codecInfo.iPtime; |
|
135 iPayloadType = codecInfo.iPayloadType; |
|
136 iFrameSize = codecInfo.iFrameSize; |
|
137 iHwFrameTime = codecInfo.iHwFrameTime; |
|
138 |
|
139 iKeepAliveTimer = codecInfo.iKeepaliveInterval; |
|
140 iKeepAlivePT = codecInfo.iKeepalivePT; |
|
141 iKeepAliveData = codecInfo.iKeepaliveData; |
|
142 |
|
143 iMaxRed = codecInfo.iMaxRed; |
|
144 |
|
145 if ( codecInfo.iConfigKey != KNullDesC8 ) |
|
146 { |
|
147 TRAP_IGNORE( SetConfigKeyL( codecInfo.iConfigKey ) ) |
|
148 } |
|
149 iEncodingDecodingDevice = codecInfo.iEncodingDecodingDevice; |
|
150 } |
|
151 |
|
152 // ----------------------------------------------------------------------------- |
|
153 // CMccCodecInformation::GetValues |
|
154 // ----------------------------------------------------------------------------- |
|
155 // |
|
156 void CMccCodecInformation::GetValues( TMccCodecInfo& codecInfo ) const |
|
157 { |
|
158 codecInfo.iType = iType; |
|
159 codecInfo.iSdpName = iSdpName; |
|
160 codecInfo.iSamplingFreq = iSamplingFreq; |
|
161 codecInfo.iBitrateMask = iBitrateMask; |
|
162 codecInfo.iJitterBufInactivityTimeOut = iJitterBufInactivityTimeOut; |
|
163 codecInfo.iJitterBufThreshold = iJitterBufThreshold; |
|
164 codecInfo.iJitterBufBufferLength = iJitterBufBufferLength; |
|
165 codecInfo.iPriority.iPriority = iPriority; |
|
166 codecInfo.iPriority.iPref = TMdaPriorityPreference( iPriorityPreference ); |
|
167 codecInfo.iAverageBitrate = iAverageBitrate; |
|
168 codecInfo.iMaxBitrate = iMaxBitrate; |
|
169 codecInfo.iFramerate = iFramerate; |
|
170 codecInfo.iComfortNoiseGenerationPt = iComfortNoiseGenerationPt; |
|
171 codecInfo.iVideoWidth = iVideoWidth; |
|
172 codecInfo.iVideoHeight = iVideoHeight; |
|
173 codecInfo.iPayloadFormatEncoder = iPayloadFormatEncoder; |
|
174 codecInfo.iPayloadFormatDecoder = iPayloadFormatDecoder; |
|
175 |
|
176 codecInfo.iFourCC = TFourCC( iFourCC ); |
|
177 codecInfo.iAlgoUsed = iAlgoUsed; |
|
178 codecInfo.iRedundancyCount = iRedCount; |
|
179 codecInfo.iRedundantPayload = iRedundancyPT; |
|
180 codecInfo.iBitrate = iBitrate; |
|
181 codecInfo.iCodecMode = iCodecMode; |
|
182 codecInfo.iEnableDTX = iEnableVAD; |
|
183 codecInfo.iMaxPtime = iMaxPTime; |
|
184 codecInfo.iPtime = iPTime; |
|
185 codecInfo.iPayloadType = iPayloadType; |
|
186 codecInfo.iFrameSize = iFrameSize; |
|
187 codecInfo.iHwFrameTime = iHwFrameTime; |
|
188 codecInfo.iRedundantPayload = iRedundancyPT; |
|
189 codecInfo.iNeighbor = iNeighbor; |
|
190 codecInfo.iModeChangePeriod = iModeChangePeriod; |
|
191 codecInfo.iKeepaliveInterval = iKeepAliveTimer; |
|
192 codecInfo.iKeepalivePT = iKeepAlivePT; |
|
193 codecInfo.iKeepaliveData = iKeepAliveData; |
|
194 codecInfo.iMaxRed = iMaxRed; |
|
195 |
|
196 if ( iConfigKey && iConfigKey->Length() <= KMaxConfigKeyLen ) |
|
197 { |
|
198 codecInfo.iConfigKey.Copy( *iConfigKey ); |
|
199 } |
|
200 |
|
201 codecInfo.iEncodingDecodingDevice = iEncodingDecodingDevice; |
|
202 } |
|
203 |
|
204 // ----------------------------------------------------------------------------- |
|
205 // CMccCodecInformation::RequireSignalling |
|
206 // ----------------------------------------------------------------------------- |
|
207 // |
|
208 TBool CMccCodecInformation::RequireSignalling( |
|
209 const CMccCodecInformation& /*aCandidate*/ ) const |
|
210 { |
|
211 return EFalse; |
|
212 } |
|
213 |
|
214 // ----------------------------------------------------------------------------- |
|
215 // CMccCodecInformation::Type |
|
216 // ----------------------------------------------------------------------------- |
|
217 // |
|
218 TUid CMccCodecInformation::Type() const |
|
219 { |
|
220 return iType; |
|
221 } |
|
222 |
|
223 // ----------------------------------------------------------------------------- |
|
224 // CMccCodecInformation::VAD |
|
225 // ----------------------------------------------------------------------------- |
|
226 // |
|
227 TBool CMccCodecInformation::VAD() const |
|
228 { |
|
229 return iEnableVAD; |
|
230 } |
|
231 |
|
232 // ----------------------------------------------------------------------------- |
|
233 // CMccCodecInformation::Bitrate |
|
234 // ----------------------------------------------------------------------------- |
|
235 // |
|
236 TUint CMccCodecInformation::Bitrate() const |
|
237 { |
|
238 return iBitrate; |
|
239 } |
|
240 |
|
241 // ----------------------------------------------------------------------------- |
|
242 // CMccCodecInformation::SamplingFreq |
|
243 // Gets the sampling frequency. |
|
244 // ----------------------------------------------------------------------------- |
|
245 // |
|
246 TUint32 CMccCodecInformation::SamplingFreq() const |
|
247 { |
|
248 return iSamplingFreq; |
|
249 } |
|
250 |
|
251 // ----------------------------------------------------------------------------- |
|
252 // CMccCodecInformation::SdpName |
|
253 // Gets the codec name. |
|
254 // ----------------------------------------------------------------------------- |
|
255 // |
|
256 const TDesC8& CMccCodecInformation::SdpName() const |
|
257 { |
|
258 return iSdpName; |
|
259 } |
|
260 |
|
261 // ----------------------------------------------------------------------------- |
|
262 // CMccCodecInformation::CodecMode |
|
263 // Gets the codec mode e.g. uLaw/aLaw. |
|
264 // ----------------------------------------------------------------------------- |
|
265 // |
|
266 TCodecMode CMccCodecInformation::CodecMode() const |
|
267 { |
|
268 return iCodecMode; |
|
269 } |
|
270 |
|
271 // ----------------------------------------------------------------------------- |
|
272 // CMccCodecInformation::PayloadType |
|
273 // Gets the payloadtype. |
|
274 // ----------------------------------------------------------------------------- |
|
275 // |
|
276 TUint8 CMccCodecInformation::PayloadType() const |
|
277 { |
|
278 return iPayloadType; |
|
279 } |
|
280 |
|
281 // ----------------------------------------------------------------------------- |
|
282 // CMccCodecInformation::PTime |
|
283 // Gets the packet time. |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 TInt CMccCodecInformation::PTime() const |
|
287 { |
|
288 return iPTime; |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // CMccCodecInformation::MaxPTime |
|
293 // Gets the max packet time. |
|
294 // ----------------------------------------------------------------------------- |
|
295 // |
|
296 TInt CMccCodecInformation::MaxPTime() const |
|
297 { |
|
298 return iMaxPTime; |
|
299 } |
|
300 |
|
301 // ----------------------------------------------------------------------------- |
|
302 // CMccCodecInformation::GetFmtpL |
|
303 // Gets the fmtp attribute |
|
304 // ----------------------------------------------------------------------------- |
|
305 // |
|
306 TDesC8& CMccCodecInformation::GetFmtpL() |
|
307 { |
|
308 if( !iFmtpAttr ) |
|
309 { |
|
310 iFmtpAttr = HBufC8::NewL(0); |
|
311 } |
|
312 |
|
313 return *iFmtpAttr; |
|
314 } |
|
315 |
|
316 |
|
317 // ----------------------------------------------------------------------------- |
|
318 // CMccCodecInformation::CreateFmtpAttrListL |
|
319 // If fmtp does not exist, then create it from internal values |
|
320 // ----------------------------------------------------------------------------- |
|
321 // |
|
322 void CMccCodecInformation::CreateFmtpAttrListL() |
|
323 { |
|
324 } |
|
325 |
|
326 // ----------------------------------------------------------------------------- |
|
327 // CMccCodecInformation::CreateFmtpAttrListL |
|
328 // If fmtp does not exist, then create it from internal values and |
|
329 // the bitrate array |
|
330 // ----------------------------------------------------------------------------- |
|
331 // |
|
332 void CMccCodecInformation::CreateFmtpAttrListL( const RArray<TUint>& /*aBitrates*/ ) |
|
333 { |
|
334 } |
|
335 |
|
336 |
|
337 // ----------------------------------------------------------------------------- |
|
338 // CMccCodecInformation::SetFmtpAttrL |
|
339 // Gets the fmtp attribute |
|
340 // ----------------------------------------------------------------------------- |
|
341 // |
|
342 void CMccCodecInformation::SetFmtpAttrL( const TDesC8& aFmtp, TBool parseFmtp ) |
|
343 { |
|
344 if ( iFmtpAttr ) |
|
345 { |
|
346 delete iFmtpAttr; |
|
347 iFmtpAttr = NULL; |
|
348 } |
|
349 |
|
350 iFmtpAttr = HBufC8::NewL( aFmtp.Length() ); |
|
351 iFmtpAttr->Des().Copy( aFmtp ); |
|
352 |
|
353 //Check if the fmtp string should be parsed |
|
354 if( parseFmtp ) |
|
355 { |
|
356 ParseFmtpAttrL( *iFmtpAttr ); |
|
357 } |
|
358 } |
|
359 |
|
360 // ----------------------------------------------------------------------------- |
|
361 // CMccCodecInformation::ParseFmtpAttrL |
|
362 // Parse the fmtp string, but doesn't update the iFmtpAttr |
|
363 // ----------------------------------------------------------------------------- |
|
364 // |
|
365 TBool CMccCodecInformation::ParseFmtpAttrL( const TDesC8& /*aFmtp*/ ) |
|
366 { |
|
367 return EFalse; |
|
368 } |
|
369 |
|
370 |
|
371 // ----------------------------------------------------------------------------- |
|
372 // CMccCodecInformation::SetAllowedBitrates |
|
373 // Gets Codec FourCC |
|
374 // ----------------------------------------------------------------------------- |
|
375 // |
|
376 TInt CMccCodecInformation::SetAllowedBitrates( TUint /*aBitrateMask*/ ) |
|
377 { |
|
378 return KErrNotSupported; |
|
379 } |
|
380 |
|
381 // ----------------------------------------------------------------------------- |
|
382 // CMccCodecInformation::AllowedBitrates |
|
383 // Gets Codec FourCC |
|
384 // ----------------------------------------------------------------------------- |
|
385 // |
|
386 TUint CMccCodecInformation::AllowedBitrates() const |
|
387 { |
|
388 return iBitrateMask; |
|
389 } |
|
390 |
|
391 // ----------------------------------------------------------------------------- |
|
392 // CMccCodecInformation::FourCC |
|
393 // Gets Codec FourCC |
|
394 // ----------------------------------------------------------------------------- |
|
395 // |
|
396 TUint32 CMccCodecInformation::FourCC( ) const |
|
397 { |
|
398 return iFourCC; |
|
399 } |
|
400 |
|
401 // ----------------------------------------------------------------------------- |
|
402 // CMccCodecInformation::FrameTime |
|
403 // Gets Frametime (ms). |
|
404 // ----------------------------------------------------------------------------- |
|
405 // |
|
406 TInt CMccCodecInformation::FrameTime() const |
|
407 { |
|
408 return iHwFrameTime; |
|
409 } |
|
410 |
|
411 // ----------------------------------------------------------------------------- |
|
412 // CMccCodecInformation::FrameSize |
|
413 // Gets FrameSize. |
|
414 // ----------------------------------------------------------------------------- |
|
415 // |
|
416 TInt CMccCodecInformation::FrameSize() const |
|
417 { |
|
418 return iFrameSize; |
|
419 } |
|
420 |
|
421 // ----------------------------------------------------------------------------- |
|
422 // CMccCodecInformation::SetAlgo |
|
423 // Sets Algorithm. |
|
424 // ----------------------------------------------------------------------------- |
|
425 // |
|
426 TInt CMccCodecInformation::SetAlgo( TAlgoUsed aAlgo ) |
|
427 { |
|
428 iAlgoUsed = aAlgo; |
|
429 return KErrNone; |
|
430 } |
|
431 |
|
432 // ----------------------------------------------------------------------------- |
|
433 // CMccCodecInformation::Algo |
|
434 // Gets used algorithm. |
|
435 // ----------------------------------------------------------------------------- |
|
436 // |
|
437 TAlgoUsed CMccCodecInformation::Algo( ) const |
|
438 { |
|
439 return iAlgoUsed; |
|
440 } |
|
441 |
|
442 // ----------------------------------------------------------------------------- |
|
443 // CMccCodecInformation::SetRedCount |
|
444 // Sets Redundancy Count. |
|
445 // ----------------------------------------------------------------------------- |
|
446 // |
|
447 TInt CMccCodecInformation::SetRedCount( TUint aRedCount ) |
|
448 { |
|
449 if ( KMaxGenRedCount < aRedCount ) |
|
450 { |
|
451 return KErrArgument; |
|
452 } |
|
453 |
|
454 TAlgoUsed algo = aRedCount > 0 ? EGenRedUsed : ENoAlgoUsed; |
|
455 SetAlgo( algo ); |
|
456 |
|
457 iRedCount = aRedCount; |
|
458 return KErrNone; |
|
459 } |
|
460 |
|
461 // ----------------------------------------------------------------------------- |
|
462 // CMccCodecInformation::RedCount |
|
463 // Gets Redundancy Count. |
|
464 // ----------------------------------------------------------------------------- |
|
465 // |
|
466 TUint CMccCodecInformation::RedCount( ) const |
|
467 { |
|
468 return iRedCount; |
|
469 } |
|
470 |
|
471 // ----------------------------------------------------------------------------- |
|
472 // CMccCodecInformation::SetRedundancyPT |
|
473 // Sets Redundancy PayloadType. |
|
474 // ----------------------------------------------------------------------------- |
|
475 // |
|
476 TInt CMccCodecInformation::SetRedundancyPT( TUint8 aRedPT ) |
|
477 { |
|
478 iRedundancyPT = aRedPT; |
|
479 return KErrNone; |
|
480 } |
|
481 |
|
482 // ----------------------------------------------------------------------------- |
|
483 // CMccCodecInformation::RedundancyPT |
|
484 // Gets Redundancy PayloadType. |
|
485 // ----------------------------------------------------------------------------- |
|
486 // |
|
487 TUint8 CMccCodecInformation::RedundancyPT( ) const |
|
488 { |
|
489 return iRedundancyPT; |
|
490 } |
|
491 |
|
492 // ----------------------------------------------------------------------------- |
|
493 // CMccCodecInformation::SetJitterBufInactivityTimeOut |
|
494 // Set JitterBuffer Timeout time |
|
495 // ----------------------------------------------------------------------------- |
|
496 // |
|
497 TInt CMccCodecInformation::SetJitterBufInactivityTimeOut( TUint aJitterBufInactivityTimeOut ) |
|
498 { |
|
499 iJitterBufInactivityTimeOut = aJitterBufInactivityTimeOut; |
|
500 |
|
501 return KErrNone; |
|
502 } |
|
503 |
|
504 // ----------------------------------------------------------------------------- |
|
505 // CMccCodecInformation::JitterBufInactivityTimeOut |
|
506 // Get JitterBuffer timeout time |
|
507 // ----------------------------------------------------------------------------- |
|
508 // |
|
509 TUint CMccCodecInformation::JitterBufInactivityTimeOut() const |
|
510 { |
|
511 return iJitterBufInactivityTimeOut; |
|
512 } |
|
513 |
|
514 // ----------------------------------------------------------------------------- |
|
515 // CMccCodecInformation::SetJitterBufThreshold |
|
516 // Set JitterBuffer treshold |
|
517 // ----------------------------------------------------------------------------- |
|
518 // |
|
519 TInt CMccCodecInformation::SetJitterBufThreshold( TUint aJitterBufThreshold ) |
|
520 { |
|
521 iJitterBufThreshold = aJitterBufThreshold; |
|
522 return KErrNone; |
|
523 } |
|
524 |
|
525 // ----------------------------------------------------------------------------- |
|
526 // CMccCodecInformation::JitterBufThreshold |
|
527 // Get JitterBuffer threshold |
|
528 // ----------------------------------------------------------------------------- |
|
529 // |
|
530 TUint CMccCodecInformation::JitterBufThreshold() const |
|
531 { |
|
532 return iJitterBufThreshold; |
|
533 } |
|
534 |
|
535 // ----------------------------------------------------------------------------- |
|
536 // CMccCodecInformation::SetJitterBufBufferLength |
|
537 // Set JitterBuffer Buffer length |
|
538 // ----------------------------------------------------------------------------- |
|
539 // |
|
540 TInt CMccCodecInformation::SetJitterBufBufferLength( TUint aJitterBufBufferLength ) |
|
541 { |
|
542 if( aJitterBufBufferLength == 0 || aJitterBufBufferLength < iJitterBufThreshold ) |
|
543 { |
|
544 return KErrUnderflow; |
|
545 } |
|
546 |
|
547 else |
|
548 { |
|
549 iJitterBufBufferLength = aJitterBufBufferLength; |
|
550 return KErrNone; |
|
551 } |
|
552 } |
|
553 |
|
554 // ----------------------------------------------------------------------------- |
|
555 // CMccCodecInformation::JitterBufBufferLength |
|
556 // Get JitterBuffer Buffer length |
|
557 // ----------------------------------------------------------------------------- |
|
558 // |
|
559 TUint CMccCodecInformation::JitterBufBufferLength() const |
|
560 { |
|
561 return iJitterBufBufferLength; |
|
562 } |
|
563 |
|
564 // ----------------------------------------------------------------------------- |
|
565 // CMccCodecInformation::SetModeChangePeriod |
|
566 // Default implementation |
|
567 // ----------------------------------------------------------------------------- |
|
568 // |
|
569 TInt CMccCodecInformation::SetModeChangePeriod( const TInt /*aPeriod*/ ) |
|
570 { |
|
571 return KErrNotSupported; |
|
572 } |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // CMccCodecInformation::ModeChangePeriod |
|
576 // Default implementation |
|
577 // ----------------------------------------------------------------------------- |
|
578 // |
|
579 TInt CMccCodecInformation::ModeChangePeriod( ) const |
|
580 { |
|
581 return KErrNotSupported; |
|
582 } |
|
583 |
|
584 // ----------------------------------------------------------------------------- |
|
585 // CMccCodecInformation::SetModeChangeNeighbor |
|
586 // Default implementation |
|
587 // ----------------------------------------------------------------------------- |
|
588 // |
|
589 TInt CMccCodecInformation::SetModeChangeNeighbor( const TBool /*aNeighbor*/ ) |
|
590 { |
|
591 return KErrNotSupported; |
|
592 } |
|
593 |
|
594 // ----------------------------------------------------------------------------- |
|
595 // CMccCodecInformation::ModeChangeNeighbor |
|
596 // Default implementation |
|
597 // ----------------------------------------------------------------------------- |
|
598 // |
|
599 TBool CMccCodecInformation::ModeChangeNeighbor( ) const |
|
600 { |
|
601 return ETrue; |
|
602 } |
|
603 |
|
604 // ----------------------------------------------------------------------------- |
|
605 // CMccCodecInformation::SetCrc |
|
606 // Default implementation |
|
607 // ----------------------------------------------------------------------------- |
|
608 // |
|
609 TInt CMccCodecInformation::SetCrc( const TBool /*aCrc*/ ) |
|
610 { |
|
611 return KErrNotSupported; |
|
612 } |
|
613 |
|
614 // ----------------------------------------------------------------------------- |
|
615 // CMccCodecInformation::GetCrc |
|
616 // Default implementation |
|
617 // ----------------------------------------------------------------------------- |
|
618 // |
|
619 TBool CMccCodecInformation::GetCrc( ) const |
|
620 { |
|
621 return EFalse; |
|
622 } |
|
623 |
|
624 // ----------------------------------------------------------------------------- |
|
625 // CMccCodecInformation::SetRobustSorting |
|
626 // Default implementation |
|
627 // ----------------------------------------------------------------------------- |
|
628 // |
|
629 TInt CMccCodecInformation::SetRobustSorting( const TBool /*aRobust*/) |
|
630 { |
|
631 return KErrNotSupported; |
|
632 } |
|
633 |
|
634 // ----------------------------------------------------------------------------- |
|
635 // CMccCodecInformation::GetRobustSorting |
|
636 // Default implementation |
|
637 // ----------------------------------------------------------------------------- |
|
638 // |
|
639 TBool CMccCodecInformation::GetRobustSorting( ) const |
|
640 { |
|
641 return EFalse; |
|
642 } |
|
643 |
|
644 // ----------------------------------------------------------------------------- |
|
645 // CMccCodecInformation::SetInterleaving |
|
646 // Default implementation |
|
647 // ----------------------------------------------------------------------------- |
|
648 // |
|
649 TInt CMccCodecInformation::SetInterleaving( const TInt /*aFrameBlockCount*/ ) |
|
650 { |
|
651 return KErrNotSupported; |
|
652 } |
|
653 |
|
654 // ----------------------------------------------------------------------------- |
|
655 // CMccCodecInformation:GetInterleaving |
|
656 // Default implementation |
|
657 // ----------------------------------------------------------------------------- |
|
658 // |
|
659 TInt CMccCodecInformation::GetInterleaving( ) const |
|
660 { |
|
661 return KErrNotSupported; |
|
662 } |
|
663 |
|
664 // ----------------------------------------------------------------------------- |
|
665 // CMccCodecInformation::SetChannels |
|
666 // Default implementation |
|
667 // ----------------------------------------------------------------------------- |
|
668 // |
|
669 TInt CMccCodecInformation::SetChannels( TInt /*aNumOfChannels*/ ) |
|
670 { |
|
671 return KErrNotSupported; |
|
672 }; |
|
673 |
|
674 // ----------------------------------------------------------------------------- |
|
675 // CMccCodecInformation:SetMaxRed |
|
676 // ----------------------------------------------------------------------------- |
|
677 // |
|
678 TInt CMccCodecInformation::SetMaxRed( TInt /*aMaxRed*/ ) |
|
679 { |
|
680 return KErrNotSupported; |
|
681 } |
|
682 |
|
683 // ----------------------------------------------------------------------------- |
|
684 // CMccCodecInformation:SetConfigKeyL |
|
685 // ----------------------------------------------------------------------------- |
|
686 // |
|
687 void CMccCodecInformation::SetConfigKeyL( const TDesC8& /*aConfigKey*/ ) |
|
688 { |
|
689 User::Leave( KErrNotSupported ); |
|
690 } |
|
691 |
|
692 // ----------------------------------------------------------------------------- |
|
693 // CMccCodecInformation:SetPreferredEncodingDecodingDevice |
|
694 // ----------------------------------------------------------------------------- |
|
695 // |
|
696 void CMccCodecInformation::SetPreferredEncodingDecodingDevice( |
|
697 TUid /*aEncodingDecodingDevice*/ ) |
|
698 { |
|
699 } |
|
700 |
|
701 // ----------------------------------------------------------------------------- |
|
702 // CMccCodecInformation:GetChannels |
|
703 // Return array of allowed modes |
|
704 // ----------------------------------------------------------------------------- |
|
705 // |
|
706 TInt CMccCodecInformation::GetChannels( TInt& /*aNumOfChannels*/ ) const |
|
707 { |
|
708 return KErrNotSupported; |
|
709 }; |
|
710 |
|
711 // ----------------------------------------------------------------------------- |
|
712 // CMccCodecInformation:SetComfortNoiseGeneration |
|
713 // Default implementation |
|
714 // ----------------------------------------------------------------------------- |
|
715 // |
|
716 TInt CMccCodecInformation::SetComfortNoiseGeneration( TUint8 /*aComfortNoisePT*/ ) |
|
717 { |
|
718 return KErrNotSupported; |
|
719 }; |
|
720 |
|
721 |
|
722 // ----------------------------------------------------------------------------- |
|
723 // CMccCodecInformation:ComfortNoiseGeneration |
|
724 // Default implementation |
|
725 // ----------------------------------------------------------------------------- |
|
726 // |
|
727 TUint8 CMccCodecInformation::ComfortNoiseGeneration() const |
|
728 { |
|
729 return iComfortNoiseGenerationPt; |
|
730 }; |
|
731 |
|
732 |
|
733 // ----------------------------------------------------------------------------- |
|
734 // CMccCodecInformation:MaxRed |
|
735 // ----------------------------------------------------------------------------- |
|
736 // |
|
737 TInt CMccCodecInformation::MaxRed() const |
|
738 { |
|
739 return iMaxRed; |
|
740 } |
|
741 |
|
742 // ----------------------------------------------------------------------------- |
|
743 // CMccCodecInformation:RedPayloadsL |
|
744 // ----------------------------------------------------------------------------- |
|
745 // |
|
746 void CMccCodecInformation::RedPayloadsL( RArray<TUint>& /*aRedPayloads*/ ) const |
|
747 { |
|
748 User::Leave( KErrNotSupported ); |
|
749 } |
|
750 |
|
751 // ----------------------------------------------------------------------------- |
|
752 // CMccCodecInformation::ConfigKeyL |
|
753 // ----------------------------------------------------------------------------- |
|
754 // |
|
755 HBufC8* CMccCodecInformation::ConfigKeyL() const |
|
756 { |
|
757 HBufC8* key = NULL; |
|
758 if ( iConfigKey ) |
|
759 { |
|
760 key = iConfigKey->AllocL(); |
|
761 } |
|
762 return key; |
|
763 } |
|
764 |
|
765 // ----------------------------------------------------------------------------- |
|
766 // CMccCodecInformation::PreferredEncodingDecodingDevice |
|
767 // ----------------------------------------------------------------------------- |
|
768 // |
|
769 TUid CMccCodecInformation::PreferredEncodingDecodingDevice() const |
|
770 { |
|
771 return iEncodingDecodingDevice; |
|
772 } |
|
773 |
|
774 // ----------------------------------------------------------------------------- |
|
775 // CMccCodecInformation:GetPriority |
|
776 // Default implementation |
|
777 // ----------------------------------------------------------------------------- |
|
778 // |
|
779 TInt CMccCodecInformation::Priority( ) const |
|
780 { |
|
781 return iPriority; |
|
782 } |
|
783 |
|
784 // ----------------------------------------------------------------------------- |
|
785 // CMccCodecInformation:SetPriority |
|
786 // Default implementation |
|
787 // ----------------------------------------------------------------------------- |
|
788 // |
|
789 void CMccCodecInformation::SetPriority( TInt aPriority ) |
|
790 { |
|
791 iPriority = aPriority; |
|
792 } |
|
793 |
|
794 // ----------------------------------------------------------------------------- |
|
795 // CMccCodecInformation:GetPriorityPreference |
|
796 // Default implementation |
|
797 // ----------------------------------------------------------------------------- |
|
798 // |
|
799 TInt CMccCodecInformation::PriorityPreference( ) const |
|
800 { |
|
801 return iPriorityPreference; |
|
802 } |
|
803 |
|
804 // ----------------------------------------------------------------------------- |
|
805 // CMccCodecInformation:SetPriorityPreference |
|
806 // Default implementation |
|
807 // ----------------------------------------------------------------------------- |
|
808 // |
|
809 void CMccCodecInformation::SetPriorityPreference(TInt aPreference ) |
|
810 { |
|
811 iPriorityPreference = aPreference; |
|
812 } |
|
813 |
|
814 // ----------------------------------------------------------------------------- |
|
815 // CMccCodecInformation:SetMaxBitrate |
|
816 // Default implementation |
|
817 // ----------------------------------------------------------------------------- |
|
818 // |
|
819 TInt CMccCodecInformation::SetMaxBitrate( TUint aMaxBitrate ) |
|
820 { |
|
821 iMaxBitrate = aMaxBitrate; |
|
822 return KErrNone; |
|
823 } |
|
824 |
|
825 // ----------------------------------------------------------------------------- |
|
826 // CMccCodecInformation:SetAverageBitrate |
|
827 // Default implementation |
|
828 // ----------------------------------------------------------------------------- |
|
829 // |
|
830 TInt CMccCodecInformation::SetAverageBitrate( TUint aAverageBitrate ) |
|
831 { |
|
832 iAverageBitrate = aAverageBitrate; |
|
833 return KErrNone; |
|
834 } |
|
835 |
|
836 // ----------------------------------------------------------------------------- |
|
837 // CMccCodecInformation:SetFramerate |
|
838 // Default implementation |
|
839 // ----------------------------------------------------------------------------- |
|
840 // |
|
841 TInt CMccCodecInformation::SetFramerate( TReal aFramerate ) |
|
842 { |
|
843 iFramerate = aFramerate; |
|
844 return KErrNone; |
|
845 } |
|
846 |
|
847 // ----------------------------------------------------------------------------- |
|
848 // CMccCodecInformation:SetFrameHeight |
|
849 // Default implementation |
|
850 // ----------------------------------------------------------------------------- |
|
851 // |
|
852 TInt CMccCodecInformation::SetFrameHeight( TUint aFrameHeight ) |
|
853 { |
|
854 iVideoHeight = aFrameHeight; |
|
855 return KErrNone; |
|
856 } |
|
857 |
|
858 // ----------------------------------------------------------------------------- |
|
859 // CMccCodecInformation:SetFrameWidth |
|
860 // Default implementation |
|
861 // ----------------------------------------------------------------------------- |
|
862 // |
|
863 TInt CMccCodecInformation::SetFrameWidth( TUint aFrameWidth ) |
|
864 { |
|
865 iVideoWidth = aFrameWidth; |
|
866 return KErrNone; |
|
867 } |
|
868 |
|
869 // ----------------------------------------------------------------------------- |
|
870 // CMccCodecInformation:MaxBitrate |
|
871 // Default implementation |
|
872 // ----------------------------------------------------------------------------- |
|
873 // |
|
874 TUint CMccCodecInformation::MaxBitrate() const |
|
875 { |
|
876 return iMaxBitrate; |
|
877 } |
|
878 |
|
879 // ----------------------------------------------------------------------------- |
|
880 // CMccCodecInformation:AverageBitrate |
|
881 // Default implementation |
|
882 // ----------------------------------------------------------------------------- |
|
883 // |
|
884 TUint CMccCodecInformation::AverageBitrate() const |
|
885 { |
|
886 return iAverageBitrate; |
|
887 } |
|
888 |
|
889 // ----------------------------------------------------------------------------- |
|
890 // CMccCodecInformation:Framerate |
|
891 // Default implementation |
|
892 // ----------------------------------------------------------------------------- |
|
893 // |
|
894 TReal CMccCodecInformation::Framerate() const |
|
895 { |
|
896 return iFramerate; |
|
897 } |
|
898 |
|
899 // ----------------------------------------------------------------------------- |
|
900 // CMccCodecInformation:FrameHeight |
|
901 // Default implementation |
|
902 // ----------------------------------------------------------------------------- |
|
903 // |
|
904 TUint CMccCodecInformation::FrameHeight() const |
|
905 { |
|
906 return iVideoHeight; |
|
907 } |
|
908 |
|
909 // ----------------------------------------------------------------------------- |
|
910 // CMccCodecInformation:FrameWidth |
|
911 // Default implementation |
|
912 // ----------------------------------------------------------------------------- |
|
913 // |
|
914 TUint CMccCodecInformation::FrameWidth() const |
|
915 { |
|
916 return iVideoWidth; |
|
917 } |
|
918 |
|
919 // ----------------------------------------------------------------------------- |
|
920 // CMccCodecInformation:SetKeepAliveTimer |
|
921 // Default implementation |
|
922 // ----------------------------------------------------------------------------- |
|
923 // |
|
924 TInt CMccCodecInformation::SetKeepAliveTimer( TUint8 aTimerValue ) |
|
925 { |
|
926 iKeepAliveTimer = aTimerValue; |
|
927 return KErrNone; |
|
928 } |
|
929 |
|
930 // ----------------------------------------------------------------------------- |
|
931 // CMccCodecInformation:SetKeepAlivePT |
|
932 // Default implementation |
|
933 // ----------------------------------------------------------------------------- |
|
934 // |
|
935 TInt CMccCodecInformation::SetKeepAlivePT( TUint8 aKeepAlivePT ) |
|
936 { |
|
937 iKeepAlivePT = aKeepAlivePT; |
|
938 return KErrNone; |
|
939 } |
|
940 |
|
941 // ----------------------------------------------------------------------------- |
|
942 // CMccCodecInformation:SetKeepAliveData |
|
943 // Default implementation |
|
944 // ----------------------------------------------------------------------------- |
|
945 // |
|
946 TInt CMccCodecInformation::SetKeepAliveData( const TDesC8& aData ) |
|
947 { |
|
948 if ( aData.Length() > KMaxKeepAliveDataLen ) |
|
949 { |
|
950 return KErrArgument; |
|
951 } |
|
952 |
|
953 iKeepAliveData = aData; |
|
954 return KErrNone; |
|
955 } |
|
956 |
|
957 // ----------------------------------------------------------------------------- |
|
958 // CMccCodecInformation:KeepAliveTimer |
|
959 // Default implementation |
|
960 // ----------------------------------------------------------------------------- |
|
961 // |
|
962 TUint8 CMccCodecInformation::KeepAliveTimer() const |
|
963 { |
|
964 return iKeepAliveTimer; |
|
965 } |
|
966 |
|
967 // ----------------------------------------------------------------------------- |
|
968 // CMccCodecInformation:KeepAlivePT |
|
969 // Default implementation |
|
970 // ----------------------------------------------------------------------------- |
|
971 // |
|
972 TUint8 CMccCodecInformation::KeepAlivePT() const |
|
973 { |
|
974 return iKeepAlivePT; |
|
975 } |
|
976 |
|
977 // ----------------------------------------------------------------------------- |
|
978 // CMccCodecInformation:KeepAliveData |
|
979 // Default implementation |
|
980 // ----------------------------------------------------------------------------- |
|
981 // |
|
982 const TDesC8& CMccCodecInformation::KeepAliveData() const |
|
983 { |
|
984 return iKeepAliveData; |
|
985 } |