multimediacommscontroller/mmccinterface/inc/mmcccodecamrwb.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 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:    Class is used for configuring AMR WB codec.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __MCC_CODEC_AMR_WB_H__
       
    22 #define __MCC_CODEC_AMR_WB_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include "mmcccodecamr.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // AMR-WB Codec possible bitrates
       
    30 const TInt KAmrWbBitrate660( 6600 );
       
    31 const TInt KAmrWbBitrate885( 8850 );
       
    32 const TInt KAmrWbBitrate1265( 12650 );
       
    33 const TInt KAmrWbBitrate1425( 14250 );
       
    34 const TInt KAmrWbBitrate1585( 15850 );
       
    35 const TInt KAmrWbBitrate1825( 18250 );
       
    36 const TInt KAmrWbBitrate1985( 19850 );
       
    37 const TInt KAmrWbBitrate2305( 23050 );
       
    38 const TInt KAmrWbBitrate2385( 23850 );
       
    39 
       
    40 const TUint KMccAllowedAmrWbBitrate660     = 0x0001;
       
    41 const TUint KMccAllowedAmrWbBitrate885     = 0x0002;
       
    42 const TUint KMccAllowedAmrWbBitrate1265    = 0x0004;
       
    43 const TUint KMccAllowedAmrWbBitrate1425    = 0x0008;
       
    44 const TUint KMccAllowedAmrWbBitrate1585    = 0x0010;
       
    45 const TUint KMccAllowedAmrWbBitrate1825    = 0x0020;
       
    46 const TUint KMccAllowedAmrWbBitrate1985    = 0x0040;
       
    47 const TUint KMccAllowedAmrWbBitrate2305    = 0x0080;
       
    48 const TUint KMccAllowedAmrWbBitrate2385    = 0x0100;
       
    49 const TUint KMccAllowedAmrWbBitrateAll     = 0x0FFF;
       
    50 
       
    51 // Allowed bitrates bitfield can contain additional information
       
    52 const TUint KMccAllowedAmrWbAdditionalInfo   = 0xF000;
       
    53 
       
    54 // If this bit is not present, mode-change-period=1
       
    55 const TUint KMccAllowedAmrWbModeChangePeriod2   = 0x1000;
       
    56 
       
    57 // If this bit is not present, mode-change-neighbor=0
       
    58 const TUint KMccAllowedAmrWbModeChangeNeighbor1 = 0x2000;
       
    59 
       
    60 const TUint KAmrWbSamplingFreq( 16000 );
       
    61 
       
    62 const TInt KAMRMode8( 8 );
       
    63 
       
    64 const TInt KAmrWbDefaultFrameSize( 64 );
       
    65 
       
    66 // CLASS DECLARATION
       
    67 /**
       
    68 *  Container class for the codec information.
       
    69 *
       
    70 *  @lib MCCInterface.dll
       
    71 *  @since Series 60 3.0
       
    72 */
       
    73 NONSHARABLE_CLASS( CMccCodecAmrWb ) : public CMccCodecAMR
       
    74     {
       
    75     public:  // Constructors and destructor
       
    76 
       
    77         /**
       
    78         * Two-phased constructor.
       
    79         */
       
    80         static CMccCodecAmrWb* NewL();
       
    81         
       
    82         /**
       
    83         * Destructor.
       
    84         */
       
    85         virtual ~CMccCodecAmrWb();
       
    86         
       
    87     public: // New functions
       
    88     
       
    89     public: // From CMccCodecInformation 
       
    90 
       
    91         /**
       
    92         * From CMccCodecInformation
       
    93         */
       
    94         CMccCodecInformation* CloneDefaultsL();
       
    95         
       
    96         /**
       
    97         * From CMccCodecInformation
       
    98         */
       
    99         CMccCodecInformation* CloneDetailedL();
       
   100         
       
   101     private:
       
   102         /**
       
   103         * C++ default constructor.
       
   104         */
       
   105         CMccCodecAmrWb();
       
   106 
       
   107         /**
       
   108         * By default Symbian 2nd phase constructor is private.
       
   109         */
       
   110         void ConstructL();
       
   111     
       
   112     
       
   113     /**
       
   114     *   Set functions
       
   115     */          
       
   116     public: 
       
   117 
       
   118         /**
       
   119         * From CMccCodecInformation. Sets bitrate used with codec.
       
   120         * @since     Series 60 3.0
       
   121         * @param     aBitrate     New bitrate value
       
   122         * @return    KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone.
       
   123         */
       
   124         TInt SetBitrate( TUint aBitrate );
       
   125         
       
   126         /**
       
   127         * From CMccCodecInformation. Sets the bitrate from the mode set .
       
   128         * @since     Series 60 3.0
       
   129         * @param     aBitrate     The mode set
       
   130         * @return    mode set value
       
   131         */
       
   132         void SetBitrateModeSet( TUint aModeSet );
       
   133         
       
   134         /**
       
   135         * From CMccCodecInformation. Sets the sampling frequency.
       
   136         * @since    Series 60 3.0
       
   137         * @param    aSamplingFreq   Sampling frequency to be used
       
   138         * @return   KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone.
       
   139         */
       
   140         TInt SetSamplingFreq( TUint32 aSamplingFreq );
       
   141 
       
   142         /**
       
   143         * From CMccCodecInformation. Sets the sdp name.
       
   144         * @since Series 60 3.0
       
   145         * @param aRtpId - [input] RTP session ID
       
   146         * @return One of the standard system-wide error codes.
       
   147         */
       
   148         TInt SetSdpName( const TDesC8& aSdpName );
       
   149                
       
   150         /**
       
   151         * Sets the allowed bitrates for the codec.
       
   152         * @since Series 60 3.0
       
   153         * @param aBitrateMask bitrate mask.
       
   154         * @return KErrNotSupported if codec doesnt' support the bitrate mask
       
   155         *     value issued; otherwise KErrNone.
       
   156         */
       
   157         TInt SetAllowedBitrates( TUint aBitrateMask );
       
   158 
       
   159 
       
   160     protected: // From CMccCodecAMR 
       
   161      
       
   162         /**
       
   163         * Sets bitrate used with codec.
       
   164         * @since Series 60 3.0
       
   165         * @param aBitrateMask bitrate mask, sets the largest bitrate
       
   166         * @return KErrNotSupported if codec doesn't support bitrate value
       
   167         *     issued; otherwise KErrNone.
       
   168         */
       
   169         TInt SetBitrateFromBitrateMask( TUint aBitrateMask ); 
       
   170         
       
   171         /**
       
   172         * From CMccCodecInformation. Gets the mode set of a bitrate.
       
   173         * @since     Series 60 3.0
       
   174         * @param     aBitrate     The bitrate value
       
   175         * @return     mode set value
       
   176         */
       
   177         TInt GetBitrateModeSet( TUint aBitrate );
       
   178         
       
   179         /**
       
   180         * From CMccCodecInformation. Gets the bitrate mask from the mode set .
       
   181         * @since     Series 60 3.0
       
   182         * @param     aMode The mode set
       
   183         * @param    aBitrateMask reference to bitrateMask
       
   184         * @return KErrNotSupported if codec doesnt' support the bitrate mask
       
   185         *     value issued; otherwise KErrNone.
       
   186         */
       
   187         TInt GetBitrateMaskFromMode( TUint aMode, TUint& aBitrateMask  );
       
   188 
       
   189     
       
   190         /**
       
   191         * Gets the allowed bitrates for the codec.
       
   192         * @since  Series 60 3.0
       
   193         * @param  aBitrateMask RArray<TUint> reference 
       
   194         * @return KErrNotSupported if codec doesnt' support the function
       
   195         *         otherwise KErrNone.
       
   196         */
       
   197         TInt GetAllowedBitratesArrayL( RArray<TUint>& aBitratesArray );
       
   198         
       
   199     protected:  // New functions
       
   200     
       
   201     protected:  // Functions from base classes
       
   202 
       
   203         
       
   204     public:     // Data    
       
   205     
       
   206     protected:  // Data
       
   207     
       
   208     private:    // Data  
       
   209         
       
   210 private:
       
   211 
       
   212     #ifdef TEST_EUNIT
       
   213         friend class UT_CMccCodecAmrWb;
       
   214     #endif
       
   215       
       
   216     };
       
   217 
       
   218 
       
   219 #endif      // __MCC_CODEC_AMR_WB_H__
       
   220 
       
   221 // End of File