71 iIsImageSupported = ETrue; |
71 iIsImageSupported = ETrue; |
72 StoreImageInfoL( aImageFile, aFsBitmap ); |
72 StoreImageInfoL( aImageFile, aFsBitmap ); |
73 } |
73 } |
74 if (iGlxTvOut->IsHDMIConnected()) |
74 if (iGlxTvOut->IsHDMIConnected()) |
75 { |
75 { |
|
76 iIsPostingMode = ETrue; // the image should be in posting mode |
76 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); |
77 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); |
77 // do not close the surface , use the same surface instead. |
78 // do not close the surface , use the same surface instead. |
78 // Call a function to pass imagefile |
79 // Call a function to pass imagefile |
79 if (!iHdmiContainer) |
80 if (!iHdmiContainer) |
80 { |
81 { |
137 // ShiftToCloningMode |
138 // ShiftToCloningMode |
138 // ----------------------------------------------------------------------------- |
139 // ----------------------------------------------------------------------------- |
139 EXPORT_C void CGlxHdmiController::ShiftToCloningMode() |
140 EXPORT_C void CGlxHdmiController::ShiftToCloningMode() |
140 { |
141 { |
141 TRACER("CGlxHdmiController::ShiftToCloningMode()"); |
142 TRACER("CGlxHdmiController::ShiftToCloningMode()"); |
|
143 // Shift to cloning only if HDMI is connected and surfaceupdater available. |
142 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
144 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
143 { |
145 { |
|
146 iIsPostingMode = EFalse; |
144 iSurfaceUpdater->ShiftToCloningMode(); |
147 iSurfaceUpdater->ShiftToCloningMode(); |
145 } |
148 } |
146 } |
149 } |
147 |
150 |
148 // ----------------------------------------------------------------------------- |
151 // ----------------------------------------------------------------------------- |
149 // ShiftToPostingMode |
152 // ShiftToPostingMode |
150 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
151 EXPORT_C void CGlxHdmiController::ShiftToPostingMode() |
154 EXPORT_C void CGlxHdmiController::ShiftToPostingMode() |
152 { |
155 { |
153 TRACER("CGlxHdmiController::ShiftToPostingMode()"); |
156 TRACER("CGlxHdmiController::ShiftToPostingMode()"); |
154 if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) |
157 if (iGlxTvOut->IsHDMIConnected()) |
155 { |
158 { |
156 iSurfaceUpdater->ShiftToPostingMode(); |
159 if (!iSurfaceUpdater) |
157 } |
160 { |
158 } |
161 GLX_LOG_INFO("CGlxHdmiController::ShiftToPostingMode() - 1"); |
159 |
162 // This case would come when HDMI connected, TvOut /headphones being connected |
160 // ----------------------------------------------------------------------------- |
163 // and then it shows a popup of "microphone connected" |
161 // HandleTvStatusChangedL |
164 // thus Background - Foreground when headphones connected during HDMI connected |
|
165 SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); |
|
166 } |
|
167 else |
|
168 { |
|
169 GLX_LOG_INFO("CGlxHdmiController::ShiftToPostingMode() - 2"); |
|
170 iSurfaceUpdater->ShiftToPostingMode(); |
|
171 } |
|
172 iIsPostingMode = ETrue; |
|
173 } |
|
174 } |
|
175 |
|
176 // ----------------------------------------------------------------------------- |
|
177 // IsHDMIConnected |
162 // ----------------------------------------------------------------------------- |
178 // ----------------------------------------------------------------------------- |
163 EXPORT_C TBool CGlxHdmiController::IsHDMIConnected() |
179 EXPORT_C TBool CGlxHdmiController::IsHDMIConnected() |
164 { |
180 { |
165 TRACER("CGlxHdmiController::IsHDMIConnected()"); |
181 TRACER("CGlxHdmiController::IsHDMIConnected()"); |
166 return iGlxTvOut->IsHDMIConnected(); |
182 return iGlxTvOut->IsHDMIConnected(); |
169 |
185 |
170 // ----------------------------------------------------------------------------- |
186 // ----------------------------------------------------------------------------- |
171 // Constructor |
187 // Constructor |
172 // ----------------------------------------------------------------------------- |
188 // ----------------------------------------------------------------------------- |
173 CGlxHdmiController::CGlxHdmiController(): |
189 CGlxHdmiController::CGlxHdmiController(): |
174 iFsBitmap(NULL) |
190 iFsBitmap(NULL), |
|
191 iIsPostingMode(EFalse) |
175 { |
192 { |
176 TRACER("CGlxHdmiController::CGlxHdmiController()"); |
193 TRACER("CGlxHdmiController::CGlxHdmiController()"); |
177 // Implement nothing here |
194 // Implement nothing here |
178 } |
195 } |
179 |
196 |
209 if (iSurfaceUpdater) |
226 if (iSurfaceUpdater) |
210 { |
227 { |
211 delete iSurfaceUpdater; |
228 delete iSurfaceUpdater; |
212 iSurfaceUpdater = NULL; |
229 iSurfaceUpdater = NULL; |
213 } |
230 } |
|
231 iIsPostingMode = EFalse; |
214 } |
232 } |
215 |
233 |
216 // ----------------------------------------------------------------------------- |
234 // ----------------------------------------------------------------------------- |
217 // CreateHdmiContainerL |
235 // CreateHdmiContainerL |
218 // ----------------------------------------------------------------------------- |
236 // ----------------------------------------------------------------------------- |
262 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
280 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
263 { |
281 { |
264 TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); |
282 TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); |
265 if ( aChangeType == ETvConnectionChanged ) |
283 if ( aChangeType == ETvConnectionChanged ) |
266 { |
284 { |
267 if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported ) |
285 if ( iGlxTvOut->IsHDMIConnected() && iGlxTvOut->IsConnected() && iSurfaceUpdater) |
|
286 { |
|
287 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI and TV Connected"); |
|
288 // Do nothing , as this means HDMI is already connected and headset/tv cable connected |
|
289 // meaning we shouldnt destroy HDMI and neither have to create surface updater. |
|
290 return; |
|
291 } |
|
292 else if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iIsPostingMode) |
268 { |
293 { |
269 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); |
294 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); |
270 // Calling SetImageL() with appropriate parameters |
295 // Calling SetImageL() with appropriate parameters |
271 SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); |
296 SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); |
272 } |
297 } |
273 else |
298 else |
274 { |
299 { |
275 GLX_LOG_INFO2("CGlxHdmiController::HandleTvStatusChangedL() iIsImageSupported=%d, iGlxTvOut->IsHDMIConnected()=%d", |
300 GLX_LOG_INFO3("CGlxHdmiController::HandleTvStatusChangedL() iIsImageSupported=%d, iGlxTvOut->IsHDMIConnected()=%d, iIsPostingMode=%d", |
276 iIsImageSupported,iGlxTvOut->IsHDMIConnected()); |
301 iIsImageSupported,iGlxTvOut->IsHDMIConnected(),iIsPostingMode); |
277 // if it gets disconnected, destroy the surface |
302 // if it gets disconnected, destroy the surface |
278 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); |
303 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); |
279 DestroySurfaceUpdater(); |
304 DestroySurfaceUpdater(); |
280 } |
305 } |
281 } |
306 } |