131 TBool CMPXVideoAccessoryObserver::UpdateTvOutStatusL() |
131 TBool CMPXVideoAccessoryObserver::UpdateTvOutStatusL() |
132 { |
132 { |
133 MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()")); |
133 MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL()")); |
134 |
134 |
135 TBool statusChanged = EFalse; |
135 TBool statusChanged = EFalse; |
|
136 TBool tvOutHDMI = EFalse; |
136 |
137 |
137 // |
138 // |
138 // Initialize TV-Out value to EFalse before checking if |
139 // Initialize TV-Out value to EFalse before checking if |
139 // accessories support TV-Out |
140 // accessories support TV-Out |
140 // |
141 // |
151 // |
152 // |
152 const TInt count = iGenericIdArray.Count(); |
153 const TInt count = iGenericIdArray.Count(); |
153 |
154 |
154 for ( TInt index = 0 ; index < count ; index++ ) |
155 for ( TInt index = 0 ; index < count ; index++ ) |
155 { |
156 { |
|
157 TAccPolGenericID genId = iGenericIdArray.GetGenericIDL( index ); |
|
158 |
156 // |
159 // |
157 // Get all supported capabilities for this connected accessory. |
160 // Get all supported capabilities for this connected accessory. |
158 // |
161 // |
159 iConnection.GetSubblockNameArrayL( iGenericIdArray.GetGenericIDL( index ), *nameArray ); |
162 iConnection.GetSubblockNameArrayL( genId, *nameArray ); |
160 |
163 |
161 // |
164 // |
162 // Check if this connected accessory supports TV-Out |
165 // Check if this connected accessory supports TV-Out |
163 // |
166 // |
164 if ( nameArray->HasName( KAccVideoOut ) ) |
167 if ( nameArray->HasName( KAccVideoOut ) ) |
165 { |
168 { |
166 MPX_DEBUG(_L(" TV-Out Capabilities Exist")); |
169 MPX_DEBUG(_L(" TV-Out Capabilities Exist")); |
167 |
170 |
168 tvOutConnected = ETrue; |
171 tvOutConnected = ETrue; |
169 break; |
172 |
|
173 TAccPolNameRecord nameRecord; |
|
174 nameRecord.SetNameL( KAccVideoOut ); |
|
175 TAccValueTypeTInt value; |
|
176 iConnection.GetValueL( genId, nameRecord, value ); |
|
177 |
|
178 if ( value.iValue == EAccVideoOutEHDMI ) |
|
179 { |
|
180 tvOutHDMI = ETrue; |
|
181 // |
|
182 // HDMI has precedence over Comp TV-Out, If the accessory is |
|
183 // HDMI then stop the search for Video Out accessory, else continue |
|
184 // looping through all the accessories. |
|
185 // |
|
186 break; |
|
187 } |
170 } |
188 } |
171 } |
189 } |
172 |
190 |
173 CleanupStack::PopAndDestroy( nameArray ); |
191 CleanupStack::PopAndDestroy( nameArray ); |
174 #endif |
192 #endif |
178 // |
196 // |
179 if ( iTvOutConnected != tvOutConnected ) |
197 if ( iTvOutConnected != tvOutConnected ) |
180 { |
198 { |
181 iTvOutConnected = tvOutConnected; |
199 iTvOutConnected = tvOutConnected; |
182 |
200 |
183 if ( iTvOutConnected ) |
201 if ( iTvOutConnected && !tvOutHDMI) |
184 { |
202 { |
185 // |
203 // |
186 // Check the playablility of the clip |
204 // Check the playablility of the clip |
187 // |
205 // |
188 iTvOutPlaybackAllowed = iController->iPlaybackMode->IsTvOutAllowedL(); |
206 iTvOutPlaybackAllowed = iController->iPlaybackMode->IsTvOutAllowedL(); |
193 } |
211 } |
194 |
212 |
195 statusChanged = ETrue; |
213 statusChanged = ETrue; |
196 } |
214 } |
197 |
215 |
198 MPX_DEBUG(_L(" iTvOutConnected = %d"), iTvOutConnected); |
216 MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL iTvOutConnected = %d, tvOutHDMI = %d"), iTvOutConnected, tvOutHDMI); |
199 |
217 |
200 MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged); |
218 MPX_DEBUG(_L("CMPXVideoAccessoryObserver::UpdateTvOutStatusL() ret = %d"), statusChanged); |
201 |
219 |
202 return statusChanged; |
220 return statusChanged; |
203 } |
221 } |