multimediacommscontroller/mmccinterface/inc/mmcccodech263.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MMCCCODECH263_H
       
    23 #define MMCCCODECH263_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include "mmcccodecinformation.h"
       
    27 
       
    28 // CONSTANTS
       
    29 const TInt KH263PTime( 50 );
       
    30 const TInt KH263PayloadType( 97 );
       
    31 const TInt KH2631998PayloadType( 99 );
       
    32 const TReal KH263Framerate( 12 );
       
    33 const TUint KH263FrameWidth( 176 );
       
    34 const TUint KH263FrameHeight( 144 );
       
    35 
       
    36 const TInt KH263FormatModeNew( 20 );
       
    37 const TInt KH263FormatModeOld( 21 );
       
    38 
       
    39 const TInt KH263Level10 = 10;
       
    40 const TInt KH263Level10Bitrate = 64000;
       
    41 const TReal KH263Level10Framerate = 12;
       
    42 const TInt KH263Level45 = 45;
       
    43 const TInt KH263Level45Bitrate = 128000;
       
    44 const TReal KH263Level45Framerate = 12;
       
    45 
       
    46 _LIT8(KH263FmtpLine, "profile=0; level=%d");
       
    47 _LIT8( KH263Profile, "*profile*");
       
    48 _LIT8( KH263Level, "*level*");
       
    49 
       
    50 // MACROS
       
    51 
       
    52 // DATA TYPES
       
    53 
       
    54 // FUNCTION PROTOTYPES
       
    55 
       
    56 // FORWARD DECLARATIONS
       
    57 
       
    58 // CLASS DECLARATION
       
    59 
       
    60 /**
       
    61 *  Container class for the codec information.
       
    62 *
       
    63 */
       
    64 NONSHARABLE_CLASS( CMccCodecH263 ) : public CMccCodecInformation
       
    65     {
       
    66     public:  // Constructors and destructor
       
    67         
       
    68         /**
       
    69         * Two-phased constructor.
       
    70         */
       
    71         static CMccCodecH263* NewL();
       
    72         
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         virtual ~CMccCodecH263();
       
    77 
       
    78     public: // New functions
       
    79 
       
    80     public: // Functions from base classes
       
    81 
       
    82     public: // From CMccCodecInformation
       
    83     
       
    84         /**
       
    85         * From CMccCodecInformation
       
    86         */
       
    87         TBool RequireSignalling( const CMccCodecInformation& aCandidate ) const;     
       
    88         
       
    89         /**
       
    90         * From CMccCodecInformation
       
    91         */
       
    92         CMccCodecInformation* CloneDefaultsL();
       
    93         
       
    94         /**
       
    95         * From CMccCodecInformation
       
    96         */
       
    97         CMccCodecInformation* CloneDetailedL();
       
    98         
       
    99         /**
       
   100         * From CMccCodecInformation. Enable / Disable Voice Activity Detection.
       
   101         * @since    Series 60 3.0
       
   102         * @param    aEnableVAD    Boolean indicating whether to enable Voice Activity Detection
       
   103         * @return   KErrNotSupported if codec doesn't support VAD; otherwise KErrNone.
       
   104         */
       
   105         TInt EnableVAD( TBool aEnableVAD );
       
   106      
       
   107         /**
       
   108         * From CMccCodecInformation. Sets bitrate used with codec.
       
   109         * @since    Series 60 3.0
       
   110         * @param    aBitrate     New bitrate value
       
   111         * @return   KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone.
       
   112         */
       
   113         TInt SetBitrate( TUint aBitrate );
       
   114         
       
   115         TInt SetMaxBitrate( TUint aMaxBitrate );
       
   116         
       
   117         /**
       
   118         * From CMccCodecInformation. Sets the sampling frequency.
       
   119         * @since    Series 60 3.0
       
   120         * @param    aSamplingFreq   Sampling frequency to be used
       
   121         * @return   KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone.
       
   122         */
       
   123         TInt SetSamplingFreq( TUint32 aSamplingFreq );
       
   124 
       
   125         /**
       
   126         * From CMccCodecInformation. Sets the packet rate.
       
   127         * @since    Series 60 3.0
       
   128         * @param    aPacketrate        New packetrate
       
   129         * @return   KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   130         */
       
   131         TInt SetPTime( TUint aPTime );
       
   132         
       
   133         /**
       
   134         * From CMccCodecInformation. Sets the packet rate.
       
   135         * @since    Series 60 3.0
       
   136         * @param    aPacketrate        New packetrate
       
   137         * @return   KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   138         */
       
   139         TInt SetMaxPTime( TUint aMaxPTime );
       
   140 
       
   141         /**
       
   142         * From CMccCodecInformation. Sets the sdp name.
       
   143         * @since    Series 60 3.0
       
   144         * @param aRtpId - [input] RTP session ID
       
   145         * @return One of the standard system-wide error codes.
       
   146         */
       
   147         TInt SetSdpName( const TDesC8& aSdpName );
       
   148         
       
   149         /**
       
   150         * From CMccCodecInformation. Sets the payload type.
       
   151         * @since    Series 60 3.0
       
   152         * @param    aRtpId - [input] RTP session ID
       
   153         * @return   One of the standard system-wide error codes.
       
   154         */
       
   155         TInt SetPayloadType( TUint8 aPayloadType );
       
   156 
       
   157         /**
       
   158         * From CMccCodecInformation. Sets the codec mode.
       
   159         * @since    Series 60 3.0
       
   160         * @param    aMode    Codec mode ( e.g. ULAW/ALAW, Bandwidth efficient / octet aligned )
       
   161         * @return   KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone.
       
   162         */
       
   163         TInt SetCodecMode( TCodecMode aCodecMode );
       
   164         
       
   165         /**
       
   166         * From CMccCodecInformation. Gets the codec fmtp parameters.
       
   167         * @return Fmtp parameters of the codec
       
   168         */
       
   169         TDesC8& GetFmtpL();
       
   170         
       
   171         void SetFmtpAttrL( const TDesC8& aFmtp, TBool parseFmtp );
       
   172         
       
   173         /**
       
   174         * Sets the allowed bitrates for the codec.
       
   175         * @since Series 60 3.0
       
   176         * @param aBitrateMask bitrate mask.
       
   177         * @return KErrNotSupported if codec doesnt' support the bitrate mask
       
   178         *     value issued; otherwise KErrNone.
       
   179         */
       
   180         TInt SetAllowedBitrates( TUint aBitrateMask );
       
   181         
       
   182         /**
       
   183         * Set encoder/decoder configuration key
       
   184         * @param aConfigKey, config key as Base64 encoded
       
   185         */    
       
   186         void SetConfigKeyL( const TDesC8& aConfigKey );
       
   187 
       
   188         
       
   189     private:
       
   190 
       
   191         /**
       
   192         * C++ default constructor.
       
   193         */
       
   194         CMccCodecH263();
       
   195 
       
   196         /**
       
   197         * By default Symbian 2nd phase constructor is private.
       
   198         */
       
   199         void ConstructL();
       
   200 
       
   201         TBool ParseFmtpAttrL( const TDesC8& aFmtp );
       
   202 
       
   203         TBool ParseFmtpSegmentL( const TDesC8& aSeg );
       
   204         
       
   205         TBool ParseProfileL( const TDesC8& aFmtp );
       
   206         
       
   207         TBool ParseLevelL( const TDesC8& aFmtp );
       
   208 
       
   209         void SetMaxBitrateFromBitrateMask( TUint aBitrateMask );
       
   210         
       
   211         void SetBitrateMaskFromMaxBitrate( TUint aMaxBitrate );
       
   212         
       
   213         void SetLevelBasedBitrate( TUint aBitrate );
       
   214         
       
   215     private:
       
   216     
       
   217         TBool iBitrateSet;
       
   218         
       
   219         #ifdef TEST_EUNIT
       
   220             friend class UT_CMccCodecH263;
       
   221         #endif
       
   222     };
       
   223 
       
   224 #endif      // __MCC_CODEC_DTMF_H__   
       
   225             
       
   226 // End of File