photosgallery/viewframework/tvout/src/glxactivedecoder.cpp
changeset 0 4e91876724a2
child 9 6b87b143d312
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    
       
    15 *
       
    16 */
       
    17 
       
    18 #include <glxtracer.h>
       
    19 #include <glxlog.h>
       
    20 #include "glxactivedecoder.h"
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // NewL
       
    24 // -----------------------------------------------------------------------------
       
    25 CGlxHdmiDecoderAO* CGlxHdmiDecoderAO::NewL(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater,
       
    26         TInt aFrameCount)
       
    27     {
       
    28     TRACER("CGlxHdmiDecoderAO::NewL()");
       
    29     CGlxHdmiDecoderAO* self = new (ELeave) CGlxHdmiDecoderAO(aHdmiSurfaceUpdater, 
       
    30                                                                         aFrameCount);
       
    31     return self;
       
    32     }
       
    33     
       
    34 // -----------------------------------------------------------------------------
       
    35 // CGlxHdmiDecoderAO()
       
    36 // -----------------------------------------------------------------------------
       
    37 CGlxHdmiDecoderAO::CGlxHdmiDecoderAO(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater,
       
    38         TInt aFrameCount):CActive(CActive::EPriorityStandard-1),
       
    39     iHdmiSurfaceUpdater(aHdmiSurfaceUpdater), iFrameCount(aFrameCount)
       
    40     {
       
    41     TRACER("CGlxHdmiDecoderAO::CGlxHdmiDecoderAO()");
       
    42     iDecodeCount = 0;
       
    43     CActiveScheduler::Add(this);
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // ~CGlxHdmiDecoderAO
       
    48 // Cancel the outstanding request
       
    49 // -----------------------------------------------------------------------------
       
    50 CGlxHdmiDecoderAO::~CGlxHdmiDecoderAO()
       
    51     {
       
    52     TRACER("CGlxHdmiDecoderAO::~CGlxHdmiDecoderAO()");  
       
    53     }
       
    54     
       
    55 // -----------------------------------------------------------------------------
       
    56 // RunL
       
    57 // Calls iHdmiSurfaceUpdater->HandleRunL() which is expected to handle the call
       
    58 // -----------------------------------------------------------------------------
       
    59 void CGlxHdmiDecoderAO::RunL()
       
    60     {
       
    61     TRACER("CGlxHdmiDecoderAO::RunL()");
       
    62     iHdmiSurfaceUpdater->HandleRunL();
       
    63     CActiveScheduler::Stop();    
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // DoCancel
       
    68 // -----------------------------------------------------------------------------
       
    69 void CGlxHdmiDecoderAO::DoCancel()
       
    70     {
       
    71     TRACER("CGlxHdmiDecoderAO::DoCancel()");
       
    72     iDecoder->Cancel();
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // ConvertImageL
       
    77 // -----------------------------------------------------------------------------
       
    78 void CGlxHdmiDecoderAO::ConvertImageL(CFbsBitmap& aBitmap, TInt aFrameNum,
       
    79         CImageDecoder* aDecoder)
       
    80     {
       
    81     TRACER("CGlxHdmiDecoderAO::ConvertImageL()");
       
    82     iDecoder = aDecoder;
       
    83     iDecoder->Convert(&iStatus,aBitmap, aFrameNum); 
       
    84     SetActive();
       
    85     CActiveScheduler::Start();
       
    86     }
       
    87     
       
    88 
       
    89