MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / HandleSetStreamPath

Method HandleSetStreamPath

src/libcec/implementations/CECCommandHandler.cpp:637–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635}
636
637int 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
676int CCECCommandHandler::HandleSystemAudioModeRequest(const cec_command &command)
677{

Callers

nothing calls this directly

Calls 11

ToStringFunction · 0.85
CECInitialisedMethod · 0.80
MarkAsActiveSourceMethod · 0.80
GetMethod · 0.80
GetDevicesMethod · 0.80
MarkAsInactiveSourceMethod · 0.80
AddLogMethod · 0.45
IsHandledByLibCECMethod · 0.45
IsActiveSourceMethod · 0.45
ActivateSourceMethod · 0.45
TransmitActiveSourceMethod · 0.45

Tested by

no test coverage detected