|
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 <e32property.h> |
|
17 #include "fwexttestcodec.h" |
|
18 |
|
19 // Read Codec |
|
20 CFwExtReadCodec* CFwExtReadCodec::NewL(CFwExtTestDecoderPlugin& aDecoder) |
|
21 { |
|
22 return new (ELeave) CFwExtReadCodec(aDecoder); |
|
23 } |
|
24 |
|
25 CFwExtReadCodec::CFwExtReadCodec(CFwExtTestDecoderPlugin& aDecoder) |
|
26 :iDecoder(&aDecoder) |
|
27 { |
|
28 } |
|
29 |
|
30 void CFwExtReadCodec::InitFrameL(TFrameInfo& /*aFrameInfo*/, CFrameImageData& /*aFrameImageData*/, TBool /*aDisableErrorDiffusion*/, CFbsBitmap& /*aDestination*/, CFbsBitmap* /*aDestinationMask*/) |
|
31 { |
|
32 } |
|
33 |
|
34 void CFwExtReadCodec::InitFrameHeader(TFrameInfo& aFrameInfo, CFrameImageData& /*aFrameData*/) |
|
35 { |
|
36 aFrameInfo.SetCurrentFrameState(TFrameInfo::EFrameInfoProcessingComplete); |
|
37 } |
|
38 |
|
39 void CFwExtReadCodec::SetPrepareProcessing() |
|
40 { |
|
41 iPrepareProcessing = ETrue; |
|
42 } |
|
43 |
|
44 TFrameState CFwExtReadCodec::ProcessFrameL(TBufPtr8& /*aSrc*/) |
|
45 { |
|
46 if ( iPrepareProcessing ) |
|
47 { |
|
48 // Prepare called. We ask Framework to call us four times before completing |
|
49 if(iLoops == 3) |
|
50 { |
|
51 iPrepareProcessing = EFalse; |
|
52 return EFrameComplete; // prepare processed successfully |
|
53 } |
|
54 iLoops++; |
|
55 return EFrameIncomplete; // processing of block is incomplete |
|
56 } |
|
57 else |
|
58 { |
|
59 // Convert called |
|
60 // Would process data passed from the extension |
|
61 return EFrameComplete; |
|
62 } |
|
63 } |
|
64 |
|
65 // Write Codec |
|
66 CFwExtWriteCodec* CFwExtWriteCodec::NewL(CFwExtTestEncoderPlugin& aEncoder) |
|
67 { |
|
68 return new (ELeave) CFwExtWriteCodec(aEncoder); |
|
69 } |
|
70 |
|
71 CFwExtWriteCodec::CFwExtWriteCodec(CFwExtTestEncoderPlugin& aEncoder) |
|
72 :iEncoder(&aEncoder) |
|
73 { |
|
74 } |
|
75 |
|
76 void CFwExtWriteCodec::ResetCount() |
|
77 { |
|
78 iLoops = 0; |
|
79 } |
|
80 |
|
81 void CFwExtWriteCodec::Complete() |
|
82 { |
|
83 iComplete = ETrue; |
|
84 } |
|
85 |
|
86 void CFwExtWriteCodec::SetPrepareProcessing() |
|
87 { |
|
88 iPrepareProcessing = ETrue; |
|
89 } |
|
90 |
|
91 TFrameState CFwExtWriteCodec::ProcessFrameL(TBufPtr8& /*aDst*/) |
|
92 { |
|
93 if ( iPrepareProcessing ) |
|
94 { |
|
95 iPrepareProcessing = EFalse; |
|
96 return EFrameComplete; // prepare processed successfully |
|
97 } |
|
98 else if(iComplete) |
|
99 { |
|
100 return EFrameComplete; // to indicate completion of image. |
|
101 } |
|
102 else |
|
103 { |
|
104 if(iLoops == 5) |
|
105 { |
|
106 return EBlockComplete; // block processed successfully |
|
107 } |
|
108 iLoops++; |
|
109 return EFrameIncomplete; // processing of block is incomplete |
|
110 } |
|
111 } |