connectivitymodules/SeCon/services/pcd/src/sconvideoparser.cpp
branchRCL_3
changeset 1 f8e15b44d440
parent 0 d0791faffa3f
child 13 81da3301b632
equal deleted inserted replaced
0:d0791faffa3f 1:f8e15b44d440
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    55     if ( iVideoUtil )
    55     if ( iVideoUtil )
    56         {
    56         {
    57         iVideoUtil->Close();
    57         iVideoUtil->Close();
    58         }
    58         }
    59     delete iVideoUtil;
    59     delete iVideoUtil;
       
    60     
       
    61     if ( iWindow )
       
    62         {
       
    63         iWindow->Close();
       
    64         }
       
    65     delete iWindow;
       
    66     iRootWindow.Close();
    60     delete iScreen;
    67     delete iScreen;
    61     iWsSession.Close();
    68     iWsSession.Close();
    62     
    69     
    63     delete iThumbnail;
    70     delete iThumbnail;
    64     delete iVideoMimeType;
    71     delete iVideoMimeType;
    88     TRACE_FUNC_ENTRY;
    95     TRACE_FUNC_ENTRY;
    89     
    96     
    90     User::LeaveIfError( iWsSession.Connect() );
    97     User::LeaveIfError( iWsSession.Connect() );
    91     
    98     
    92     iScreen = new(ELeave) CWsScreenDevice( iWsSession );
    99     iScreen = new(ELeave) CWsScreenDevice( iWsSession );
    93     iScreen->Construct();
   100     User::LeaveIfError( iScreen->Construct() );
    94     
   101     
    95     RWindowGroup wg( iWsSession );
   102     iRootWindow = RWindowGroup(iWsSession);
    96     User::LeaveIfError( wg.Construct(reinterpret_cast<TUint32>(&wg), EFalse) );
   103     User::LeaveIfError( iRootWindow.Construct(reinterpret_cast<TUint32>(&iWsSession), EFalse) );
    97     CleanupClosePushL( wg );
   104     
    98     
   105     iWindow = new(ELeave) RWindow( iWsSession );
    99     CWindowGc* gc;
   106     User::LeaveIfError( iWindow->Construct(iRootWindow, reinterpret_cast<TUint32>(&iRootWindow) + 1) );
   100     User::LeaveIfError( iScreen->CreateContext(gc) );
       
   101     CleanupStack::PushL(gc);
       
   102     
       
   103     RWindow window( iWsSession );
       
   104     User::LeaveIfError( window.Construct(wg, reinterpret_cast<TUint32>(&wg) + 1) );
       
   105     CleanupClosePushL( window );
       
   106     
   107     
   107     TRect temp(0,0,320,240); // dummy parameter
   108     TRect temp(0,0,320,240); // dummy parameter
   108     iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *(iScreen), window, temp, temp);
   109     iVideoUtil = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceNone, iWsSession, *iScreen, *iWindow, temp, temp);
   109     
       
   110     CleanupStack::PopAndDestroy( &window );
       
   111     CleanupStack::PopAndDestroy( gc );
       
   112     CleanupStack::PopAndDestroy( &wg );
       
   113     
   110     
   114     iTimeOut = CSconTimeOut::NewL( *this );
   111     iTimeOut = CSconTimeOut::NewL( *this );
   115     
   112     
   116     TRACE_FUNC_EXIT;
   113     TRACE_FUNC_EXIT;
   117     }
   114     }