multimediacommsengine/mmceshared/inc/mcecomamrcodec.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 CMCECOMAMRCODEC_H
       
    22 #define CMCECOMAMRCODEC_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include "mcecomaudiocodec.h"
       
    26 #include "mcedefs.h"
       
    27 
       
    28 
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32 *  Container class for the codec information.
       
    33 *
       
    34 *  @lib 
       
    35 */
       
    36 class CMceComAMRCodec : public CMceComAudioCodec
       
    37     {
       
    38 public:  // Constructors and destructor
       
    39 
       
    40     /**
       
    41     * Two-phased constructor.
       
    42     * @param aSdpName sdp name
       
    43     */
       
    44     static CMceComAMRCodec* NewL( TBuf8<KMceMaxSdpNameLength> aSdpName );
       
    45     
       
    46     /**
       
    47     * Two-phased constructor.
       
    48     * @param aSdpName sdp name
       
    49     */
       
    50     static CMceComAMRCodec* NewLC( TBuf8<KMceMaxSdpNameLength> aSdpName );
       
    51     
       
    52     /**
       
    53     * Destructor.
       
    54     */
       
    55     ~CMceComAMRCodec();
       
    56 
       
    57 public: // from CMceComCodec
       
    58 
       
    59     /**
       
    60     * Sets bitrate used with codec for encoding.
       
    61     * @param aBitrate bitrate value for encoding
       
    62     * @return KErrNotSupported if codec doesn't support bitrate
       
    63     *         value issued
       
    64     */
       
    65     TInt SetBitrate( TUint aBitrate );
       
    66     
       
    67     /**
       
    68     * Sets bitrates allowed with codec.
       
    69     * @param aBitrates allowed bitrate values
       
    70     * @return KErrNotSupported if codec doesn't support bitrate
       
    71     *         values issued
       
    72     */
       
    73     TInt SetAllowedBitrates( TUint aBitrates );
       
    74 
       
    75     /**
       
    76     * Sets the codec specific mode.
       
    77     * @param aCodecMode mode of the codec
       
    78     * @return KErrNotSupported if codec doesnt' support codec mode
       
    79     *         value issued
       
    80     */
       
    81     TInt SetCodecMode( TUint aCodecMode );
       
    82     
       
    83     /**
       
    84     * Sets the payload type.
       
    85     * @param aPayloadType type identifier of the payload
       
    86     * @return KErrNotSupported if codec doesn't support payload type issued
       
    87     */
       
    88     TInt SetPayloadType( TUint8 aPayloadType );
       
    89     
       
    90     /**
       
    91     * Returns max bit rate
       
    92     * @return max bit rate
       
    93     */
       
    94     TUint GetMaxBitRate();
       
    95     
       
    96     /**
       
    97     * Resolve allowed bitrates based on given bitrate value.
       
    98     * @param aBitrate
       
    99     * @param aAllowedBitrates, on return contains allowed bitrates
       
   100     * @return error code
       
   101     */
       
   102     TInt ResolveAllowedBitrates( TUint aBitrate, TUint& aAllowedBitrates );
       
   103 
       
   104 public: // from CMceAudioCodec
       
   105     
       
   106     /**
       
   107     * Sets the sampling frequency.
       
   108     * @param aSamplingFreq, Sampling frequency to be used
       
   109     * @return KErrNotSupported if codec doesn't support sampling frequency issued;
       
   110     * otherwise KErrNone.
       
   111     */
       
   112     TInt SetSamplingFreq( TUint aSamplingFreq );
       
   113 
       
   114     /**
       
   115     * Sets the packetization rate. 
       
   116     * @param aPTime, Packetization rate, must be multiple of audio frame size.
       
   117     * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   118     */
       
   119     TInt SetPTime( TUint aPTime );
       
   120     
       
   121     /**
       
   122     * Sets the maximum packetization rate.
       
   123     * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size.
       
   124     * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone.
       
   125     */
       
   126     TInt SetMaxPTime( TUint aMaxPTime );
       
   127 
       
   128 #ifdef MCE_COMMON_SERVER_SIDE
       
   129     
       
   130 protected: // from CMceComCodec
       
   131     
       
   132     /**
       
   133     * Validates codec values based on mcc codec
       
   134     * @param aMccCodec mcc codec
       
   135     * @param aStream stream
       
   136     * @param aRole role
       
   137     */
       
   138     CMceComCodec* DoMccValidateL( CMccCodecInformation& aMccCodec,
       
   139                                   CMceSrvStream& aStream,
       
   140                                   TMceNegotiationRole aRole );
       
   141     
       
   142     /**
       
   143     * Set default fmtp line
       
   144     */                                    
       
   145     void DoSetDefaultFmtpAttributeL();
       
   146 
       
   147 #endif
       
   148 
       
   149 public: // serialization etc
       
   150 
       
   151     /**
       
   152     * Clones
       
   153     */
       
   154     CMceComAudioCodec* CloneL();
       
   155 
       
   156 protected:
       
   157 
       
   158     /**
       
   159     * C++ default constructor.
       
   160     */
       
   161     CMceComAMRCodec();
       
   162 
       
   163     /**
       
   164     * By default Symbian 2nd phase constructor is private.
       
   165     */
       
   166     void ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName);
       
   167 
       
   168     /**
       
   169      * second-phase copy constructor
       
   170      */
       
   171     void ConstructL( CMceComAMRCodec& aCodec );
       
   172     
       
   173     #ifdef EUNIT_TEST
       
   174     friend class UT_CMceComAMRCodec;
       
   175     #endif
       
   176     };
       
   177 
       
   178 
       
   179 #endif      // __MCP_AMR_CODEC_H__
       
   180 
       
   181 // End of File