repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a1f8fb1
)
cec: send a reply from the correct device when the stream path is requested
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Sun, 6 Nov 2011 14:08:32 +0000
(15:08 +0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Sun, 6 Nov 2011 14:08:32 +0000
(15:08 +0100)
src/lib/devices/CECBusDevice.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/CECCommandHandler.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/CECCommandHandler.h
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/devices/CECBusDevice.cpp
b/src/lib/devices/CECBusDevice.cpp
index 7c2f6bf5705f89c501f1ce2ab2b9ea6d9f0c6335..999270bdd93fb6666570632e7e098d949bf7249f 100644
(file)
--- a/
src/lib/devices/CECBusDevice.cpp
+++ b/
src/lib/devices/CECBusDevice.cpp
@@
-340,7
+340,7
@@
void CCECBusDevice::SetVendorId(uint64_t iVendorId, uint8_t iVendorClass /* = 0
bool CCECBusDevice::TransmitActiveSource(void)
{
CStdString strLog;
bool CCECBusDevice::TransmitActiveSource(void)
{
CStdString strLog;
- strLog.Format("<< %x -> broadcast: active source
", m_iLog
icalAddress);
+ strLog.Format("<< %x -> broadcast: active source
(%4x)", m_iLogicalAddress, m_iPhys
icalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
@@
-354,7
+354,7
@@
bool CCECBusDevice::TransmitActiveSource(void)
bool CCECBusDevice::TransmitActiveView(void)
{
CStdString strLog;
bool CCECBusDevice::TransmitActiveView(void)
{
CStdString strLog;
- strLog.Format("<< %x -> broadcast: active view
", m_iLog
icalAddress);
+ strLog.Format("<< %x -> broadcast: active view
(%4x)", m_iLogicalAddress, m_iPhys
icalAddress);
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
diff --git
a/src/lib/implementations/CECCommandHandler.cpp
b/src/lib/implementations/CECCommandHandler.cpp
index 94348676b94600b020b27405667ddf7468140a98..a424bca3414d2ea38ccedac4a5dc9cfde91e9893 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.cpp
+++ b/
src/lib/implementations/CECCommandHandler.cpp
@@
-313,13
+313,9
@@
bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
CStdString strLog;
strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
CStdString strLog;
strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- if (streamaddr == m_busDevice->GetMyPhysicalAddress())
- {
- CCECBusDevice *device = GetDevice(command.destination);
- if (device)
- return device->TransmitActiveSource();
- return false;
- }
+ CCECBusDevice *device = GetDeviceByPhysicalAddress(streamaddr);
+ if (device)
+ return device->TransmitActiveSource();
}
return true;
}
}
return true;
}
@@
-364,3
+360,19
@@
CCECBusDevice *CCECCommandHandler::GetDevice(cec_logical_address iLogicalAddress
return device;
}
return device;
}
+
+CCECBusDevice *CCECCommandHandler::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress) const
+{
+ CCECBusDevice *device = NULL;
+
+ for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
+ {
+ if (m_busDevice->GetProcessor()->m_busDevices[iPtr]->GetPhysicalAddress() == iPhysicalAddress)
+ {
+ device = m_busDevice->GetProcessor()->m_busDevices[iPtr];
+ break;
+ }
+ }
+
+ return device;
+}
diff --git
a/src/lib/implementations/CECCommandHandler.h
b/src/lib/implementations/CECCommandHandler.h
index 6be4b707baced9e99af593e81fe7c3122ad8946b..96f6db55b1442a06c8f0ebcde2f5b54437582eea 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.h
+++ b/
src/lib/implementations/CECCommandHandler.h
@@
-68,6
+68,7
@@
namespace CEC
virtual void UnhandledCommand(const cec_command &command);
virtual CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
virtual void UnhandledCommand(const cec_command &command);
virtual CCECBusDevice *GetDevice(cec_logical_address iLogicalAddress) const;
+ virtual CCECBusDevice *GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress) const;
CCECBusDevice *m_busDevice;
};
};
CCECBusDevice *m_busDevice;
};
};