mmlibs/mmfw/src/Client/Video/mediaclientvideodisplaybody.cpp
changeset 57 1cbb0d5bf7f2
parent 41 f7bf1ed8db72
equal deleted inserted replaced
56:b6488ac24ddc 57:1cbb0d5bf7f2
   236             User::LeaveIfError(SetBackgroundSurface(winData, aCropRegion));
   236             User::LeaveIfError(SetBackgroundSurface(winData, aCropRegion));
   237             }
   237             }
   238 		}
   238 		}
   239 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::AddDisplayWindowL ---");
   239 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::AddDisplayWindowL ---");
   240 	}
   240 	}
       
   241 
       
   242 void CMediaClientVideoDisplayBody::UpdateDisplayWindowL(const RWindowBase* aWindow, const TRect& aClipRect, const TRect& aCropRegion, const TRect& aVideoExtent, 
       
   243                                                             TReal32 aScaleWidth, TReal32 aScaleHeight, TVideoRotation aRotation, 
       
   244                                                             TAutoScaleType aAutoScaleType, TInt aHorizPos, TInt aVertPos, RWindow* aWindow2)
       
   245     {   
       
   246     DEBUG_PRINTF("CMediaClientVideoDisplayBody::UpdateDisplayWindowL +++");
       
   247     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aWindow WsHandle 0x%X", aWindow->WsHandle());
       
   248     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aClipRect %d,%d - %d,%d", aClipRect.iTl.iX, aClipRect.iTl.iY, aClipRect.iBr.iX, aClipRect.iBr.iY);
       
   249     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aCropRegion %d,%d - %d,%d", aCropRegion.iTl.iX, aCropRegion.iTl.iY, aCropRegion.iBr.iX, aCropRegion.iBr.iY);
       
   250     DEBUG_PRINTF5("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aVideoExtent %d,%d - %d,%d", aVideoExtent.iTl.iX, aVideoExtent.iTl.iY, aVideoExtent.iBr.iX, aVideoExtent.iBr.iY);
       
   251     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aScaleWidth %f, aScaleHeight %f", aScaleWidth, aScaleHeight);
       
   252     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aRotation %d", aRotation);
       
   253     DEBUG_PRINTF2("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aAutoScaleType %d", aAutoScaleType);
       
   254     DEBUG_PRINTF3("CMediaClientVideoDisplayBody::UpdateDisplayWindowL - aHorizPos %d, aVertPos %d", aHorizPos, aVertPos);
       
   255 
       
   256     if (!IsRotationValid(aRotation))
       
   257         {
       
   258         User::Leave(KErrArgument);
       
   259         }
       
   260 
       
   261     if (!IsAutoScaleTypeValid(aAutoScaleType))
       
   262         {
       
   263         User::Leave(KErrArgument);
       
   264         }
       
   265 
       
   266     TInt pos = iClientWindows.Find(aWindow->WsHandle(), TWindowData::CompareByWsHandle);
       
   267     User::LeaveIfError(pos);
       
   268     iClientWindows.Remove(pos);
       
   269     
       
   270     TWindowData winData(aWindow, aClipRect, aVideoExtent, aScaleWidth, aScaleHeight, aRotation, aAutoScaleType, aHorizPos, aVertPos, aWindow2);
       
   271     iClientWindows.AppendL(winData);
       
   272     
       
   273     TRect prevCropRegion = iCropRegion;
       
   274     iCropRegion = aCropRegion;
       
   275     
       
   276     if (IsSurfaceCreated())
       
   277         {
       
   278         if(ClientCropRegionChangeRequiresRedraw(prevCropRegion, aCropRegion, iCropRect))
       
   279             {
       
   280             // all windows need to be redrawn
       
   281             User::LeaveIfError(RedrawWindows(aCropRegion));
       
   282             }
       
   283         else
       
   284             {
       
   285             // only redraw affected window as other window data may have changed
       
   286             if(!iSwitchedToExternalDisplay)
       
   287                 {
       
   288                 User::LeaveIfError(SetBackgroundSurface(winData, aCropRegion));
       
   289                 }
       
   290             }
       
   291         }
       
   292 
       
   293     DEBUG_PRINTF("CMediaClientVideoDisplayBody::UpdateDisplayWindowL ---");
       
   294     }
   241 
   295 
   242 void CMediaClientVideoDisplayBody::RemoveDisplay()
   296 void CMediaClientVideoDisplayBody::RemoveDisplay()
   243 	{
   297 	{
   244 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplay +++");
   298 	DEBUG_PRINTF("CMediaClientVideoDisplayBody::RemoveDisplay +++");
   245 	iEventHandler = NULL;
   299 	iEventHandler = NULL;