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