multimediacommsengine/mmceshared/inc/mcecommsrpcodec.h
branchrcs
changeset 49 64c62431ac08
equal deleted inserted replaced
44:fb024d5e35fa 49:64c62431ac08
       
     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 CMCECOMMSRPCODEC_H
       
    22 #define CMCECOMMSRPCODEC_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include "mcecommessagecodec.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 CMceComMsrpCodec : public CMceComMessageCodec
       
    37     {
       
    38 public:  // Constructors and destructor
       
    39 
       
    40     /**
       
    41     * Two-phased constructor.
       
    42     * @param aSdpName sdp name
       
    43     */
       
    44     static CMceComMsrpCodec* NewL( TBuf8<KMceMaxSdpNameLength> aSdpName );
       
    45     
       
    46     /**
       
    47     * Two-phased constructor.
       
    48     * @param aSdpName sdp name
       
    49     */
       
    50     static CMceComMsrpCodec* NewLC( TBuf8<KMceMaxSdpNameLength> aSdpName );
       
    51     
       
    52     /**
       
    53     * Destructor.
       
    54     */
       
    55     ~CMceComMsrpCodec();
       
    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     * Returns max bit rate
       
    77     * @return max bit rate
       
    78     */
       
    79     TUint GetMaxBitRate();
       
    80     
       
    81     /**
       
    82     * Resolve allowed bitrates based on given bitrate value.
       
    83     * @param aBitrate
       
    84     * @param aAllowedBitrates, on return contains allowed bitrates
       
    85     * @return error code
       
    86     */
       
    87     TInt ResolveAllowedBitrates( TUint aBitrate, TUint& aAllowedBitrates );
       
    88 
       
    89 #ifdef MCE_COMMON_SERVER_SIDE
       
    90     
       
    91     /**
       
    92     * Validates codec values based on mcc codec
       
    93     * @param aMccCodec mcc codec
       
    94     * @param aStream stream
       
    95     * @param aRole role
       
    96     */
       
    97     CMceComCodec* DoMccValidateL( CMccCodecInformation& aMccCodec,
       
    98                                   CMceSrvStream& aStream,
       
    99                                   TMceNegotiationRole aRole );
       
   100                                   
       
   101 protected: // from CMceComCodec
       
   102     
       
   103     /**
       
   104     * Set default fmtp line
       
   105     */                                    
       
   106     void DoSetDefaultFmtpAttributeL();
       
   107 
       
   108 #endif
       
   109 
       
   110 public: // serialization etc
       
   111 
       
   112     /**
       
   113     * Clones
       
   114     */
       
   115     CMceComMessageCodec* CloneL();
       
   116 
       
   117 private:
       
   118 
       
   119     /**
       
   120     * C++ default constructor.
       
   121     */
       
   122     CMceComMsrpCodec();
       
   123 
       
   124     /**
       
   125     * By default Symbian 2nd phase constructor is private.
       
   126     */
       
   127     void ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName);
       
   128 
       
   129     /**
       
   130      * second-phase copy constructor
       
   131      */
       
   132     void ConstructL( CMceComMsrpCodec& aCodec );
       
   133 
       
   134     
       
   135     #ifdef EUNIT_TEST
       
   136         friend class UT_CMceComMsrpCodec;
       
   137     #endif
       
   138     
       
   139     };
       
   140 
       
   141 
       
   142 #endif     
       
   143 
       
   144 // End of File