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