ipappsrv_plat/multimedia_comms_api/inc/mcecncodec.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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 #ifndef MCECNCODEC_H
       
    22 #define MCECNCODEC_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <mceaudiocodec.h>
       
    26 #include <mcedefs.h>
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // CN Default Payload Types
       
    31 const TUint8 KMceDefaultCnPayloadType = 13; 
       
    32 const TUint8 KMceDefaultCnPayloadType2 = 19; 
       
    33 
       
    34 // Default Sampling Rate   
       
    35 const TUint KMceCnSamplingFreq = 8000;
       
    36 
       
    37 // PTime and MaxPTime
       
    38 const TUint KMceCnDefaultPtime =  20; 
       
    39 const TUint KMceCnDefaultMaxPtime = 200;
       
    40 
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 * Class for the Comfort Noise codec information.
       
    46 *
       
    47 * It checks the validity of inserted values for CN.
       
    48 * 
       
    49 *  @l
       
    50  mceclient.lib
       
    51 */
       
    52 class CMceCnCodec : public CMceAudioCodec
       
    53     {
       
    54 	public:  // Constructors and destructor
       
    55 	    
       
    56 	    /**
       
    57 	    * Destructor.
       
    58 	    */
       
    59 	    IMPORT_C ~CMceCnCodec();
       
    60 	        
       
    61 	public: // From base class
       
    62 
       
    63 	    /**
       
    64 	    * Enable / Disable Voice Activity Detection.
       
    65 	    * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection
       
    66 	    * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone.
       
    67 	    */
       
    68 	    IMPORT_C TInt EnableVAD(TBool aEnableVAD);
       
    69         
       
    70         /**
       
    71 	    * Sets bitrate used with codec for encoding.
       
    72 	    * @param aBitrate, bitrate value for encoding
       
    73 	    * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone.
       
    74 	    */
       
    75 	    IMPORT_C TInt SetBitrate(TUint aBitrate);
       
    76 	    
       
    77 	    /**
       
    78 	    * Sets bitrates allowed with codec.
       
    79 	    * @param aBitrates, allowed bitrate values 
       
    80 	    * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone.
       
    81 	    */
       
    82 	    IMPORT_C TInt SetAllowedBitrates(TUint aBitrates);
       
    83 	        
       
    84 	    /**
       
    85 	    * Sets the sampling frequency.
       
    86 	    * @param aSamplingFreq, Sampling frequency to be used
       
    87 	    * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone.
       
    88 	    */
       
    89 	    IMPORT_C TInt SetSamplingFreq(TUint aSamplingFreq);
       
    90 
       
    91 	    /**
       
    92 	    * Sets the packetization rate. 
       
    93 	    * @param aPTime, Packetization rate, must be multiple of audio frame size.
       
    94 	    * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
    95 	    */
       
    96 	    IMPORT_C TInt SetPTime(TUint aPTime);
       
    97 	    
       
    98 	    /**
       
    99 	    * Sets the maximum packetization rate.
       
   100 	    * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size.
       
   101 	    * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   102 	    */
       
   103 	    IMPORT_C TInt SetMaxPTime(TUint aMaxPTime);
       
   104 	    
       
   105 	    /**
       
   106 	    * Sets the payload type identifier.
       
   107 	    * @param aPayloadType payload type identifier.
       
   108 	    * @return One of the standard system-wide error codes.
       
   109 	    */
       
   110 	    IMPORT_C TInt SetPayloadType(TUint8 aPayloadType);
       
   111 
       
   112 	    /**
       
   113 	    * Sets the codec mode.
       
   114 	    * @param aCodecMode	Codec mode
       
   115 	    * @return KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone.
       
   116 	    */
       
   117 	    IMPORT_C TInt SetCodecMode(TUint aCodecMode);
       
   118 	    
       
   119 	    /**
       
   120 	    * Clones codec, ownership is transferred.
       
   121 	    * @return cloned codec
       
   122 	    */
       
   123 	    IMPORT_C CMceAudioCodec* CloneL() const;
       
   124 
       
   125 	public: 
       
   126 
       
   127 	    /**
       
   128 	    * Two-phased constructor.
       
   129 	    * @param aSdpName sdp name
       
   130 	    */
       
   131 	    static CMceCnCodec* NewL( TBuf8<KMceMaxSdpNameLength> aSdpName);
       
   132 
       
   133 	    /**
       
   134 	    * Two-phased constructor.
       
   135 	    * @param aSdpName sdp name
       
   136 	    */
       
   137 	    static CMceCnCodec* NewLC(TBuf8<KMceMaxSdpNameLength> aSdpName);
       
   138 
       
   139 	    	    
       
   140 	private:
       
   141 
       
   142 	    /**
       
   143 	    * C++ default constructor.
       
   144 	    */
       
   145 	    CMceCnCodec();
       
   146 
       
   147 	    /**
       
   148 	    * By default Symbian 2nd phase constructor is private.
       
   149 	    */
       
   150 	    void ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName);
       
   151 
       
   152 	    /**
       
   153 	    * Sets the sdp name.
       
   154 	    * @param aSdpName the sdp name
       
   155 	    */
       
   156 	    void SetSdpNameL( const TDesC8& aSdpName );
       
   157 
       
   158 		//for testing
       
   159 
       
   160 	    MCE_UNIT_TEST_DEFS	    
       
   161     };
       
   162 
       
   163 
       
   164 #endif      
       
   165 
       
   166 // End of File
       
   167