multimediacommscontroller/mmccinterface/inc/mmcccodecilbc.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004-2008 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:    Class is used for configuring G729 codec.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __MCC_CODEC_ILBC_H__
       
    22 #define __MCC_CODEC_ILBC_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include "mmcccodecinformation.h"
       
    26 
       
    27 // CONSTANTS
       
    28 const TUint KIlbcMaxPTime30 = 180;
       
    29 
       
    30 // iLBC Codec possible bitrates
       
    31 const TInt KIlbcBitrate20 = 15200;
       
    32 const TInt KIlbcBitrate30 = 13330;
       
    33 
       
    34 // Other iLBC related constants
       
    35 const TInt KIlbcSampleRate( 8000 );
       
    36 const TInt KIlbcPTime( 30 );
       
    37 const TInt KIlbcHwFrameTime( 30 );
       
    38 const TInt KIlbcMaxPTime( 180 );
       
    39 const TInt KIlbcPTime20( 20 );
       
    40 const TInt KIlbcPTime30( 30 );
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45  *  Container class for the iLBC codec information.
       
    46  *
       
    47  *  @lib mmccinterface.dll
       
    48  */
       
    49 NONSHARABLE_CLASS( CMCCCodecILBC ): public CMccCodecInformation
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52    
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         static CMCCCodecILBC* NewL();
       
    57         
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CMCCCodecILBC();
       
    62         
       
    63     public:    // From CMccCodecInformation
       
    64 
       
    65         /**
       
    66         * From CMccCodecInformation
       
    67         */
       
    68         CMccCodecInformation* CloneDefaultsL();
       
    69         
       
    70         /**
       
    71         * From CMccCodecInformation
       
    72         */
       
    73         CMccCodecInformation* CloneDetailedL();
       
    74         
       
    75         /**
       
    76         * From CMccCodecInformation
       
    77         */
       
    78         TBool RequireSignalling( const CMccCodecInformation& aCandidate ) const; 
       
    79         
       
    80         /**
       
    81         * From MccCodecInformation. Enable / Disable Voice Activity Detection.
       
    82         * @since    Series 60 3.0
       
    83         * @param    aEnableVAD    Boolean indicating whether to enable Voice Activity Detection
       
    84         * @return   KErrNotSupported if codec doesn't support VAD; otherwise KErrNone.
       
    85         */
       
    86         TInt EnableVAD( TBool aEnableVAD );
       
    87                
       
    88         /**
       
    89         * From MccCodecInformation. Sets bitrate used with codec.
       
    90         * @since     Series 60 3.0
       
    91         * @param     aBitrate     New bitrate value
       
    92         * @return    KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone.
       
    93         */
       
    94         TInt SetBitrate( TUint aBitrate );
       
    95             
       
    96         /**
       
    97         * From MccCodecInformation. Sets the sampling frequency.
       
    98         * @since    Series 60 3.0
       
    99         * @param    aSamplingFreq   Sampling frequency to be used
       
   100         * @return   KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone.
       
   101         */
       
   102         TInt SetSamplingFreq( TUint32 aSamplingFreq );
       
   103 
       
   104         /**
       
   105         * From MccCodecInformation. Sets the sdp name.
       
   106         * @since Series 60 3.0
       
   107         * @param aRtpId - [input] RTP session ID
       
   108         * @return One of the standard system-wide error codes.
       
   109         */
       
   110         TInt SetSdpName( const TDesC8& aSdpName );
       
   111         
       
   112         /**
       
   113         * From MccCodecInformation. Sets the payload type.
       
   114         * @since Series 60 3.0
       
   115         * @param aRtpId - [input] RTP session ID
       
   116         * @return One of the standard system-wide error codes.
       
   117         */
       
   118         TInt SetPayloadType( TUint8 aPayloadType );
       
   119         
       
   120         /**
       
   121         * From MccCodecInformation. Sets the codec mode.
       
   122         * @since         Series 60 3.0
       
   123         * @param aMode   Codec mode ( e.g. ULAW/ALAW, Bandwidth efficient / octet aligned )
       
   124         * @return        KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone.
       
   125         */
       
   126         TInt SetCodecMode( TCodecMode aCodecMode );
       
   127 
       
   128         /**
       
   129         * Creates the fmtp string from internal values
       
   130         * @since Series 60 3.0
       
   131         * @return void
       
   132         */
       
   133         void CreateFmtpAttrListL();
       
   134         
       
   135         /**
       
   136         * Parses the fmtp attributes, and updates the internal values
       
   137         * except the iFmtpAttr attribute
       
   138         * @since Series 60 3.0
       
   139         * @param aFmtp Fmtp attribute
       
   140         * @return True if any param was updated
       
   141         */
       
   142         TBool ParseFmtpAttrL( const TDesC8& aFmtp );
       
   143                
       
   144         /**
       
   145         * Get the fmtp string
       
   146         * @since Series 60 3.0
       
   147         * @return Fmtp.
       
   148         */
       
   149         TDesC8& GetFmtpL( );
       
   150         
       
   151         /**
       
   152         * From MccCodecInformation. Sets max packet time.
       
   153         * @since    Series 60 3.0
       
   154         * @param aMaxPTime Maximum PacketTime
       
   155         * @return One of the standard system-wide error codes.
       
   156         */
       
   157         TInt SetMaxPTime( TUint aMaxPTime );
       
   158         
       
   159         /**
       
   160         * From MccCodecInformation. Sets the packet time.
       
   161         * @since    Series 60 3.0
       
   162         * @param aPTime PacketTime.
       
   163         * @return One of the standard system-wide error codes.
       
   164         */
       
   165         TInt SetPTime( TUint aPTime );
       
   166 
       
   167         /**
       
   168         * Enable / Disable Comfort noise generation.
       
   169         * @param aComfortNoisePT Payloadtype value indicating what
       
   170         *        payload type should be used for comfort noise.
       
   171         *        KPayloadTypeUndefined can be used to turn comfor noise
       
   172         *        generation off.
       
   173         * @return One of the standard system-wide error codes.
       
   174         */
       
   175         TInt SetComfortNoiseGeneration( TUint8 aComfortNoisePT );
       
   176         
       
   177         /**
       
   178         * Set Allowed BitRate
       
   179         * @since    Series 60 3.0
       
   180         * @param    aBitRateMask
       
   181         *                       
       
   182         * @return   Etrue, if Mask is valid
       
   183         */
       
   184 
       
   185         TInt SetAllowedBitrates( TUint aBitrateMask );
       
   186                    
       
   187     private:
       
   188         
       
   189         /**
       
   190         * C++ default constructor.
       
   191         */
       
   192         CMCCCodecILBC();
       
   193 
       
   194         /**
       
   195         * By default Symbian 2nd phase constructor is private.
       
   196         */
       
   197         void ConstructL();
       
   198         
       
   199         /**
       
   200         * Adjust codec.
       
   201         */
       
   202         void AdjustCodec();
       
   203 
       
   204     public:     // Data
       
   205 
       
   206     protected:  // Data
       
   207 
       
   208     private:    // Data
       
   209 
       
   210     public:     // Friend classes
       
   211 
       
   212     protected:  // Friend classes
       
   213 
       
   214     private:    // Friend classes
       
   215 
       
   216     };
       
   217 
       
   218 
       
   219 #endif      //__MCC_CODEC_ILBC_H__
       
   220 
       
   221 // End of File