voipplugins/voipadapters/cpvoipadapter/inc/CWPVoIPCodec.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  Handles and stores the VoIP codec settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CWPVOIPCODEC_H
       
    20 #define CWPVOIPCODEC_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 // Media type name.
       
    28 _LIT( KAudio, "audio" );
       
    29 
       
    30 // Media sub-type names.
       
    31 _LIT( KAMR,      "AMR"         ); // 0
       
    32 _LIT( KILBC,     "iLBC"        ); // 1
       
    33 _LIT( KVMRWB,    "VMR-WB"      ); // 2
       
    34 _LIT( KG711ALAW, "PCMA"        ); // 3
       
    35 _LIT( KG711uLAW, "PCMU"        ); // 4
       
    36 _LIT( KG726_40,  "G726-40"     ); // 5
       
    37 _LIT( KG726_32,  "G726-32"     ); // 6
       
    38 _LIT( KG726_24,  "G726-24"     ); // 7
       
    39 _LIT( KG726_16,  "G726-16"     ); // 8
       
    40 _LIT( KCN,       "CN"          ); // 9
       
    41 _LIT( KG729B,    "G729"        ); // 10
       
    42 _LIT( KAMRWB,    "AMR-WB"      ); // 11
       
    43 _LIT( KGSMEFR,   "GSM-EFR"     ); // 12
       
    44 _LIT( KGSMFR,    "GSM-FR"      ); // 13
       
    45 _LIT( KEVRC,     "EVRC"        ); // 14
       
    46 _LIT( KEVRC0,    "EVRC0"       ); // 15
       
    47 _LIT( KSMV,      "SMV"         ); // 16
       
    48 _LIT( KSMV0,     "SMV0"        ); // 17
       
    49 
       
    50 
       
    51 // CLASS DECLARATION
       
    52 /**
       
    53 *  This class keeps transiently the VoIP codec data and stores the 
       
    54 *  codec via interface provided by RCSE.
       
    55 *
       
    56 *  @lib CWPVoIPAdapter.lib
       
    57 *  @since Series 60 3.0.
       
    58 */
       
    59 class CWPVoIPCodec : public CBase
       
    60     {    
       
    61     #ifdef _DEBUG
       
    62     /**
       
    63      * Friend class for unit testing.
       
    64      */
       
    65     friend class UT_CWPVoIPAdapter;
       
    66     friend class UT_CWPVoIPCodec;
       
    67     friend class UT_CWPVoIPItem;
       
    68     #endif
       
    69 
       
    70 
       
    71     public: // Enums
       
    72 
       
    73     enum TAudioCodecs
       
    74         {
       
    75         EAMR = 0,
       
    76         EiLBC,
       
    77         EVMRWB,
       
    78         EPCMA,
       
    79         EPCMU,
       
    80         EG726_40,
       
    81         EG726_32,
       
    82         EG726_24,
       
    83         EG726_16,
       
    84         ECN,
       
    85         EG729,
       
    86         EAMRWB,
       
    87         EGSMEFR,
       
    88         EGSMFR,
       
    89         EEVRC,
       
    90         EEVRC0,
       
    91         ESMV,
       
    92         ESMV0,
       
    93         };
       
    94 
       
    95     public: // Constructors and destructor
       
    96 
       
    97         /**
       
    98          * Two-phased constructor.
       
    99          */
       
   100         static CWPVoIPCodec* NewL();
       
   101 
       
   102         /**
       
   103          * Destructor.
       
   104          */
       
   105         virtual ~CWPVoIPCodec();
       
   106 
       
   107     public: // New functions
       
   108 
       
   109         /**
       
   110          * Setter for MediaSubtypeName.
       
   111          * @since Series 60 3.0.
       
   112          * @param TDesC& aMediaSubtypeName.
       
   113          */
       
   114 		void SetMediaSubtypeNameL( const TDesC& aMediaSubtypeName );
       
   115 
       
   116     private:
       
   117 
       
   118         /**
       
   119          * C++ default constructor.
       
   120          */
       
   121         CWPVoIPCodec();
       
   122 
       
   123         /**
       
   124          * By default Symbian 2nd phase constructor is private.
       
   125          */
       
   126         void ConstructL();
       
   127 
       
   128     public: // Data
       
   129         /** 
       
   130          * Existence of the data member value is dependent on the type of the 
       
   131          * particular codec. The following table describes the codecs 
       
   132          * parameter  by parameter. See further description on VoIP software 
       
   133          * settings document.
       
   134          *
       
   135          * Table legend:
       
   136          * X: there must be a value.
       
   137          * D: there is a default value (VoIP software settings document).
       
   138          * -: there is no value at all.
       
   139          * +: the value is optional.
       
   140          *
       
   141          * Codecs: (same values as in enum TVoIPCodec)
       
   142          *         0: AMR-NB
       
   143          *         1: iLBC
       
   144          *         2: VMR-WB
       
   145          *         3: G.711 A-law
       
   146          *         4: G.711 µ-law
       
   147          *         5: G726-40
       
   148          *         6: G726-32
       
   149          *         7: G726-24
       
   150          *         8: G726-16
       
   151          *         9: CN
       
   152          *        10: G.729B
       
   153          *        11: AMR-WB
       
   154          *        12: GSM-EFR
       
   155          *        13: GSM-FR
       
   156          *        14: EVRC
       
   157          *        15: EVRC0
       
   158          *        16: SMV
       
   159          *        17: SMV0
       
   160          *
       
   161          * Codec                             0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 16 17
       
   162          * VoIP codec id.                    X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
       
   163          * Media type name.                  XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD
       
   164          * Media subtype name.               XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD XD
       
   165          * Jitter buffer size.               +D +D +D +D +D -  -  -  -  +D +D +D -  -  +D +D +D +D
       
   166          * octet-align.                      +D -  +D +D +D -  -  -  -  -  -  +  -  -  -  -  -  -
       
   167          * Mode-set.                         +  +  +  -  -  -  -  -  -  -  -  +  -  -  -  -  -  - 
       
   168          * Mode-change-period.               +  -  -  -  -  -  -  -  -  -  -  +D -  -  +D -  -  -
       
   169          * Mode-change-neighbor.             +D -  -  -  -  -  -  -  -  -  -  +D -  -  -  -  -  -
       
   170          * Ptime.                            +D +D +  +D +D -  -  -  -  -  +  +D -  -  +  +  +  -
       
   171          * Maxptime.                         +D +D +  +D +D -  -  -  -  -  +  +D -  -  +D +  +  -
       
   172          * Crc.                              +  -  -  -  -  -  -  -  -  -  -  +  -  -  -  -  -  -
       
   173          * Robust-sorting.                   +  -  -  -  -  -  -  -  -  -  -  +  -  -  -  -  -  -
       
   174          * Interleaving.                     +  -  +  -  -  -  -  -  -  -  -  +  -  -  -  -  +D -
       
   175          * Channels.                         +D -  +  -  -  -  -  -  -  -  -  +D -  -  -  -  -  -
       
   176          * Voice Activation Detection (VAD). +  -  -  +D +D -  -  -  -  -  -  +  -  -  -  -  -  -
       
   177          * Discontinuous transmission (DTX). +  -  +D -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
       
   178          * Sampling rate.                    -  -  +D +D -  -  -  -  -  -  -  -  -  -  -  -  -  +D
       
   179          * Annex b.                          -  -  -  -  -  -  -  -  -  +D -  -  -  -  -  -  -  -
       
   180          * Max-red                           -  -  -  -  -  -  -  -  -  -  -  +D -  -  -  -  -  -
       
   181          */
       
   182 
       
   183         /*
       
   184          * VoIP codec id.
       
   185          */
       
   186         TUint iId;
       
   187 
       
   188         /*
       
   189          * Media type name.
       
   190          * Own.
       
   191          */
       
   192         HBufC* iMediaTypeName;
       
   193 
       
   194         /*
       
   195          * Media subtype name.
       
   196          * Own.
       
   197          */
       
   198         HBufC* iMediaSubtypeName;
       
   199 
       
   200         /*
       
   201          * PriorityIndex by which the codecs of the VoIP profile are ordered.
       
   202          */
       
   203         TInt32 iPriorityIndex;
       
   204 
       
   205         /*
       
   206          * Jitter buffer size.
       
   207          */
       
   208         TInt32 iJitterBufferSize;
       
   209 
       
   210         /*
       
   211          * octet-align.
       
   212          */
       
   213         TInt32 iOctetAlign;
       
   214 
       
   215         /*
       
   216          * Mode-set.
       
   217          * Own.
       
   218          */
       
   219         RArray<TInt32> iModeSet;
       
   220 
       
   221         /*
       
   222          * Mode-change-period.
       
   223          */
       
   224         TInt32 iModeChangePeriod;
       
   225 
       
   226         /*
       
   227          * Mode-change-neighbor.
       
   228          */
       
   229         TInt32 iModeChangeNeighbor;
       
   230 
       
   231         /*
       
   232          * Ptime.
       
   233          */
       
   234         TInt32 iPTime;
       
   235 
       
   236         /*
       
   237          * Maxptime.
       
   238          */
       
   239         TInt32 iMaxPTime;
       
   240 
       
   241         /*
       
   242          * Crc.
       
   243          */
       
   244         TInt32 iCrc;
       
   245 
       
   246         /*
       
   247          * Robust-sorting.
       
   248          */
       
   249         TInt32 iRobustSorting;
       
   250 
       
   251         /*
       
   252          * Interleaving.
       
   253          */
       
   254         TInt32 iInterLeaving;
       
   255 
       
   256         /*
       
   257          * Channels.
       
   258          * Own.
       
   259          */
       
   260         RArray<TInt32> iChannels;
       
   261 
       
   262         /*
       
   263          * Voice Activation Detection (VAD).
       
   264          */
       
   265         TInt32 iVAD;
       
   266 
       
   267         /*
       
   268          * Discontinuous transmission (DTX).
       
   269          */
       
   270         TInt32 iDTX;
       
   271 
       
   272         /*
       
   273          * Sampling rate.
       
   274          */
       
   275         TInt32 iSamplingRate;
       
   276 
       
   277         /*
       
   278          * Annex b.
       
   279          */
       
   280         TInt iAnnexB;
       
   281 
       
   282         /*
       
   283          * Max-red
       
   284          */
       
   285         TInt32 iMaxRed;
       
   286 
       
   287     };
       
   288 
       
   289 #endif      // CWPVOIPCODEC_H
       
   290 
       
   291 // End of File