1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 // |
14 // |
15 |
15 |
16 #ifndef MEDIACLIENTVIDEODISPLAYBODY_H |
16 #ifndef MEDIACLIENTVIDEODISPLAYBODY_H |
17 #define MEDIACLIENTVIDEODISPLAYBODY_H |
17 #define MEDIACLIENTVIDEODISPLAYBODY_H |
18 |
18 |
19 #include <w32std.h> |
19 #include "mediaclientextdisplayhandler.h" |
20 #include <graphics/surface.h> |
20 #include <graphics/surface.h> |
21 #include <graphics/surfaceconfiguration.h> |
21 #include <graphics/surfaceconfiguration.h> |
22 #include <mmf/common/mmfvideosurfacecustomcommands.h> |
22 #include <mmf/common/mmfvideosurfacecustomcommands.h> |
23 #include <videoplayer.h> |
23 #include <videoplayer.h> |
24 #include <mmf/plugin/mmfmediaclientextdisplayinterface.h> |
24 #include <mmf/plugin/mmfmediaclientextdisplayinterface.h> |
90 return ret; |
90 return ret; |
91 } |
91 } |
92 }; |
92 }; |
93 public: |
93 public: |
94 |
94 |
95 static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId); |
95 static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId, TBool aExtDisplaySwitchingControl); |
96 static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio); |
96 static CMediaClientVideoDisplayBody* NewL(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio, TBool aExtDisplaySwitchingControl); |
97 |
97 |
98 ~CMediaClientVideoDisplayBody(); |
98 ~CMediaClientVideoDisplayBody(); |
99 |
99 |
100 void AddDisplayL(MMMFSurfaceEventHandler& aEventHandler); |
100 void AddDisplayL(MMMFSurfaceEventHandler& aEventHandler); |
101 void AddDisplayWindowL(const RWindowBase* aWindow, const TRect& aClipRect, const TRect& aCropRegion, const TRect& aVideoExtent, |
101 void AddDisplayWindowL(const RWindowBase* aWindow, const TRect& aClipRect, const TRect& aCropRegion, const TRect& aVideoExtent, |
127 private: |
127 private: |
128 |
128 |
129 CMediaClientVideoDisplayBody(TInt aDisplayId); |
129 CMediaClientVideoDisplayBody(TInt aDisplayId); |
130 CMediaClientVideoDisplayBody(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio); |
130 CMediaClientVideoDisplayBody(TInt aDisplayId, const TSurfaceId& aSurfaceId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio); |
131 |
131 |
132 void ConstructL(); |
132 void ConstructL(TBool aExtDisplaySwitchingControl); |
133 |
133 |
134 CFbsBitGc::TGraphicsOrientation ConvertRotation(TVideoRotation aRotation); |
134 CFbsBitGc::TGraphicsOrientation ConvertRotation(TVideoRotation aRotation); |
135 |
135 |
136 RArray<CMediaClientVideoDisplayBody::TWindowData>& Windows(); |
136 RArray<CMediaClientVideoDisplayBody::TWindowData>& Windows(); |
137 TInt DisplayId() const; |
137 TInt DisplayId() const; |
139 static TInt CompareByDisplay(const TInt* aDisplayId, const CMediaClientVideoDisplayBody& aDisplay); |
139 static TInt CompareByDisplay(const TInt* aDisplayId, const CMediaClientVideoDisplayBody& aDisplay); |
140 static TInt Compare(const CMediaClientVideoDisplayBody& aLeft, const CMediaClientVideoDisplayBody& aRight); |
140 static TInt Compare(const CMediaClientVideoDisplayBody& aLeft, const CMediaClientVideoDisplayBody& aRight); |
141 static CMediaClientVideoDisplayBody* FindDisplayWithWindowL(const RPointerArray<CMediaClientVideoDisplayBody>& aDisplays, const RWindowBase& aWindow); |
141 static CMediaClientVideoDisplayBody* FindDisplayWithWindowL(const RPointerArray<CMediaClientVideoDisplayBody>& aDisplays, const RWindowBase& aWindow); |
142 TBool IsSurfaceCreated() const; |
142 TBool IsSurfaceCreated() const; |
143 TInt SetBackgroundSurface(TWindowData& aWindowData, const TRect& aCropRegion); |
143 TInt SetBackgroundSurface(TWindowData& aWindowData, const TRect& aCropRegion); |
144 void CalculateExtentAndViewport(const TWindowData& aWindowData, TRect& aExtent, TRect& aViewport); |
|
145 TBool HasWindows() const; |
144 TBool HasWindows() const; |
146 |
145 |
147 void CreateExtDisplayConnProvAndRemoveSurfaceL(TBool aRemoveBackgroundSurface); |
|
148 void RemoveExtDisplayConnProvAndRedrawL(); |
|
149 void RemoveExtDisplayConnProv(); |
|
150 void MedcpcExtDisplayCalculateExtentAndViewportL(TRect& aExtent, TRect& aViewport, TRect& aExternalDisplayRect); |
|
151 void MedcpcExtDisplayNotifyConnected(TBool aExtDisplayConnected); |
146 void MedcpcExtDisplayNotifyConnected(TBool aExtDisplayConnected); |
152 |
147 |
|
148 void UpdateCropRegionL(const TRect& aCropRegion, TInt aPos); |
|
149 void CreateExtDisplayPluginL(); |
|
150 void RemoveExtDisplayPlugin(); |
|
151 void CreateExtDisplayHandlerL(); |
|
152 void RemoveExtDisplayHandler(); |
|
153 void SetWindowArrayPtr2Client(); |
|
154 void SetWindowArrayPtr2Ext(); |
|
155 |
153 private: |
156 private: |
154 |
157 |
155 MMMFSurfaceEventHandler* iEventHandler; |
158 MMMFSurfaceEventHandler* iEventHandler; |
156 const TInt iDisplayId; |
159 const TInt iDisplayId; |
157 TSurfaceId iSurfaceId; |
160 TSurfaceId iSurfaceId; |
158 TRect iCropRect; |
161 TRect iCropRect; |
159 TVideoAspectRatio iAspectRatio; |
162 TVideoAspectRatio iAspectRatio; |
160 RArray<TWindowData> iWindows; |
163 |
|
164 RArray<TWindowData> iClientWindows; |
|
165 RArray<TWindowData> iExtDisplayWindows; |
|
166 RArray<TWindowData>* iWindowsArrayPtr; |
161 |
167 |
162 TRect iCropRegion; |
168 TRect iCropRegion; |
163 TBool iClientRequestedExtDisplaySwitching; |
169 TBool iClientRequestedExtDisplaySwitching; |
164 CExtDisplayConnectionProviderInterface* iExtDisplayConnectionProvider; |
170 CExtDisplayConnectionProviderInterface* iExtDisplayConnectionProvider; |
|
171 CMediaClientExtDisplayHandler* iExtDisplayHandler; |
165 TBool iExtDisplayConnected; |
172 TBool iExtDisplayConnected; |
166 TBool iExtDisplaySwitchingSupported; |
173 TBool iExtDisplaySwitchingSupported; |
167 |
174 |
168 friend class CVideoPlayerUtility::CBody; |
175 friend class CVideoPlayerUtility::CBody; |
169 friend class CTestStepUnitMMFVidClient; |
176 friend class CTestStepUnitMMFVidClient; |