imaging/imagingfws/src/iclextproxystubutil.cpp
changeset 0 5752a19fdefe
equal deleted inserted replaced
-1:000000000000 0:5752a19fdefe
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32base.h>
       
    17 #include "icl/ICL_UIDS.hrh"
       
    18 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    19 #include <icl/icl_uids_const.hrh>
       
    20 #include <icl/icl_uids_def.hrh>
       
    21 #endif
       
    22 #include "ThreadRelay.h"
       
    23 #include "ImageClientMain.h"
       
    24 #include "fwextconstants.h"
       
    25 #include "fwextensionparams.h"
       
    26 
       
    27 // Static utility class
       
    28 CImageConvProxyBase* ProxyStubUtility::GetNewProxyL(TUid aUid, MImageConvExtensionThreadedSupport* aParent)
       
    29 	{
       
    30 	switch(aUid.iUid)
       
    31 		{
       
    32 		case KUidImageConvExtOperationValue:
       
    33 			{
       
    34 			return CImageConvOperationProxy::NewL(aParent);
       
    35 			}
       
    36 		case KUidImageConvExtScalerValue:
       
    37 			{
       
    38 			return CImageConvScalerProxy::NewL(aParent);
       
    39 			}
       
    40 		case KUidImageConvExtStreamedDecodeValue:
       
    41 			{
       
    42 			return CImageConvStreamedDecodeProxy::NewL(aParent);
       
    43 			}
       
    44 		case KUidImageConvExtStreamedEncodeValue:
       
    45 			{
       
    46 			return CImageConvStreamedEncodeProxy::NewL(aParent);
       
    47 			}
       
    48 		case KUidImageConvExtPrepareValue:
       
    49 			{
       
    50 			return CImageConvPrepareProxy::NewL(aParent);
       
    51 			}
       
    52 		default:
       
    53 			{
       
    54 			Panic(EInvalidFwExtensionUid);
       
    55 			}
       
    56 		}
       
    57 	return NULL;
       
    58 	}
       
    59 	
       
    60 CImageConvProxyBase* ProxyStubUtility::GetNewStraightProxyL(TUid aUid, MFrameworkExtAsyncInterface* aStatusOwner,
       
    61 															RThread& aRequestThread)
       
    62 	{
       
    63 	switch(aUid.iUid)
       
    64 		{
       
    65 		case KUidImageConvExtOperationValue:
       
    66 			{
       
    67 			return CImageConvOperationStraightProxy::NewL(aStatusOwner, aRequestThread);
       
    68 			}
       
    69 		case KUidImageConvExtScalerValue:
       
    70 			{
       
    71 			return CImageConvScalerStraightProxy::NewL(aStatusOwner, aRequestThread);
       
    72 			}
       
    73 		case KUidImageConvExtStreamedDecodeValue:
       
    74 			{
       
    75 			return CImageConvStreamedDecodeStraightProxy::NewL(aStatusOwner, aRequestThread);
       
    76 			}
       
    77 		case KUidImageConvExtStreamedEncodeValue:
       
    78 			{
       
    79 			return CImageConvStreamedEncodeStraightProxy::NewL(aStatusOwner, aRequestThread);
       
    80 			}
       
    81 		case KUidImageConvExtPrepareValue:
       
    82 			{
       
    83 			return CImageConvPrepareStraightProxy::NewL(aStatusOwner, aRequestThread);
       
    84 			}
       
    85 		default:
       
    86 			{
       
    87 			Panic(EInvalidFwExtensionUid);
       
    88 			}
       
    89 		}
       
    90 	return NULL;
       
    91 	}
       
    92 
       
    93 CImageConvStubBase* ProxyStubUtility::NewStubL(TUid aUid,
       
    94 											   MImageConvExtension* aExtension,
       
    95 											   MFrameworkExtAsyncInterface* aStatusOwner,
       
    96 											   RThread& aRequestThread)
       
    97 	{
       
    98 	switch(aUid.iUid)
       
    99 		{
       
   100 		case KUidImageConvExtOperationValue:
       
   101 			{
       
   102 			return CImageConvOperationStub::NewL(aExtension, aStatusOwner, aRequestThread);
       
   103 			}
       
   104 		case KUidImageConvExtScalerValue:
       
   105 			{
       
   106 			return CImageConvScalerStub::NewL(aExtension, aStatusOwner, aRequestThread);
       
   107 			}
       
   108 		case KUidImageConvExtStreamedDecodeValue:
       
   109 			{
       
   110 			return CImageConvStreamedDecodeStub::NewL(aExtension, aStatusOwner, aRequestThread);
       
   111 			}
       
   112 		case KUidImageConvExtStreamedEncodeValue:
       
   113 			{
       
   114 			return CImageConvStreamedEncodeStub::NewL(aExtension, aStatusOwner, aRequestThread);
       
   115 			}
       
   116 		case KUidImageConvExtPrepareValue:
       
   117 			{
       
   118 			return CImageConvPrepareStub::NewL(aExtension, aStatusOwner, aRequestThread);
       
   119 			}
       
   120 		default:
       
   121 			{
       
   122 			Panic(EInvalidFwExtensionUid);
       
   123 			}
       
   124 		}
       
   125 	return NULL;
       
   126 	}
       
   127 
       
   128 // Operation straight proxy
       
   129 CImageConvOperationStraightProxy* CImageConvOperationStraightProxy::NewL(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   130 	{
       
   131 	return new (ELeave) CImageConvOperationStraightProxy(aStatusOwner, aRequestThread);
       
   132 	}
       
   133 
       
   134 CImageConvOperationStraightProxy::CImageConvOperationStraightProxy(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   135 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   136 	{
       
   137 	}
       
   138 	
       
   139 CImageConvOperationStraightProxy::~CImageConvOperationStraightProxy()
       
   140 	{
       
   141 	if(iExtension)
       
   142 		{
       
   143 		iExtension->Release();
       
   144 		}
       
   145 	}
       
   146 
       
   147 void CImageConvOperationStraightProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   148 	{
       
   149 	iExtension = static_cast<MImageConvOperation*>(aExtension);
       
   150 	aExtension = this;
       
   151 	}
       
   152 	
       
   153 TUid CImageConvOperationStraightProxy::Uid() const
       
   154 	{
       
   155 	return iExtension->Uid();
       
   156 	}
       
   157 	
       
   158 void CImageConvOperationStraightProxy::IncrementRef()
       
   159 	{
       
   160 	iExtension->IncrementRef();
       
   161 	}
       
   162 	
       
   163 void CImageConvOperationStraightProxy::Release()
       
   164 	{
       
   165 	iExtension->Release();
       
   166 	}
       
   167 	
       
   168 TUint CImageConvOperationStraightProxy::Capabilities() const
       
   169 	{
       
   170 	return iExtension->Capabilities();
       
   171 	}
       
   172 	
       
   173 void CImageConvOperationStraightProxy::AddOperationL(TImageConvOperation::TOperation aOperation)
       
   174 	{
       
   175 	iExtension->AddOperationL(aOperation);
       
   176 	}
       
   177 	
       
   178 void CImageConvOperationStraightProxy::ClearOperationStack()
       
   179 	{
       
   180 	iExtension->ClearOperationStack();
       
   181 	}
       
   182 
       
   183 // Operation proxy
       
   184 CImageConvOperationProxy* CImageConvOperationProxy::NewL(MImageConvExtensionThreadedSupport* aParent)
       
   185 	{
       
   186 	return new (ELeave) CImageConvOperationProxy(aParent);
       
   187 	}
       
   188 	
       
   189 CImageConvOperationProxy::CImageConvOperationProxy(MImageConvExtensionThreadedSupport* aParent)
       
   190 :iParent(aParent)
       
   191 	{
       
   192 	}
       
   193 
       
   194 void CImageConvOperationProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   195 	{
       
   196 	aExtension = this;
       
   197 	}
       
   198 
       
   199 TUid CImageConvOperationProxy::Uid() const
       
   200 	{
       
   201 	TUidExecCmdParams uid(KICLOperationUid, EImgConvExtUid);
       
   202 	iParent->ExecuteCommand(uid);
       
   203 	return uid.iReturn;
       
   204 	}
       
   205 	
       
   206 void CImageConvOperationProxy::IncrementRef()
       
   207 	{
       
   208 	ASSERT(EFalse);
       
   209 	}
       
   210 	
       
   211 void CImageConvOperationProxy::Release()
       
   212 	{
       
   213 	ASSERT(EFalse);
       
   214 	}
       
   215 	
       
   216 TUint CImageConvOperationProxy::Capabilities() const
       
   217 	{
       
   218 	TCapabilitiesExecCmdParams capabilities(KICLOperationUid, EImgConvExtCapabilities);
       
   219 	iParent->ExecuteCommand(capabilities);
       
   220 	return capabilities.iReturn;
       
   221 	}
       
   222 	
       
   223 void CImageConvOperationProxy::AddOperationL(TImageConvOperation::TOperation aOperation)
       
   224 	{
       
   225 	TAddOperationLExecCmdParams addOperationL(KICLOperationUid, EImgConvExtAddOperationL, aOperation);
       
   226 	iParent->ExecuteCommandL(addOperationL);
       
   227 	}
       
   228 	
       
   229 void CImageConvOperationProxy::ClearOperationStack()
       
   230 	{
       
   231 	TClearOperationStackExecCmdParams clearOperationStack(KICLOperationUid, EImgConvExtClearOperationStack);
       
   232 	iParent->ExecuteCommand(clearOperationStack);
       
   233 	}
       
   234 
       
   235 // Operation stub
       
   236 CImageConvOperationStub* CImageConvOperationStub::NewL(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   237 	{
       
   238 	return new (ELeave) CImageConvOperationStub(aExtension, aStatusOwner, aRequestThread);
       
   239 	}
       
   240 
       
   241 CImageConvOperationStub::CImageConvOperationStub(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   242 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   243 	{
       
   244 	iExtension = static_cast<MImageConvOperation*>(aExtension);
       
   245 	}	
       
   246 
       
   247 CImageConvOperationStub::~CImageConvOperationStub()
       
   248 	{
       
   249 	if(iExtension)
       
   250 		{
       
   251 		iExtension->Release();
       
   252 		}
       
   253 	}
       
   254 	
       
   255 TUid CImageConvOperationStub::Uid() const
       
   256 	{
       
   257 	return iExtension->Uid();
       
   258 	}
       
   259 	
       
   260 void CImageConvOperationStub::HandleExecuteCommandL(TExecuteCommandParamsBase& aExecuteCommandBase)
       
   261 	{
       
   262 	switch(aExecuteCommandBase.iCmdNum)
       
   263 		{
       
   264 		case EImgConvExtUid:
       
   265 			{
       
   266 			// cast to appropriate extension TClass
       
   267 			TUidExecCmdParams* uid = static_cast<TUidExecCmdParams*>(&aExecuteCommandBase);
       
   268 			uid->iReturn = iExtension->Uid();
       
   269 			break;
       
   270 			}
       
   271 		case EImgConvExtIncrementRef:
       
   272 			{
       
   273 			iExtension->IncrementRef();
       
   274 			break;
       
   275 			}
       
   276 		case EImgConvExtRelease:
       
   277 			{
       
   278 			iExtension->Release();
       
   279 			break;
       
   280 			}
       
   281 		case EImgConvExtCapabilities:
       
   282 			{
       
   283 			TCapabilitiesExecCmdParams* capabilities = static_cast<TCapabilitiesExecCmdParams*>(&aExecuteCommandBase);
       
   284 			capabilities->iReturn = iExtension->Capabilities();
       
   285 			break;
       
   286 			}
       
   287 		case EImgConvExtAddOperationL:
       
   288 			{
       
   289 			TAddOperationLExecCmdParams* addOperationL = static_cast<TAddOperationLExecCmdParams*>(&aExecuteCommandBase);
       
   290 			iExtension->AddOperationL(addOperationL->iOperation);
       
   291 			break;
       
   292 			}
       
   293 		case EImgConvExtClearOperationStack:
       
   294 			{
       
   295 			iExtension->ClearOperationStack();
       
   296 			break;
       
   297 			}
       
   298 		default:
       
   299 			{
       
   300 			Panic(EInvalidFwExtensionCall);
       
   301 			}
       
   302 		}
       
   303 	}
       
   304 	
       
   305 void CImageConvOperationStub::HandleExecuteAsyncCommand(TExecuteCommandParamsAsyncBase& /*aExecuteCommandBase*/)
       
   306 	{
       
   307 	// No async calls for transform
       
   308 	}
       
   309 
       
   310 // Straight scaler proxy
       
   311 CImageConvScalerStraightProxy* CImageConvScalerStraightProxy::NewL(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   312 	{
       
   313 	return new (ELeave) CImageConvScalerStraightProxy(aStatusOwner, aRequestThread);
       
   314 	}
       
   315 	
       
   316 CImageConvScalerStraightProxy::CImageConvScalerStraightProxy(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   317 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   318 	{
       
   319 	}
       
   320 	
       
   321 CImageConvScalerStraightProxy::~CImageConvScalerStraightProxy()
       
   322 	{
       
   323 	if(iExtension)
       
   324 		{
       
   325 		iExtension->Release();
       
   326 		}
       
   327 	}
       
   328 	
       
   329 void CImageConvScalerStraightProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   330 	{
       
   331 	iExtension = static_cast<MImageConvScaler*>(aExtension);
       
   332 	aExtension = this;
       
   333 	}
       
   334 	
       
   335 TUid CImageConvScalerStraightProxy::Uid() const
       
   336 	{
       
   337 	return iExtension->Uid();
       
   338 	}
       
   339 	
       
   340 void CImageConvScalerStraightProxy::IncrementRef()
       
   341 	{
       
   342 	iExtension->IncrementRef();
       
   343 	}
       
   344 	
       
   345 void CImageConvScalerStraightProxy::Release()
       
   346 	{
       
   347 	iExtension->Release();
       
   348 	}
       
   349 	
       
   350 void CImageConvScalerStraightProxy::GetCapabilities(TScalerCaps& aCaps) const
       
   351 	{
       
   352 	iExtension->GetCapabilities(aCaps);
       
   353 	}
       
   354 
       
   355 void CImageConvScalerStraightProxy::SetScalingL(const TSize& aDesiredSize, TImageConvScaler::TScalerQuality aQuality, TBool aLockAspectRatio)
       
   356 	{
       
   357 	iExtension->SetScalingL(aDesiredSize, aQuality, aLockAspectRatio);
       
   358 	}
       
   359 	
       
   360 void CImageConvScalerStraightProxy::SetScalingL(TInt aScalingCoeff, TImageConvScaler::TScalerQuality aScalingQuality)
       
   361 	{
       
   362 	iExtension->SetScalingL(aScalingCoeff, aScalingQuality);
       
   363 	}
       
   364 
       
   365 // Scaler proxy
       
   366 CImageConvScalerProxy* CImageConvScalerProxy::NewL(MImageConvExtensionThreadedSupport* aParent)
       
   367 	{
       
   368 	return new (ELeave) CImageConvScalerProxy(aParent);
       
   369 	}
       
   370 
       
   371 CImageConvScalerProxy::CImageConvScalerProxy(MImageConvExtensionThreadedSupport* aParent)
       
   372 :iParent(aParent)
       
   373 	{
       
   374 	}
       
   375 	
       
   376 void CImageConvScalerProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   377 	{
       
   378 	aExtension = this;
       
   379 	}
       
   380 
       
   381 TUid CImageConvScalerProxy::Uid() const
       
   382 	{
       
   383 	TUidExecCmdParams uid(KICLScalerUid, EImgConvExtUid);
       
   384 	iParent->ExecuteCommand(uid);
       
   385 	return uid.iReturn;
       
   386 	}
       
   387 	
       
   388 void CImageConvScalerProxy::IncrementRef()
       
   389 	{
       
   390 	ASSERT(EFalse);
       
   391 	}
       
   392 	
       
   393 void CImageConvScalerProxy::Release()
       
   394 	{
       
   395 	ASSERT(EFalse);
       
   396 	}
       
   397 
       
   398 void CImageConvScalerProxy::GetCapabilities(TScalerCaps& aCaps) const
       
   399 	{
       
   400 	TGetCapabilitiesScalerExecCmdParams scalerCaps(KICLScalerUid, EImgConvExtGetCapabilitiesScaler, aCaps);
       
   401 	iParent->ExecuteCommand(scalerCaps);
       
   402 	}
       
   403 	
       
   404 void CImageConvScalerProxy::SetScalingL(const TSize& aDesiredSize, TImageConvScaler::TScalerQuality aQuality, TBool aLockAspectRatio)
       
   405 	{
       
   406 	TSetScalingLSizeExecCmdParams setScalingL(KICLScalerUid, EImgConvExtSetScalingLSize, aDesiredSize, aQuality, aLockAspectRatio);
       
   407 	iParent->ExecuteCommandL(setScalingL);
       
   408 	}
       
   409 
       
   410 void CImageConvScalerProxy::SetScalingL(TInt aScalingCoeff, TImageConvScaler::TScalerQuality aScalingQuality)
       
   411 	{
       
   412 	TSetScalingLCoeffExecCmdParams setScaling(KICLScalerUid, EImgConvExtSetScalingLCoeff, aScalingCoeff, aScalingQuality);
       
   413 	iParent->ExecuteCommandL(setScaling);
       
   414 	}
       
   415 	
       
   416 // Scaler stub
       
   417 CImageConvScalerStub* CImageConvScalerStub::NewL(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   418 	{
       
   419 	return new (ELeave) CImageConvScalerStub(aExtension, aStatusOwner, aRequestThread);
       
   420 	}
       
   421 
       
   422 CImageConvScalerStub::CImageConvScalerStub(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   423 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   424 	{
       
   425 	iExtension = static_cast<MImageConvScaler*>(aExtension);
       
   426 	}
       
   427 
       
   428 CImageConvScalerStub::~CImageConvScalerStub()
       
   429 	{
       
   430 	if(iExtension)
       
   431 		{
       
   432 		iExtension->Release();
       
   433 		}
       
   434 	}
       
   435 	
       
   436 TUid CImageConvScalerStub::Uid() const
       
   437 	{
       
   438 	return iExtension->Uid();
       
   439 	}	
       
   440 	
       
   441 void CImageConvScalerStub::HandleExecuteCommandL(TExecuteCommandParamsBase& aExecuteCommandBase)
       
   442 	{
       
   443 	switch(aExecuteCommandBase.iCmdNum)
       
   444 		{
       
   445 		case EImgConvExtUid:
       
   446 			{
       
   447 			// cast to appropriate extension TClass
       
   448 			TUidExecCmdParams* uid = static_cast<TUidExecCmdParams*>(&aExecuteCommandBase);
       
   449 			uid->iReturn = iExtension->Uid();
       
   450 			break;
       
   451 			}
       
   452 		case EImgConvExtIncrementRef:
       
   453 			{
       
   454 			iExtension->IncrementRef();
       
   455 			break;
       
   456 			}
       
   457 		case EImgConvExtRelease:
       
   458 			{
       
   459 			iExtension->Release();
       
   460 			break;
       
   461 			}
       
   462 		case EImgConvExtGetCapabilitiesScaler:
       
   463 			{
       
   464 			TGetCapabilitiesScalerExecCmdParams* scalerCaps = static_cast<TGetCapabilitiesScalerExecCmdParams*>(&aExecuteCommandBase);
       
   465 			iExtension->GetCapabilities(*scalerCaps->iCaps);
       
   466 			break;
       
   467 			}
       
   468 		case EImgConvExtSetScalingLSize:
       
   469 			{
       
   470 			TSetScalingLSizeExecCmdParams* setScalingLSize = static_cast<TSetScalingLSizeExecCmdParams*>(&aExecuteCommandBase);
       
   471 			iExtension->SetScalingL(*setScalingLSize->iDesiredSize, setScalingLSize->iQuality, setScalingLSize->iLockAspectRatio);
       
   472 			break;
       
   473 			}
       
   474 		case EImgConvExtSetScalingLCoeff:
       
   475 			{
       
   476 			TSetScalingLCoeffExecCmdParams* setScalingLCoeff = static_cast<TSetScalingLCoeffExecCmdParams*>(&aExecuteCommandBase);
       
   477 			iExtension->SetScalingL(setScalingLCoeff->iScalingCoeff, setScalingLCoeff->iScalingQuality);
       
   478 			break;
       
   479 			}
       
   480 		default:
       
   481 			{
       
   482 			Panic(EInvalidFwExtensionCall);
       
   483 			}
       
   484 		}
       
   485 	}
       
   486 	
       
   487 void CImageConvScalerStub::HandleExecuteAsyncCommand(TExecuteCommandParamsAsyncBase& /*aExecuteCommandBase*/)
       
   488 	{
       
   489 	// No async calls for scaler
       
   490 	}
       
   491 
       
   492 // Streamed decode straight proxy
       
   493 CImageConvStreamedDecodeStraightProxy* CImageConvStreamedDecodeStraightProxy::NewL(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   494 	{
       
   495 	return new (ELeave) CImageConvStreamedDecodeStraightProxy(aStatusOwner, aRequestThread);
       
   496 	}
       
   497 	
       
   498 CImageConvStreamedDecodeStraightProxy::CImageConvStreamedDecodeStraightProxy(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   499 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   500 	{
       
   501 	}
       
   502 
       
   503 CImageConvStreamedDecodeStraightProxy::~CImageConvStreamedDecodeStraightProxy()
       
   504 	{
       
   505 	if(iExtension)
       
   506 		{
       
   507 		iExtension->Release();
       
   508 		}
       
   509 	}
       
   510 	
       
   511 void CImageConvStreamedDecodeStraightProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   512 	{
       
   513 	iExtension = static_cast<MImageConvStreamedDecode*>(aExtension);
       
   514 	aExtension = this;
       
   515 	}
       
   516 	
       
   517 TUid CImageConvStreamedDecodeStraightProxy::Uid() const
       
   518 	{
       
   519 	return iExtension->Uid();
       
   520 	}
       
   521 	
       
   522 void CImageConvStreamedDecodeStraightProxy::IncrementRef()
       
   523 	{
       
   524 	iExtension->IncrementRef();
       
   525 	}
       
   526 	
       
   527 void CImageConvStreamedDecodeStraightProxy::Release()
       
   528 	{
       
   529 	iExtension->Release();
       
   530 	}
       
   531 	
       
   532 void CImageConvStreamedDecodeStraightProxy::GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const
       
   533 	{
       
   534 	iExtension->GetSupportedFormatsL(aFormats, aOptimalFormat);
       
   535 	}
       
   536 
       
   537 void CImageConvStreamedDecodeStraightProxy::GetCapabilities(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps& aCaps) const
       
   538 	{
       
   539 	iExtension->GetCapabilities(aFormat, aFrameNumber, aCaps);
       
   540 	}
       
   541 
       
   542 TInt CImageConvStreamedDecodeStraightProxy::GetBufferSize(TUid aFormat, TSize& aBlockSizeInPixels, TInt aNumBlocks) const
       
   543 	{
       
   544 	return iExtension->GetBufferSize(aFormat, aBlockSizeInPixels, aNumBlocks);
       
   545 	}
       
   546 
       
   547 void CImageConvStreamedDecodeStraightProxy::InitFrameL(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps::TNavigation aNavigation)
       
   548 	{
       
   549 	iExtension->InitFrameL(aFormat, aFrameNumber, aNavigation);
       
   550 	}
       
   551 
       
   552 void CImageConvStreamedDecodeStraightProxy::GetBlocks(TRequestStatus* aStatus, CImageFrame* aFrame, TInt aSeqPosition, TInt aNumBlocksToGet, TInt* aNumBlocksRead)
       
   553 	{
       
   554 	iStatusOwner->RegisterClientRequestStatus(*iThread, aStatus);
       
   555 	iExtension->GetBlocks(NULL, aFrame, aSeqPosition, aNumBlocksToGet, aNumBlocksRead);
       
   556 	if(*aStatus == KRequestPending)
       
   557 		{
       
   558 		iStatusOwner->StartActivity();
       
   559 		}
       
   560 	}
       
   561 	
       
   562 void CImageConvStreamedDecodeStraightProxy::GetNextBlocks(TRequestStatus* aStatus, CImageFrame* aFrame, TInt aNumBlocksToGet, TInt* aNumBlocksRead, TBool* aHaveMoreBlocks)
       
   563 	{
       
   564 	iStatusOwner->RegisterClientRequestStatus(*iThread, aStatus);
       
   565 	iExtension->GetNextBlocks(NULL, aFrame, aNumBlocksToGet, aNumBlocksRead, aHaveMoreBlocks);
       
   566 	if(*aStatus == KRequestPending)
       
   567 		{
       
   568 		iStatusOwner->StartActivity();
       
   569 		}
       
   570 	}
       
   571 
       
   572 // Streamed decode proxy
       
   573 CImageConvStreamedDecodeProxy* CImageConvStreamedDecodeProxy::NewL(MImageConvExtensionThreadedSupport* aParent)
       
   574 	{
       
   575 	return new (ELeave) CImageConvStreamedDecodeProxy(aParent);
       
   576 	}
       
   577 
       
   578 CImageConvStreamedDecodeProxy::CImageConvStreamedDecodeProxy(MImageConvExtensionThreadedSupport* aParent)
       
   579 :iParent(aParent)
       
   580 	{
       
   581 	}
       
   582 	
       
   583 void CImageConvStreamedDecodeProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   584 	{
       
   585 	aExtension = this;
       
   586 	}
       
   587 
       
   588 TUid CImageConvStreamedDecodeProxy::Uid() const
       
   589 	{
       
   590 	TUidExecCmdParams uid(KICLStreamedDecodeUid, EImgConvExtUid);
       
   591 	iParent->ExecuteCommand(uid);
       
   592 	return uid.iReturn;
       
   593 	}
       
   594 	
       
   595 void CImageConvStreamedDecodeProxy::IncrementRef()
       
   596 	{
       
   597 	ASSERT(EFalse);
       
   598 	}
       
   599 	
       
   600 void CImageConvStreamedDecodeProxy::Release()
       
   601 	{
       
   602 	ASSERT(EFalse);
       
   603 	}
       
   604 
       
   605 void CImageConvStreamedDecodeProxy::GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const
       
   606 	{
       
   607 	TGetSupportedFormatsLStrDecExecCmdParams supportedFormats(KICLStreamedDecodeUid, EImgConvExtGetSupportedFormatsLStreamDec, aFormats, aOptimalFormat);
       
   608 	iParent->ExecuteCommandL(supportedFormats);
       
   609 	}	
       
   610 
       
   611 void CImageConvStreamedDecodeProxy::GetCapabilities(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps& aCaps) const
       
   612 	{
       
   613 	TGetCapabilitiesStrDecExecCmdParams streamCaps(KICLStreamedDecodeUid, EImgConvExtGetCapabilitiesStreamDec, aFormat, aFrameNumber, aCaps);
       
   614 	iParent->ExecuteCommand(streamCaps);
       
   615 	}
       
   616 
       
   617 TInt CImageConvStreamedDecodeProxy::GetBufferSize(TUid aFormat, TSize& aBlockSizeInPixels, TInt aNumBlocks) const
       
   618 	{
       
   619 	TGetBufferSizeExecCmdParams bufferSize(KICLStreamedDecodeUid, EImgConvExtGetBufferSize, aFormat, aBlockSizeInPixels, aNumBlocks);
       
   620 	iParent->ExecuteCommand(bufferSize);
       
   621 	return bufferSize.iReturn;
       
   622 	}
       
   623 
       
   624 void CImageConvStreamedDecodeProxy::InitFrameL(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps::TNavigation aNavigation)
       
   625 	{
       
   626 	TInitFrameLStrDecExecCmdParams initFrame(KICLStreamedDecodeUid, EImgConvExtInitFrameLStreamDec, aFormat, aFrameNumber, aNavigation);
       
   627 	iParent->ExecuteCommandL(initFrame);
       
   628 	}
       
   629 
       
   630 void CImageConvStreamedDecodeProxy::GetBlocks(TRequestStatus* aStatus, CImageFrame* aFrame, TInt aSeqPosition, TInt aNumBlocksToGet, TInt* aNumBlocksRead)
       
   631 	{
       
   632 	TGetBlocksExecCmdParams getBlocks(KICLStreamedDecodeUid, EImgConvExtGetBlocks, aStatus, aFrame, aSeqPosition, aNumBlocksToGet, aNumBlocksRead);
       
   633 	iParent->ExecuteAsyncCommand(getBlocks);
       
   634 	}
       
   635 
       
   636 void CImageConvStreamedDecodeProxy::GetNextBlocks(TRequestStatus* aStatus, CImageFrame* aFrame, TInt aNumBlocksToGet, TInt* aNumBlocksRead, TBool* aHaveMoreBlocks)
       
   637 	{
       
   638 	TGetNextBlocksExecCmdParams getNextBlocks(KICLStreamedDecodeUid, EImgConvExtGetNextBlocks, aStatus, aFrame, aNumBlocksToGet, aNumBlocksRead, aHaveMoreBlocks);
       
   639 	iParent->ExecuteAsyncCommand(getNextBlocks);
       
   640 	}
       
   641 
       
   642 // Streamed decode stub
       
   643 CImageConvStreamedDecodeStub* CImageConvStreamedDecodeStub::NewL(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   644 	{
       
   645 	return new (ELeave) CImageConvStreamedDecodeStub(aExtension, aStatusOwner, aRequestThread);
       
   646 	}
       
   647 
       
   648 CImageConvStreamedDecodeStub::CImageConvStreamedDecodeStub(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   649 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   650 	{
       
   651 	iExtension = static_cast<MImageConvStreamedDecode*>(aExtension);
       
   652 	}
       
   653 
       
   654 CImageConvStreamedDecodeStub::~CImageConvStreamedDecodeStub()
       
   655 	{
       
   656 	if(iExtension)
       
   657 		{
       
   658 		iExtension->Release();
       
   659 		}
       
   660 	}
       
   661 	
       
   662 TUid CImageConvStreamedDecodeStub::Uid() const
       
   663 	{
       
   664 	return iExtension->Uid();
       
   665 	}		
       
   666 	
       
   667 void CImageConvStreamedDecodeStub::HandleExecuteCommandL(TExecuteCommandParamsBase& aExecuteCommandBase)
       
   668 	{
       
   669 	switch(aExecuteCommandBase.iCmdNum)
       
   670 		{
       
   671 		case EImgConvExtUid:
       
   672 			{
       
   673 			// cast to appropriate extension TClass
       
   674 			TUidExecCmdParams* uid = static_cast<TUidExecCmdParams*>(&aExecuteCommandBase);
       
   675 			uid->iReturn = iExtension->Uid();
       
   676 			break;
       
   677 			}
       
   678 		case EImgConvExtIncrementRef:
       
   679 			{
       
   680 			iExtension->IncrementRef();
       
   681 			break;
       
   682 			}
       
   683 		case EImgConvExtRelease:
       
   684 			{
       
   685 			iExtension->Release();
       
   686 			break;
       
   687 			}
       
   688 		case EImgConvExtGetBufferSize:
       
   689 			{
       
   690 			TGetBufferSizeExecCmdParams* getBufferSize = static_cast<TGetBufferSizeExecCmdParams*>(&aExecuteCommandBase);
       
   691 			getBufferSize->iReturn = iExtension->GetBufferSize(getBufferSize->iFormat, *getBufferSize->iBlockSizeInPixels, getBufferSize->iNumBlocks);
       
   692 			break;
       
   693 			}
       
   694 		case EImgConvExtGetCapabilitiesStreamDec:
       
   695 			{
       
   696 			TGetCapabilitiesStrDecExecCmdParams* getStreamCaps = static_cast<TGetCapabilitiesStrDecExecCmdParams*>(&aExecuteCommandBase);
       
   697 			iExtension->GetCapabilities(getStreamCaps->iFormat, getStreamCaps->iFrameNumber, *getStreamCaps->iCaps);
       
   698 			break;
       
   699 			}
       
   700 		case EImgConvExtGetSupportedFormatsLStreamDec:
       
   701 			{
       
   702 			TGetSupportedFormatsLStrDecExecCmdParams* getSupportedFormats = static_cast<TGetSupportedFormatsLStrDecExecCmdParams*>(&aExecuteCommandBase);
       
   703 			iExtension->GetSupportedFormatsL(*getSupportedFormats->iFormats, *getSupportedFormats->iOptimalFormat);
       
   704 			break;
       
   705 			}
       
   706 		case EImgConvExtInitFrameLStreamDec:
       
   707 			{
       
   708 			TInitFrameLStrDecExecCmdParams* initFrame = static_cast<TInitFrameLStrDecExecCmdParams*>(&aExecuteCommandBase);
       
   709 			iExtension->InitFrameL(initFrame->iFormat, initFrame->iFrameNumber, initFrame->iNavigation);
       
   710 			break;
       
   711 			}
       
   712 		default:
       
   713 			{
       
   714 			Panic(EInvalidFwExtensionCall);
       
   715 			}
       
   716 		}
       
   717 	}
       
   718 	
       
   719 void CImageConvStreamedDecodeStub::HandleExecuteAsyncCommand(TExecuteCommandParamsAsyncBase& aExecuteCommandBase)
       
   720 	{
       
   721 	iStatusOwner->RegisterClientRequestStatus(*iThread, aExecuteCommandBase.iRequestStatus);
       
   722 	
       
   723 	switch(aExecuteCommandBase.iCmdNum)
       
   724 		{
       
   725 		case EImgConvExtGetBlocks:
       
   726 			{
       
   727 			TGetBlocksExecCmdParams* getBlocks = static_cast<TGetBlocksExecCmdParams*>(&aExecuteCommandBase);
       
   728 			iExtension->GetBlocks(NULL,
       
   729 									getBlocks->iFrame,
       
   730 									getBlocks->iSeqPosition, 
       
   731 									getBlocks->iNumBlocksToGet, 
       
   732 									getBlocks->iNumBlocksRead);
       
   733 			break;
       
   734 			}
       
   735 		case EImgConvExtGetNextBlocks:
       
   736 			{		
       
   737 			TGetNextBlocksExecCmdParams* getNextBlocks = static_cast<TGetNextBlocksExecCmdParams*>(&aExecuteCommandBase);
       
   738 			iExtension->GetNextBlocks(NULL,
       
   739 										getNextBlocks->iFrame,
       
   740 										getNextBlocks->iNumBlocksToGet, 
       
   741 										getNextBlocks->iNumBlocksRead,
       
   742 										getNextBlocks->iHaveMoreBlocks);
       
   743 			break;
       
   744 			}
       
   745 		default:
       
   746 			{
       
   747 			Panic(EInvalidFwExtensionCall);
       
   748 			}
       
   749 		}
       
   750 	if(*(aExecuteCommandBase.iRequestStatus) == KRequestPending)
       
   751 		{
       
   752 		iStatusOwner->StartActivity();
       
   753 		}
       
   754 	}
       
   755 
       
   756 // Straight streamed encode proxy
       
   757 CImageConvStreamedEncodeStraightProxy* CImageConvStreamedEncodeStraightProxy::NewL(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   758 	{
       
   759 	return new (ELeave) CImageConvStreamedEncodeStraightProxy(aStatusOwner, aRequestThread);
       
   760 	}
       
   761 
       
   762 CImageConvStreamedEncodeStraightProxy::CImageConvStreamedEncodeStraightProxy(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   763 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   764 	{
       
   765 	}
       
   766 
       
   767 CImageConvStreamedEncodeStraightProxy::~CImageConvStreamedEncodeStraightProxy()
       
   768 	{
       
   769 	if(iExtension)
       
   770 		{
       
   771 		iExtension->Release();
       
   772 		}
       
   773 	}
       
   774 
       
   775 void CImageConvStreamedEncodeStraightProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   776 	{
       
   777 	iExtension = static_cast<MImageConvStreamedEncode*>(aExtension);
       
   778 	aExtension = this;
       
   779 	}
       
   780 
       
   781 TUid CImageConvStreamedEncodeStraightProxy::Uid() const
       
   782 	{
       
   783 	return iExtension->Uid();
       
   784 	}
       
   785 
       
   786 void CImageConvStreamedEncodeStraightProxy::IncrementRef()
       
   787 	{
       
   788 	iExtension->IncrementRef();
       
   789 	}
       
   790 
       
   791 void CImageConvStreamedEncodeStraightProxy::Release()
       
   792 	{
       
   793 	iExtension->Release();
       
   794 	}
       
   795 
       
   796 void CImageConvStreamedEncodeStraightProxy::GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const
       
   797 	{
       
   798 	iExtension->GetSupportedFormatsL(aFormats, aOptimalFormat);
       
   799 	}
       
   800 
       
   801 void CImageConvStreamedEncodeStraightProxy::GetCapabilities(TUid aFormat, TEncodeStreamCaps& aCaps) const
       
   802 	{
       
   803 	iExtension->GetCapabilities(aFormat, aCaps);
       
   804 	}
       
   805 
       
   806 void CImageConvStreamedEncodeStraightProxy::InitFrameL(TUid aFormat, TInt aFrameNumber, const TSize& aFrameSizeInPixels, const TSize& aBlockSizeInPixels, TEncodeStreamCaps::TNavigation aNavigation, const CFrameImageData* aFrameImageData)
       
   807 	{
       
   808 	iExtension->InitFrameL(aFormat, aFrameNumber, aFrameSizeInPixels, aBlockSizeInPixels, aNavigation, aFrameImageData);
       
   809 	}
       
   810 
       
   811 void CImageConvStreamedEncodeStraightProxy::AppendBlocks(TRequestStatus* aStatus, const CImageFrame& aBlocks, TInt aNumBlocksToAdd)
       
   812 	{
       
   813 	iStatusOwner->RegisterClientRequestStatus(*iThread, aStatus);
       
   814 	iExtension->AppendBlocks(NULL, aBlocks, aNumBlocksToAdd);
       
   815 	if(*aStatus == KRequestPending)
       
   816 		{
       
   817 		iStatusOwner->StartActivity();
       
   818 		}
       
   819 	}
       
   820 
       
   821 void CImageConvStreamedEncodeStraightProxy::AddBlocks(TRequestStatus* aStatus, const CImageFrame& aBlocks, const TInt& aSeqPosition)
       
   822 	{
       
   823 	iStatusOwner->RegisterClientRequestStatus(*iThread, aStatus);
       
   824 	iExtension->AddBlocks(NULL, aBlocks, aSeqPosition);
       
   825 	if(*aStatus == KRequestPending)
       
   826 		{
       
   827 		iStatusOwner->StartActivity();
       
   828 		}
       
   829 	}
       
   830 
       
   831 void CImageConvStreamedEncodeStraightProxy::Complete(TRequestStatus* aStatus)
       
   832 	{
       
   833 	iStatusOwner->RegisterClientRequestStatus(*iThread, aStatus);
       
   834 	iExtension->Complete(NULL);
       
   835 	if(*aStatus == KRequestPending)
       
   836 		{
       
   837 		iStatusOwner->StartActivity();
       
   838 		}
       
   839 	}
       
   840 
       
   841 // Streamed encode proxy
       
   842 CImageConvStreamedEncodeProxy* CImageConvStreamedEncodeProxy::NewL(MImageConvExtensionThreadedSupport* aParent)
       
   843 	{
       
   844 	return new (ELeave) CImageConvStreamedEncodeProxy(aParent);	
       
   845 	}
       
   846 
       
   847 CImageConvStreamedEncodeProxy::CImageConvStreamedEncodeProxy(MImageConvExtensionThreadedSupport* aParent)
       
   848 :iParent(aParent)
       
   849 	{
       
   850 	}
       
   851 	
       
   852 void CImageConvStreamedEncodeProxy::SetupExtension(MImageConvExtension*& aExtension)
       
   853 	{
       
   854 	aExtension = this;
       
   855 	}
       
   856 
       
   857 TUid CImageConvStreamedEncodeProxy::Uid() const
       
   858 	{
       
   859 	TUidExecCmdParams uid(KICLStreamedEncodeUid, EImgConvExtUid);
       
   860 	iParent->ExecuteCommand(uid);
       
   861 	return uid.iReturn;
       
   862 	}
       
   863 	
       
   864 void CImageConvStreamedEncodeProxy::IncrementRef()
       
   865 	{
       
   866 	ASSERT(EFalse);
       
   867 	}
       
   868 	
       
   869 void CImageConvStreamedEncodeProxy::Release()
       
   870 	{
       
   871 	ASSERT(EFalse);
       
   872 	}
       
   873 
       
   874 void CImageConvStreamedEncodeProxy::GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const
       
   875 	{
       
   876 	TGetSupportedFormatsLStrEncExecCmdParams supportedFormats(KICLStreamedEncodeUid, EImgConvExtGetSupportedFormatsLStreamEnc, aFormats, aOptimalFormat);
       
   877 	iParent->ExecuteCommandL(supportedFormats);
       
   878 	}
       
   879 
       
   880 void CImageConvStreamedEncodeProxy::GetCapabilities(TUid aFormat, TEncodeStreamCaps& aCaps) const
       
   881 	{
       
   882 	TGetCapabilitiesStrEncExecCmdParams getCapabilities(KICLStreamedEncodeUid, EImgConvExtGetCapabilitiesStreamEnc, aFormat, aCaps);
       
   883 	iParent->ExecuteCommand(getCapabilities);
       
   884 	}
       
   885 
       
   886 void CImageConvStreamedEncodeProxy::InitFrameL(TUid aFormat, TInt aFrameNumber, const TSize& aFrameSizeInPixels, const TSize& aBlockSizeInPixels, TEncodeStreamCaps::TNavigation aNavigation, const CFrameImageData* aFrameImageData)
       
   887 	{
       
   888 	TInitFrameLStrEncExecCmdParams initFrame(KICLStreamedEncodeUid, EImgConvExtInitFrameLStreamEnc, aFormat, aFrameNumber, aFrameSizeInPixels, aBlockSizeInPixels, aNavigation, aFrameImageData);
       
   889 	iParent->ExecuteCommandL(initFrame);
       
   890 	}
       
   891 
       
   892 void CImageConvStreamedEncodeProxy::AppendBlocks(TRequestStatus* aStatus, const CImageFrame& aBlocks, TInt aNumBlocksToAdd)
       
   893 	{
       
   894 	TAppendBlocksExecCmdParams appendBlocks(KICLStreamedEncodeUid, EImgConvExtAppendBlocks, aStatus, aBlocks, aNumBlocksToAdd);
       
   895 	iParent->ExecuteAsyncCommand(appendBlocks);
       
   896 	}
       
   897 
       
   898 void CImageConvStreamedEncodeProxy::AddBlocks(TRequestStatus* aStatus, const CImageFrame& aBlocks, const TInt& aSeqPosition)
       
   899 	{
       
   900 	TAddBlocksExecCmdParams addBlocks(KICLStreamedEncodeUid, EImgConvExtAddBlocks, aStatus, aBlocks, aSeqPosition);
       
   901 	iParent->ExecuteAsyncCommand(addBlocks);
       
   902 	}
       
   903 
       
   904 void CImageConvStreamedEncodeProxy::Complete(TRequestStatus* aStatus)
       
   905 	{
       
   906 	TCompleteExecCmdParams complete(KICLStreamedEncodeUid, EImgConvExtComplete, aStatus);
       
   907 	iParent->ExecuteAsyncCommand(complete);
       
   908 	}
       
   909 
       
   910 // Streamed encode stub
       
   911 CImageConvStreamedEncodeStub* CImageConvStreamedEncodeStub::NewL(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   912 	{
       
   913 	return new (ELeave) CImageConvStreamedEncodeStub(aExtension, aStatusOwner, aRequestThread);
       
   914 	}
       
   915 
       
   916 CImageConvStreamedEncodeStub::CImageConvStreamedEncodeStub(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
   917 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
   918 	{
       
   919 	iExtension = static_cast<MImageConvStreamedEncode*>(aExtension);
       
   920 	}
       
   921 
       
   922 CImageConvStreamedEncodeStub::~CImageConvStreamedEncodeStub()
       
   923 	{
       
   924 	if(iExtension)
       
   925 		{
       
   926 		iExtension->Release();
       
   927 		}
       
   928 	}
       
   929 
       
   930 TUid CImageConvStreamedEncodeStub::Uid() const
       
   931 	{
       
   932 	return iExtension->Uid();	
       
   933 	}
       
   934 
       
   935 void CImageConvStreamedEncodeStub::HandleExecuteCommandL(TExecuteCommandParamsBase& aExecuteCommandBase)
       
   936 	{
       
   937 	switch(aExecuteCommandBase.iCmdNum)
       
   938 		{
       
   939 		case EImgConvExtUid:
       
   940 			{
       
   941 			// cast to appropriate extension TClass
       
   942 			TUidExecCmdParams* uid = static_cast<TUidExecCmdParams*>(&aExecuteCommandBase);
       
   943 			uid->iReturn = iExtension->Uid();
       
   944 			break;
       
   945 			}
       
   946 		case EImgConvExtIncrementRef:
       
   947 			{
       
   948 			iExtension->IncrementRef();
       
   949 			break;
       
   950 			}
       
   951 		case EImgConvExtRelease:
       
   952 			{
       
   953 			iExtension->Release();
       
   954 			break;
       
   955 			}
       
   956 		case EImgConvExtGetSupportedFormatsLStreamEnc:
       
   957 			{
       
   958 			TGetSupportedFormatsLStrEncExecCmdParams* getSupportedFormats = static_cast<TGetSupportedFormatsLStrEncExecCmdParams*>(&aExecuteCommandBase);
       
   959 			iExtension->GetSupportedFormatsL(*getSupportedFormats->iFormats, *getSupportedFormats->iOptimalFormat);
       
   960 			break;
       
   961 			}
       
   962 		case EImgConvExtGetCapabilitiesStreamEnc:
       
   963 			{
       
   964 			TGetCapabilitiesStrEncExecCmdParams* getStreamCaps = static_cast<TGetCapabilitiesStrEncExecCmdParams*>(&aExecuteCommandBase);
       
   965 			iExtension->GetCapabilities(getStreamCaps->iFormat, *getStreamCaps->iCaps);
       
   966 			break;
       
   967 			}
       
   968 		case EImgConvExtInitFrameLStreamEnc:
       
   969 			{
       
   970 			TInitFrameLStrEncExecCmdParams* initFrame = static_cast<TInitFrameLStrEncExecCmdParams*>(&aExecuteCommandBase);
       
   971 			iExtension->InitFrameL(initFrame->iFormat, initFrame->iFrameNumber,
       
   972 									initFrame->iFrameSizeInPixels, initFrame->iBlockSizeInPixels,
       
   973 									initFrame->iNavigation, initFrame->iFrameImageData);
       
   974 			break;
       
   975 			}
       
   976 		default:
       
   977 			{
       
   978 			Panic(EInvalidFwExtensionCall);
       
   979 			}
       
   980 		}	
       
   981 	}
       
   982 
       
   983 void CImageConvStreamedEncodeStub::HandleExecuteAsyncCommand(TExecuteCommandParamsAsyncBase& aExecuteCommandBase)
       
   984 	{
       
   985 	switch(aExecuteCommandBase.iCmdNum)
       
   986 		{
       
   987 		case EImgConvExtAppendBlocks:
       
   988 			{
       
   989 			iStatusOwner->RegisterClientRequestStatus(*iThread, aExecuteCommandBase.iRequestStatus);
       
   990 			TAppendBlocksExecCmdParams* appendBlocks = static_cast<TAppendBlocksExecCmdParams*>(&aExecuteCommandBase);
       
   991 			iExtension->AppendBlocks(NULL,
       
   992 										*appendBlocks->iBlocks,
       
   993 										appendBlocks->iNumBlocksToAdd);
       
   994 			break;	
       
   995 			}
       
   996 		case EImgConvExtAddBlocks:
       
   997 			{
       
   998 			iStatusOwner->RegisterClientRequestStatus(*iThread, aExecuteCommandBase.iRequestStatus);
       
   999 			TAddBlocksExecCmdParams* addBlocks = static_cast<TAddBlocksExecCmdParams*>(&aExecuteCommandBase);
       
  1000 			iExtension->AddBlocks(NULL,
       
  1001 									*addBlocks->iBlocks,
       
  1002 									*addBlocks->iSeqPosition);
       
  1003 			break;
       
  1004 			}
       
  1005 		case EImgConvExtComplete:
       
  1006 			{
       
  1007 			iStatusOwner->RegisterClientRequestStatus(*iThread, aExecuteCommandBase.iRequestStatus);
       
  1008 			iExtension->Complete(NULL);
       
  1009 			break;
       
  1010 			}
       
  1011 		default:
       
  1012 			{
       
  1013 			Panic(EInvalidFwExtensionCall);
       
  1014 			}
       
  1015 		}
       
  1016 	if(*(aExecuteCommandBase.iRequestStatus) == KRequestPending)
       
  1017 		{
       
  1018 		iStatusOwner->StartActivity();
       
  1019 		}
       
  1020 	}
       
  1021 
       
  1022 
       
  1023 
       
  1024 // Prepare straight proxy
       
  1025 CImageConvPrepareStraightProxy* CImageConvPrepareStraightProxy::NewL(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
  1026 	{
       
  1027 	return new (ELeave) CImageConvPrepareStraightProxy(aStatusOwner, aRequestThread);
       
  1028 	}
       
  1029 	
       
  1030 CImageConvPrepareStraightProxy::CImageConvPrepareStraightProxy(MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
  1031 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
  1032 	{
       
  1033 	}
       
  1034 
       
  1035 CImageConvPrepareStraightProxy::~CImageConvPrepareStraightProxy()
       
  1036 	{
       
  1037 	if(iExtension)
       
  1038 		{
       
  1039 		iExtension->Release();
       
  1040 		}
       
  1041 	}
       
  1042 	
       
  1043 void CImageConvPrepareStraightProxy::SetupExtension(MImageConvExtension*& aExtension)
       
  1044 	{
       
  1045 	iExtension = static_cast<MImageConvPrepare*>(aExtension);
       
  1046 	aExtension = this;
       
  1047 	}
       
  1048 	
       
  1049 TUid CImageConvPrepareStraightProxy::Uid() const
       
  1050 	{
       
  1051 	return iExtension->Uid();
       
  1052 	}
       
  1053 	
       
  1054 void CImageConvPrepareStraightProxy::IncrementRef()
       
  1055 	{
       
  1056 	iExtension->IncrementRef();
       
  1057 	}
       
  1058 	
       
  1059 void CImageConvPrepareStraightProxy::Release()
       
  1060 	{
       
  1061 	iExtension->Release();
       
  1062 	}
       
  1063 	
       
  1064 void CImageConvPrepareStraightProxy::Prepare(TRequestStatus* aStatus)
       
  1065 	{
       
  1066 	iStatusOwner->RegisterClientRequestStatus(*iThread, aStatus);
       
  1067 	iExtension->Prepare(NULL);
       
  1068 	if(*aStatus == KRequestPending)
       
  1069 		{
       
  1070 		iStatusOwner->StartActivity();
       
  1071 		}
       
  1072 	}
       
  1073 	
       
  1074 // Prepare proxy
       
  1075 CImageConvPrepareProxy* CImageConvPrepareProxy::NewL(MImageConvExtensionThreadedSupport* aParent)
       
  1076 	{
       
  1077 	return new (ELeave) CImageConvPrepareProxy(aParent);
       
  1078 	}
       
  1079 
       
  1080 CImageConvPrepareProxy::CImageConvPrepareProxy(MImageConvExtensionThreadedSupport* aParent)
       
  1081 :iParent(aParent)
       
  1082 	{
       
  1083 	}
       
  1084 	
       
  1085 void CImageConvPrepareProxy::SetupExtension(MImageConvExtension*& aExtension)
       
  1086 	{
       
  1087 	aExtension = this;
       
  1088 	}
       
  1089 
       
  1090 TUid CImageConvPrepareProxy::Uid() const
       
  1091 	{
       
  1092 	TUidExecCmdParams uid(KICLPrepareUid, EImgConvExtUid);
       
  1093 	iParent->ExecuteCommand(uid);
       
  1094 	return uid.iReturn;
       
  1095 	}
       
  1096 	
       
  1097 void CImageConvPrepareProxy::IncrementRef()
       
  1098 	{
       
  1099 	ASSERT(EFalse);
       
  1100 	}
       
  1101 	
       
  1102 void CImageConvPrepareProxy::Release()
       
  1103 	{
       
  1104 	ASSERT(EFalse);
       
  1105 	}
       
  1106 
       
  1107 void CImageConvPrepareProxy::Prepare(TRequestStatus* aStatus)
       
  1108 	{
       
  1109 	TPrepareExecCmdParams prepare(KICLPrepareUid, EImgConvExtPrepare, aStatus);
       
  1110 	iParent->ExecuteAsyncCommand(prepare);
       
  1111 	}
       
  1112 
       
  1113 // Prepare stub
       
  1114 CImageConvPrepareStub* CImageConvPrepareStub::NewL(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
  1115 	{
       
  1116 	return new (ELeave) CImageConvPrepareStub(aExtension, aStatusOwner, aRequestThread);
       
  1117 	}
       
  1118 
       
  1119 CImageConvPrepareStub::CImageConvPrepareStub(MImageConvExtension* aExtension, MFrameworkExtAsyncInterface* aStatusOwner, RThread& aRequestThread)
       
  1120 :iStatusOwner(aStatusOwner), iThread(&aRequestThread)
       
  1121 	{
       
  1122 	iExtension = static_cast<MImageConvPrepare*>(aExtension);
       
  1123 	}
       
  1124 
       
  1125 CImageConvPrepareStub::~CImageConvPrepareStub()
       
  1126 	{
       
  1127 	if(iExtension)
       
  1128 		{
       
  1129 		iExtension->Release();
       
  1130 		}
       
  1131 	}
       
  1132 	
       
  1133 TUid CImageConvPrepareStub::Uid() const
       
  1134 	{
       
  1135 	return iExtension->Uid();
       
  1136 	}		
       
  1137 	
       
  1138 void CImageConvPrepareStub::HandleExecuteCommandL(TExecuteCommandParamsBase& aExecuteCommandBase)
       
  1139 	{
       
  1140 	switch(aExecuteCommandBase.iCmdNum)
       
  1141 		{
       
  1142 		case EImgConvExtUid:
       
  1143 			{
       
  1144 			// cast to appropriate extension TClass
       
  1145 			TUidExecCmdParams* uid = static_cast<TUidExecCmdParams*>(&aExecuteCommandBase);
       
  1146 			uid->iReturn = iExtension->Uid();
       
  1147 			break;
       
  1148 			}
       
  1149 		case EImgConvExtIncrementRef:
       
  1150 			{
       
  1151 			iExtension->IncrementRef();
       
  1152 			break;
       
  1153 			}
       
  1154 		case EImgConvExtRelease:
       
  1155 			{
       
  1156 			iExtension->Release();
       
  1157 			break;
       
  1158 			}
       
  1159 		default:
       
  1160 			{
       
  1161 			Panic(EInvalidFwExtensionCall);
       
  1162 			}
       
  1163 		}
       
  1164 	}
       
  1165 	
       
  1166 void CImageConvPrepareStub::HandleExecuteAsyncCommand(TExecuteCommandParamsAsyncBase& aExecuteCommandBase)
       
  1167 	{
       
  1168 	switch(aExecuteCommandBase.iCmdNum)
       
  1169 		{
       
  1170 		case EImgConvExtPrepare:
       
  1171 			{
       
  1172 			iStatusOwner->RegisterClientRequestStatus(*iThread, aExecuteCommandBase.iRequestStatus);
       
  1173 			iExtension->Prepare(NULL);
       
  1174 			break;
       
  1175 			}
       
  1176 		default:
       
  1177 			{
       
  1178 			Panic(EInvalidFwExtensionCall);
       
  1179 			}
       
  1180 		}
       
  1181 		
       
  1182 	if(*(aExecuteCommandBase.iRequestStatus) == KRequestPending)
       
  1183 		{
       
  1184 		iStatusOwner->StartActivity();
       
  1185 		}
       
  1186 	}