mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.cpp
changeset 33 0267baa9dea9
parent 24 2672ba96448e
child 38 4269ca484c7b
equal deleted inserted replaced
24:2672ba96448e 33:0267baa9dea9
    23 #include <centralrepository.h>
    23 #include <centralrepository.h>
    24 
    24 
    25 const TUid KCRUidTvoutSettings = {0x1020730B};
    25 const TUid KCRUidTvoutSettings = {0x1020730B};
    26 const TUint32 KSettingsTvAspectRatio = 0x00000001;
    26 const TUint32 KSettingsTvAspectRatio = 0x00000001;
    27 
    27 
       
    28 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
    29 // make sure that off screen is bottom right and not top left. This makes it more efficient for GCE backend
       
    30 // to render
       
    31 const TInt KHiddenExtentA = 2000; // rect Ax and Ay co-ordinate used to set extent off screen
       
    32 const TInt KHiddenExtentB = 2001; // rect Bx and By co-ordinate used to set extent off screen
       
    33 #endif
       
    34 
    28 CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId, TBool aExtDisplaySwitchingControl)
    35 CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId, TBool aExtDisplaySwitchingControl)
    29 	{
    36 	{
    30 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL +++");
    37 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL +++");
    31     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aDisplayId %d", aDisplayId);
    38     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aDisplayId %d", aDisplayId);
    32     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aExtDisplaySwitchingControl %d", aExtDisplaySwitchingControl);
    39     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aExtDisplaySwitchingControl %d", aExtDisplaySwitchingControl);
    42 CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId,
    49 CMediaClientVideoDisplayBody* CMediaClientVideoDisplayBody::NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId,
    43 		const TRect& aCropRect, TVideoAspectRatio aAspectRatio, TBool aExtDisplaySwitchingControl)
    50 		const TRect& aCropRect, TVideoAspectRatio aAspectRatio, TBool aExtDisplaySwitchingControl)
    44 	{
    51 	{
    45 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL +++");
    52 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::NewL +++");
    46 	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aDisplayId %d", aDisplayId);
    53 	DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aDisplayId %d", aDisplayId);
    47     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::NewL - aSurfaceId 0x%X,0x%X,0x%X,0x%X", aSurfaceId.iInternal[0], aSurfaceId.iInternal[1], aSurfaceId.iInternal[2], aSurfaceId.iInternal[3]);
    54     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::NewL - aSurfaceId %08x:%08x:%08x:%08x", aSurfaceId.iInternal[3], aSurfaceId.iInternal[2], aSurfaceId.iInternal[1], aSurfaceId.iInternal[0]);
    48     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::NewL - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
    55     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::NewL - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
    49     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::NewL - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
    56     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::NewL - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
    50     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aExtDisplaySwitchingControl %d", aExtDisplaySwitchingControl);
    57     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::NewL - aExtDisplaySwitchingControl %d", aExtDisplaySwitchingControl);
    51 
    58 
    52 	if(aSurfaceId.IsNull())
    59 	if(aSurfaceId.IsNull())
   123 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody +++");
   130 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::~CMediaClientVideoDisplayBody +++");
   124 
   131 
   125 	// remove for whichever array is current
   132 	// remove for whichever array is current
   126 	RemoveBackgroundSurface(ETrue);
   133 	RemoveBackgroundSurface(ETrue);
   127 
   134 
       
   135 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
   136     if(iSwitchedToExternalDisplay)
       
   137         {
       
   138         SetWindowArrayPtr2Client();
       
   139         RemoveBackgroundSurface(ETrue);
       
   140         }
       
   141 #endif
       
   142 
   128 	iClientWindows.Close();	
   143 	iClientWindows.Close();	
   129     iExtDisplayWindows.Close(); 
   144     iExtDisplayWindows.Close(); 
   130 
   145 
   131 	delete iExtDisplayHandler;
   146 	delete iExtDisplayHandler;
   132 	RemoveExtDisplayPlugin();
   147 	RemoveExtDisplayPlugin();
   203             {
   218             {
   204             TRAPD(err, CreateExtDisplayHandlerL());
   219             TRAPD(err, CreateExtDisplayHandlerL());
   205             DEBUG_PRINTF2("CMediaClientVideoDisplayBody::AddDisplayWindowL CreateExtDisplayHandlerL error %d", err);
   220             DEBUG_PRINTF2("CMediaClientVideoDisplayBody::AddDisplayWindowL CreateExtDisplayHandlerL error %d", err);
   206             if(err == KErrNone)
   221             if(err == KErrNone)
   207                 {
   222                 {
       
   223 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
   224                 // attach surface to client window and hide
       
   225                 // ignore error - no handling required
       
   226                 SetHiddenBackgroundSurfaceOnClientWindow(winData);
       
   227 #endif                
       
   228                 // handle external display
   208                 SetWindowArrayPtr2Ext();
   229                 SetWindowArrayPtr2Ext();
   209                 User::LeaveIfError(RedrawWindows(aCropRegion));
   230                 User::LeaveIfError(RedrawWindows(aCropRegion));
   210                 }
   231                 }
   211             }
   232             }
   212         
   233         
   230 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplayWindow +++");
   251 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplayWindow +++");
   231 	TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
   252 	TInt pos = iClientWindows.Find(aWindow.WsHandle(), TWindowData::CompareByWsHandle);
   232 	
   253 	
   233 	if (pos >= 0)
   254 	if (pos >= 0)
   234 	    {
   255 	    {
       
   256 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
   257         if(IsSurfaceCreated())
       
   258 #else
   235 	    if(IsSurfaceCreated() && !iSwitchedToExternalDisplay)
   259 	    if(IsSurfaceCreated() && !iSwitchedToExternalDisplay)
   236             {
   260 #endif
       
   261 	        {
   237             iClientWindows[pos].iWindow->RemoveBackgroundSurface(ETrue);
   262             iClientWindows[pos].iWindow->RemoveBackgroundSurface(ETrue);
   238             // Make sure all window rendering has completed before proceeding
   263             // Make sure all window rendering has completed before proceeding
   239             RWsSession* ws = iClientWindows[pos].iWindow->Session();
   264             RWsSession* ws = iClientWindows[pos].iWindow->Session();
   240             if (ws)
   265             if (ws)
   241                 {
   266                 {
   265 
   290 
   266 
   291 
   267 TInt CMediaClientVideoDisplayBody::SurfaceCreated(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, const TRect& aCropRegion)
   292 TInt CMediaClientVideoDisplayBody::SurfaceCreated(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, const TRect& aCropRegion)
   268 	{
   293 	{
   269 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceCreated +++");
   294 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceCreated +++");
   270     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aSurfaceId 0x%X,0x%X,0x%X,0x%X", aSurfaceId.iInternal[0], aSurfaceId.iInternal[1], aSurfaceId.iInternal[2], aSurfaceId.iInternal[3]);
   295     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aSurfaceId %08x:%08x:%08x:%08x", aSurfaceId.iInternal[3], aSurfaceId.iInternal[2], aSurfaceId.iInternal[1], aSurfaceId.iInternal[0]);
   271     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
   296     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
   272     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SurfaceCreated - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
   297     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SurfaceCreated - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
   273     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
   298     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
   274 
   299 
   275     TBool emitEvent = EFalse;
   300     TBool emitEvent = EFalse;
   300             {
   325             {
   301             TRAP(err, CreateExtDisplayHandlerL());
   326             TRAP(err, CreateExtDisplayHandlerL());
   302             DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SurfaceCreated CreateExtDisplayHandlerL error %d", err);
   327             DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SurfaceCreated CreateExtDisplayHandlerL error %d", err);
   303             if(err == KErrNone)
   328             if(err == KErrNone)
   304                 {
   329                 {
       
   330 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
   331                 SetHiddenBackgroundSurfaceOnAllClientWindows();
       
   332 #endif          
   305                 SetWindowArrayPtr2Ext();
   333                 SetWindowArrayPtr2Ext();
   306                 }
   334                 }
   307             }
   335             }
   308         }
   336         }
   309     
   337     
   314 	}
   342 	}
   315 
   343 
   316 void CMediaClientVideoDisplayBody::RemoveBackgroundSurface(TBool aTriggerRedraw)
   344 void CMediaClientVideoDisplayBody::RemoveBackgroundSurface(TBool aTriggerRedraw)
   317 	{
   345 	{
   318 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveBackgroundSurface +++");
   346 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveBackgroundSurface +++");
       
   347     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::RemoveBackgroundSurface - iSurfaceId %08x:%08x:%08x:%08x", iSurfaceId.iInternal[3], iSurfaceId.iInternal[2], iSurfaceId.iInternal[1], iSurfaceId.iInternal[0]);
       
   348 
   319 	if (IsSurfaceCreated())
   349 	if (IsSurfaceCreated())
   320 		{
   350 		{
   321 		RWsSession* ws = NULL;
   351 		RWsSession* ws = NULL;
   322 		TInt count = iWindowsArrayPtr->Count();
   352 		TInt count = iWindowsArrayPtr->Count();
   323 	
   353 	
   336 	}
   366 	}
   337 
   367 
   338 void CMediaClientVideoDisplayBody::RemoveSurface(TBool aControllerEvent)
   368 void CMediaClientVideoDisplayBody::RemoveSurface(TBool aControllerEvent)
   339     {
   369     {
   340     DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveSurface +++");
   370     DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveSurface +++");
       
   371     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::RemoveSurface - iSurfaceId %08x:%08x:%08x:%08x", iSurfaceId.iInternal[3], iSurfaceId.iInternal[2], iSurfaceId.iInternal[1], iSurfaceId.iInternal[0]);
       
   372 
   341     if (IsSurfaceCreated())
   373     if (IsSurfaceCreated())
   342         {
   374         {
   343         RemoveBackgroundSurface(ETrue);
   375         RemoveBackgroundSurface(ETrue);
   344 
   376 
   345         if (iEventHandler  && aControllerEvent)
   377         if (iEventHandler  && aControllerEvent)
   346             {
   378             {
   347             iEventHandler->MmsehRemoveSurface(iSurfaceId);
   379             iEventHandler->MmsehRemoveSurface(iSurfaceId);
   348             }
   380             }
   349 
   381 
       
   382         if(iSwitchedToExternalDisplay)
       
   383             {
       
   384             SetWindowArrayPtr2Client();
       
   385 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
   386             RemoveBackgroundSurface(ETrue);
       
   387 #endif
       
   388             RemoveExtDisplayHandler();
       
   389             }
   350         iSurfaceId = TSurfaceId::CreateNullId();
   390         iSurfaceId = TSurfaceId::CreateNullId();
   351 
       
   352         if(iSwitchedToExternalDisplay)
       
   353             {
       
   354             SetWindowArrayPtr2Client();
       
   355             RemoveExtDisplayHandler();
       
   356             }
       
   357         }
   391         }
   358     
   392     
   359     DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveSurface ---");
   393     DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveSurface ---");
   360     }
   394     }
   361 
   395 
   362 TInt CMediaClientVideoDisplayBody::SurfaceParametersChanged(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio)
   396 TInt CMediaClientVideoDisplayBody::SurfaceParametersChanged(const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio)
   363 	{
   397 	{
   364 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceParametersChanged +++");
   398 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::SurfaceParametersChanged +++");
   365     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aSurfaceId 0x%X,0x%X,0x%X,0x%X", aSurfaceId.iInternal[0], aSurfaceId.iInternal[1], aSurfaceId.iInternal[2], aSurfaceId.iInternal[3]);
   399     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aSurfaceId %08x:%08x:%08x:%08x", aSurfaceId.iInternal[3], aSurfaceId.iInternal[2], aSurfaceId.iInternal[1], aSurfaceId.iInternal[0]);
   366     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
   400     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SurfaceCreated - aCropRect %d,%d - %d,%d", aCropRect.iTl.iX, aCropRect.iTl.iY, aCropRect.iBr.iX, aCropRect.iBr.iY);
   367     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SurfaceCreated - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
   401     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::SurfaceCreated - aAspectRatio %d/%d", aAspectRatio.iNumerator, aAspectRatio.iDenominator);
   368 
   402 
   369     if (!IsSurfaceCreated())
   403     if (!IsSurfaceCreated())
   370 		{
   404 		{
  1047     aWindowData.iSurfaceConfig.SetViewport(viewport);
  1081     aWindowData.iSurfaceConfig.SetViewport(viewport);
  1048     aWindowData.iSurfaceConfig.SetExtent(extent);
  1082     aWindowData.iSurfaceConfig.SetExtent(extent);
  1049     aWindowData.iSurfaceConfig.SetOrientation(ConvertRotation(aWindowData.iRotation));
  1083     aWindowData.iSurfaceConfig.SetOrientation(ConvertRotation(aWindowData.iRotation));
  1050     
  1084     
  1051     aWindowData.iSurfaceConfig.SetSurfaceId(iSurfaceId);
  1085     aWindowData.iSurfaceConfig.SetSurfaceId(iSurfaceId);
       
  1086 
       
  1087     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetBackgroundSurface - iSurfaceId %08x:%08x:%08x:%08x",
       
  1088             iSurfaceId.iInternal[3], iSurfaceId.iInternal[2], iSurfaceId.iInternal[1], iSurfaceId.iInternal[0]);
  1052     
  1089     
  1053     // Get the rectangle that bounds the crop rectangle and the viewport.  This should be
  1090     // Get the rectangle that bounds the crop rectangle and the viewport.  This should be
  1054     // the same as the crop rectangle as long as the viewport does not go outside this area.
  1091     // the same as the crop rectangle as long as the viewport does not go outside this area.
  1055     TRect rect(iCropRect);
  1092     TRect rect(iCropRect);
  1056     rect.BoundingRect(viewport);
  1093     rect.BoundingRect(viewport);
  1425         {
  1462         {
  1426         TRAPD(err, CreateExtDisplayHandlerL());
  1463         TRAPD(err, CreateExtDisplayHandlerL());
  1427         DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SwitchSurface CreateExtDisplayHandlerL error %d", err);
  1464         DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SwitchSurface CreateExtDisplayHandlerL error %d", err);
  1428         if(err == KErrNone)
  1465         if(err == KErrNone)
  1429             {
  1466             {
  1430             // Set background surface for external display window before removing from client windows.
       
  1431             // Required for switching of paused video
       
  1432             SetWindowArrayPtr2Ext();
  1467             SetWindowArrayPtr2Ext();
  1433             RedrawWindows(iCropRegion);
  1468             RedrawWindows(iCropRegion); 
       
  1469             
       
  1470 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
  1471             // Hide surface so that video is not seen on client window
       
  1472             HideAllClientWindows();
       
  1473 #else
       
  1474             // Surface removed from window
  1434             SetWindowArrayPtr2Client();
  1475             SetWindowArrayPtr2Client();
  1435             RemoveBackgroundSurface(ETrue);
  1476             RemoveBackgroundSurface(ETrue);
  1436             SetWindowArrayPtr2Ext();
  1477             SetWindowArrayPtr2Ext();
       
  1478 #endif
  1437             }
  1479             }
  1438         }
  1480         }
  1439     else if(iSwitchedToExternalDisplay)
  1481     else if(iSwitchedToExternalDisplay)
  1440         {
  1482         {
  1441         // Set background surface for clientwindows before removing from external display window.
  1483         // Set background surface for clientwindows before removing from external display window.
  1442         // Required for switching of paused video
       
  1443         SetWindowArrayPtr2Client();
  1484         SetWindowArrayPtr2Client();
       
  1485         // RedrawWindows handles both the case where the surface was removed from client window and 
       
  1486         // also the case where the surface was hidden from client window
  1444         RedrawWindows(iCropRegion);
  1487         RedrawWindows(iCropRegion);
  1445         SetWindowArrayPtr2Ext();
  1488         SetWindowArrayPtr2Ext();
  1446         RemoveBackgroundSurface(ETrue);
  1489         RemoveBackgroundSurface(ETrue);
  1447         RemoveExtDisplayHandler();
  1490         RemoveExtDisplayHandler();
  1448         SetWindowArrayPtr2Client();
  1491         SetWindowArrayPtr2Client();
  1663         }
  1706         }
  1664     
  1707     
  1665     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::ExtDisplayAutoScaleTypeL --- return %d", autoScaleType);
  1708     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::ExtDisplayAutoScaleTypeL --- return %d", autoScaleType);
  1666     return autoScaleType;
  1709     return autoScaleType;
  1667     }
  1710     }
       
  1711 
       
  1712 #ifdef MEDIA_CLIENT_SURFACE_NOT_REMOVED_FROM_CLIENT_WINDOW
       
  1713 
       
  1714 void CMediaClientVideoDisplayBody::HideAllClientWindows()
       
  1715     {
       
  1716     DEBUG_PRINTF("CMediaClientVideoDisplayBody::HideAllClientWindows +++");
       
  1717 
       
  1718     TInt count = iClientWindows.Count();
       
  1719     for (TInt i = 0; i < count; ++i)
       
  1720         {
       
  1721         // ignore error - cannot be handled
       
  1722         HideWindow(iClientWindows[i].iWindow);
       
  1723         }
       
  1724     
       
  1725     DEBUG_PRINTF("CMediaClientVideoDisplayBody::HideAllClientWindows ---");
       
  1726     }
       
  1727 
       
  1728 TInt CMediaClientVideoDisplayBody::HideWindow(RWindowBase* aWindow)
       
  1729     {
       
  1730     DEBUG_PRINTF("CMediaClientVideoDisplayBody::HideWindow +++");
       
  1731 
       
  1732     TSurfaceConfiguration config;
       
  1733     TInt err = aWindow->GetBackgroundSurface(config);
       
  1734     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::HideWindow GetBackgroundSurface error %d", err);
       
  1735     
       
  1736 #ifdef _DEBUG
       
  1737     TSurfaceId surface;
       
  1738     config.GetSurfaceId(surface);
       
  1739     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::HideWindow - Retrieved Surface %08x:%08x:%08x:%08x", 
       
  1740             surface.iInternal[3], surface.iInternal[2], surface.iInternal[1], surface.iInternal[0]);
       
  1741 #endif
       
  1742     
       
  1743     if (err == KErrNone)
       
  1744         {
       
  1745         config.SetExtent(TRect(KHiddenExtentA, KHiddenExtentA, KHiddenExtentB, KHiddenExtentB));
       
  1746         err = aWindow->SetBackgroundSurface(config, ETrue);
       
  1747         // Make sure all window rendering has completed before proceeding
       
  1748         RWsSession* ws = aWindow->Session();
       
  1749         if (ws)
       
  1750            {
       
  1751            ws->Finish();
       
  1752            }
       
  1753         DEBUG_PRINTF2("CMediaClientVideoDisplayBody::HideWindow SetBackgroundSurface error %d", err);
       
  1754         }
       
  1755     
       
  1756     DEBUG_PRINTF("CMediaClientVideoDisplayBody::HideWindow ---");
       
  1757     return err;
       
  1758     }
       
  1759 
       
  1760 void CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnAllClientWindows()
       
  1761     {
       
  1762     DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnAllClientWindows +++");
       
  1763 
       
  1764     TInt count = iClientWindows.Count();
       
  1765     for (TInt i = 0; i < count; ++i)
       
  1766         {
       
  1767         // ignore error - cannot be handled
       
  1768         SetHiddenBackgroundSurfaceOnClientWindow(iClientWindows[i]);
       
  1769         }
       
  1770     
       
  1771     DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnAllClientWindows ---");
       
  1772     }
       
  1773 
       
  1774 
       
  1775 TInt CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnClientWindow(TWindowData& aWindowData)
       
  1776     {
       
  1777     DEBUG_PRINTF("CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnClientWindow +++");    
       
  1778     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnClientWindow - iSurfaceId %08x:%08x:%08x:%08x",
       
  1779                 iSurfaceId.iInternal[3], iSurfaceId.iInternal[2], iSurfaceId.iInternal[1], iSurfaceId.iInternal[0]);
       
  1780     
       
  1781     TSurfaceConfiguration config;
       
  1782     config.SetExtent(TRect(KHiddenExtentA, KHiddenExtentA, KHiddenExtentB, KHiddenExtentB));   
       
  1783     config.SetSurfaceId(iSurfaceId);
       
  1784     TInt err = aWindowData.iWindow->SetBackgroundSurface(config, ETrue);
       
  1785     
       
  1786     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::SetHiddenBackgroundSurfaceOnClientWindow ---, return %d", err);
       
  1787     return err;
       
  1788     }
       
  1789 #endif