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