| 1242 | } |
| 1243 | |
| 1244 | void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */) |
| 1245 | { |
| 1246 | if (iNewAddress != CEC_INVALID_PHYSICAL_ADDRESS) |
| 1247 | SetPowerStatus(CEC_POWER_STATUS_ON); |
| 1248 | |
| 1249 | CLockObject lock(m_mutex); |
| 1250 | if (iNewAddress != m_iStreamPath) |
| 1251 | { |
| 1252 | LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): stream path changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, iOldAddress == 0 ? m_iStreamPath : iOldAddress, iNewAddress); |
| 1253 | m_iStreamPath = iNewAddress; |
| 1254 | } |
| 1255 | |
| 1256 | if (!LIB_CEC->IsValidPhysicalAddress(iNewAddress)) |
| 1257 | return; |
| 1258 | |
| 1259 | CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress); |
| 1260 | if (device) |
| 1261 | { |
| 1262 | // if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive |
| 1263 | device->MarkAsActiveSource(); |
| 1264 | |
| 1265 | // respond with an active source message if this device is handled by libCEC |
| 1266 | if (device->IsHandledByLibCEC()) |
| 1267 | device->TransmitActiveSource(true); |
| 1268 | } |
| 1269 | else |
| 1270 | { |
| 1271 | // try to find the device with the old address, and mark it as inactive when found |
| 1272 | device = m_processor->GetDeviceByPhysicalAddress(iOldAddress); |
| 1273 | if (device) |
| 1274 | device->MarkAsInactiveSource(); |
| 1275 | } |
| 1276 | } |
| 1277 | |
| 1278 | bool CCECBusDevice::PowerOn(const cec_logical_address initiator) |
| 1279 | { |
nothing calls this directly
no test coverage detected