| 635 | } |
| 636 | |
| 637 | int CCECCommandHandler::HandleSetStreamPath(const cec_command &command) |
| 638 | { |
| 639 | if (!m_processor->CECInitialised()) |
| 640 | return CEC_ABORT_REASON_NOT_IN_CORRECT_MODE_TO_RESPOND; |
| 641 | |
| 642 | if (command.parameters.size >= 2) |
| 643 | { |
| 644 | uint16_t iStreamAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); |
| 645 | LIB_CEC->AddLog(CEC_LOG_DEBUG, ">> %s (%x) sets stream path to physical address %04x", ToString(command.initiator), command.initiator, iStreamAddress); |
| 646 | |
| 647 | /* one of the device handled by libCEC has been made active */ |
| 648 | CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); |
| 649 | if (device) |
| 650 | { |
| 651 | if (device->IsHandledByLibCEC()) |
| 652 | { |
| 653 | if (!device->IsActiveSource()) |
| 654 | device->ActivateSource(); |
| 655 | else |
| 656 | { |
| 657 | device->MarkAsActiveSource(); |
| 658 | device->TransmitActiveSource(true); |
| 659 | } |
| 660 | } |
| 661 | return COMMAND_HANDLED; |
| 662 | } |
| 663 | else |
| 664 | { |
| 665 | // mark all devices as inactive sources |
| 666 | CECDEVICEVEC devices; |
| 667 | m_processor->GetDevices()->Get(devices); |
| 668 | for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++) |
| 669 | (*it)->MarkAsInactiveSource(); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | return CEC_ABORT_REASON_INVALID_OPERAND; |
| 674 | } |
| 675 | |
| 676 | int CCECCommandHandler::HandleSystemAudioModeRequest(const cec_command &command) |
| 677 | { |
nothing calls this directly
no test coverage detected