diff -r a297cbce4e85 -r 5be06b45e413 multimediacommscontroller/mmccshared/inc/mccinternaldef.h --- a/multimediacommscontroller/mmccshared/inc/mccinternaldef.h Fri May 28 16:08:43 2010 +0300 +++ b/multimediacommscontroller/mmccshared/inc/mccinternaldef.h Fri Jun 11 11:20:25 2010 +0300 @@ -25,6 +25,8 @@ #include #include #include +#include +#include <3gplibrary/mp4lib.h> #include "rtpdef.h" @@ -68,6 +70,10 @@ // Increased RTP socket size in bytes, default socket size is around 4KB const TInt KMccIncreasedRtpSocketSize = 10000; +// Values used to force better interoperability against some vendors +const TReal KMccH263ProfileZeroMaxFramerateIOP = 15; +const TUint32 KMccH263ProfileZeroMinBitRateIOP = 64001; + // MACROS #ifdef _DEBUG @@ -782,6 +788,35 @@ User::LeaveIfError( encoder.Encode( aInput, ptrOutput ) ); return output; } + + static void FrameRateSanitize( + TReal& aSanitizedFrameRate, TReal aOrigFrameRate, TUint32 aVideoType ) + { + // Round to have zero decimals for clearness sake + User::LeaveIfError( Math::Round( aSanitizedFrameRate, aOrigFrameRate, 0 ) ); + + if ( aVideoType == MP4_TYPE_H263_PROFILE_0 && + aSanitizedFrameRate > KMccH263ProfileZeroMaxFramerateIOP ) + { + aSanitizedFrameRate = KMccH263ProfileZeroMaxFramerateIOP; + } + } + + static void BitRateSanitize( + TUint32& aSanitizedBitRate, TUint32 aOrigBitRate, TUint32 aVideoType ) + { + if ( aVideoType == MP4_TYPE_H263_PROFILE_0 && + aOrigBitRate > 0 && + aOrigBitRate < KMccH263ProfileZeroMinBitRateIOP ) + { + aSanitizedBitRate = KMccH263ProfileZeroMinBitRateIOP; + } + else + { + aSanitizedBitRate = aOrigBitRate; + } + } + }; #endif