multimediacommsengine/mmcecli/src/mcevideocodec.cpp
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 #include "mcevideocodec.h"
       
    22 #include "mcecomvideocodec.h"
       
    23 #include "mcefactory.h"
       
    24 #include "mceevents.h"
       
    25 
       
    26 
       
    27 #define _FLAT_DATA static_cast<CMceComVideoCodec*>( iFlatData )
       
    28 #define FLAT_DATA( data ) _FLAT_DATA->data
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CMceVideoCodec::~CMceVideoCodec
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CMceVideoCodec::~CMceVideoCodec()
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CMceVideoCodec::AllowedFrameRates
       
    43 // -----------------------------------------------------------------------------
       
    44 //	    
       
    45 EXPORT_C TUint CMceVideoCodec::AllowedFrameRates() const
       
    46     {
       
    47     return FLAT_DATA( iAllowedFrameRates );
       
    48     }
       
    49     
       
    50 // -----------------------------------------------------------------------------
       
    51 // CMceVideoCodec::FrameRate
       
    52 // -----------------------------------------------------------------------------
       
    53 //	    
       
    54 EXPORT_C TReal CMceVideoCodec::FrameRate() const
       
    55     {
       
    56     return FLAT_DATA( iFrameRate );
       
    57     }
       
    58 
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // 
       
    62 // -----------------------------------------------------------------------------
       
    63 //	   
       
    64 EXPORT_C TUint CMceVideoCodec::MaxBitRate() const
       
    65     {
       
    66     return FLAT_DATA( iMaxBitRate );
       
    67     }
       
    68 
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // 
       
    72 // -----------------------------------------------------------------------------
       
    73 //		
       
    74 EXPORT_C TUint CMceVideoCodec::AllowedResolutions() const
       
    75     {
       
    76     return FLAT_DATA( iAllowedResolutions );
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // 
       
    81 // -----------------------------------------------------------------------------
       
    82 //	    
       
    83 EXPORT_C TSize CMceVideoCodec::Resolution() const
       
    84     {
       
    85     return TSize( FLAT_DATA( iResolutionWidth ), 
       
    86                   FLAT_DATA( iResolutionHeight ) );
       
    87     }
       
    88 // -----------------------------------------------------------------------------
       
    89 // 
       
    90 // -----------------------------------------------------------------------------
       
    91 //    
       
    92 EXPORT_C HBufC8* CMceVideoCodec::ConfigKeyL() const
       
    93     {
       
    94     HBufC8* configKey = NULL;
       
    95     if ( FLAT_DATA( iConfigKey ) )
       
    96         {
       
    97         configKey = FLAT_DATA( iConfigKey )->AllocL();
       
    98         }
       
    99     return configKey;
       
   100     
       
   101     } 
       
   102     
       
   103 // -----------------------------------------------------------------------------
       
   104 // CMceVideoCodec::Factory
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 TMceVideoCodecFactory CMceVideoCodec::Factory()
       
   108     {
       
   109     return TMceVideoCodecFactory();
       
   110     }
       
   111  
       
   112 // -----------------------------------------------------------------------------
       
   113 // CMceVideoCodec::ComparePreferences
       
   114 // -----------------------------------------------------------------------------
       
   115 //  
       
   116 TInt CMceVideoCodec::ComparePreferences( const CMceVideoCodec& aIndex1, 
       
   117                                          const CMceVideoCodec& aIndex2 )
       
   118     {
       
   119     if ( aIndex1.Preference() >= aIndex2.Preference() )
       
   120         {
       
   121         return (1);
       
   122         }
       
   123     else if ( aIndex1.Preference() < aIndex2.Preference() )
       
   124         {
       
   125         return (-1);
       
   126         }
       
   127     else
       
   128         {
       
   129         return (0);
       
   130         }
       
   131     }
       
   132                                                  
       
   133 // -----------------------------------------------------------------------------
       
   134 // CMceVideoCodec::CMceVideoCodec
       
   135 // -----------------------------------------------------------------------------
       
   136 //
       
   137 CMceVideoCodec::CMceVideoCodec()
       
   138     {
       
   139     iType = KMceVideoCodec;
       
   140     }
       
   141 
       
   142 // -----------------------------------------------------------------------------
       
   143 // CMceVideoCodec::ConstructL
       
   144 // -----------------------------------------------------------------------------
       
   145 //
       
   146 void CMceVideoCodec::ConstructL( CMceComVideoCodec* aFlatData )
       
   147     {
       
   148     CMceCodec::ConstructL( aFlatData );
       
   149     }
       
   150