|
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 "fwexttestconvert.h" |
|
17 #include "fwexttestcodec.h" |
|
18 #include "imageframe.h" |
|
19 #include <icl/icl_uids.hrh> |
|
20 #include <e32property.h> |
|
21 #include "fwextconstants.h" |
|
22 |
|
23 // Concrete Decode Transform Extension class |
|
24 CDecodeOperationExtension* CDecodeOperationExtension::NewL(CFwExtTestDecoderPlugin* aParent) |
|
25 { |
|
26 return new (ELeave) CDecodeOperationExtension(aParent); |
|
27 } |
|
28 |
|
29 CDecodeOperationExtension::CDecodeOperationExtension(CFwExtTestDecoderPlugin* aParent) |
|
30 :iParent(aParent), iReferenceCount(1), iOperationCaps(0x0F) |
|
31 { |
|
32 } |
|
33 |
|
34 CDecodeOperationExtension::~CDecodeOperationExtension() |
|
35 { |
|
36 ASSERT(iReferenceCount == 0); |
|
37 } |
|
38 |
|
39 TUid CDecodeOperationExtension::Uid() const |
|
40 { |
|
41 return iParent->iTestOperationExtPtr->Uid(); |
|
42 } |
|
43 |
|
44 void CDecodeOperationExtension::IncrementRef() |
|
45 { |
|
46 iReferenceCount++; |
|
47 iParent->iTestOperationExtPtr->IncrementRef(); |
|
48 } |
|
49 |
|
50 void CDecodeOperationExtension::Release() |
|
51 { |
|
52 iReferenceCount--; |
|
53 iParent->iTestOperationExtPtr->Release(); |
|
54 } |
|
55 |
|
56 TUint CDecodeOperationExtension::Capabilities() const |
|
57 { |
|
58 return iOperationCaps; |
|
59 } |
|
60 |
|
61 void CDecodeOperationExtension::AddOperationL(TImageConvOperation::TOperation aOperation) |
|
62 { |
|
63 /* |
|
64 This bitwise OR is purely for testing purposes only. An actual |
|
65 AddOperationL call would append the operation to a stack of operations. |
|
66 */ |
|
67 iOperations |= aOperation; |
|
68 iParent->iTestOperationExtPtr->AddOperationL(aOperation); |
|
69 } |
|
70 |
|
71 void CDecodeOperationExtension::ClearOperationStack() |
|
72 { |
|
73 iOperations = 0; |
|
74 iParent->iTestOperationExtPtr->ClearOperationStack(); |
|
75 } |
|
76 |
|
77 // Concrete Scaler Extension class |
|
78 CScalerExtension* CScalerExtension::NewL(CFwExtTestDecoderPlugin* aParent) |
|
79 { |
|
80 return new (ELeave) CScalerExtension(aParent); |
|
81 } |
|
82 |
|
83 CScalerExtension::CScalerExtension(CFwExtTestDecoderPlugin* aParent) |
|
84 :iParent(aParent), iReferenceCount(1) |
|
85 { |
|
86 } |
|
87 |
|
88 CScalerExtension::~CScalerExtension() |
|
89 { |
|
90 ASSERT(iReferenceCount == 0); |
|
91 } |
|
92 |
|
93 TUid CScalerExtension::Uid() const |
|
94 { |
|
95 return iParent->iTestScalerExtPtr->Uid(); |
|
96 } |
|
97 |
|
98 void CScalerExtension::IncrementRef() |
|
99 { |
|
100 iReferenceCount++; |
|
101 iParent->iTestScalerExtPtr->IncrementRef(); |
|
102 } |
|
103 |
|
104 void CScalerExtension::Release() |
|
105 { |
|
106 iReferenceCount--; |
|
107 iParent->iTestScalerExtPtr->Release(); |
|
108 } |
|
109 |
|
110 void CScalerExtension::GetCapabilities(TScalerCaps& aCaps) const |
|
111 { |
|
112 aCaps = iScalerCaps; |
|
113 iParent->iTestScalerExtPtr->GetCapabilities(aCaps); |
|
114 } |
|
115 |
|
116 void CScalerExtension::SetScalingL(const TSize& aDesiredSize, TImageConvScaler::TScalerQuality aQuality, TBool aLockAspectRatio) |
|
117 { |
|
118 iParent->iTestScalerExtPtr->SetScalingL(aDesiredSize, aQuality, aLockAspectRatio); |
|
119 } |
|
120 |
|
121 void CScalerExtension::SetScalingL(TInt aScalingCoeff, TImageConvScaler::TScalerQuality aScalingQuality) |
|
122 { |
|
123 iParent->iTestScalerExtPtr->SetScalingL(aScalingCoeff, aScalingQuality); |
|
124 } |
|
125 |
|
126 // Concrete Streamed Decode Extension class |
|
127 CStreamedDecodeExtension* CStreamedDecodeExtension::NewL(CFwExtTestDecoderPlugin* aParent) |
|
128 { |
|
129 return new (ELeave) CStreamedDecodeExtension(aParent); |
|
130 } |
|
131 |
|
132 CStreamedDecodeExtension::CStreamedDecodeExtension(CFwExtTestDecoderPlugin* aParent) |
|
133 :iParent(aParent), iReferenceCount(1) |
|
134 { |
|
135 } |
|
136 |
|
137 CStreamedDecodeExtension::~CStreamedDecodeExtension() |
|
138 { |
|
139 ASSERT(iReferenceCount == 0); |
|
140 } |
|
141 |
|
142 TUid CStreamedDecodeExtension::Uid() const |
|
143 { |
|
144 return iParent->iTestStreamedDecodeExtPtr->Uid(); |
|
145 } |
|
146 |
|
147 void CStreamedDecodeExtension::IncrementRef() |
|
148 { |
|
149 iReferenceCount++; |
|
150 iParent->iTestStreamedDecodeExtPtr->IncrementRef(); |
|
151 } |
|
152 |
|
153 void CStreamedDecodeExtension::Release() |
|
154 { |
|
155 iReferenceCount--; |
|
156 iParent->iTestStreamedDecodeExtPtr->Release(); |
|
157 } |
|
158 |
|
159 void CStreamedDecodeExtension::GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const |
|
160 { |
|
161 iParent->iTestStreamedDecodeExtPtr->GetSupportedFormatsL(aFormats, aOptimalFormat); |
|
162 } |
|
163 |
|
164 void CStreamedDecodeExtension::GetCapabilities(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps& aCaps) const |
|
165 { |
|
166 iParent->iTestStreamedDecodeExtPtr->GetCapabilities(aFormat, aFrameNumber, aCaps); |
|
167 } |
|
168 |
|
169 TInt CStreamedDecodeExtension::GetBufferSize(TUid aFormat, TSize& aBlockSizeInPixels, TInt aNumBlocks) const |
|
170 { |
|
171 return iParent->iTestStreamedDecodeExtPtr->GetBufferSize(aFormat, aBlockSizeInPixels, aNumBlocks); |
|
172 } |
|
173 |
|
174 void CStreamedDecodeExtension::InitFrameL(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps::TNavigation aNavigation) |
|
175 { |
|
176 iParent->iTestStreamedDecodeExtPtr->InitFrameL(aFormat, aFrameNumber, aNavigation); |
|
177 } |
|
178 |
|
179 void CStreamedDecodeExtension::GetBlocks(TRequestStatus* aStatus, CImageFrame* aFrame, TInt aSeqPosition, TInt aNumBlocksToGet, TInt* aNumBlocksRead) |
|
180 { |
|
181 iParent->iTestStreamedDecodeExtPtr->GetBlocks(aStatus, aFrame, aSeqPosition, aNumBlocksToGet, aNumBlocksRead); |
|
182 } |
|
183 |
|
184 void CStreamedDecodeExtension::GetNextBlocks(TRequestStatus* aStatus, CImageFrame* aFrame, TInt aNumBlocksToGet, TInt* aNumBlocksRead, TBool* aHaveMoreBlocks) |
|
185 { |
|
186 iParent->iTestStreamedDecodeExtPtr->GetNextBlocks(aStatus, aFrame, aNumBlocksToGet, aNumBlocksRead, aHaveMoreBlocks); |
|
187 } |
|
188 |
|
189 // Concrete Prepare Extension class |
|
190 CPrepareDecodeExtension* CPrepareDecodeExtension::NewL(CFwExtTestDecoderPlugin* aParent) |
|
191 { |
|
192 return new (ELeave) CPrepareDecodeExtension(aParent); |
|
193 } |
|
194 |
|
195 CPrepareDecodeExtension::CPrepareDecodeExtension(CFwExtTestDecoderPlugin* aParent) |
|
196 :iParent(aParent), iReferenceCount(1) |
|
197 { |
|
198 } |
|
199 |
|
200 CPrepareDecodeExtension::~CPrepareDecodeExtension() |
|
201 { |
|
202 ASSERT(iReferenceCount == 0); |
|
203 } |
|
204 |
|
205 TUid CPrepareDecodeExtension::Uid() const |
|
206 { |
|
207 return iParent->iTestPrepareExtPtr->Uid(); |
|
208 } |
|
209 |
|
210 void CPrepareDecodeExtension::IncrementRef() |
|
211 { |
|
212 iReferenceCount++; |
|
213 iParent->iTestPrepareExtPtr->IncrementRef(); |
|
214 } |
|
215 |
|
216 void CPrepareDecodeExtension::Release() |
|
217 { |
|
218 iReferenceCount--; |
|
219 iParent->iTestPrepareExtPtr->Release(); |
|
220 } |
|
221 |
|
222 void CPrepareDecodeExtension::Prepare(TRequestStatus* aStatus) |
|
223 { |
|
224 iParent->iTestPrepareExtPtr->Prepare(aStatus); |
|
225 iParent->iReadCodec->SetPrepareProcessing(); // indcate that doing Prepare processing |
|
226 } |
|
227 |
|
228 // Concrete Encode Transform Extension class |
|
229 CEncodeOperationExtension* CEncodeOperationExtension::NewL(CFwExtTestEncoderPlugin* aParent) |
|
230 { |
|
231 return new (ELeave) CEncodeOperationExtension(aParent); |
|
232 } |
|
233 |
|
234 CEncodeOperationExtension::CEncodeOperationExtension(CFwExtTestEncoderPlugin* aParent) |
|
235 :iParent(aParent), iReferenceCount(1), iOperationCaps(0x0F) |
|
236 { |
|
237 } |
|
238 |
|
239 CEncodeOperationExtension::~CEncodeOperationExtension() |
|
240 { |
|
241 ASSERT(iReferenceCount == 0); |
|
242 } |
|
243 |
|
244 TUid CEncodeOperationExtension::Uid() const |
|
245 { |
|
246 return iParent->iTestOperationExtPtr->Uid(); |
|
247 } |
|
248 |
|
249 void CEncodeOperationExtension::IncrementRef() |
|
250 { |
|
251 iReferenceCount++; |
|
252 iParent->iTestOperationExtPtr->IncrementRef(); |
|
253 } |
|
254 |
|
255 void CEncodeOperationExtension::Release() |
|
256 { |
|
257 iReferenceCount--; |
|
258 iParent->iTestOperationExtPtr->Release(); |
|
259 } |
|
260 |
|
261 TUint CEncodeOperationExtension::Capabilities() const |
|
262 { |
|
263 return iOperationCaps; |
|
264 } |
|
265 |
|
266 void CEncodeOperationExtension::AddOperationL(TImageConvOperation::TOperation aOperation) |
|
267 { |
|
268 /* |
|
269 This bitwise OR is purely for testing purposes only. An actual |
|
270 AddOperationL call would append the operation to a stack of operations. |
|
271 */ |
|
272 iOperations |= aOperation; |
|
273 iParent->iTestOperationExtPtr->AddOperationL(aOperation); |
|
274 } |
|
275 |
|
276 void CEncodeOperationExtension::ClearOperationStack() |
|
277 { |
|
278 iOperations = 0; |
|
279 iParent->iTestOperationExtPtr->ClearOperationStack(); |
|
280 } |
|
281 |
|
282 // Concrete Prepare Extension class for encoder |
|
283 CPrepareEncodeExtension* CPrepareEncodeExtension::NewL(CFwExtTestEncoderPlugin* aParent) |
|
284 { |
|
285 return new (ELeave) CPrepareEncodeExtension(aParent); |
|
286 } |
|
287 |
|
288 CPrepareEncodeExtension::CPrepareEncodeExtension(CFwExtTestEncoderPlugin* aParent) |
|
289 :iParent(aParent), iReferenceCount(1) |
|
290 { |
|
291 } |
|
292 |
|
293 CPrepareEncodeExtension::~CPrepareEncodeExtension() |
|
294 { |
|
295 ASSERT(iReferenceCount == 0); |
|
296 } |
|
297 |
|
298 TUid CPrepareEncodeExtension::Uid() const |
|
299 { |
|
300 return iParent->iTestPrepareExtPtr->Uid(); |
|
301 } |
|
302 |
|
303 void CPrepareEncodeExtension::IncrementRef() |
|
304 { |
|
305 iReferenceCount++; |
|
306 iParent->iTestPrepareExtPtr->IncrementRef(); |
|
307 } |
|
308 |
|
309 void CPrepareEncodeExtension::Release() |
|
310 { |
|
311 iReferenceCount--; |
|
312 iParent->iTestPrepareExtPtr->Release(); |
|
313 } |
|
314 |
|
315 void CPrepareEncodeExtension::Prepare(TRequestStatus* aStatus) |
|
316 { |
|
317 // test code only - avoids processing framework msgs |
|
318 CFwExtWriteCodec* codec = CFwExtWriteCodec::NewL(*iParent); |
|
319 iParent->SetImageWriteCodec(codec); // Framework takes ownership |
|
320 iParent->SetCodec(codec); // plugin pointer to codec |
|
321 |
|
322 iParent->iTestPrepareExtPtr->Prepare(aStatus); |
|
323 iParent->iWriteCodec->SetPrepareProcessing(); // indicate that doing Prepare processing |
|
324 } |
|
325 |
|
326 // Concrete Streamed Encode Extension class |
|
327 CStreamedEncodeExtension* CStreamedEncodeExtension::NewL(CFwExtTestEncoderPlugin* aParent) |
|
328 { |
|
329 return new (ELeave) CStreamedEncodeExtension(aParent); |
|
330 } |
|
331 |
|
332 CStreamedEncodeExtension::CStreamedEncodeExtension(CFwExtTestEncoderPlugin* aParent) |
|
333 :iParent(aParent), iReferenceCount(1) |
|
334 { |
|
335 } |
|
336 |
|
337 CStreamedEncodeExtension::~CStreamedEncodeExtension() |
|
338 { |
|
339 ASSERT(iReferenceCount == 0); |
|
340 } |
|
341 |
|
342 TUid CStreamedEncodeExtension::Uid() const |
|
343 { |
|
344 return iParent->iTestStreamedEncodeExtPtr->Uid(); |
|
345 } |
|
346 |
|
347 void CStreamedEncodeExtension::IncrementRef() |
|
348 { |
|
349 iReferenceCount++; |
|
350 iParent->iTestStreamedEncodeExtPtr->IncrementRef(); |
|
351 } |
|
352 |
|
353 void CStreamedEncodeExtension::Release() |
|
354 { |
|
355 iReferenceCount--; |
|
356 iParent->iTestStreamedEncodeExtPtr->Release(); |
|
357 } |
|
358 |
|
359 void CStreamedEncodeExtension::GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const |
|
360 { |
|
361 iParent->iTestStreamedEncodeExtPtr->GetSupportedFormatsL(aFormats, aOptimalFormat); |
|
362 } |
|
363 |
|
364 void CStreamedEncodeExtension::GetCapabilities(TUid aFormat, TEncodeStreamCaps& aCaps) const |
|
365 { |
|
366 iParent->iTestStreamedEncodeExtPtr->GetCapabilities(aFormat, aCaps); |
|
367 } |
|
368 |
|
369 void CStreamedEncodeExtension::InitFrameL(TUid aFormat, TInt aFrameNumber, const TSize& aFrameSizeInPixels, const TSize& aBlockSizeInPixels, TEncodeStreamCaps::TNavigation aNavigation, const CFrameImageData* aFrameImageData) |
|
370 { |
|
371 iParent->iTestStreamedEncodeExtPtr->InitFrameL(aFormat, aFrameNumber, aFrameSizeInPixels, aBlockSizeInPixels, aNavigation, aFrameImageData); |
|
372 |
|
373 // Have sufficient information to create the appropriate writecodec |
|
374 CFwExtWriteCodec* codec = CFwExtWriteCodec::NewL(*iParent); |
|
375 iParent->SetImageWriteCodec(codec); // Framework takes ownership |
|
376 iParent->SetCodec(codec); // plugin pointer to codec |
|
377 } |
|
378 |
|
379 void CStreamedEncodeExtension::AppendBlocks(TRequestStatus* aStatus, const CImageFrame& aBlocks, TInt aNumBlocksToAdd) |
|
380 { |
|
381 iParent->iTestStreamedEncodeExtPtr->AppendBlocks(aStatus, aBlocks, aNumBlocksToAdd); |
|
382 } |
|
383 |
|
384 void CStreamedEncodeExtension::AddBlocks(TRequestStatus* aStatus, const CImageFrame& aBlocks, const TInt& aSeqPosition) |
|
385 { |
|
386 iParent->iTestStreamedEncodeExtPtr->AddBlocks(aStatus, aBlocks, aSeqPosition); |
|
387 } |
|
388 |
|
389 void CStreamedEncodeExtension::Complete(TRequestStatus* aStatus) |
|
390 { |
|
391 iParent->iTestStreamedEncodeExtPtr->Complete(aStatus); |
|
392 // iParent->iWriteCodec->Complete(); // indicate complete to the write codec |
|
393 } |
|
394 |
|
395 // Decoder Plugin |
|
396 CFwExtTestDecoderPlugin* CFwExtTestDecoderPlugin::NewL() |
|
397 { |
|
398 return new (ELeave) CFwExtTestDecoderPlugin(); |
|
399 } |
|
400 |
|
401 void CFwExtTestDecoderPlugin::ImageType(TInt /*aFrameNumber*/, TUid& /*aImageType*/, TUid& /*aImageSubType*/) const |
|
402 { |
|
403 |
|
404 } |
|
405 |
|
406 void CFwExtTestDecoderPlugin::ScanDataL() |
|
407 { |
|
408 // Just create codec and set in the Priv |
|
409 CFwExtReadCodec* imageReadCodec = CFwExtReadCodec::NewL(*this); |
|
410 SetImageReadCodec(imageReadCodec); |
|
411 iReadCodec = imageReadCodec; |
|
412 |
|
413 SetDataLength(10); |
|
414 |
|
415 ReadFrameHeadersL(); |
|
416 } |
|
417 |
|
418 CFrameInfoStrings* CFwExtTestDecoderPlugin::FrameInfoStringsL(RFs& /*aFs*/, TInt /*aFrameNumber*/) |
|
419 { |
|
420 return NULL; |
|
421 } |
|
422 |
|
423 CFwExtTestDecoderPlugin::CFwExtTestDecoderPlugin() |
|
424 :iDestSize(1234,1234) |
|
425 { |
|
426 } |
|
427 |
|
428 CFwExtTestDecoderPlugin::~CFwExtTestDecoderPlugin() |
|
429 { |
|
430 // test extension shared with test code |
|
431 delete iTestOperationExtPtr; |
|
432 delete iTestScalerExtPtr; |
|
433 delete iTestStreamedDecodeExtPtr; |
|
434 |
|
435 // actual extensions that point to the above |
|
436 delete iOperationExt; |
|
437 delete iScalerExt; |
|
438 delete iStreamedDecodeExt; |
|
439 |
|
440 // Call last |
|
441 Cleanup(); |
|
442 } |
|
443 |
|
444 void CFwExtTestDecoderPlugin::GetExtensionL(TUid aExtUid, MImageConvExtension*& aExtPtr) |
|
445 { |
|
446 switch(aExtUid.iUid) |
|
447 { |
|
448 case KUidImageConvExtOperationValue: |
|
449 { |
|
450 iOperationExt = CDecodeOperationExtension::NewL(this); |
|
451 aExtPtr = iOperationExt; |
|
452 break; |
|
453 } |
|
454 case KUidImageConvExtScalerValue: |
|
455 { |
|
456 iScalerExt= CScalerExtension::NewL(this); |
|
457 aExtPtr = iScalerExt; |
|
458 break; |
|
459 } |
|
460 case KUidImageConvExtStreamedDecodeValue: |
|
461 { |
|
462 iStreamedDecodeExt = CStreamedDecodeExtension::NewL(this); |
|
463 aExtPtr = iStreamedDecodeExt; |
|
464 break; |
|
465 } |
|
466 case KUidImageConvExtPrepareValue: |
|
467 { |
|
468 iPrepareExt = CPrepareDecodeExtension::NewL(this); |
|
469 aExtPtr = iPrepareExt; |
|
470 break; |
|
471 } |
|
472 default: |
|
473 { |
|
474 User::Leave(KErrNotSupported); |
|
475 } |
|
476 } |
|
477 } |
|
478 |
|
479 TInt CFwExtTestDecoderPlugin::GetDestinationSize(TSize& aSize, TInt aFrameNumber) |
|
480 { |
|
481 aSize.iWidth = aSize.iWidth/2; |
|
482 aSize.iHeight = aSize.iHeight/2; |
|
483 return aFrameNumber; |
|
484 } |
|
485 |
|
486 void CFwExtTestDecoderPlugin::SetClippingRectL(const TRect* aClipRect) |
|
487 { |
|
488 if(!aClipRect) |
|
489 { |
|
490 User::Leave(KErrArgument); |
|
491 } |
|
492 |
|
493 const TRect KClippingRectSize(2,4,6,8); |
|
494 |
|
495 if(*aClipRect != KClippingRectSize) |
|
496 { |
|
497 User::Leave(KErrArgument); |
|
498 } |
|
499 } |
|
500 |
|
501 void CFwExtTestDecoderPlugin::HandleCustomSyncL(TInt aParam) |
|
502 { |
|
503 MImageConvExtension* tempExt = reinterpret_cast<MImageConvExtension*>(aParam); |
|
504 |
|
505 if(tempExt->Uid() == KICLOperationUid) |
|
506 { |
|
507 iTestOperationExtPtr = static_cast<CDecodeOperationExtension*>(tempExt); |
|
508 } |
|
509 else if(tempExt->Uid() == KICLScalerUid) |
|
510 { |
|
511 iTestScalerExtPtr = static_cast<CScalerExtension*>(tempExt); |
|
512 } |
|
513 else if(tempExt->Uid() == KICLStreamedDecodeUid) |
|
514 { |
|
515 iTestStreamedDecodeExtPtr = static_cast<CStreamedDecodeExtension*>(tempExt); |
|
516 } |
|
517 else if(tempExt->Uid() == KICLPrepareUid) |
|
518 { |
|
519 iTestPrepareExtPtr = static_cast<CPrepareDecodeExtension*>(tempExt); |
|
520 } |
|
521 else |
|
522 { |
|
523 User::Leave(KErrNotSupported); |
|
524 } |
|
525 } |
|
526 |
|
527 void CFwExtTestDecoderPlugin::InitCustomAsyncL(TInt /*aParam*/) |
|
528 { |
|
529 } |
|
530 |
|
531 // Encoder Plugin |
|
532 CFwExtTestEncoderPlugin* CFwExtTestEncoderPlugin::NewL() |
|
533 { |
|
534 return new (ELeave) CFwExtTestEncoderPlugin(); |
|
535 } |
|
536 |
|
537 CFwExtTestEncoderPlugin::CFwExtTestEncoderPlugin() |
|
538 { |
|
539 } |
|
540 |
|
541 CFwExtTestEncoderPlugin::~CFwExtTestEncoderPlugin() |
|
542 { |
|
543 // Call last |
|
544 Cleanup(); |
|
545 } |
|
546 |
|
547 void CFwExtTestEncoderPlugin::SetCodec(CFwExtWriteCodec* aWriteCodec) |
|
548 { |
|
549 iWriteCodec = aWriteCodec; |
|
550 } |
|
551 |
|
552 void CFwExtTestEncoderPlugin::PrepareEncoderL(const CFrameImageData* /*aFrameImageData*/) |
|
553 { |
|
554 } |
|
555 |
|
556 void CFwExtTestEncoderPlugin::UpdateHeaderL() |
|
557 { |
|
558 } |
|
559 |
|
560 void CFwExtTestEncoderPlugin::HandleCustomSyncL(TInt aParam) |
|
561 { |
|
562 MImageConvExtension* tempExt = reinterpret_cast<MImageConvExtension*>(aParam); |
|
563 |
|
564 if(tempExt->Uid() == KICLOperationUid) |
|
565 { |
|
566 iTestOperationExtPtr = static_cast<CEncodeOperationExtension*>(tempExt); |
|
567 } |
|
568 else if(tempExt->Uid() == KICLStreamedEncodeUid) |
|
569 { |
|
570 iTestStreamedEncodeExtPtr = static_cast<CStreamedEncodeExtension*>(tempExt); |
|
571 } |
|
572 else if(tempExt->Uid() == KICLPrepareUid) |
|
573 { |
|
574 iTestPrepareExtPtr = static_cast<CPrepareEncodeExtension*>(tempExt); |
|
575 } |
|
576 else |
|
577 { |
|
578 User::Leave(KErrNotSupported); |
|
579 } |
|
580 } |
|
581 |
|
582 void CFwExtTestEncoderPlugin::GetExtensionL(TUid aExtUid, MImageConvExtension*& aExtPtr) |
|
583 { |
|
584 switch(aExtUid.iUid) |
|
585 { |
|
586 case KUidImageConvExtOperationValue: |
|
587 { |
|
588 iOperationExt = CEncodeOperationExtension::NewL(this); |
|
589 aExtPtr = iOperationExt; |
|
590 break; |
|
591 } |
|
592 case KUidImageConvExtStreamedEncodeValue: |
|
593 { |
|
594 iStreamedEncodeExt = CStreamedEncodeExtension::NewL(this); |
|
595 aExtPtr = iStreamedEncodeExt; |
|
596 break; |
|
597 } |
|
598 case KUidImageConvExtPrepareValue: |
|
599 { |
|
600 iPrepareExt = CPrepareEncodeExtension::NewL(this); |
|
601 aExtPtr = iPrepareExt; |
|
602 break; |
|
603 } |
|
604 default: |
|
605 { |
|
606 User::Leave(KErrNotSupported); |
|
607 } |
|
608 } |
|
609 } |
|
610 |