23 |
23 |
24 #include <IclExtJpegApi.h> |
24 #include <IclExtJpegApi.h> |
25 #include "thumbnailimagedecoderv3.h" |
25 #include "thumbnailimagedecoderv3.h" |
26 #include "thumbnaillog.h" |
26 #include "thumbnaillog.h" |
27 #include "thumbnailpanic.h" |
27 #include "thumbnailpanic.h" |
|
28 #include "OstTraceDefinitions.h" |
|
29 #ifdef OST_TRACE_COMPILER_IN_USE |
|
30 #include "thumbnailimagedecoderv3Traces.h" |
|
31 #endif |
|
32 |
28 |
33 |
29 |
34 |
30 // CImageDecoder supports up to 1/8 size reduction if EFullyScaleable is |
35 // CImageDecoder supports up to 1/8 size reduction if EFullyScaleable is |
31 // not set. |
36 // not set. |
32 const TInt KMaximumReductionFactor = 8; |
37 const TInt KMaximumReductionFactor = 8; |
66 aObserver, const CThumbnailManager::TThumbnailFlags /*aFlags*/, const |
71 aObserver, const CThumbnailManager::TThumbnailFlags /*aFlags*/, const |
67 TDataType& aMimeType, const TSize& aSize ) |
72 TDataType& aMimeType, const TSize& aSize ) |
68 { |
73 { |
69 |
74 |
70 TN_DEBUG1( "CCThumbnailImageDecoderv3::CreateL() called" ); |
75 TN_DEBUG1( "CCThumbnailImageDecoderv3::CreateL() called" ); |
|
76 OstTrace0( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_CREATEL, "CThumbnailImageDecoderv3::CreateL" ); |
71 |
77 |
72 iSize = aSize; |
78 iSize = aSize; |
73 iMimeType = aMimeType; |
79 iMimeType = aMimeType; |
74 iObserver = &aObserver; |
80 iObserver = &aObserver; |
75 iBuffer = aBuffer; |
81 iBuffer = aBuffer; |
222 CExtJpegDecoder::EHwImplementation, iFs, *iBuffer, options )); |
231 CExtJpegDecoder::EHwImplementation, iFs, *iBuffer, options )); |
223 |
232 |
224 if ( decErr != KErrNone ) |
233 if ( decErr != KErrNone ) |
225 { |
234 { |
226 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr); |
235 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder failed %d", decErr); |
|
236 OstTrace1( TRACE_NORMAL, CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - HW CExtJpegDecoder failed;decErr=%d", decErr ); |
227 |
237 |
228 LeaveIfCorruptL( decErr ); |
238 LeaveIfCorruptL( decErr ); |
229 |
239 |
230 TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL( |
240 TRAP( decErr, iDecoder = CExtJpegDecoder::DataNewL( |
231 CExtJpegDecoder::ESwImplementation, iFs, *iBuffer, options )); |
241 CExtJpegDecoder::ESwImplementation, iFs, *iBuffer, options )); |
232 |
242 |
233 if ( decErr != KErrNone ) |
243 if ( decErr != KErrNone ) |
234 { |
244 { |
235 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr); |
245 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder failed %d", decErr); |
|
246 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - SW CExtJpegDecoder failed;decErr=%d", decErr ); |
236 |
247 |
237 LeaveIfCorruptL( decErr ); |
248 LeaveIfCorruptL( decErr ); |
238 // don't force any mime type |
249 // don't force any mime type |
239 TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) ); |
250 TRAPD( decErr, iDecoder = CImageDecoder::DataNewL( iFs, *iBuffer, options ) ); |
240 if ( decErr != KErrNone ) |
251 if ( decErr != KErrNone ) |
241 { |
252 { |
242 Release(); |
253 Release(); |
243 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder error %d", decErr ); |
254 TN_DEBUG2( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder error %d", decErr ); |
|
255 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - CImageDecoder error;decErr=%d", decErr ); |
244 |
256 |
245 User::Leave( decErr ); |
257 User::Leave( decErr ); |
246 } |
258 } |
247 |
259 |
248 TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder created" ); |
260 TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - CImageDecoder created" ); |
|
261 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - CImageDecoder created" ); |
249 } |
262 } |
250 else |
263 else |
251 { |
264 { |
252 TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder created" ); |
265 TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - SW CExtJpegDecoder created" ); |
|
266 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - SW CExtJpegDecoder created" ); |
253 } |
267 } |
254 } |
268 } |
255 else |
269 else |
256 { |
270 { |
257 TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder created" ); |
271 TN_DEBUG1( "CThumbnailImageDecoderv3::CreateDecoderL() - HW CExtJpegDecoder created" ); |
|
272 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILIMAGEDECODERV3_CREATEDECODERL, "CThumbnailImageDecoderv3::CreateDecoderL - HW CExtJpegDecoder created" ); |
258 } |
273 } |
259 } |
274 } |
260 |
275 |
261 |
276 |
262 // ----------------------------------------------------------------------------- |
277 // ----------------------------------------------------------------------------- |