mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceh263codec.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2006 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 "mceh263codec.h"
       
    20 
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // CMceH263Codec::~CMceH263Codec
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C CMceH263Codec::~CMceH263Codec()
       
    29     {
       
    30     }
       
    31 
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CMceH263Codec::NewL
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 EXPORT_C CMceH263Codec* CMceH263Codec::NewL( TBuf8<KMceMaxSdpNameLength> aSdpName )
       
    38     {
       
    39     CMceH263Codec* self = NewLC( aSdpName );
       
    40     CleanupStack::Pop( self );
       
    41     return self;
       
    42     }
       
    43 
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CMceH263Codec::NewL
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 EXPORT_C CMceH263Codec* CMceH263Codec::NewLC( TBuf8<KMceMaxSdpNameLength> aSdpName )
       
    50     {
       
    51     CMceH263Codec* self = new (ELeave) CMceH263Codec();
       
    52     CleanupStack::PushL( self );
       
    53     self->ConstructL( aSdpName );
       
    54     return self;
       
    55     }
       
    56 
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CMceH263Codec::SetBitrate
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C TInt CMceH263Codec::SetBitrate(TUint aBitrate)
       
    63     {
       
    64     iBitrate = aBitrate;
       
    65     return KErrNone;
       
    66     }
       
    67 
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CMceH263Codec::SetAllowedBitrates
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C TInt CMceH263Codec::SetAllowedBitrates(TUint aBitrates)
       
    74     {
       
    75     iAllowedBitrates = aBitrates;
       
    76     return KErrNone;
       
    77     }
       
    78 
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CMceH263Codec::SetCodecMode
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 EXPORT_C TInt CMceH263Codec::SetCodecMode(TUint aCodecMode)
       
    85     {
       
    86     iCodecMode = aCodecMode;
       
    87     return KErrNone;
       
    88     }
       
    89 
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CMceH263Codec::SetPayloadType
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 EXPORT_C TInt CMceH263Codec::SetPayloadType(TUint8 aPayloadType)
       
    96     {
       
    97     iPayloadType = aPayloadType;
       
    98     return KErrNone;
       
    99     }        
       
   100 
       
   101     
       
   102 // -----------------------------------------------------------------------------
       
   103 // CMceH263Codec::CloneL
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 EXPORT_C CMceVideoCodec* CMceH263Codec::CloneL() const
       
   107     {
       
   108     CMceH263Codec* clone = CMceH263Codec::NewLC( iSdpName );
       
   109    
       
   110 	if ( iFmtpAttr )
       
   111 	    {
       
   112         clone->iFmtpAttr = iFmtpAttr->AllocL();
       
   113         }
       
   114     clone->iPayloadType = iPayloadType;
       
   115     
       
   116 	clone->iBitrate = iBitrate;
       
   117 	clone->iAllowedBitrates = iAllowedBitrates;
       
   118     clone->iCodecMode = iCodecMode;
       
   119 	clone->iFourCC = iFourCC;
       
   120 	clone->iFrameSize = iFrameSize;
       
   121 	
       
   122 	clone->iFrameRate = iFrameRate;
       
   123 	clone->iMaxBitRate = iMaxBitRate;	
       
   124 	clone->iAllowedResolutions = iAllowedResolutions;	
       
   125 	clone->iResolutionWidth = iResolutionWidth;	
       
   126 	clone->iResolutionHeight = iResolutionHeight;	
       
   127 	clone->iAllowedFrameRates = iAllowedFrameRates;	
       
   128 	clone->iClockRate = iClockRate;	
       
   129 	
       
   130 	CleanupStack::Pop( clone );
       
   131     return clone;
       
   132     }
       
   133 
       
   134 
       
   135 // -----------------------------------------------------------------------------
       
   136 // CMceH263Codec::
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 EXPORT_C void CMceH263Codec::SetMaxBitrateL( TUint aMaxBitrate )
       
   140     {
       
   141     iMaxBitRate = aMaxBitrate;
       
   142     }
       
   143 
       
   144 
       
   145 // -----------------------------------------------------------------------------
       
   146 // CMceH263Codec::
       
   147 // -----------------------------------------------------------------------------
       
   148 //
       
   149 EXPORT_C void CMceH263Codec::SetAllowedResolutionsL( TUint aResolutions )
       
   150     {
       
   151     iAllowedResolutions = aResolutions;
       
   152     }
       
   153 
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CMceH263Codec::
       
   157 // -----------------------------------------------------------------------------
       
   158 //
       
   159 EXPORT_C void CMceH263Codec::SetResolutionL( TSize aResolution )
       
   160     {
       
   161     iResolutionWidth = aResolution.iWidth;
       
   162     iResolutionHeight = aResolution.iHeight;
       
   163     }
       
   164 
       
   165 
       
   166 // -----------------------------------------------------------------------------
       
   167 // CMceH263Codec::
       
   168 // -----------------------------------------------------------------------------
       
   169 //
       
   170 EXPORT_C void CMceH263Codec::SetAllowedFrameRatesL( TUint aFrameRates )
       
   171     {
       
   172     iAllowedFrameRates = aFrameRates;
       
   173     }
       
   174 
       
   175 
       
   176 // -----------------------------------------------------------------------------
       
   177 // CMceH263Codec::
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 EXPORT_C void CMceH263Codec::SetFrameRateL( TReal aFrameRate )
       
   181     {
       
   182     iFrameRate = aFrameRate;
       
   183     }
       
   184 
       
   185 
       
   186 // -----------------------------------------------------------------------------
       
   187 // CMceH263Codec::SetPreferredEncodingDecodingDeviceL
       
   188 // -----------------------------------------------------------------------------
       
   189 //
       
   190 EXPORT_C void CMceH263Codec::SetPreferredEncodingDecodingDeviceL( 
       
   191     TUid /*aEncodingDecodingDevice*/ )
       
   192     {
       
   193     User::Leave( KErrNotSupported );
       
   194     }
       
   195 
       
   196 
       
   197 // -----------------------------------------------------------------------------
       
   198 // CMceH263Codec::SetConfigKeyL
       
   199 // -----------------------------------------------------------------------------
       
   200 //        
       
   201 EXPORT_C void CMceH263Codec::SetConfigKeyL( const TDesC8& /*aConfigKey*/ )
       
   202     {
       
   203     User::Leave( KErrNotSupported );
       
   204     }
       
   205 
       
   206 
       
   207 // -----------------------------------------------------------------------------
       
   208 // CMceH263Codec::SetSdpNameL
       
   209 // -----------------------------------------------------------------------------
       
   210 //
       
   211 void CMceH263Codec::SetSdpNameL( const TDesC8& aSdpName )
       
   212     {
       
   213     __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, 
       
   214                      User::Leave( KErrArgument ) );
       
   215     iSdpName.Copy( aSdpName );
       
   216     }
       
   217 
       
   218 
       
   219 // -----------------------------------------------------------------------------
       
   220 // CMceH263Codec::CMceH263Codec
       
   221 // -----------------------------------------------------------------------------
       
   222 //
       
   223 CMceH263Codec::CMceH263Codec()
       
   224     :CMceVideoCodec()
       
   225     {
       
   226     }
       
   227 
       
   228 
       
   229 // -----------------------------------------------------------------------------
       
   230 // CMceH263Codec::ConstructL
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233 void CMceH263Codec::ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName )
       
   234     {
       
   235     iSdpName = aSdpName;
       
   236     iClockRate = KMceH263ClockRate;
       
   237     iFrameRate = KMceH263FrameRate;
       
   238     iResolutionWidth = KMceH263FrameWidth;
       
   239     iResolutionHeight = KMceH263FrameHeight;
       
   240     }
       
   241 
       
   242 
       
   243 
       
   244