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