65 // ----------------------------------------------------------------------------- |
64 // ----------------------------------------------------------------------------- |
66 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile, CFbsBitmap* aFsBitmap, |
65 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile, CFbsBitmap* aFsBitmap, |
67 TBool aStore) |
66 TBool aStore) |
68 { |
67 { |
69 TRACER("CGlxHdmiController::SetImageL()"); |
68 TRACER("CGlxHdmiController::SetImageL()"); |
|
69 if (aFsBitmap == NULL || !aImageFile.Length()) |
|
70 { |
|
71 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - NULL Uri"); |
|
72 return; |
|
73 } |
70 if (aStore) |
74 if (aStore) |
71 { |
75 { |
72 iIsImageSupported = ETrue; |
76 iIsImageSupported = ETrue; |
73 StoreImageInfoL( aImageFile, aFsBitmap ); |
77 StoreImageInfoL( aImageFile, aFsBitmap ); |
74 } |
78 } |
75 if (iGlxTvOut->IsHDMIConnected()) |
79 if (iGlxTvOut->IsHDMIConnected()) |
76 { |
80 { |
77 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); |
81 iPhotosForeground = ETrue; // the image should be in posting mode |
78 // do not close the surface , use the same surface instead. |
82 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); |
79 // Call a function to pass imagefile |
83 // do not close the surface , use the same surface instead. |
80 if (!iHdmiContainer) |
84 // Call a function to pass imagefile |
81 { |
85 if (!iHdmiContainer) |
82 CreateHdmiContainerL(); |
86 { |
83 } |
87 CreateHdmiContainerL(); |
84 if (!iSurfaceUpdater) |
88 } |
85 { |
89 if (!iSurfaceUpdater) |
86 // This case would come when surface updater is not created at the first instance and also |
90 { |
87 // it satisfies the 720p condition |
91 // This case would come when surface updater is not created at the first instance and also |
88 CreateSurfaceUpdaterL(aImageFile); |
92 // it satisfies the 720p condition |
89 } |
93 CreateSurfaceUpdaterL(aImageFile); |
90 else |
94 } |
91 { |
95 else |
|
96 { |
92 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3"); |
97 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3"); |
93 iSurfaceUpdater->UpdateNewImageL(aImageFile, aFsBitmap); |
98 iSurfaceUpdater->UpdateNewImageL(aImageFile, aFsBitmap); |
94 } |
99 } |
95 iHdmiContainer->DrawNow(); |
100 iHdmiContainer->DrawNow(); |
96 } |
101 } |
97 } |
102 } |
98 |
103 |
99 // ----------------------------------------------------------------------------- |
104 // ----------------------------------------------------------------------------- |
100 // IsVideo |
105 // ItemNotSupported |
101 // ----------------------------------------------------------------------------- |
106 // ----------------------------------------------------------------------------- |
102 EXPORT_C void CGlxHdmiController::ItemNotSupported() |
107 EXPORT_C void CGlxHdmiController::ItemNotSupported() |
103 { |
108 { |
104 TRACER("CGlxHdmiController::IsVideo()"); |
109 TRACER("CGlxHdmiController::IsVideo()"); |
105 iIsImageSupported = EFalse; |
110 iIsImageSupported = EFalse; |
114 // ActivateZoom |
119 // ActivateZoom |
115 // ----------------------------------------------------------------------------- |
120 // ----------------------------------------------------------------------------- |
116 EXPORT_C void CGlxHdmiController::ActivateZoom(TBool aAutoZoomOut) |
121 EXPORT_C void CGlxHdmiController::ActivateZoom(TBool aAutoZoomOut) |
117 { |
122 { |
118 TRACER("CGlxHdmiController::ActivateZoom()"); |
123 TRACER("CGlxHdmiController::ActivateZoom()"); |
|
124 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
|
125 { |
|
126 iSurfaceUpdater->ActivateZoom(aAutoZoomOut); |
|
127 } |
|
128 } |
|
129 |
|
130 // ----------------------------------------------------------------------------- |
|
131 // DeactivateZoom |
|
132 // ----------------------------------------------------------------------------- |
|
133 EXPORT_C void CGlxHdmiController::DeactivateZoom() |
|
134 { |
|
135 TRACER("CGlxHdmiController::DeactivateZoom()"); |
|
136 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
|
137 { |
|
138 iSurfaceUpdater->DeactivateZoom(); |
|
139 } |
|
140 } |
|
141 |
|
142 // ----------------------------------------------------------------------------- |
|
143 // ShiftToCloningMode |
|
144 // ----------------------------------------------------------------------------- |
|
145 EXPORT_C void CGlxHdmiController::ShiftToCloningMode() |
|
146 { |
|
147 TRACER("CGlxHdmiController::ShiftToCloningMode()"); |
|
148 iPhotosForeground = EFalse; |
|
149 // Shift to cloning only if HDMI is connected and surfaceupdater available. |
|
150 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
|
151 { |
|
152 iSurfaceUpdater->ShiftToCloningMode(); |
|
153 } |
|
154 } |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // ShiftToPostingMode |
|
158 // ----------------------------------------------------------------------------- |
|
159 EXPORT_C void CGlxHdmiController::ShiftToPostingMode() |
|
160 { |
|
161 TRACER("CGlxHdmiController::ShiftToPostingMode()"); |
|
162 iPhotosForeground = ETrue; |
119 if (iGlxTvOut->IsHDMIConnected()) |
163 if (iGlxTvOut->IsHDMIConnected()) |
120 { |
164 { |
121 iSurfaceUpdater->ActivateZoom(aAutoZoomOut); |
165 if (!iSurfaceUpdater) |
122 } |
166 { |
123 } |
167 GLX_LOG_INFO("CGlxHdmiController::ShiftToPostingMode() - 1"); |
124 |
168 // This case would come when HDMI connected, TvOut /headphones being connected |
125 // ----------------------------------------------------------------------------- |
169 // and then it shows a popup of "microphone connected" |
126 // DeactivateZoom |
170 // thus Background - Foreground when headphones connected during HDMI connected |
127 // ----------------------------------------------------------------------------- |
171 if (iFsBitmap == NULL || !iStoredImagePath->Length()) |
128 EXPORT_C void CGlxHdmiController::DeactivateZoom() |
172 { |
129 { |
173 GLX_LOG_INFO("CGlxHdmiController::ShiftToPostingMode() - NULL Uri"); |
130 TRACER("CGlxHdmiController::DeactivateZoom()"); |
174 return; |
131 if (iGlxTvOut->IsHDMIConnected()) |
175 } |
132 { |
176 SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); |
133 iSurfaceUpdater->DeactivateZoom(); |
177 } |
134 } |
178 else |
135 } |
179 { |
136 |
180 GLX_LOG_INFO("CGlxHdmiController::ShiftToPostingMode() - 2"); |
137 // ----------------------------------------------------------------------------- |
181 iSurfaceUpdater->ShiftToPostingMode(); |
138 // ShiftToCloningMode |
182 } |
139 // ----------------------------------------------------------------------------- |
183 } |
140 EXPORT_C void CGlxHdmiController::ShiftToCloningMode() |
184 } |
141 { |
185 |
142 TRACER("CGlxHdmiController::ShiftToCloningMode()"); |
186 // ----------------------------------------------------------------------------- |
143 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
187 // IsHDMIConnected |
144 { |
188 // ----------------------------------------------------------------------------- |
145 iSurfaceUpdater->ShiftToCloningMode(); |
189 EXPORT_C TBool CGlxHdmiController::IsHDMIConnected() |
146 } |
190 { |
147 } |
191 TRACER("CGlxHdmiController::IsHDMIConnected()"); |
148 |
192 return iGlxTvOut->IsHDMIConnected(); |
149 // ----------------------------------------------------------------------------- |
193 } |
150 // ShiftToPostingMode |
194 |
151 // ----------------------------------------------------------------------------- |
|
152 EXPORT_C void CGlxHdmiController::ShiftToPostingMode() |
|
153 { |
|
154 TRACER("CGlxHdmiController::ShiftToPostingMode()"); |
|
155 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
|
156 { |
|
157 iSurfaceUpdater->ShiftToPostingMode(); |
|
158 } |
|
159 } |
|
160 |
195 |
161 // ----------------------------------------------------------------------------- |
196 // ----------------------------------------------------------------------------- |
162 // Constructor |
197 // Constructor |
163 // ----------------------------------------------------------------------------- |
198 // ----------------------------------------------------------------------------- |
164 CGlxHdmiController::CGlxHdmiController(): |
199 CGlxHdmiController::CGlxHdmiController(): |
165 iFsBitmap(NULL) |
200 iFsBitmap(NULL), |
|
201 iStoredImagePath(NULL), |
|
202 iPhotosForeground(EFalse) |
166 { |
203 { |
167 TRACER("CGlxHdmiController::CGlxHdmiController()"); |
204 TRACER("CGlxHdmiController::CGlxHdmiController()"); |
168 // Implement nothing here |
205 // Implement nothing here |
169 } |
206 } |
170 |
207 |
254 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
290 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
255 { |
291 { |
256 TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); |
292 TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); |
257 if ( aChangeType == ETvConnectionChanged ) |
293 if ( aChangeType == ETvConnectionChanged ) |
258 { |
294 { |
259 if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported ) |
295 if ( iGlxTvOut->IsHDMIConnected() && iGlxTvOut->IsConnected() && iSurfaceUpdater) |
|
296 { |
|
297 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI and TV Connected"); |
|
298 // Do nothing , as this means HDMI is already connected and headset/tv cable connected |
|
299 // meaning we shouldnt destroy HDMI and neither have to create surface updater. |
|
300 return; |
|
301 } |
|
302 else if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iPhotosForeground) |
260 { |
303 { |
261 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); |
304 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); |
262 // Calling SetImageL() with appropriate parameters |
305 // Calling SetImageL() with appropriate parameters |
263 SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); |
306 SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); |
264 } |
307 } |
265 else |
308 else |
266 { |
309 { |
267 GLX_LOG_INFO2("CGlxHdmiController::HandleTvStatusChangedL() iIsImageSupported=%d, iGlxTvOut->IsHDMIConnected()=%d", |
310 GLX_LOG_INFO3("CGlxHdmiController::HandleTvStatusChangedL() iIsImageSupported=%d, iGlxTvOut->IsHDMIConnected()=%d, iIsPostingMode=%d", |
268 iIsImageSupported,iGlxTvOut->IsHDMIConnected()); |
311 iIsImageSupported,iGlxTvOut->IsHDMIConnected(),iPhotosForeground); |
269 // if it gets disconnected, destroy the surface |
312 // if it gets disconnected, destroy the surface |
270 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); |
313 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); |
271 DestroySurfaceUpdater(); |
314 DestroySurfaceUpdater(); |
272 } |
315 } |
273 } |
316 } |
274 } |
317 } |
275 |
318 |
276 // ----------------------------------------------------------------------------- |
|
277 // HandleTvStatusChangedL |
|
278 // ----------------------------------------------------------------------------- |
|
279 EXPORT_C TBool CGlxHdmiController::IsHDMIConnected() |
|
280 { |
|
281 TRACER("CGlxHdmiController::IsHDMIConnected()"); |
|
282 return iGlxTvOut->IsHDMIConnected(); |
|
283 } |
|
284 |
|