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