169 iParent(aParent), |
169 iParent(aParent), |
170 iScreenNumber(aScreenNumber) |
170 iScreenNumber(aScreenNumber) |
171 #ifdef SYMBIAN_BUILD_GCE |
171 #ifdef SYMBIAN_BUILD_GCE |
172 ,iGlobalScaleWidth(100.0f), |
172 ,iGlobalScaleWidth(100.0f), |
173 iGlobalScaleHeight(100.0f), |
173 iGlobalScaleHeight(100.0f), |
|
174 iGlobalAutoScaleType(EAutoScaleBestFit), // Really need some platform specific way of defining this. Not everyone will want it. |
174 iGlobalHorizPos(EHorizontalAlignCenter), |
175 iGlobalHorizPos(EHorizontalAlignCenter), |
175 iGlobalVertPos(EVerticalAlignCenter) |
176 iGlobalVertPos(EVerticalAlignCenter) |
176 #endif |
177 #endif |
177 { |
178 { |
178 iPrioritySettings.iPriority = aPriority; |
179 iPrioritySettings.iPriority = aPriority; |
751 { |
752 { |
752 CMediaClientVideoDisplayBody::TWindowData& window = windows[i]; |
753 CMediaClientVideoDisplayBody::TWindowData& window = windows[i]; |
753 if (window.iRotation != aRotation) |
754 if (window.iRotation != aRotation) |
754 { |
755 { |
755 // update config only if setting has actually changed |
756 // update config only if setting has actually changed |
756 UpdateSurfaceAndSubtitleConfigL(*display, window, window.iClipRect, aRotation, iCropRegion); |
757 display->SetRotationL(*window.iWindow, aRotation, iCropRegion); |
|
758 |
|
759 if (iSubtitleUtility) |
|
760 { |
|
761 TMMFSubtitleWindowConfig config; |
|
762 GetSubtitleConfigFromWindowData(window, config); |
|
763 |
|
764 iSubtitleUtility->UpdateSubtitleConfig(config); |
|
765 } |
757 } |
766 } |
758 } |
767 } |
759 #else |
768 #else |
760 |
769 |
761 iActiveDisplays[i]->SetRotationL(aRotation, iCropRegion); |
770 iActiveDisplays[i]->SetRotationL(aRotation, iCropRegion); |
855 else |
864 else |
856 { |
865 { |
857 // Crop region setting is not sent to controller when graphics surfaces are used. |
866 // Crop region setting is not sent to controller when graphics surfaces are used. |
858 // If the surface has been created, perform crop region with the help of graphics surfaces; |
867 // If the surface has been created, perform crop region with the help of graphics surfaces; |
859 // otherwise, just store the crop region info. |
868 // otherwise, just store the crop region info. |
860 |
869 if (aCropRegion != iCropRegion) |
861 iCropRegion = aCropRegion; |
870 { |
862 User::LeaveIfError(SetAllBackgroundSurfaces()); |
871 iCropRegion = aCropRegion; |
|
872 User::LeaveIfError(SetAllBackgroundSurfaces()); |
|
873 } |
863 } |
874 } |
864 #else |
875 #else |
865 User::LeaveIfError(iVideoPlayControllerCustomCommands.SetCropRegion(aCropRegion)); |
876 User::LeaveIfError(iVideoPlayControllerCustomCommands.SetCropRegion(aCropRegion)); |
866 #endif // SYMBIAN_BUILD_GCE |
877 #endif // SYMBIAN_BUILD_GCE |
867 } |
878 } |
1243 |
1254 |
1244 TInt count = iActiveDisplays.Count(); |
1255 TInt count = iActiveDisplays.Count(); |
1245 TInt error2 = KErrNone; |
1256 TInt error2 = KErrNone; |
1246 for (TInt i = 0; i < count; ++i) |
1257 for (TInt i = 0; i < count; ++i) |
1247 { |
1258 { |
1248 // ignore error and continue to set parameters |
1259 error2 = iActiveDisplays[i]->SurfaceParametersChanged(surfaceId, cropRect, aspectRatio); |
1249 iActiveDisplays[i]->SurfaceParametersChanged(surfaceId, cropRect, aspectRatio); |
1260 |
1250 |
1261 // Save the error for the first failure only |
1251 // save the error for the first failure and attempt to redraw remaining displays |
|
1252 error2 = iActiveDisplays[i]->RedrawWindows(iCropRegion); |
|
1253 if ((error2 != KErrNone) && (error == KErrNone)) |
1262 if ((error2 != KErrNone) && (error == KErrNone)) |
1254 { |
1263 { |
1255 error = error2; |
1264 error = error2; |
1256 } |
1265 } |
1257 } |
1266 } |
1743 |
1752 |
1744 CMediaClientVideoDisplayBody::TWindowData& currentWin = windows[pos]; |
1753 CMediaClientVideoDisplayBody::TWindowData& currentWin = windows[pos]; |
1745 if (currentWin.iClipRect != aWindowClipRect) |
1754 if (currentWin.iClipRect != aWindowClipRect) |
1746 { |
1755 { |
1747 // update config only if setting has actually changed |
1756 // update config only if setting has actually changed |
1748 UpdateSurfaceAndSubtitleConfigL(*display, currentWin, aWindowClipRect, currentWin.iRotation, iCropRegion); |
1757 display->SetWindowClipRectL(aWindow, aWindowClipRect, iCropRegion); |
|
1758 |
|
1759 if (iSubtitleUtility) |
|
1760 { |
|
1761 TMMFSubtitleWindowConfig config; |
|
1762 GetSubtitleConfigFromWindowData(currentWin, config); |
|
1763 |
|
1764 iSubtitleUtility->UpdateSubtitleConfig(config); |
|
1765 } |
1749 } |
1766 } |
1750 #else |
1767 #else |
1751 display->SetWindowClipRectL(aWindow, aWindowClipRect, iCropRegion); |
1768 display->SetWindowClipRectL(aWindow, aWindowClipRect, iCropRegion); |
1752 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT |
1769 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT |
1753 |
1770 |
1820 User::LeaveIfError(pos); |
1837 User::LeaveIfError(pos); |
1821 |
1838 |
1822 CMediaClientVideoDisplayBody::TWindowData& currentWin = windows[pos]; |
1839 CMediaClientVideoDisplayBody::TWindowData& currentWin = windows[pos]; |
1823 if (currentWin.iRotation != aRotation) |
1840 if (currentWin.iRotation != aRotation) |
1824 { |
1841 { |
1825 UpdateSurfaceAndSubtitleConfigL(*display, currentWin, currentWin.iClipRect, aRotation, iCropRegion); |
1842 display->SetRotationL(aWindow, aRotation, iCropRegion); |
|
1843 |
|
1844 if (iSubtitleUtility) |
|
1845 { |
|
1846 TMMFSubtitleWindowConfig config; |
|
1847 GetSubtitleConfigFromWindowData(currentWin, config); |
|
1848 |
|
1849 iSubtitleUtility->UpdateSubtitleConfig(config); |
|
1850 } |
1826 } |
1851 } |
1827 #else |
1852 #else |
1828 display->SetRotationL(aWindow, aRotation, iCropRegion); |
1853 display->SetRotationL(aWindow, aRotation, iCropRegion); |
1829 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT |
1854 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT |
1830 DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetRotationL--"); |
1855 DEBUG_PRINTF("CVideoPlayerUtility::CBody::SetRotationL--"); |
2170 } |
2195 } |
2171 |
2196 |
2172 return NULL; |
2197 return NULL; |
2173 } |
2198 } |
2174 |
2199 |
2175 // Update the supplied window with the new clip rect and rotation |
|
2176 // If updating of surface failed, this function leave after restoring the original aWindowData |
|
2177 void CVideoPlayerUtility::CBody::UpdateSurfaceAndSubtitleConfigL(CMediaClientVideoDisplayBody& aDisplay,CMediaClientVideoDisplayBody::TWindowData& aWindowData, const TRect& aClipRect, TVideoRotation aRotation, const TRect& aCropRegion) |
|
2178 { |
|
2179 TRect oldClipRect = aWindowData.iClipRect; |
|
2180 TVideoRotation oldRotation = aWindowData.iRotation; |
|
2181 |
|
2182 aWindowData.iClipRect = aClipRect; |
|
2183 aWindowData.iRotation = aRotation; |
|
2184 |
|
2185 if (aDisplay.IsSurfaceCreated()) |
|
2186 { |
|
2187 TInt err = aDisplay.SetBackgroundSurface(aWindowData, aCropRegion); |
|
2188 if (KErrNone != err) |
|
2189 { |
|
2190 aWindowData.iClipRect = oldClipRect; |
|
2191 aWindowData.iRotation = oldRotation; |
|
2192 User::Leave(err); |
|
2193 } |
|
2194 } |
|
2195 |
|
2196 // Set background was successful or surface was not created, so |
|
2197 // update subtitle config if subtitles are enabled |
|
2198 if (iSubtitleUtility) |
|
2199 { |
|
2200 TMMFSubtitleWindowConfig config; |
|
2201 GetSubtitleConfigFromWindowData(aWindowData, config); |
|
2202 |
|
2203 iSubtitleUtility->UpdateSubtitleConfig(config); |
|
2204 } |
|
2205 } |
|
2206 |
|
2207 void CVideoPlayerUtility::CBody::GetSubtitleConfigFromWindowData(CMediaClientVideoDisplayBody::TWindowData& aWindowData, TMMFSubtitleWindowConfig& aConfig) |
2200 void CVideoPlayerUtility::CBody::GetSubtitleConfigFromWindowData(CMediaClientVideoDisplayBody::TWindowData& aWindowData, TMMFSubtitleWindowConfig& aConfig) |
2208 { |
2201 { |
2209 aConfig.iWindowId = aWindowData.iWindow->WsHandle(); |
2202 aConfig.iWindowId = aWindowData.iWindow->WsHandle(); |
2210 aConfig.iWindowClipRect = aWindowData.iClipRect; |
2203 aConfig.iWindowClipRect = aWindowData.iClipRect; |
2211 aConfig.iDisplayMode = aWindowData.iWindow->DisplayMode(); |
2204 aConfig.iDisplayMode = aWindowData.iWindow->DisplayMode(); |