multimediacommsengine/tsrc/mccstub/inc/Mccinternalcodecs.h
changeset 0 1bce908db942
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:    Definitions for Mcc internal codec information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MCCINTERNALCODECS_H
       
    23 #define MCCINTERNALCODECS_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <mmf/common/mmfutilities.h>
       
    27 #include <mmf/common/mmffourcc.h>
       
    28 #include <mmf/common/mmfbase.h>
       
    29 #include <in_sock.h>
       
    30 #include "mmcccodecinformation.h"
       
    31 #include "mmccnetworksettings.h"
       
    32 
       
    33 // CONSTANTS
       
    34 
       
    35 // Internal value for Mcc codec information in order to catch undefined values
       
    36 const TUint KMccCodecParamUndefined = 0;
       
    37 // Internal value for undefined payload type as max payload type is 127 (7-bit value)
       
    38 // and values 0-127 are used for different payload types. Naturally then value 128 is
       
    39 // then a good value for payload type.
       
    40 const TUint8 KMccPayloadTypeMax = 128;
       
    41 
       
    42 // Default ports for RTP & RTCP
       
    43 //const TUint KMDefaultRtpPort = 5000;
       
    44 //const TUint KDefaultRtcpPort = 5001;
       
    45 
       
    46 // Default jitter buffer size in milliseconds
       
    47 const TUint KDefautJitterBufferSize = 200;
       
    48 
       
    49 // Number of AMR bitrates supported
       
    50 const TUint KAmrBitratesSupported = 8;
       
    51 
       
    52 // Number of G.711 bitrates supported
       
    53 const TUint KG711BitratesSupported = 1;
       
    54 
       
    55 // Number of iLBC bitrates supported
       
    56 const TUint KIlbcBitratesSupported = 2;
       
    57 
       
    58 // Number of G.729 bitrates supported
       
    59 const TUint KG729BitratesSupported = 1;
       
    60 
       
    61 // AMR BITRATES
       
    62 const TUint KAmrBitrates[KAmrBitratesSupported] = 
       
    63     { 
       
    64     4750, 5150, 5900, 6700, 7400, 7950, 10200, 12200  
       
    65     };
       
    66 
       
    67 // G.711 BITRATES
       
    68 const TUint KG711Bitrates[KG711BitratesSupported] = 
       
    69     { 
       
    70     64000 
       
    71     };
       
    72 
       
    73 // iLBC BITRATES (Can also tell the codec mode for iLBC (20ms, 30ms)
       
    74 const TUint KIlbcBitrates[KIlbcBitratesSupported] = 
       
    75     { 
       
    76     13330, 15200 
       
    77     };
       
    78     
       
    79 // G.729 BITRATES
       
    80 const TUint KG729Bitrates[KG729BitratesSupported] = 
       
    81     {
       
    82     8000
       
    83     };
       
    84 
       
    85 // Generic nothing mode
       
    86 const TUint KMccCodecModeNone = 1;
       
    87 
       
    88 // G.711 Codec modes as it uses one FourCC
       
    89 const TUint KG711ModeaLawEnc = 2;
       
    90 const TUint KG711ModeuLawEnc = 3;
       
    91 
       
    92 // AMR Codec modes
       
    93 const TUint KAmrCodecModeBandwidthEfficient = 4;
       
    94 const TUint KAmrCodecModeOctetAlign = 5;
       
    95 
       
    96 // DTMF Modes
       
    97 const TUint KDtmfModeEvent = 6;
       
    98 const TUint KDtmfModeTone = 7;
       
    99 const TUint KDtmfModeRedEvents = 8;
       
   100 
       
   101 // iLBC codec modes
       
   102 const TUint KIlbcMode20msFrame = 9;
       
   103 const TUint KIlbcMode30msFrame = 10;
       
   104 
       
   105 // NALU constants
       
   106 const TInt KMccNaluStartCodeLen = 3;
       
   107 const TInt KMccNaluEndCodeLen = 2;
       
   108 // MACROS
       
   109 
       
   110 // DATA TYPES
       
   111 
       
   112 // FUNCTION PROTOTYPES
       
   113 
       
   114 // FORWARD DECLARATIONS
       
   115 
       
   116 // CLASS DECLARATION
       
   117 
       
   118 /**
       
   119 *  Mcc Codec information for Mcc internal use
       
   120 *
       
   121 *  @lib N/A
       
   122 *  @since Series 60 3.0
       
   123 */
       
   124 
       
   125 class TMccCodecInfo
       
   126     {
       
   127     public: // Constructors
       
   128         
       
   129         /**
       
   130         * Default constructor
       
   131         */
       
   132         inline TMccCodecInfo() : 
       
   133         				iType(TUid()),
       
   134                         iFourCC( TFourCC() ),
       
   135                         iPayloadFormatEncoder( 0 ),
       
   136                         iPayloadFormatDecoder( 0 ),                         
       
   137                         iBitrate( KMccCodecParamUndefined ),
       
   138                         iSamplingFreq( 0 ), 
       
   139                         iEnableDTX( EFalse ),
       
   140                         iCodecMode( KMccCodecParamUndefined ), 
       
   141                         iAlgoUsed( ENoAlgoUsed ),
       
   142                         iPtime( KMccCodecParamUndefined ), 
       
   143                         iMaxPtime( KMccCodecParamUndefined ),
       
   144                         iPayloadType( KMccPayloadTypeMax ), 
       
   145                         iRedundantPayload( KMccPayloadTypeMax ),
       
   146                         iRedundancyCount( static_cast<TUint8>( KMccCodecParamUndefined ) ),
       
   147                         iHwFrameTime( 0 ), 
       
   148                         iFrameSize( 0 ), 
       
   149                         iCNFrameSize( 0 ),
       
   150                         iFmtpLength( 0 ),
       
   151                         iJitterSize( 0 ),
       
   152                         iNeighbor( EFalse ),
       
   153                         iModeChangePeriod( 1 ),
       
   154                         iJitterBufInactivityTimeOut( 0 ),
       
   155                         iJitterBufPlayToneTimeout( 0 ),
       
   156                         iJitterBufPlayToneFrequency( 0 ),
       
   157                         iJitterBufPlayToneDuration( 0 ),
       
   158                         iJitterBufThreshold( 0 ),
       
   159                         iJitterBufBufferLength( 0 ),
       
   160                         iComfortNoiseGenerationPt( KPayloadTypeUndefined ),
       
   161                         iBitrateMask( 0 ),
       
   162 						iAverageBitrate( 0 ),
       
   163 						iMaxBitrate( 0 ),
       
   164 						iFramerate( 0 ),
       
   165 					    iVideoWidth( 0 ),
       
   166 					    iVideoHeight( 0 ),
       
   167 					    iMTUSize( 1400 ),
       
   168                         iSessionID( 0 ),
       
   169                         iLinkID( 0 ),
       
   170                         iStreamID( 0 ),
       
   171                         iKeepaliveInterval( 0 ),
       
   172                         iKeepalivePT( 0 ),
       
   173                         iKeepaliveData( KNullDesC8 ),
       
   174                         iIsUpdate(0),
       
   175                         iMaxRed( -1 ),
       
   176                         iSourceDefinedTimeStamps( EFalse ),
       
   177                         iConfigKey( KNullDesC8 ),
       
   178                         iEncodingDecodingDevice( KNullUid )
       
   179             {   };
       
   180 
       
   181         /**
       
   182         * Copy constructor
       
   183         */
       
   184         inline TMccCodecInfo( const TMccCodecInfo& aCodec ) : 
       
   185                     iType( aCodec.iType ),         
       
   186                     iSdpName( aCodec.iSdpName ),         
       
   187                     iFourCC( aCodec.iFourCC ), 
       
   188                     iPayloadFormatEncoder( aCodec.iPayloadFormatEncoder ),
       
   189                     iPayloadFormatDecoder( aCodec.iPayloadFormatDecoder ),                         
       
   190                     iBitrate( aCodec.iBitrate ),
       
   191                     iSamplingFreq( aCodec.iSamplingFreq ), 
       
   192                     iEnableDTX( aCodec.iEnableDTX ), 
       
   193                     iCodecMode( aCodec.iCodecMode ),
       
   194                     iAlgoUsed( aCodec.iAlgoUsed ), 
       
   195                     iPtime( aCodec.iPtime ),
       
   196                     iMaxPtime( aCodec.iMaxPtime ), 
       
   197                     iPayloadType( aCodec.iPayloadType ),
       
   198                     iRedundantPayload( aCodec.iRedundantPayload ), 
       
   199                     iRedundancyCount( aCodec.iRedundancyCount ),
       
   200                     iHwFrameTime( aCodec.iHwFrameTime ),
       
   201                     iFrameSize( aCodec.iFrameSize ), 
       
   202                     iCNFrameSize( aCodec.iCNFrameSize ),
       
   203                     iFmtpLength( aCodec.iFmtpLength ),
       
   204                     iJitterSize( aCodec.iJitterSize ),
       
   205                     iNeighbor( aCodec.iNeighbor ),
       
   206                     iModeChangePeriod( aCodec.iModeChangePeriod ),
       
   207                     iJitterBufInactivityTimeOut( aCodec.iJitterBufInactivityTimeOut ),
       
   208                     iJitterBufPlayToneTimeout( aCodec.iJitterBufPlayToneTimeout ),
       
   209                     iJitterBufPlayToneFrequency( aCodec.iJitterBufPlayToneFrequency ),
       
   210                     iJitterBufPlayToneDuration( aCodec.iJitterBufPlayToneDuration ),
       
   211                     iJitterBufThreshold( aCodec.iJitterBufThreshold ),
       
   212                     iJitterBufBufferLength( aCodec.iJitterBufBufferLength ),
       
   213                     iComfortNoiseGenerationPt( aCodec.iComfortNoiseGenerationPt ),
       
   214                     iBitrateMask( aCodec.iBitrateMask ),
       
   215 					iAverageBitrate( aCodec.iAverageBitrate ),
       
   216 					iMaxBitrate( aCodec.iMaxBitrate ),
       
   217 					iFramerate( aCodec.iFramerate ),
       
   218 					iVideoWidth( aCodec.iVideoWidth ),
       
   219 					iVideoHeight( aCodec.iVideoHeight ),
       
   220 					iMTUSize( aCodec.iMTUSize ),
       
   221                     iSessionID( aCodec.iSessionID ),
       
   222                     iLinkID( aCodec.iLinkID ),
       
   223                     iStreamID( aCodec.iStreamID ),
       
   224                     iPriority( aCodec.iPriority ),
       
   225                     iKeepaliveInterval( aCodec.iKeepaliveInterval ),
       
   226                     iKeepalivePT( aCodec.iKeepalivePT ),
       
   227                     iKeepaliveData( aCodec.iKeepaliveData ),
       
   228                     iIsUpdate( aCodec.iIsUpdate ),
       
   229                     iMaxRed( aCodec.iMaxRed ),
       
   230                     iSourceDefinedTimeStamps( aCodec.iSourceDefinedTimeStamps ),
       
   231                     iConfigKey( aCodec.iConfigKey ),
       
   232                     iEncodingDecodingDevice( aCodec.iEncodingDecodingDevice )
       
   233                     
       
   234             {   };
       
   235 
       
   236     public: // Functions
       
   237     
       
   238         /**
       
   239         * Helper method for checking the codecinfo parameters
       
   240         * @since Series 60 3.0
       
   241         * @param aCodec Codec which to check
       
   242         * @return KErrNotReady or KErrNone
       
   243         */
       
   244         static inline TInt CheckCodecInfo( const TMccCodecInfo& /*aCodec*/ )
       
   245             {
       
   246             // And different codec bitrate/mode combinations should be checked also
       
   247             /*
       
   248             if(  aCodec.iFourCC == KMMFFourCCCodeNULL)
       
   249                 {
       
   250                 return KErrNotReady;
       
   251                 }
       
   252             else if( KMccCodecParamUndefined == aCodec.iBitrate )
       
   253                 {
       
   254                 return KErrNotReady-1;
       
   255                 }
       
   256             else if( KMccCodecParamUndefined == aCodec.iPtime )
       
   257                 {
       
   258                 return KErrNotReady-2;
       
   259                 }
       
   260             else if( KMccCodecParamUndefined == aCodec.iMaxPtime )
       
   261                 {
       
   262                 return KErrNotReady-3;
       
   263                 }
       
   264             else if( KMccPayloadTypeMax <= aCodec.iPayloadType )
       
   265                 {
       
   266                 return KErrNotReady-4;
       
   267                 }
       
   268             else
       
   269                 {
       
   270                 return KErrNone;
       
   271                 }
       
   272             */
       
   273             // Need to reimplement this as this is not a good function
       
   274             return KErrNone;
       
   275             };
       
   276             
       
   277         /**
       
   278         * Function for comparing two codec info objects
       
   279         * @since Series 60 3.0
       
   280         * @param aCodec1 Codecinfo 1 to compare
       
   281         * @param aCodec2 Codecinfo 2 to compare
       
   282         * @return TBool ETrue if aCodec1 and aCodec2 match
       
   283         */
       
   284         static inline TBool Compare( const TMccCodecInfo& aCodec1, 
       
   285                 const TMccCodecInfo& aCodec2 )
       
   286             {
       
   287             if( aCodec1.iFourCC == aCodec2.iFourCC &&
       
   288                 aCodec1.iBitrate == aCodec2.iBitrate && 
       
   289                 aCodec1.iSamplingFreq == aCodec2.iSamplingFreq &&
       
   290                 aCodec1.iVideoHeight == aCodec2.iVideoHeight &&
       
   291                 aCodec1.iVideoWidth == aCodec2.iVideoWidth &&
       
   292                 aCodec1.iFramerate == aCodec2.iFramerate &&
       
   293                 aCodec1.iEnableDTX == aCodec2.iEnableDTX && 
       
   294                 aCodec1.iCodecMode == aCodec2.iCodecMode && 
       
   295                 aCodec1.iAlgoUsed == aCodec2.iAlgoUsed && 
       
   296                 aCodec1.iPtime == aCodec2.iPtime && 
       
   297                 aCodec1.iMaxPtime == aCodec2.iMaxPtime && 
       
   298                 aCodec1.iPayloadType == aCodec2.iPayloadType && 
       
   299                 aCodec1.iRedundantPayload == aCodec2.iRedundantPayload && 
       
   300                 aCodec1.iRedundancyCount == aCodec2.iRedundancyCount && 
       
   301                 aCodec1.iHwFrameTime == aCodec2.iHwFrameTime && 
       
   302                 aCodec1.iFrameSize == aCodec2.iFrameSize && 
       
   303                 aCodec1.iCNFrameSize == aCodec2.iCNFrameSize && 
       
   304                 aCodec1.iJitterSize == aCodec2.iJitterSize &&
       
   305                 aCodec1.iPriority.iPriority == aCodec2.iPriority.iPriority &&
       
   306                 aCodec1.iPriority.iPref == aCodec2.iPriority.iPref &&
       
   307                 aCodec1.iKeepaliveInterval == aCodec2.iKeepaliveInterval &&
       
   308                 aCodec1.iKeepalivePT == aCodec2.iKeepalivePT &&
       
   309                 aCodec1.iKeepaliveData == aCodec2.iKeepaliveData &&
       
   310                 aCodec1.iSourceDefinedTimeStamps == aCodec2.iSourceDefinedTimeStamps &&
       
   311                 aCodec1.iConfigKey == aCodec2.iConfigKey &&
       
   312                 aCodec1.iEncodingDecodingDevice == aCodec2.iEncodingDecodingDevice )
       
   313                 {
       
   314                 return ETrue;
       
   315                 }
       
   316             else
       
   317                 {
       
   318                 return EFalse;
       
   319                 }
       
   320             };
       
   321             
       
   322         static TBool IsAvcPpsOrSpsData( const TDesC8& aBuffer, TBool aIgnoreStartCode = EFalse )
       
   323             {
       
   324             TBool isPpsOrSps( EFalse );
       
   325             const TUint8 KMccAvcTypeMask = 0x1F;
       
   326             const TUint8 KMccAvcTypePps = 0x7;
       
   327             const TUint8 KMccAvcTypeSps = 0x8;
       
   328             
       
   329             TInt bufferIndex( 0 );
       
   330             TInt index( KErrNotFound );
       
   331             if ( aIgnoreStartCode )
       
   332                 {
       
   333                 index = aBuffer.Length() > 0 ? 0 : KErrNotFound;
       
   334                 }
       
   335             else
       
   336                 {
       
   337                 index = FindAvcNaluStart( bufferIndex, aBuffer );
       
   338                 }
       
   339             
       
   340             if ( index != KErrNotFound )
       
   341                 {
       
   342                 TUint8 typeInfo = aBuffer[ index ];
       
   343                 isPpsOrSps = ( ( typeInfo & KMccAvcTypeMask ) == KMccAvcTypePps ||
       
   344                                ( typeInfo & KMccAvcTypeMask ) == KMccAvcTypeSps );
       
   345                 }
       
   346             return isPpsOrSps;
       
   347             };
       
   348         
       
   349         /**
       
   350         * This function finds a NALU's starting byte by detecting unique start code
       
   351         * occurring in the buffer, as specified in sec B.2 of H264 specs.
       
   352         * NOTE: 4-byte start code 0x00000001 is a special case of 3-byte code, 
       
   353         * automatically catered in the logic
       
   354         *
       
   355         * @param aBufferIndex, search start index, on return contains information
       
   356         * of how for buffer was searched
       
   357         * @param aBuffer
       
   358         * @return KErrNotFound if nalu start code is not found, otherwise index
       
   359         *         to beginning of end code.
       
   360         */     
       
   361         static TInt FindAvcNaluStart( TInt& aBufferIndex, const TDesC8& aBuffer )
       
   362             {
       
   363         	TUint8 a1, a2, a3;
       
   364 	
       
   365         	if ( aBufferIndex < 0 )
       
   366         	    {
       
   367         		return KErrNotFound;
       
   368         	    }
       
   369         	
       
   370         	const TUint8 *origDataPtr = aBuffer.Ptr();
       
   371         	const TUint8 *dataPtr = origDataPtr;
       
   372         	TInt size( aBuffer.Size() );
       
   373         	while ( aBufferIndex+KMccNaluStartCodeLen < size )	// at least one byte after start code
       
   374         	    {
       
   375         	    dataPtr = ( origDataPtr + aBufferIndex );
       
   376         		a1 = *dataPtr;
       
   377         		dataPtr++;
       
   378         		a2 = *dataPtr;
       
   379         		dataPtr++;
       
   380         		a3 = *dataPtr;
       
   381         		
       
   382         		if ( a1 == 0x00 && a2 == 0x00 && a3 == 0x01 )
       
   383         		    {
       
   384         			aBufferIndex += KMccNaluStartCodeLen;
       
   385         			return aBufferIndex;
       
   386         		    }
       
   387         		
       
   388         		aBufferIndex++;
       
   389         	    }
       
   390         	
       
   391         	return KErrNotFound;
       
   392             };
       
   393         
       
   394         /**
       
   395         * This function returns location of first byte at the end of  NALU
       
   396         * by detecting unique end pattern, as specified in sec B.2 of H264 specs.
       
   397         *
       
   398         * @param aBufferIndex, search start index, on return contains information
       
   399         * of how for buffer was searched
       
   400         * @param aBuffer
       
   401         * @return index to end beginning of end code or last index of aBuffer if
       
   402         *         end code is not found
       
   403         */    
       
   404         static TInt FindAvcNaluEnd( TInt& aBufferIndex, const TDesC8& aBuffer )
       
   405             {
       
   406         	TUint8 a1, a2, a3;
       
   407         	
       
   408         	if ( ( aBufferIndex < 0 ) || ( aBufferIndex >= aBuffer.Size() ) )
       
   409         	    {
       
   410         		return KErrNotFound;
       
   411         	    }
       
   412         	
       
   413         	const TUint8 *origDataPtr = aBuffer.Ptr();
       
   414         	const TUint8 *dataPtr = origDataPtr;
       
   415         	TInt size( aBuffer.Size() );	
       
   416         	while ( aBufferIndex < size )
       
   417             	{
       
   418         		if ( aBufferIndex+KMccNaluEndCodeLen < size )
       
   419         		    {
       
   420         		    dataPtr = ( origDataPtr + aBufferIndex );
       
   421         			a1 = *dataPtr;
       
   422         			dataPtr++;
       
   423             		a2 = *dataPtr;
       
   424             		dataPtr++;
       
   425             		a3 = *dataPtr;
       
   426         			
       
   427         			if( ( a1 == 0x00 && a2 == 0x00 && a3 == 0x01 ) ||
       
   428         				( a1 == 0x00 && a2 == 0x00 && a3 == 0x00 ) )
       
   429         			    {
       
   430         				return aBufferIndex;
       
   431         		    	}
       
   432         	    	}
       
   433         		aBufferIndex++;
       
   434         	    }
       
   435         	
       
   436         	return aBufferIndex;
       
   437             };
       
   438         
       
   439     public: // Data
       
   440     
       
   441     	TUid iType;
       
   442     	
       
   443         /**
       
   444         * Sdp name used in SDP messages
       
   445         */
       
   446         TBuf8<KMaxSdpNameLength> iSdpName;        
       
   447     	
       
   448         // MMF FourCC code of the codec
       
   449         TFourCC iFourCC;
       
   450 
       
   451         // MMF format encoder for the codec
       
   452         TUint32 iPayloadFormatEncoder;
       
   453 
       
   454         // MMF format decoder for the codec
       
   455         TUint32 iPayloadFormatDecoder;
       
   456         
       
   457         // Codec bitrate
       
   458         TUint iBitrate;
       
   459         
       
   460         // sampling rate
       
   461         TUint32 iSamplingFreq;
       
   462         
       
   463         // Should DTX/VAD/CNG be enabled
       
   464         TBool iEnableDTX;
       
   465         
       
   466         // Codec mode
       
   467         TUint iCodecMode;
       
   468         
       
   469         // Algorithm used
       
   470         TUint iAlgoUsed;
       
   471         
       
   472         // Minimum packet time for codec
       
   473         TUint iPtime;
       
   474         
       
   475         // Maximum packet time for codec
       
   476         TUint iMaxPtime;
       
   477         
       
   478         // RTP Payload type for the codec
       
   479         TUint8 iPayloadType;
       
   480         
       
   481         // RTP payload type for redundant audio
       
   482         TUint8 iRedundantPayload;
       
   483         
       
   484         // Number of redundant frames if enabled
       
   485         TUint8 iRedundancyCount;
       
   486         
       
   487         // Frametime
       
   488         TUint8 iHwFrameTime;
       
   489         
       
   490         // Frame size
       
   491         TUint iFrameSize;
       
   492         
       
   493         // CN Frame size
       
   494         TUint8 iCNFrameSize;
       
   495         
       
   496         //Fmtp size
       
   497         TInt iFmtpLength;
       
   498         
       
   499         // Jitter buffer size
       
   500         TUint iJitterSize;
       
   501 
       
   502         // Mode change neighbor
       
   503         TBool iNeighbor;
       
   504         
       
   505         // Mode change period
       
   506         TUint iModeChangePeriod;
       
   507         
       
   508         //JitterBuffer InactivityTimeOut
       
   509         TUint iJitterBufInactivityTimeOut;
       
   510 
       
   511         //JitterBuffer tone TimeOut
       
   512         TUint iJitterBufPlayToneTimeout; 
       
   513         
       
   514         //JitterBuffer tone frequecy
       
   515         TUint iJitterBufPlayToneFrequency; 
       
   516         
       
   517         //JitterBuffer tone duration
       
   518         TUint iJitterBufPlayToneDuration;
       
   519         
       
   520         //JitterBuffer threshold
       
   521         TUint iJitterBufThreshold;
       
   522         
       
   523         //JitterBuffer buffer length
       
   524         TUint iJitterBufBufferLength;
       
   525         
       
   526         /**
       
   527          * Comfort noise generation payload type .
       
   528          * Disabled if KPayloadTypeUndefined.
       
   529          */
       
   530         TUint8 iComfortNoiseGenerationPt;
       
   531     
       
   532         //Bitrates used in codec
       
   533         TUint iBitrateMask;
       
   534     
       
   535         //Average bitrate used in codec
       
   536 		TUint iAverageBitrate;
       
   537 				
       
   538         //Max bitrate used in codec
       
   539 		TUint iMaxBitrate;
       
   540 		
       
   541         //Frame rate for video
       
   542 		TReal iFramerate;
       
   543 
       
   544 	    // Horizontal resolution of video
       
   545 	    TUint iVideoWidth;
       
   546 
       
   547 	    // Vertical resolution of video
       
   548 	    TUint iVideoHeight;
       
   549 	    
       
   550 	    // Network MTU size (in order to determine outgoing packet's maximum size, if needed) default: 1400
       
   551 	    TUint iMTUSize;
       
   552     
       
   553         // Session ID
       
   554         TUint32 iSessionID;
       
   555         
       
   556         // Link ID
       
   557         TUint32 iLinkID;
       
   558 
       
   559         // Stream ID
       
   560         TUint32 iStreamID;
       
   561         
       
   562         // MMF Priority settings
       
   563         TMMFPrioritySettings iPriority;       
       
   564         
       
   565         // Rtp keepalive interval (secs)
       
   566         TUint8 iKeepaliveInterval;
       
   567     
       
   568         // Rtp keepalive payload type
       
   569         TUint8 iKeepalivePT;
       
   570     
       
   571         // Rtp keepalive data
       
   572         TBuf8<KMaxKeepAliveDataLen> iKeepaliveData;
       
   573         
       
   574         // Indicates if update param set
       
   575         TBool iIsUpdate;
       
   576         
       
   577         /**
       
   578          * Maximum redundancy in milliseconds
       
   579          */ 
       
   580         TInt iMaxRed;
       
   581 
       
   582         // Trust timestamps provided by datasource
       
   583         TBool iSourceDefinedTimeStamps;
       
   584         
       
   585         // Rtp keepalive data
       
   586         TBuf8<KMaxConfigKeyLen> iConfigKey;
       
   587         
       
   588         TUid iEncodingDecodingDevice;
       
   589     };
       
   590 
       
   591 typedef TPckgBuf<TMccCodecInfo> TMccCodecInfoBuffer;
       
   592 
       
   593 /**
       
   594 * Mcc Stream settings for Mcc internal use
       
   595 * 
       
   596 * @lib N/A
       
   597 * @since Series 60 3.0
       
   598 */
       
   599 class TMccStreamSettings
       
   600     {
       
   601     public: // Constructors
       
   602         
       
   603         /**
       
   604         * Default constructor
       
   605         */
       
   606         inline TMccStreamSettings() : iRemoteAddress( KInetAddrAny ), 
       
   607             iLocalRtpPort( KDefaultRtpPort ), iLocalRtcpPort( KDefaultRtcpPort ),
       
   608             iPriority( TMMFPrioritySettings() ), iIapId( 0 ), iRtcpEnabled( EFalse ),
       
   609             iIpTos( 0 )
       
   610             {   };
       
   611             
       
   612     public: // Data
       
   613         
       
   614         // Remote address
       
   615         TInetAddr iRemoteAddress;
       
   616         
       
   617         // Local RTP port
       
   618         TUint iLocalRtpPort;
       
   619         
       
   620         // Local RTCP port
       
   621         TUint iLocalRtcpPort;
       
   622         
       
   623         // MMF Priority settings
       
   624         TMMFPrioritySettings iPriority;
       
   625         
       
   626         // IAP ID
       
   627         TInt iIapId;
       
   628         
       
   629         // RTCP enabled
       
   630         TBool iRtcpEnabled;
       
   631         
       
   632         // TOS setting
       
   633         TInt iIpTos;
       
   634     };
       
   635     
       
   636 #endif      // MCCINTERNALCODECS_H  
       
   637             
       
   638 // End of File