mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcevideocodec.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     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 #include "mcevideocodec.h"
       
    20 
       
    21 // Avc config keys for all the .
       
    22 // Getter is not virtual so keys must be returned from base class and
       
    23 // the level values defined in mceavccodec.h are redefined.
       
    24 _LIT8( KMceStubAvcBitrateLevel1ConfigKey, "TestTextForAvcBrL1Level" );
       
    25 _LIT8( KMceStubAvcBitrateLevel1bConfigKey, "TestTextForAvcBrL1bLevel" );
       
    26 _LIT8( KMceStubAvcBitrateLevel1_1ConfigKey, "TestTextForAvcBrL1_1Level" );
       
    27 _LIT8( KMceStubAvcBitrateLevel1_2ConfigKey, "TestTextForAvcBrL1_2Level" );
       
    28 _LIT8( KMceStubAvcBitrateLevel1_3ConfigKey, "TestTextForAvcBrL1_3Level" );
       
    29 _LIT8( KMceStubAvcBitrateLevel2ConfigKey, "TestTextForAvcBrL2Level" );
       
    30 const TUint KMceStubAvcBitrateLevel1 = 0x0001;
       
    31 const TUint KMceStubAvcBitrateLevel1b = 0x0002;
       
    32 const TUint KMceStubAvcBitrateLevel1_1 = 0x0004;
       
    33 const TUint KMceStubAvcBitrateLevel1_2 = 0x0008;
       
    34 const TUint KMceStubAvcBitrateLevel1_3 = 0x0010;
       
    35 const TUint KMceStubAvcBitrateLevel2 = 0x0020;
       
    36 
       
    37 // ============================ MEMBER FUNCTIONS ===============================
       
    38 
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // CMceVideoCodec::~CMceVideoCodec
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CMceVideoCodec::~CMceVideoCodec()
       
    45     {
       
    46     delete iConfigKey;
       
    47     }
       
    48 
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CMceVideoCodec::AllowedFrameRates
       
    52 // -----------------------------------------------------------------------------
       
    53 //	    
       
    54 EXPORT_C TUint CMceVideoCodec::AllowedFrameRates() const
       
    55     {
       
    56     return iAllowedFrameRates;
       
    57     }
       
    58 
       
    59     
       
    60 // -----------------------------------------------------------------------------
       
    61 // CMceVideoCodec::FrameRate
       
    62 // -----------------------------------------------------------------------------
       
    63 //	    
       
    64 EXPORT_C TReal CMceVideoCodec::FrameRate() const
       
    65     {
       
    66     return iFrameRate;
       
    67     }
       
    68     
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // 
       
    72 // -----------------------------------------------------------------------------
       
    73 //    
       
    74 EXPORT_C HBufC8* CMceVideoCodec::ConfigKeyL() const
       
    75     {
       
    76     HBufC8* configKey = NULL;
       
    77 
       
    78     if ( iConfigKey )
       
    79         {
       
    80         configKey = iConfigKey->AllocL();
       
    81         }
       
    82 
       
    83     if ( !configKey && SdpName() == KMceSDPNameH264() )
       
    84         {
       
    85         if ( AllowedBitrates() & KMceStubAvcBitrateLevel1 )
       
    86             {
       
    87             configKey = KMceStubAvcBitrateLevel1ConfigKey().AllocL();
       
    88             }
       
    89         else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1b )
       
    90             {
       
    91             configKey = KMceStubAvcBitrateLevel1bConfigKey().AllocL();
       
    92             }
       
    93         else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_1 )
       
    94             {
       
    95             configKey = KMceStubAvcBitrateLevel1_1ConfigKey().AllocL();
       
    96             }
       
    97         else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_2 )
       
    98             {
       
    99             configKey = KMceStubAvcBitrateLevel1_2ConfigKey().AllocL();
       
   100             }
       
   101         else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_3 )
       
   102             {
       
   103             configKey = KMceStubAvcBitrateLevel1_3ConfigKey().AllocL();
       
   104             }
       
   105         else if ( AllowedBitrates() & KMceStubAvcBitrateLevel2 )
       
   106             {
       
   107             configKey = KMceStubAvcBitrateLevel2ConfigKey().AllocL();
       
   108             }
       
   109         else
       
   110             {
       
   111             User::Leave( KErrNotFound );
       
   112             }
       
   113         }
       
   114          
       
   115     return configKey;
       
   116     } 
       
   117 
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // 
       
   121 // -----------------------------------------------------------------------------
       
   122 //	   
       
   123 EXPORT_C TUint CMceVideoCodec::MaxBitRate() const
       
   124     {
       
   125     return iMaxBitRate;
       
   126     }
       
   127 
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // 
       
   131 // -----------------------------------------------------------------------------
       
   132 //		
       
   133 EXPORT_C TUint CMceVideoCodec::AllowedResolutions() const
       
   134     {
       
   135     return iAllowedResolutions;
       
   136     }
       
   137 
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // 
       
   141 // -----------------------------------------------------------------------------
       
   142 //	    
       
   143 EXPORT_C TSize CMceVideoCodec::Resolution() const
       
   144     {
       
   145     return TSize( iResolutionWidth, 
       
   146                   iResolutionHeight );
       
   147     }
       
   148 
       
   149             
       
   150 // -----------------------------------------------------------------------------
       
   151 // CMceVideoCodec::CMceVideoCodec
       
   152 // -----------------------------------------------------------------------------
       
   153 //
       
   154 CMceVideoCodec::CMceVideoCodec()
       
   155     {
       
   156     iType = KMceVideoCodec;
       
   157     }
       
   158