24 #include "thumbnaildecodetask.h" |
24 #include "thumbnaildecodetask.h" |
25 #include "thumbnailprovider.h" |
25 #include "thumbnailprovider.h" |
26 #include "thumbnailserver.h" |
26 #include "thumbnailserver.h" |
27 #include "thumbnaillog.h" |
27 #include "thumbnaillog.h" |
28 #include "thumbnailpanic.h" |
28 #include "thumbnailpanic.h" |
29 #include "OstTraceDefinitions.h" |
|
30 #ifdef OST_TRACE_COMPILER_IN_USE |
|
31 #include "thumbnaildecodetaskTraces.h" |
|
32 #endif |
|
33 |
|
34 |
29 |
35 |
30 |
36 // ======== MEMBER FUNCTIONS ======== |
31 // ======== MEMBER FUNCTIONS ======== |
37 |
32 |
38 // --------------------------------------------------------------------------- |
33 // --------------------------------------------------------------------------- |
44 CThumbnailServer& aServer, TDesC8* aBuffer, TInt aPriority, TDisplayMode aDisplayMode): CThumbnailTask( aProcessor, |
39 CThumbnailServer& aServer, TDesC8* aBuffer, TInt aPriority, TDisplayMode aDisplayMode): CThumbnailTask( aProcessor, |
45 aPriority ), iServer( aServer ), iBuffer(aBuffer), iDisplayMode(aDisplayMode) |
40 aPriority ), iServer( aServer ), iBuffer(aBuffer), iDisplayMode(aDisplayMode) |
46 { |
41 { |
47 TN_DEBUG3( "CThumbnailDecodeTask(0x%08x)::CThumbnailDecodeTask() aDisplayMode = %d", this |
42 TN_DEBUG3( "CThumbnailDecodeTask(0x%08x)::CThumbnailDecodeTask() aDisplayMode = %d", this |
48 , iDisplayMode); |
43 , iDisplayMode); |
49 OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_CTHUMBNAILDECODETASK, "CThumbnailDecodeTask::CThumbnailDecodeTask;iDisplayMode=%u", iDisplayMode ); |
|
50 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILDECODETASK_CTHUMBNAILDECODETASK, "CThumbnailDecodeTask::CThumbnailDecodeTask;this=%o", this ); |
|
51 } |
44 } |
52 |
45 |
53 |
46 |
54 // --------------------------------------------------------------------------- |
47 // --------------------------------------------------------------------------- |
55 // CThumbnailDecodeTask::~CThumbnailDecodeTask() |
48 // CThumbnailDecodeTask::~CThumbnailDecodeTask() |
57 // --------------------------------------------------------------------------- |
50 // --------------------------------------------------------------------------- |
58 // |
51 // |
59 CThumbnailDecodeTask::~CThumbnailDecodeTask() |
52 CThumbnailDecodeTask::~CThumbnailDecodeTask() |
60 { |
53 { |
61 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::~CThumbnailDecodeTask()", this ); |
54 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::~CThumbnailDecodeTask()", this ); |
62 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILDECODETASK_CTHUMBNAILDECODETASK, "CThumbnailDecodeTask::~CThumbnailDecodeTask" ); |
|
63 |
|
64 if ( iProvider ) |
55 if ( iProvider ) |
65 { |
56 { |
66 iProvider->CancelGetThumbnail(); |
57 iProvider->CancelGetThumbnail(); |
67 } |
58 } |
68 |
59 |
77 // --------------------------------------------------------------------------- |
68 // --------------------------------------------------------------------------- |
78 // |
69 // |
79 void CThumbnailDecodeTask::StartL() |
70 void CThumbnailDecodeTask::StartL() |
80 { |
71 { |
81 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::StartL()", this ); |
72 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::StartL()", this ); |
82 OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_STARTL, "CThumbnailDecodeTask::StartL;this=%o", this ); |
|
83 |
73 |
84 CThumbnailTask::StartL(); |
74 CThumbnailTask::StartL(); |
85 |
75 |
86 const TPtrC8 mimeType = KJpegMime(); |
76 const TPtrC8 mimeType = KJpegMime(); |
87 |
77 |
88 iProvider = iServer.ResolveProviderL( mimeType ); |
78 iProvider = iServer.ResolveProviderL( mimeType ); |
89 TN_DEBUG3( "CThumbnailDecodeTask(0x%08x) -- provider UID 0x%08x", this, |
79 TN_DEBUG3( "CThumbnailDecodeTask(0x%08x) -- provider UID 0x%08x", this, |
90 iProvider->Uid()); |
80 iProvider->Uid()); |
91 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILDECODETASK_STARTL, "CThumbnailDecodeTask::StartL;this=%o", this ); |
|
92 |
81 |
93 __ASSERT_DEBUG(( iProvider ), ThumbnailPanic( EThumbnailNullPointer )); |
82 __ASSERT_DEBUG(( iProvider ), ThumbnailPanic( EThumbnailNullPointer )); |
94 |
83 |
95 iProvider->CancelGetThumbnail(); |
84 iProvider->CancelGetThumbnail(); |
96 iProvider->Reset(); |
85 iProvider->Reset(); |
106 // |
95 // |
107 void CThumbnailDecodeTask::RunL() |
96 void CThumbnailDecodeTask::RunL() |
108 { |
97 { |
109 // No implementation required |
98 // No implementation required |
110 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::RunL()", this ); |
99 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::RunL()", this ); |
111 OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_RUNL, "CThumbnailDecodeTask::RunL;this=%o", this ); |
|
112 } |
100 } |
113 |
101 |
114 |
102 |
115 // --------------------------------------------------------------------------- |
103 // --------------------------------------------------------------------------- |
116 // CThumbnailDecodeTask::DoCancel() |
104 // CThumbnailDecodeTask::DoCancel() |
117 // --------------------------------------------------------------------------- |
105 // --------------------------------------------------------------------------- |
118 // |
106 // |
119 void CThumbnailDecodeTask::DoCancel() |
107 void CThumbnailDecodeTask::DoCancel() |
120 { |
108 { |
121 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::DoCancel()", this ); |
109 TN_DEBUG2( "CThumbnailDecodeTask(0x%08x)::DoCancel()", this ); |
122 OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_DOCANCEL, "CThumbnailDecodeTask::DoCancel;this=%o", this ); |
|
123 if ( iProvider ) |
110 if ( iProvider ) |
124 { |
111 { |
125 iProvider->CancelGetThumbnail(); |
112 iProvider->CancelGetThumbnail(); |
126 } |
113 } |
127 } |
114 } |
136 void CThumbnailDecodeTask::ThumbnailProviderReady( const TInt aError, |
123 void CThumbnailDecodeTask::ThumbnailProviderReady( const TInt aError, |
137 CFbsBitmap* aBitmap, const TSize& aOriginalSize, const TBool /*aEXIF*/, const TBool /*aPortrait*/ ) |
124 CFbsBitmap* aBitmap, const TSize& aOriginalSize, const TBool /*aEXIF*/, const TBool /*aPortrait*/ ) |
138 { |
125 { |
139 TN_DEBUG4( "CThumbnailDecodeTask(0x%08x)::ThumbnailProviderReady(aError=%d, aBitmap=0x%08x)", |
126 TN_DEBUG4( "CThumbnailDecodeTask(0x%08x)::ThumbnailProviderReady(aError=%d, aBitmap=0x%08x)", |
140 this, aError, aBitmap ); |
127 this, aError, aBitmap ); |
141 OstTrace1( TRACE_NORMAL, CTHUMBNAILDECODETASK_THUMBNAILPROVIDERREADY, "CThumbnailDecodeTask::ThumbnailProviderReady;this=%o", this ); |
|
142 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILDECODETASK_THUMBNAILPROVIDERREADY, "CThumbnailDecodeTask::ThumbnailProviderReady;aError=%d", aError ); |
|
143 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILDECODETASK_THUMBNAILPROVIDERREADY, "CThumbnailDecodeTask::ThumbnailProviderReady;aBitmap=%o", aBitmap ); |
|
144 |
128 |
145 iOriginalSize = aOriginalSize; |
129 iOriginalSize = aOriginalSize; |
146 |
130 |
147 if ( aError ) |
131 if ( aError ) |
148 { |
132 { |