191 iMmcSoundsPath = mmcSoundPath.Right( mmcSoundPath.Length() - 1 ).AllocL(); |
191 iMmcSoundsPath = mmcSoundPath.Right( mmcSoundPath.Length() - 1 ).AllocL(); |
192 } |
192 } |
193 |
193 |
194 void CHarvesterOMADRMPlugin::HarvestL( CHarvesterData* aHarvesterData ) |
194 void CHarvesterOMADRMPlugin::HarvestL( CHarvesterData* aHarvesterData ) |
195 { |
195 { |
196 WRITELOG( "CHarvesterImagePlugin::HarvestL()" ); |
196 WRITELOG( "CHarvesterOMADRMPlugin::HarvestL()" ); |
197 CMdEObject& mdeObject = aHarvesterData->MdeObject(); |
197 CMdEObject& mdeObject = aHarvesterData->MdeObject(); |
198 CDRMHarvestData* drmHarvestData = CDRMHarvestData::NewL(); |
198 CDRMHarvestData* drmHarvestData = CDRMHarvestData::NewL(); |
199 CleanupStack::PushL( drmHarvestData ); |
199 CleanupStack::PushL( drmHarvestData ); |
200 |
200 |
201 CFileData* fileData = CFileData::NewL(); |
201 CFileData* fileData = CFileData::NewL(); |
328 if ( err != KErrNone) |
328 if ( err != KErrNone) |
329 { |
329 { |
330 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting protection info failed %d", err ); |
330 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting protection info failed %d", err ); |
331 } |
331 } |
332 |
332 |
333 CImageDecoder* decoder = NULL; |
333 if( aMetadataObject.Def().Name() == MdeConstants::Image::KImageObject ) |
334 |
334 { |
335 TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, |
335 CImageDecoder* decoder = NULL; |
336 ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode ))); |
336 |
337 |
337 TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, |
338 CleanupStack::PushL( decoder ); |
338 ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode ))); |
339 |
339 |
340 if(decoder && !err) |
340 CleanupStack::PushL( decoder ); |
341 { |
341 |
342 WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." ); |
342 if(decoder && !err) |
343 // Get image width, frame count, height and bits per pixel from image decoder. |
343 { |
344 const TFrameInfo info = decoder->FrameInfo( 0 ); |
344 WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." ); |
345 const TSize imageSize = info.iOverallSizeInPixels; |
345 // Get image width, frame count, height and bits per pixel from image decoder. |
346 const TInt framecount = decoder->FrameCount(); |
346 const TFrameInfo info = decoder->FrameInfo( 0 ); |
347 aFileData.iFrameCount = framecount; |
347 const TSize imageSize = info.iOverallSizeInPixels; |
348 aFileData.iImageWidth = imageSize.iWidth; |
348 const TInt framecount = decoder->FrameCount(); |
349 aFileData.iImageHeight = imageSize.iHeight; |
349 aFileData.iFrameCount = framecount; |
350 aFileData.iBitsPerPixel = info.iBitsPerPixel; |
350 aFileData.iImageWidth = imageSize.iWidth; |
351 } |
351 aFileData.iImageHeight = imageSize.iHeight; |
352 else |
352 aFileData.iBitsPerPixel = info.iBitsPerPixel; |
353 { |
353 } |
354 WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err ); |
354 else |
355 } |
355 { |
356 |
356 WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err ); |
357 CleanupStack::PopAndDestroy( 4 ); // content, data, attrSet, imagedecoder |
357 } |
|
358 CleanupStack::PopAndDestroy( decoder ); |
|
359 } |
|
360 |
|
361 |
|
362 CleanupStack::PopAndDestroy( 3 ); // content, data, attrSet |
358 return KErrNone; |
363 return KErrNone; |
359 } |
364 } |
360 |
365 |
361 // --------------------------------------------------------------------------- |
366 // --------------------------------------------------------------------------- |
362 // HandleObjectPropertiesL |
367 // HandleObjectPropertiesL |