vtengines/videoteleng/Src/Media/CVtEngDrawDSA.cpp
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Remote video handler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "CVtEngDrawDSA.h"
       
    22 #include "CVtEngEventManager.h"
       
    23 #include "VtEngPanic.h"
       
    24 #include "MVtEngFrameObserver.h"
       
    25 #include "CVtEngSettings.h"
       
    26 #include "VtEngUtils.h"
       
    27 #include <videotelephonyvariant.hrh>
       
    28 #include <tdisplaysinkparamsdsa.h>
       
    29 #include <cvtlogger.h>
       
    30 
       
    31 // LOCAL CONSTANTS
       
    32 
       
    33 // Default display mode.
       
    34 const TDisplayMode KVtEngDefaultDisplayMode( EColor64K );
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CVtEngDrawDSA::NewL
       
    38 // Symbian 2nd phase constructor can leave.
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CVtEngDrawDSA* CVtEngDrawDSA::NewL(
       
    42     MDisplaySinkObserver* aObserver )
       
    43     {
       
    44     CVtEngDrawDSA* self = new ( ELeave ) CVtEngDrawDSA( aObserver );
       
    45     CleanupStack::PushL( self );
       
    46     self->ConstructL( );
       
    47     CleanupStack::Pop();
       
    48     return self;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CVtEngDrawDSA::~CVtEngDrawDSA
       
    53 // Destructor. Cannot leave.
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 CVtEngDrawDSA::~CVtEngDrawDSA()
       
    57     {
       
    58     __VTPRINTENTER( "RVD(DSA).~" )
       
    59     Cancel();
       
    60     delete iBitmap1;
       
    61     delete iBitmap2;
       
    62     if ( iImageScaler )
       
    63         {
       
    64         iImageScaler->Release();
       
    65         }
       
    66     __VTPRINTEXIT( "RVD(DSA).~" )
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CVtEngDrawDSA::CVtEngDrawDSA
       
    71 // C++ constructor. Cannot leave.
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CVtEngDrawDSA::CVtEngDrawDSA( MDisplaySinkObserver* aObserver ) :
       
    75     CVtEngDraw( aObserver ), iBitmapSetAvail( ETrue )
       
    76     {
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CVtEngDrawDSA::BaseConstructL
       
    81 // Base construction.
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CVtEngDrawDSA::BaseConstructL( )
       
    85     {
       
    86     __VTPRINTENTER( "RVD(DSA).BaseConstructL" )
       
    87     TSize vtEngRemoteVideoDefaultSize( KVtEngRemoteVideoDefaultWidth,
       
    88         KVtEngRemoteVideoDefaultHeight );
       
    89 
       
    90     iBitmap1 = new ( ELeave ) CFbsBitmap();
       
    91     User::LeaveIfError( iBitmap1->Create(
       
    92         vtEngRemoteVideoDefaultSize, KVtEngDefaultDisplayMode ) );
       
    93     iBitmap2 = new ( ELeave ) CFbsBitmap();
       
    94     User::LeaveIfError( iBitmap2->Create(
       
    95         vtEngRemoteVideoDefaultSize, KVtEngDefaultDisplayMode ) );
       
    96     iImageScaler = VtEngScalerFactory::CreateScalerL( *this );
       
    97     __VTPRINT2( DEBUG_MEDIA | DEBUG_CONSTRUCT,
       
    98         "RVD.ConL scaler ok %d", iImageScaler != NULL )
       
    99     __VTPRINTEXIT( "RVD(DSA).BaseConstructL" )
       
   100     }
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // CVtEngDrawDSA::CreateSinkL
       
   104 // Instantiates display sink.
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 MDisplaySink* CVtEngDrawDSA::CreateSinkL()
       
   108     {
       
   109     __VTPRINTENTER( "RVD(DSA).CreateSinkL" )
       
   110     TDisplaySinkParamsDSA params;
       
   111     GetSinkParams( params );
       
   112     MDisplaySink* sink = ::CreateSinkL( params, KNullDesC8 );
       
   113     __VTPRINTEXITR( "RVD(DSA).CreateSinkL flags=%d", params.iFlags )
       
   114     return sink;
       
   115     }
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // CVtEngDrawDSA::BaseDoCancel
       
   119 // DoCancel for derived class.
       
   120 // -----------------------------------------------------------------------------
       
   121 //
       
   122 void CVtEngDrawDSA::BaseDoCancel()
       
   123     {
       
   124     __VTPRINTENTER( "RVD(DSA).BaseDoCancel" )
       
   125     __VTPRINTEXIT( "RVD(DSA).BaseDoCancel" )
       
   126     }
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // CVtEngDrawDSA::BaseVerifyConfigL
       
   130 // Checks current configuration against DSA implementation.
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 void CVtEngDrawDSA::BaseVerifyConfigL()
       
   134     {
       
   135     __VTPRINTENTER( "RVD(DSA).BaseVerifyConfigL" )
       
   136     __VTPRINTEXIT( "RVD(DSA).BaseVerifyConfigL" )
       
   137     }
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // CVtEngDrawDSA::BaseRestartL
       
   141 // -----------------------------------------------------------------------------
       
   142 //
       
   143 void CVtEngDrawDSA::BaseRestartL()
       
   144     {
       
   145     __VTPRINTENTER( "RVD(DSA).BaseRestartL" )
       
   146     __VTPRINTEXIT( "RVD(DSA).BaseRestartL" )
       
   147     }
       
   148 
       
   149 // -----------------------------------------------------------------------------
       
   150 // CVtEngDrawDSA::BaseAbortNow
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 void CVtEngDrawDSA::BaseAbortNow()
       
   154     {
       
   155     __VTPRINTENTER( "RVD(DSA).BaseAbortNow" )
       
   156     __VTPRINTEXIT( "RVD(DSA).BaseAbortNow" )
       
   157     }
       
   158 
       
   159 // -----------------------------------------------------------------------------
       
   160 // CVtEngDrawDSA::BaseStartDrawL
       
   161 // Starts the drawing.
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 void CVtEngDrawDSA::BaseStartDrawL()
       
   165     {
       
   166     __VTPRINTENTER( "RVD(DSA).BaseStartDrawL" )
       
   167     if ( iDSA )
       
   168         {
       
   169         SetFlag( EReadyInternal );
       
   170         if ( !IsActive() )
       
   171             {
       
   172             Activate();
       
   173             iDisplaySink->SetBitmapAvailable( MDisplaySink::EFirstBitmap );
       
   174             __VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   175                 "RVD(DSA).BaseStartDrawL bmp avail done" )
       
   176             iWatcher->Start( KVtEngWatcherTimeout, KVtEngWatcherTimeout,
       
   177                 iCallback );
       
   178             }
       
   179         SetFlag( ERemoteVideoDrawing );
       
   180         }
       
   181     else
       
   182         {
       
   183         User::Leave( KErrNotReady );
       
   184         }
       
   185     __VTPRINTEXIT( "RVD(DSA).BaseStartDrawL" )
       
   186     }
       
   187 
       
   188 // -----------------------------------------------------------------------------
       
   189 // CVtEngDrawDSA::BaseStopDraw
       
   190 // Stop the drawing.
       
   191 // -----------------------------------------------------------------------------
       
   192 //
       
   193 void CVtEngDrawDSA::BaseStopDraw()
       
   194     {
       
   195     // Cancel the timer in any case.
       
   196     __VTPRINTENTER( "RVD(DSA).BaseStopDraw" )
       
   197     iWatcher->Cancel();
       
   198     if ( iDSA )
       
   199         {
       
   200         ClearFlag( ERemoteVideoDrawing | EStarted );
       
   201         iDSA->Cancel();
       
   202         }
       
   203 
       
   204     // Stop also scaling
       
   205     if ( iImageScaler )
       
   206         {
       
   207         iImageScaler->Cancel();
       
   208         }
       
   209 
       
   210     Cancel();
       
   211     __VTPRINTEXIT( "RVD(DSA).BaseStopDraw" )
       
   212     }
       
   213 
       
   214 // -----------------------------------------------------------------------------
       
   215 // CVtEngDrawDSA::BaseSetConfigL
       
   216 // Sets new configuration.
       
   217 // -----------------------------------------------------------------------------
       
   218 //
       
   219 void CVtEngDrawDSA::BaseSetConfigL( const TVtEngRenderConfig& aConfig )
       
   220     {
       
   221     __VTPRINTENTER( "RVD(DSA).BaseSetConfigL" )
       
   222     Mem::FillZ( &iConfig, sizeof( TVtEngRenderConfigDSA ) );
       
   223     iConfig = aConfig;
       
   224     ConfigUpdatedL();
       
   225     __VTPRINTEXIT( "RVD(DSA).BaseSetConfigL" )
       
   226     }
       
   227 
       
   228 // -----------------------------------------------------------------------------
       
   229 // CVtEngDrawDSA::BaseSetUIForegroundL
       
   230 // Sets UI foreground status.
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233 void CVtEngDrawDSA::BaseSetUIForegroundL( TBool aForeground )
       
   234     {
       
   235     __VTPRINTENTER( "RVD(DSA).BaseSetUIForegroundL" )
       
   236     if ( aForeground )
       
   237         {
       
   238         TBool wasSentToBackground( IsFlag( ESentToBackground ) );
       
   239         SetFlag( EFlagUIForeground );
       
   240         ClearFlag( ESentToBackground );
       
   241         if ( wasSentToBackground )
       
   242             {
       
   243             BaseRefreshBitmapsL();
       
   244             Restart( RDirectScreenAccess::ETerminateCancel );
       
   245             BaseStartDrawL();
       
   246             }
       
   247         }
       
   248     else
       
   249         {
       
   250         BaseStopDraw();
       
   251         ClearFlag( EFlagUIForeground );
       
   252         SetFlag( ESentToBackground );
       
   253         }
       
   254     __VTPRINTEXIT( "RVD(DSA).BaseSetUIForegroundL" )
       
   255     }
       
   256 
       
   257 // -----------------------------------------------------------------------------
       
   258 // CVtEngDrawDSA::BaseVideoFrameSizeChangedL
       
   259 // Called when incoming frame buffer size changes.
       
   260 // -----------------------------------------------------------------------------
       
   261 //
       
   262 void CVtEngDrawDSA::BaseVideoFrameSizeChangedL( const TSize& /*aTo*/ )
       
   263     {
       
   264     __VTPRINTENTER( "RVD(DSA).BaseVideoFrameSizeChangedL" )
       
   265     __VTPRINTEXIT( "RVD(DSA).BaseVideoFrameSizeChangedL" )
       
   266     }
       
   267 
       
   268 // -----------------------------------------------------------------------------
       
   269 // CVtEngDrawDSA::BaseRequestLastFrame
       
   270 // Request update last remote video frame through MVtEngFrameObserver::vtSetFrame
       
   271 // -----------------------------------------------------------------------------
       
   272 //
       
   273 void CVtEngDrawDSA::BaseRequestLastFrame()
       
   274     {
       
   275     __VTPRINTENTER( "RVD(DSA).BaseRequestLastFrame" )
       
   276     __VTPRINTEXIT( "RVD(DSA).BaseRequestLastFrame" )    
       
   277     }
       
   278 
       
   279 // -----------------------------------------------------------------------------
       
   280 // CVtEngDrawDSA::Config
       
   281 // Returns current configuration.
       
   282 // -----------------------------------------------------------------------------
       
   283 //
       
   284 TVtEngRenderConfig& CVtEngDrawDSA::Config()
       
   285     {
       
   286     return iConfig;
       
   287     }
       
   288 
       
   289 // -----------------------------------------------------------------------------
       
   290 // CVtEngDrawDSA::RunL
       
   291 // CActive heir execution method.
       
   292 // -----------------------------------------------------------------------------
       
   293 //
       
   294 void CVtEngDrawDSA::RunL()
       
   295     {
       
   296     __VTPRINTENTER( "RVD(DSA).RunL" )
       
   297     __VTPRINT2( DEBUG_MEDIA, "  bmpNo=%d", iBitmapNo )
       
   298     iBitmapNo = iStatus.Int() == 0 ?
       
   299         MDisplaySink::ESecondBitmap :
       
   300         MDisplaySink::EFirstBitmap ;
       
   301 
       
   302     iBitmapSetAvail = EFalse;
       
   303 
       
   304     TBool dropFrame( EFalse );
       
   305 
       
   306     if ( !iDSUpdated )
       
   307         {
       
   308         __VTPRINT( DEBUG_MEDIA, "RVD(DSA).RunL !Updated" )
       
   309         dropFrame = ETrue;
       
   310         }
       
   311     else if ( !IsFlag( EFlagUIForeground ) )
       
   312         {
       
   313         __VTPRINT( DEBUG_MEDIA, "RVD(DSA).RunL !Flag( EFlagUIForeground )" )
       
   314         dropFrame = ETrue;
       
   315         }
       
   316 
       
   317     if ( dropFrame )
       
   318         {
       
   319         iBitmapSetAvail = ETrue;
       
   320         Activate();
       
   321         iDisplaySink->SetBitmapAvailable( iBitmapNo );
       
   322         __VTPRINTEXIT( "RVD(DSA).RunL" )
       
   323         return;
       
   324         }
       
   325 
       
   326     // Image received, reset counter.
       
   327     iCheckpoint = KVtEngWatcherThreshold;
       
   328 
       
   329     __VTPRINT2( DEBUG_MEDIA, "RVD(DSA).RunL iStatus=%d", iStatus.Int() )
       
   330     if ( iStatus >= KErrNone )
       
   331         {
       
   332         __VTPRINT2( DEBUG_MEDIA, "RVD(DSA).RunL flags=%d", iFlags )
       
   333         TBool firstFrame( !IsFlag ( EFirstFrameReceived ) );
       
   334         SetFlag( EFirstFrameReceived );
       
   335 
       
   336         // Remote video is about to start?
       
   337         if ( !IsFlag( EStarted ) && IsFlag( EReadyInternal ) )
       
   338             {
       
   339             SetFlag( EStarted );
       
   340             iDSA->StartL();
       
   341             if ( !iConfig.iClipRect.IsEmpty() )
       
   342                 {
       
   343                 SetFlag( EReadyForeground );
       
   344                 iDSA->Gc()->SetClippingRect( iConfig.iClipRect );
       
   345                 }
       
   346             __VTPRINT( DEBUG_MEDIA, "RVD(DSA).RunL notify rvd start" )
       
   347             //CVtEngEventManager::NotifyEvent( KVtEngRemoteVideoStarted );
       
   348             }
       
   349         if ( firstFrame )
       
   350             {
       
   351             CVtEngEventManager::NotifyEvent( KVtEngRemoteVideoStarted );
       
   352             }
       
   353         if ( IsFlag( EStarted ) )
       
   354             {
       
   355             __VTPRINT( DEBUG_MEDIA, "RVD(DSA).RunL refresh" )
       
   356             BaseRefreshL();
       
   357             }
       
   358         }
       
   359     else
       
   360         {
       
   361         __VTPRINT( DEBUG_MEDIA, "RVD.RunL notify rvd problem" )
       
   362         CVtEngEventManager::NotifyEvent( KVtEngRemoteRenderingProblem );
       
   363         __VTPRINTEXIT( "RVD(DSA).RunL" )
       
   364         return;
       
   365         }
       
   366 
       
   367     __VTPRINT( DEBUG_MEDIA, "RVD.RunL setting active" )
       
   368     Activate();
       
   369 
       
   370     // Set bitmap only if not to be scaled
       
   371     if( !iImageScaler )
       
   372         {
       
   373         if ( !iBitmapSetAvail )
       
   374             {
       
   375             iDisplaySink->SetBitmapAvailable( iBitmapNo );
       
   376             iBitmapSetAvail = ETrue;
       
   377             }
       
   378         __VTPRINT( DEBUG_MEDIA, "RVD(DSA).ScalingCompleted set bmp available" )
       
   379         }
       
   380 
       
   381     __VTPRINTEXIT( "RVD(DSA).RunL" )
       
   382     }
       
   383 
       
   384 // -----------------------------------------------------------------------------
       
   385 // CVtEngDrawDSA::ScalingCompleted
       
   386 // Callback to receive scaled images.
       
   387 // Draws received image.
       
   388 // -----------------------------------------------------------------------------
       
   389 //
       
   390 void CVtEngDrawDSA::ScalingCompleted(
       
   391     CFbsBitmap* aBitmap,
       
   392     TInt aError )
       
   393     {
       
   394     __VTPRINTENTER( "RVD(DSA).ScalingCompleted" )
       
   395     __VTPRINT2( DEBUG_MEDIA, "RVD(DSA).ScalingReady %d", aError )
       
   396     __VTPRINT2( DEBUG_MEDIA, "RVD(DSA).ScalingReady image %d", aBitmap ? 1 : 0 )
       
   397     if ( aError == KErrNone &&
       
   398          aBitmap != NULL )
       
   399         {
       
   400         DrawBitmap( *aBitmap );
       
   401         if ( !iBitmapSetAvail )
       
   402             {
       
   403             // Set bitmap available if not already set
       
   404             __VTPRINT( DEBUG_MEDIA, "RVD(DSA).ScalingCompleted set bmp available" )
       
   405             Activate();
       
   406             iDisplaySink->SetBitmapAvailable( iBitmapNo );
       
   407             iBitmapSetAvail = ETrue;
       
   408             }
       
   409         __VTPRINT( DEBUG_MEDIA, "RVD(DSA).ScalingCompleted available?" )
       
   410         }
       
   411     else if ( aError != KErrCancel )
       
   412         {
       
   413         // Notification of failed scaling.
       
   414         CVtEngEventManager::NotifyEvent( KVtEngRemoteRenderingProblem );
       
   415         __VTPRINT( DEBUG_MEDIA, "RVD(DSA).ScalingReady problems" )
       
   416         }
       
   417     __VTPRINTEXITR( "RVD(DSA).ScalingCompleted err=%d", aError )
       
   418     }
       
   419 
       
   420 // -----------------------------------------------------------------------------
       
   421 // CVtEngDrawDSA::BaseRefreshL
       
   422 // If using scaler, start the scaling otherwise draw a bitmap.
       
   423 // -----------------------------------------------------------------------------
       
   424 //
       
   425 void CVtEngDrawDSA::BaseRefreshL()
       
   426     {
       
   427     __VTPRINTENTER( "RVD(DSA).BaseRefreshL" )
       
   428     if ( iConfig.iWindow )
       
   429         {
       
   430         if ( IsFlag( EReady ) && IsFlag( EFirstFrameReceived ) &&
       
   431                 IsFlag( EFlagUIForeground ) )
       
   432             {
       
   433             CFbsBitmap* current = iBitmapNo != 0 ? iBitmap1 : iBitmap2;
       
   434             if ( current )
       
   435                 {
       
   436                 if ( iImageScaler )
       
   437                     {
       
   438                     __VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   439                         "RVD(DSA).BaseRefreshL scaling" )
       
   440                     TInt index = 0;
       
   441                     if ( current == iBitmap2 )
       
   442                         {
       
   443                         index = 1;
       
   444                         }
       
   445                     iImageScaler->Cancel();
       
   446                     iImageScaler->ScaleL( index );
       
   447                     }
       
   448                 else
       
   449                     {
       
   450                     DrawBitmap( *current );
       
   451                     }
       
   452                 }
       
   453             }
       
   454         }
       
   455     __VTPRINTEXIT( "RVD(DSA).BaseRefreshL" )
       
   456     }
       
   457 
       
   458 // -----------------------------------------------------------------------------
       
   459 // CVtEngDrawDSA::BaseRefreshBitmapsL
       
   460 // Refreshes bitmaps sizes and display mode if needed.
       
   461 // -----------------------------------------------------------------------------
       
   462 //
       
   463 void CVtEngDrawDSA::BaseRefreshBitmapsL()
       
   464     {
       
   465     __VTPRINTENTER( "RVD(DSA).BaseRefreshBitmapsL" )
       
   466     const TDisplayMode currentMode( iConfig.iWsSreenDevice->DisplayMode() );
       
   467     TBool refreshDisplayMode = EFalse;
       
   468     TSize newSize( KVtEngRemoteVideoDefaultWidth,
       
   469         KVtEngRemoteVideoDefaultHeight );
       
   470 
       
   471     // Use new size if supplied
       
   472     if ( iSourceSize.iHeight > 0 && iSourceSize.iWidth > 0 )
       
   473         {
       
   474         newSize = iSourceSize;
       
   475         iSourceSize.iHeight = 0;
       
   476         iSourceSize.iWidth = 0;
       
   477         }
       
   478 
       
   479     __VTPRINT( DEBUG_MEDIA , "================== RVD.RFBM ==================" )
       
   480     __VTPRINT2( DEBUG_MEDIA , "    newSize.iWidth: %d", newSize.iWidth)
       
   481     __VTPRINT2( DEBUG_MEDIA , "    newSize.iHeight: %d ", newSize.iHeight )
       
   482     __VTPRINT( DEBUG_MEDIA , "================== RVD.RFBM ==================" )
       
   483 
       
   484     TBool refreshSize = EFalse;
       
   485     if ( iBitmap1 )
       
   486         {
       
   487         refreshDisplayMode = ( iBitmap1->DisplayMode() != currentMode );
       
   488         refreshSize = ( newSize != iBitmap1->SizeInPixels() );
       
   489         }
       
   490 
       
   491     // Delete and create the bitmaps
       
   492     if ( refreshDisplayMode || refreshSize || !iBitmap1 || !iBitmap2 )
       
   493         {
       
   494         __VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   495             "RVD(DSA).BaseRefreshBitmapsL bmp create" )
       
   496         if ( iImageScaler )
       
   497             {
       
   498             iImageScaler->Cancel();
       
   499             }
       
   500 
       
   501         iConfig.iObserver->vtSetFrame(
       
   502             MVtEngFrameObserver::ERemoteVideoFrame, 0 );
       
   503         delete iBitmap1;
       
   504         iBitmap1 = NULL;
       
   505         delete iBitmap2;
       
   506         iBitmap2 = NULL;
       
   507 
       
   508         iBitmap1 = new ( ELeave ) CFbsBitmap();
       
   509         User::LeaveIfError( iBitmap1->Create(
       
   510             newSize, currentMode ) );
       
   511         iBitmap2 = new ( ELeave ) CFbsBitmap();
       
   512         User::LeaveIfError( iBitmap2->Create(
       
   513             newSize, currentMode ) );
       
   514         ClearFlag( EFirstFrameReceived );
       
   515         }
       
   516 
       
   517     // set the params for DS
       
   518     TDisplaySinkParamsDSA params;
       
   519     GetSinkParams( params );
       
   520 
       
   521      // Update the scaler
       
   522     if ( iImageScaler )
       
   523         {
       
   524         // Try to configure first, if returns true
       
   525         // configure again
       
   526         __VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   527             "RVD(DSA).BaseRefreshBitmapsL cnfg" )
       
   528 
       
   529         iImageScaler->ConfigureL( currentMode,
       
   530         	iConfig.iRect.Size(), params.iBitmap1Handle,
       
   531         	params.iBitmap2Handle );
       
   532 
       
   533         if ( IsFlag( EFirstFrameReceived ) )
       
   534             {
       
   535             __VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   536                 "CVtEngDrawDSA::RefreshBitmapsL RFR" )
       
   537             BaseRefreshL();
       
   538             }
       
   539 
       
   540         }
       
   541 	__VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   542 	"RVD(DSA).BaseRefreshBitmapsL USP" )
       
   543 	__VTPRINT( DEBUG_MEDIA | DEBUG_DETAIL,
       
   544 	"RVD(DSA).BaseRefreshBitmapsL USP flag" )
       
   545     iDisplaySink->UpdateSinkParamsL( params, iDSUpdated );
       
   546     Activate();
       
   547     iDisplaySink->SetBitmapAvailable( MDisplaySink::EFirstBitmap );
       
   548     __VTPRINTEXIT( "RVD(DSA).BaseRefreshBitmapsL" )
       
   549     }
       
   550 
       
   551 // -----------------------------------------------------------------------------
       
   552 // CVtEngDrawDSA::DrawBitmap
       
   553 // Draws bitmap
       
   554 // -----------------------------------------------------------------------------
       
   555 //
       
   556 void CVtEngDrawDSA::DrawBitmap( CFbsBitmap& aBitmap )
       
   557     {
       
   558     __VTPRINTENTER( "RVD(DSA).DrawBitmap" )
       
   559     __ASSERT_ALWAYS( aBitmap.Handle(),
       
   560         Panic( EVtEngPanicInvalidBitmapHandle ) );
       
   561     __ASSERT_ALWAYS( iDSA, Panic( EVtEngPanicInvalidPointer ) );
       
   562     iDSA->Gc()->SetFaded( iConfig.iWindow->IsFaded() );
       
   563     iDSA->Gc()->BitBlt( iConfig.iRect.iTl, &aBitmap );
       
   564     iDSA->ScreenDevice()->Update();
       
   565     iConfig.iObserver->vtSetFrame( MVtEngFrameObserver::ERemoteVideoFrame,
       
   566         &aBitmap );
       
   567 	__VTPRINTEXITR( "RVD(DSA).DrawBitmap h=%d", aBitmap.Handle() )
       
   568     }
       
   569 
       
   570 // -----------------------------------------------------------------------------
       
   571 // CVtEngDrawDSA::GetSinkParams
       
   572 // -----------------------------------------------------------------------------
       
   573 //
       
   574 void CVtEngDrawDSA::GetSinkParams( TDisplaySinkParamsDSA& aSinkParams )
       
   575     {
       
   576     __VTPRINTENTER( "RVD(DSA).GetSinkParams" )
       
   577     aSinkParams.iThreadId = RThread().Id();
       
   578     aSinkParams.iRequestStatusPtr = &iStatus;
       
   579     aSinkParams.iObserver = iObserver;
       
   580     aSinkParams.iBitmap1Handle = iBitmap1->Handle();
       
   581     aSinkParams.iBitmap2Handle = iBitmap2->Handle();
       
   582     aSinkParams.iFlags = TDisplaySinkParams::EDisplaySinkDSA;
       
   583 	__VTPRINTEXIT( "RVD(DSA).GetSinkParams" )
       
   584     }
       
   585 
       
   586 //  End of File