61 |
61 |
62 // ----------------------------------------------------------------------------- |
62 // ----------------------------------------------------------------------------- |
63 // Setting an Image Path |
63 // Setting an Image Path |
64 // ----------------------------------------------------------------------------- |
64 // ----------------------------------------------------------------------------- |
65 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile, |
65 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile, |
66 TSize aImageDimensions, TInt aFrameCount) |
66 TSize aImageDimensions, TInt aFrameCount, TBool aStore) |
67 { |
67 { |
68 TRACER("CGlxHdmiController::SetImageL()"); |
68 TRACER("CGlxHdmiController::SetImageL()"); |
69 StoreImageInfoL(aImageFile, aImageDimensions, aFrameCount); |
69 if (aStore) |
70 if (iGlxTvOut->IsConnected()) |
70 StoreImageInfoL(aImageFile, aImageDimensions, aFrameCount); |
71 { |
71 |
|
72 if (iGlxTvOut->IsHDMIConnected()) |
|
73 { |
|
74 iIsHDMIconnected = ETrue; |
72 if(aImageDimensions.iHeight<=KHdTvHeight && |
75 if(aImageDimensions.iHeight<=KHdTvHeight && |
73 aImageDimensions.iWidth<= KHdTvWidth && aFrameCount > 0) |
76 aImageDimensions.iWidth<= KHdTvWidth && aFrameCount > 0) |
74 { |
77 { |
|
78 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 1"); |
75 DestroySurfaceUpdater(); |
79 DestroySurfaceUpdater(); |
76 if (!iHdmiContainer) |
80 if (!iHdmiContainer) |
77 { |
81 { |
78 CreateHdmiContainerL(); |
82 CreateHdmiContainerL(); |
79 } |
83 } |
80 CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount); |
84 CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount); |
81 } |
85 } |
82 else |
86 else |
83 { |
87 { |
|
88 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); |
84 // do not close the surface , use the same surface instead. |
89 // do not close the surface , use the same surface instead. |
85 // Call a function to pass imagefile, imagedimension, framecount |
90 // Call a function to pass imagefile, imagedimension, framecount |
86 if (!iHdmiContainer) |
91 if (!iHdmiContainer) |
87 { |
92 { |
88 CreateHdmiContainerL(); |
93 CreateHdmiContainerL(); |
93 // it satisfies the 720p condition |
98 // it satisfies the 720p condition |
94 CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount); |
99 CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount); |
95 } |
100 } |
96 else |
101 else |
97 { |
102 { |
|
103 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3"); |
98 iSurfaceUpdater->UpdateNewImageL(aImageFile, aFrameCount); |
104 iSurfaceUpdater->UpdateNewImageL(aImageFile, aFrameCount); |
99 } |
105 } |
100 iHdmiContainer->DrawNow(); |
106 iHdmiContainer->DrawNow(); |
101 } |
107 } |
102 } |
108 } |
106 // IsVideo |
112 // IsVideo |
107 // ----------------------------------------------------------------------------- |
113 // ----------------------------------------------------------------------------- |
108 EXPORT_C void CGlxHdmiController::IsVideo() |
114 EXPORT_C void CGlxHdmiController::IsVideo() |
109 { |
115 { |
110 TRACER("CGlxHdmiController::IsVideo()"); |
116 TRACER("CGlxHdmiController::IsVideo()"); |
111 if (iGlxTvOut->IsConnected()) |
117 if (iGlxTvOut->IsHDMIConnected()) |
112 { |
118 { |
113 DestroySurfaceUpdater(); |
119 DestroySurfaceUpdater(); |
114 } |
120 } |
115 } |
121 } |
116 |
122 |
119 // ActivateZoom |
125 // ActivateZoom |
120 // ----------------------------------------------------------------------------- |
126 // ----------------------------------------------------------------------------- |
121 EXPORT_C void CGlxHdmiController::ActivateZoom() |
127 EXPORT_C void CGlxHdmiController::ActivateZoom() |
122 { |
128 { |
123 TRACER("CGlxHdmiController::ActivateZoom()"); |
129 TRACER("CGlxHdmiController::ActivateZoom()"); |
124 if (iGlxTvOut->IsConnected()) |
130 if (iGlxTvOut->IsHDMIConnected()) |
125 { |
131 { |
126 iSurfaceUpdater->ActivateZoom(); |
132 iSurfaceUpdater->ActivateZoom(); |
127 } |
133 } |
128 } |
134 } |
129 |
135 |
131 // DeactivateZoom |
137 // DeactivateZoom |
132 // ----------------------------------------------------------------------------- |
138 // ----------------------------------------------------------------------------- |
133 EXPORT_C void CGlxHdmiController::DeactivateZoom() |
139 EXPORT_C void CGlxHdmiController::DeactivateZoom() |
134 { |
140 { |
135 TRACER("CGlxHdmiController::DeactivateZoom()"); |
141 TRACER("CGlxHdmiController::DeactivateZoom()"); |
136 if (iGlxTvOut->IsConnected()) |
142 if (iGlxTvOut->IsHDMIConnected()) |
137 { |
143 { |
138 iSurfaceUpdater->DeactivateZoom(); |
144 iSurfaceUpdater->DeactivateZoom(); |
139 } |
145 } |
140 } |
146 } |
141 // ----------------------------------------------------------------------------- |
147 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
159 // ----------------------------------------------------------------------------- |
154 void CGlxHdmiController::ConstructL() |
160 void CGlxHdmiController::ConstructL() |
155 { |
161 { |
156 TRACER("CGlxHdmiController::ConstructL()"); |
162 TRACER("CGlxHdmiController::ConstructL()"); |
157 iGlxTvOut = CGlxTv::NewL(*this); |
163 iGlxTvOut = CGlxTv::NewL(*this); |
|
164 iIsHDMIconnected = EFalse; |
|
165 iIsHDMIdisConnected = EFalse; |
158 } |
166 } |
159 |
167 |
160 // ----------------------------------------------------------------------------- |
168 // ----------------------------------------------------------------------------- |
161 // DestroyContainer |
169 // DestroyContainer |
162 // ----------------------------------------------------------------------------- |
170 // ----------------------------------------------------------------------------- |
229 // HandleTvStatusChangedL |
237 // HandleTvStatusChangedL |
230 // ----------------------------------------------------------------------------- |
238 // ----------------------------------------------------------------------------- |
231 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
239 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) |
232 { |
240 { |
233 TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); |
241 TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); |
234 if ( aChangeType == ETvConnectionChanged ) |
242 if(iIsHDMIdisConnected) |
235 { |
243 { |
236 if ( iGlxTvOut->IsConnected() ) |
244 iIsHDMIdisConnected = EFalse; |
|
245 } |
|
246 else if ( aChangeType == ETvConnectionChanged ) |
|
247 { |
|
248 if ( iGlxTvOut->IsHDMIConnected() ) |
237 { |
249 { |
238 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); |
250 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); |
239 // Calling SetImageL() with appropriate parameters |
251 // Calling SetImageL() with appropriate parameters |
240 SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount); |
252 if(!iIsHDMIconnected) |
|
253 { |
|
254 SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount, EFalse); |
|
255 } |
241 } |
256 } |
242 else |
257 else |
243 { |
258 { |
244 // if it gets disconnected, destroy the surface |
259 // if it gets disconnected, destroy the surface |
245 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); |
260 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); |
|
261 iIsHDMIconnected = EFalse; |
|
262 iIsHDMIdisConnected = ETrue; |
246 DestroySurfaceUpdater(); |
263 DestroySurfaceUpdater(); |
247 } |
264 } |
248 } |
265 } |
249 } |
266 } |
250 |
267 |