multimediacommsengine/tsrc/mccstub/inc/mmcccodecred.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 red codec.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __MCC_CODEC_RED_H__
       
    22 #define __MCC_CODEC_RED_H__
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32cmn.h>
       
    26 #include <rtpdef.h>
       
    27 #include "mmcccodecinformation.h"
       
    28 
       
    29 // CONSTANTS
       
    30 const TText8 KCharSpace( ' ' );
       
    31 const TText8 KCharSlash( '/' );
       
    32 
       
    33 const TInt KRedSampleRate = 8000;
       
    34 const TInt KRedPTime = 20;
       
    35 const TInt KRedMaxPTime = 200;
       
    36 
       
    37 // Red Codec possible bitrates
       
    38 const TUint KRedSamplingFreq = 8000;
       
    39 
       
    40 // MACROS
       
    41 
       
    42 // DATA TYPES
       
    43 
       
    44 // FUNCTION PROTOTYPES
       
    45 
       
    46 // FORWARD DECLARATIONS
       
    47 
       
    48 // CLASS DECLARATION
       
    49 /**
       
    50 *  Container class for the codec information.
       
    51 *
       
    52 *  @lib mmccinterface.dll
       
    53 *  
       
    54 */
       
    55 NONSHARABLE_CLASS( CMccCodecRed ) : public CMccCodecInformation
       
    56     {
       
    57     public:  // Constructors and destructor
       
    58 
       
    59         /**
       
    60         * Two-phased constructor.
       
    61         */
       
    62         static CMccCodecRed* NewL();
       
    63         
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67         virtual ~CMccCodecRed();
       
    68         
       
    69     public: // New functions
       
    70     
       
    71     public: // From CMccCodecInformation
       
    72     
       
    73         /**
       
    74         * From CMccCodecInformation
       
    75         */
       
    76         TBool RequireSignalling( const CMccCodecInformation& aCandidate ) const;     
       
    77         
       
    78         /**
       
    79         * From CMccCodecInformation
       
    80         */
       
    81         CMccCodecInformation* CloneDefaultsL();
       
    82         
       
    83         /**
       
    84         * From CMccCodecInformation
       
    85         */
       
    86         CMccCodecInformation* CloneDetailedL();
       
    87         
       
    88         /**
       
    89         * From CMccCodecInformation. Enable / Disable Voice Activity Detection.
       
    90         * @since    Series 60 3.0
       
    91         * @param    aEnableVAD    Boolean indicating whether to enable Voice Activity Detection
       
    92         * @return   KErrNotSupported if codec doesn't support VAD; otherwise KErrNone.
       
    93         */
       
    94         TInt EnableVAD( TBool aEnableVAD );
       
    95      
       
    96         /**
       
    97         * From CMccCodecInformation. Sets bitrate used with codec.
       
    98         * @since     Series 60 3.0
       
    99         * @param     aBitrate     New bitrate value
       
   100         * @return    KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone.
       
   101         */
       
   102         TInt SetBitrate( TUint aBitrate );
       
   103         
       
   104         /**
       
   105         * From CMccCodecInformation. Sets the sampling frequency.
       
   106         * @since    Series 60 3.0
       
   107         * @param    aSamplingFreq   Sampling frequency to be used
       
   108         * @return   KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone.
       
   109         */
       
   110         TInt SetSamplingFreq( TUint32 aSamplingFreq );
       
   111 
       
   112         /**
       
   113         * From CMccCodecInformation. Sets the packet rate.
       
   114         * @since     Series 60 3.0
       
   115         * @param     aPacketrate        New packetrate
       
   116         * @return    KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   117         */
       
   118         TInt SetPTime( TUint aPTime );
       
   119         
       
   120         /**
       
   121         * From CMccCodecInformation. Sets the packet rate.
       
   122         * @since     Series 60 3.0
       
   123         * @param     aPacketrate        New packetrate
       
   124         * @return    KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   125         */
       
   126         TInt SetMaxPTime( TUint aMaxPTime );
       
   127         
       
   128         /**
       
   129         * From CMccCodecInformation. Sets the sdp name.
       
   130         * @since Series 60 3.0
       
   131         * @param aRtpId - [input] RTP session ID
       
   132         * @return One of the standard system-wide error codes.
       
   133         */
       
   134         TInt SetSdpName( const TDesC8& aSdpName );
       
   135         
       
   136         /**
       
   137         * From CMccCodecInformation. Sets the payload type.
       
   138         * @since Series 60 3.0
       
   139         * @param aRtpId - [input] RTP session ID
       
   140         * @return One of the standard system-wide error codes.
       
   141         */
       
   142         TInt SetPayloadType( TUint8 aPayloadType );
       
   143 
       
   144         /**
       
   145         * From CMccCodecInformation. Sets the codec mode.
       
   146         * @since         Series 60 3.0
       
   147         * @param aMode   Codec mode ( e.g. ULAW/ALAW, Bandwidth efficient / octet aligned )
       
   148         * @return        KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone.
       
   149         */
       
   150         TInt SetCodecMode( TCodecMode aCodecMode );
       
   151         
       
   152         /**
       
   153         * Parses the fmtp attribute and sets the parsed codecs   
       
   154         * @since         Series60 3.0
       
   155         * @param aFmtp   Fmtp attribute
       
   156         * @return        One of the standard system-wide error codes.
       
   157         */
       
   158         TBool ParseFmtpAttrL( const TDesC8& aFmtp );    
       
   159         
       
   160         /**
       
   161         * Set Allowed BitRate
       
   162         * @since    Series 60 3.0
       
   163         * @param    aBitRateMask
       
   164         *                       
       
   165         * @return   Etrue, if Mask is valid
       
   166         */
       
   167         TInt SetAllowedBitrates( TUint aBitrateMask );
       
   168           
       
   169         /**
       
   170         * Sets the payload types used in redundancy 
       
   171         * @since        Series60 3.0
       
   172         * @param        Reference to the array containing the codecs
       
   173         * @return       None       
       
   174         */
       
   175         void SetRedPayloadsL( RArray<TUint>& aRedPayloads );
       
   176         
       
   177         /**
       
   178         * Fills array with red payload types.
       
   179         * @since        Series60 3.0
       
   180         * @param        aRedPayloads   
       
   181         */
       
   182         void RedPayloadsL( RArray<TUint>& aRedPayloads ) const;
       
   183    
       
   184    public: // New methods
       
   185        
       
   186         const RArray<TUint>& RedPayloads() const;
       
   187            
       
   188     private:
       
   189         /**
       
   190         * C++ default constructor.
       
   191         */
       
   192         CMccCodecRed();
       
   193 
       
   194         /**
       
   195         * By default Symbian 2nd phase constructor is private.
       
   196         */
       
   197         void ConstructL();
       
   198         
       
   199         /** 
       
   200         * Array contains the payloadtypes used in the Redundancy payload
       
   201         * Used only for redundancy payload format type 
       
   202         */ 
       
   203         RArray< TUint > iRedPayloads;        
       
   204     private:
       
   205         #ifdef TEST_EUNIT
       
   206             friend class UT_CMccCodecRed;
       
   207         #endif     
       
   208     };
       
   209 
       
   210 
       
   211 #endif      // __MCC_CODEC_RED_H__
       
   212 
       
   213 // End of File