tvout/src/glxactivedecoder.cpp
changeset 23 74c9f037fd5d
child 24 99ad1390cd33
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     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     if(iStatus == KErrUnderflow)
       
    63         {
       
    64         GLX_LOG_INFO("CGlxHdmiDecoderAO::RunL() - call continueconvert");
       
    65         iDecoder->ContinueConvert(&iStatus);
       
    66         }
       
    67     else
       
    68         {
       
    69         GLX_LOG_INFO("CGlxHdmiDecoderAO::RunL() - call handlerunL");
       
    70         iHdmiSurfaceUpdater->HandleRunL(iStatus);
       
    71         }
       
    72     }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // DoCancel
       
    76 // -----------------------------------------------------------------------------
       
    77 void CGlxHdmiDecoderAO::DoCancel()
       
    78     {
       
    79     TRACER("CGlxHdmiDecoderAO::DoCancel()");
       
    80     iDecoder->Cancel();
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // ConvertImageL
       
    85 // -----------------------------------------------------------------------------
       
    86 void CGlxHdmiDecoderAO::ConvertImageL(CFbsBitmap& aBitmap, TInt aFrameNum,
       
    87         CImageDecoder* aDecoder)
       
    88     {
       
    89     TRACER("CGlxHdmiDecoderAO::ConvertImageL()");
       
    90     if (iDecoder)
       
    91         {
       
    92         GLX_LOG_INFO("CGlxHdmiDecoderAO::ConvertImageL() -1");
       
    93         iDecoder = NULL;
       
    94         }
       
    95     iDecoder = aDecoder;
       
    96     GLX_LOG_INFO1("CGlxHdmiDecoderAO::ConvertImageL() FrameNo=%d",aFrameNum);
       
    97     iDecoder->Convert(&iStatus,aBitmap, aFrameNum); 
       
    98     SetActive();
       
    99     }
       
   100     
       
   101 
       
   102