multimediacommscontroller/mmccshared/inc/mccinternaldef.h
branchRCL_3
changeset 33 f40c1a748eb9
parent 0 1bce908db942
equal deleted inserted replaced
25:fb1bbf85a302 33:f40c1a748eb9
    23 
    23 
    24 // INCLUDES
    24 // INCLUDES
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <mmf/common/mmfcontroller.h>
    26 #include <mmf/common/mmfcontroller.h>
    27 #include <tconvbase64.h>  
    27 #include <tconvbase64.h>  
       
    28 #include <e32math.h>
       
    29 #include <3gplibrary/mp4lib.h>
    28 
    30 
    29 
    31 
    30 #include "rtpdef.h"
    32 #include "rtpdef.h"
    31 #include "mmccinterfacedef.h"
    33 #include "mmccinterfacedef.h"
    32 #include "mccinternalcodecs.h"
    34 #include "mccinternalcodecs.h"
    65 // Use TPckgBuf<TInt> as a parameter value. Should not overlap with values from API.
    67 // Use TPckgBuf<TInt> as a parameter value. Should not overlap with values from API.
    66 const TUint32 KMccPrerollTime = 60;
    68 const TUint32 KMccPrerollTime = 60;
    67 
    69 
    68 // Increased RTP socket size in bytes, default socket size is around 4KB
    70 // Increased RTP socket size in bytes, default socket size is around 4KB
    69 const TInt KMccIncreasedRtpSocketSize = 10000;
    71 const TInt KMccIncreasedRtpSocketSize = 10000;
       
    72 
       
    73 // Values used to force better interoperability against some vendors
       
    74 const TReal KMccH263ProfileZeroMaxFramerateIOP = 15;
       
    75 const TUint32 KMccH263ProfileZeroMinBitRateIOP = 64001;
    70 
    76 
    71 // MACROS
    77 // MACROS
    72 
    78 
    73 #ifdef _DEBUG
    79 #ifdef _DEBUG
    74     #define TRACE_MCC_CONTROLLER
    80     #define TRACE_MCC_CONTROLLER
   780         TPtr8 ptrOutput( output->Des() );
   786         TPtr8 ptrOutput( output->Des() );
   781         TBase64 encoder;
   787         TBase64 encoder;
   782     	User::LeaveIfError( encoder.Encode( aInput, ptrOutput ) );
   788     	User::LeaveIfError( encoder.Encode( aInput, ptrOutput ) );
   783     	return output;
   789     	return output;
   784         }
   790         }
       
   791     
       
   792     static void FrameRateSanitizeL( 
       
   793         TReal& aSanitizedFrameRate, TReal aOrigFrameRate, TUint32 aVideoType )
       
   794         {
       
   795         // Round to have zero decimals for clearness sake
       
   796         User::LeaveIfError( Math::Round( aSanitizedFrameRate, aOrigFrameRate, 0 ) );
       
   797         
       
   798         if ( aVideoType == MP4_TYPE_H263_PROFILE_0 && 
       
   799              aSanitizedFrameRate > KMccH263ProfileZeroMaxFramerateIOP )
       
   800             {
       
   801             aSanitizedFrameRate = KMccH263ProfileZeroMaxFramerateIOP;
       
   802             }
       
   803         }
       
   804     
       
   805     static void BitRateSanitize( 
       
   806         TUint32& aSanitizedBitRate, TUint32 aOrigBitRate, TUint32 aVideoType )
       
   807         {
       
   808         if ( aVideoType == MP4_TYPE_H263_PROFILE_0 && 
       
   809              aOrigBitRate > 0 && 
       
   810              aOrigBitRate < KMccH263ProfileZeroMinBitRateIOP )
       
   811             {
       
   812             aSanitizedBitRate = KMccH263ProfileZeroMinBitRateIOP;
       
   813             }
       
   814         else 
       
   815             {
       
   816             aSanitizedBitRate = aOrigBitRate;
       
   817             }
       
   818         }
       
   819     
   785     };
   820     };
   786         
   821         
   787 #endif
   822 #endif