harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp
branchRCL_3
changeset 21 85f623e1ef41
parent 20 f23c07ec56e2
child 22 29d87345eaeb
equal deleted inserted replaced
20:f23c07ec56e2 21:85f623e1ef41
   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( "CHarvesterOMADRMPlugin::HarvestL()" );
   196 	WRITELOG( "CHarvesterImagePlugin::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     if( aMetadataObject.Def().Name() == MdeConstants::Image::KImageObject )
   333     CImageDecoder* decoder = NULL;
   334         {
   334 
   335         CImageDecoder* decoder = NULL;
   335     TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, 
   336 
   336             ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode )));
   337         TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, 
   337 
   338                 ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode )));
   338     CleanupStack::PushL( decoder );
   339 
   339     
   340         CleanupStack::PushL( decoder );
   340     if(decoder && !err)
   341     
   341         {
   342         if(decoder && !err)
   342         WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." );        
   343             {
   343         // Get image width, frame count, height and bits per pixel from image decoder.
   344             WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." );        
   344         const TFrameInfo info = decoder->FrameInfo( 0 );
   345             // Get image width, frame count, height and bits per pixel from image decoder.
   345         const TSize imageSize = info.iOverallSizeInPixels;
   346             const TFrameInfo info = decoder->FrameInfo( 0 );
   346         const TInt framecount = decoder->FrameCount();
   347             const TSize imageSize = info.iOverallSizeInPixels;
   347         aFileData.iFrameCount = framecount;
   348             const TInt framecount = decoder->FrameCount();
   348         aFileData.iImageWidth = imageSize.iWidth;
   349             aFileData.iFrameCount = framecount;
   349         aFileData.iImageHeight = imageSize.iHeight;
   350             aFileData.iImageWidth = imageSize.iWidth;
   350         aFileData.iBitsPerPixel = info.iBitsPerPixel;
   351             aFileData.iImageHeight = imageSize.iHeight;
   351         }
   352             aFileData.iBitsPerPixel = info.iBitsPerPixel;
   352     else
   353             }
   353         {
   354         else
   354         WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err );
   355             {
   355         }
   356             WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err );
   356 
   357             }    
   357     CleanupStack::PopAndDestroy( 4 ); // content, data, attrSet, imagedecoder
   358         CleanupStack::PopAndDestroy( decoder );
       
   359         }
       
   360 
       
   361 
       
   362     CleanupStack::PopAndDestroy( 3 ); // content, data, attrSet
       
   363     return KErrNone;
   358     return KErrNone;
   364     }
   359     }
   365 
   360 
   366 // ---------------------------------------------------------------------------
   361 // ---------------------------------------------------------------------------
   367 // HandleObjectPropertiesL
   362 // HandleObjectPropertiesL