repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d14323
)
cec: fixed - don't request the PA of devices when handling an incoming CEC command...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Thu, 26 Apr 2012 09:29:17 +0000
(11:29 +0200)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Thu, 26 Apr 2012 09:29:17 +0000
(11:29 +0200)
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.h
patch
|
blob
|
blame
|
history
src/lib/devices/CECBusDevice.cpp
patch
|
blob
|
blame
|
history
src/lib/devices/CECBusDevice.h
patch
|
blob
|
blame
|
history
src/lib/implementations/SLCommandHandler.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/VLCommandHandler.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index 07e7d8f0dc4003b3d4ee280e88a9cd306a282318..9c04b423bb2b100b0d0b651b129206023c76e9a5 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-409,7
+409,7
@@
bool CCECProcessor::ChangeDeviceType(cec_device_type from, cec_device_type to)
newDevice->SetOSDName(previousDevice->GetOSDName(false));
previousDevice->SetOSDName(ToString(previousDevice->GetLogicalAddress()));
newDevice->SetOSDName(previousDevice->GetOSDName(false));
previousDevice->SetOSDName(ToString(previousDevice->GetLogicalAddress()));
- newDevice->SetPhysicalAddress(previousDevice->GetPhysicalAddress(
false
));
+ newDevice->SetPhysicalAddress(previousDevice->GetPhysicalAddress());
previousDevice->SetPhysicalAddress(0xFFFF);
newDevice->SetPowerStatus(previousDevice->GetPowerStatus(false));
previousDevice->SetPhysicalAddress(0xFFFF);
newDevice->SetPowerStatus(previousDevice->GetPowerStatus(false));
@@
-525,7
+525,7
@@
bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
}
m_busDevices[addr]->SetActiveSource();
}
m_busDevices[addr]->SetActiveSource();
- if (m_busDevices[addr]->GetPhysicalAddress(
false
) != 0xFFFF)
+ if (m_busDevices[addr]->GetPhysicalAddress() != 0xFFFF)
bReturn = m_busDevices[addr]->ActivateSource();
return bReturn;
bReturn = m_busDevices[addr]->ActivateSource();
return bReturn;
@@
-536,7
+536,7
@@
bool CCECProcessor::SetActiveSource(uint16_t iStreamPath)
bool bReturn(false);
// suppress polls when searching for a device
bool bReturn(false);
// suppress polls when searching for a device
- CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath
, false, true
);
+ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath);
if (device)
{
device->SetActiveSource();
if (device)
{
device->SetActiveSource();
@@
-649,7
+649,7
@@
bool CCECProcessor::PhysicalAddressInUse(uint16_t iPhysicalAddress)
{
for (unsigned int iPtr = 0; iPtr < 15; iPtr++)
{
{
for (unsigned int iPtr = 0; iPtr < 15; iPtr++)
{
- if (m_busDevices[iPtr]->GetPhysicalAddress(
false
) == iPhysicalAddress)
+ if (m_busDevices[iPtr]->GetPhysicalAddress() == iPhysicalAddress)
return true;
}
return false;
return true;
}
return false;
@@
-810,15
+810,15
@@
uint8_t CCECProcessor::MuteAudio(bool bSendRelease /* = true */)
return status;
}
return status;
}
-CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool b
Refresh /* = false */, bool bSuppressPoll /* = false */) const
+CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool b
SuppressUpdate /* = true */)
{
{
- if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress(
false
) == iPhysicalAddress)
+ if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress() == iPhysicalAddress)
return m_busDevices[m_configuration.logicalAddresses.primary];
CCECBusDevice *device = NULL;
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
{
return m_busDevices[m_configuration.logicalAddresses.primary];
CCECBusDevice *device = NULL;
for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
{
- if (m_busDevices[iPtr]->GetPhysicalAddress(b
Refresh, bSuppressPoll
) == iPhysicalAddress)
+ if (m_busDevices[iPtr]->GetPhysicalAddress(b
SuppressUpdate
) == iPhysicalAddress)
{
device = m_busDevices[iPtr];
break;
{
device = m_busDevices[iPtr];
break;
@@
-896,7
+896,7
@@
uint64_t CCECProcessor::GetDeviceVendorId(cec_logical_address iAddress)
uint16_t CCECProcessor::GetDevicePhysicalAddress(cec_logical_address iAddress)
{
if (m_busDevices[iAddress])
uint16_t CCECProcessor::GetDevicePhysicalAddress(cec_logical_address iAddress)
{
if (m_busDevices[iAddress])
- return m_busDevices[iAddress]->GetPhysicalAddress(
false
);
+ return m_busDevices[iAddress]->GetPhysicalAddress();
return false;
}
return false;
}
@@
-1023,7
+1023,7
@@
bool CCECProcessor::IsPresentDeviceType(cec_device_type type)
uint16_t CCECProcessor::GetPhysicalAddress(void) const
{
if (!m_configuration.logicalAddresses.IsEmpty() && m_busDevices[m_configuration.logicalAddresses.primary])
uint16_t CCECProcessor::GetPhysicalAddress(void) const
{
if (!m_configuration.logicalAddresses.IsEmpty() && m_busDevices[m_configuration.logicalAddresses.primary])
- return m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress(
false
);
+ return m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress();
return false;
}
return false;
}
diff --git
a/src/lib/CECProcessor.h
b/src/lib/CECProcessor.h
index d5571046202caacc27b158d27af8be09c58cf5a9..acefd8b0a4840c1c1eab17ae8f51917853f00af9 100644
(file)
--- a/
src/lib/CECProcessor.h
+++ b/
src/lib/CECProcessor.h
@@
-109,7
+109,7
@@
namespace CEC
bool OnCommandReceived(const cec_command &command);
bool IsMonitoring(void) const { return m_bMonitor; }
bool OnCommandReceived(const cec_command &command);
bool IsMonitoring(void) const { return m_bMonitor; }
- CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool b
Refresh = false, bool bSuppressPoll = false) const
;
+ CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool b
SuppressUpdate = true)
;
CCECBusDevice * GetDeviceByType(cec_device_type type) const;
CCECBusDevice * GetPrimaryDevice(void) const;
cec_version GetDeviceCecVersion(cec_logical_address iAddress);
CCECBusDevice * GetDeviceByType(cec_device_type type) const;
CCECBusDevice * GetPrimaryDevice(void) const;
cec_version GetDeviceCecVersion(cec_logical_address iAddress);
diff --git
a/src/lib/devices/CECBusDevice.cpp
b/src/lib/devices/CECBusDevice.cpp
index cfdc520b3934f27610faa1c19b2b319ad77bb2dc..51ddfeca68af118baca2ed31bda586c1d0921cee 100644
(file)
--- a/
src/lib/devices/CECBusDevice.cpp
+++ b/
src/lib/devices/CECBusDevice.cpp
@@
-278,21
+278,23
@@
bool CCECBusDevice::RequestOSDName(bool bWaitForResponse /* = true */)
return bReturn;
}
return bReturn;
}
-uint16_t CCECBusDevice::GetPhysicalAddress(bool b
Update /* = false */, bool bSuppressPoll /* = fals
e */)
+uint16_t CCECBusDevice::GetPhysicalAddress(bool b
SuppressUpdate /* = tru
e */)
{
{
- bool bIsPresent(GetStatus(false, bSuppressPoll) == CEC_DEVICE_STATUS_PRESENT);
- bool bRequestUpdate(false);
+ if (!bSuppressUpdate)
{
{
- CLockObject lock(m_mutex);
- bRequestUpdate = bIsPresent &&
- (m_iPhysicalAddress == 0xFFFF || bUpdate);
- }
+ bool bIsPresent(GetStatus() == CEC_DEVICE_STATUS_PRESENT);
+ bool bRequestUpdate(false);
+ {
+ CLockObject lock(m_mutex);
+ bRequestUpdate = bIsPresent && m_iPhysicalAddress == 0xFFFF;
+ }
- if (bRequestUpdate)
- {
- CheckVendorIdRequested();
- if (!RequestPhysicalAddress())
- CLibCEC::AddLog(CEC_LOG_ERROR, "failed to request the physical address");
+ if (bRequestUpdate)
+ {
+ CheckVendorIdRequested();
+ if (!RequestPhysicalAddress())
+ CLibCEC::AddLog(CEC_LOG_ERROR, "failed to request the physical address");
+ }
}
CLockObject lock(m_mutex);
}
CLockObject lock(m_mutex);
@@
-644,7
+646,7
@@
void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /*
m_iStreamPath = iNewAddress;
// suppress polls when searching for a device
m_iStreamPath = iNewAddress;
// suppress polls when searching for a device
- CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress
, false, true
);
+ CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress);
if (device)
{
// if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive
if (device)
{
// if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive
@@
-653,7
+655,7
@@
void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /*
else
{
// try to find the device with the old address, and mark it as inactive when found
else
{
// try to find the device with the old address, and mark it as inactive when found
- device = m_processor->GetDeviceByPhysicalAddress(iOldAddress
, false, true
);
+ device = m_processor->GetDeviceByPhysicalAddress(iOldAddress);
if (device)
device->SetInactiveSource();
}
if (device)
device->SetInactiveSource();
}
diff --git
a/src/lib/devices/CECBusDevice.h
b/src/lib/devices/CECBusDevice.h
index 377bec395e1732b9b702df941d3f39df0621cbdd..803f6f6ea4a514ab2f142ef8281106e2d2107e73 100644
(file)
--- a/
src/lib/devices/CECBusDevice.h
+++ b/
src/lib/devices/CECBusDevice.h
@@
-63,7
+63,7
@@
namespace CEC
virtual cec_logical_address GetMyLogicalAddress(void) const;
virtual uint16_t GetMyPhysicalAddress(void) const;
virtual CStdString GetOSDName(bool bUpdate = false);
virtual cec_logical_address GetMyLogicalAddress(void) const;
virtual uint16_t GetMyPhysicalAddress(void) const;
virtual CStdString GetOSDName(bool bUpdate = false);
- virtual uint16_t GetPhysicalAddress(bool b
Update = false, bool bSuppressPoll = fals
e);
+ virtual uint16_t GetPhysicalAddress(bool b
SuppressUpdate = tru
e);
virtual cec_power_status GetPowerStatus(bool bUpdate = false);
virtual CCECProcessor * GetProcessor(void) const { return m_processor; }
virtual cec_device_type GetType(void) const { return m_type; }
virtual cec_power_status GetPowerStatus(bool bUpdate = false);
virtual CCECProcessor * GetProcessor(void) const { return m_processor; }
virtual cec_device_type GetType(void) const { return m_type; }
diff --git
a/src/lib/implementations/SLCommandHandler.cpp
b/src/lib/implementations/SLCommandHandler.cpp
index 5b8a7295949d7ba46affddeb4e12ca6285ce340f..f32209b332f0f22df0df8e5399b83340adde63d6 100644
(file)
--- a/
src/lib/implementations/SLCommandHandler.cpp
+++ b/
src/lib/implementations/SLCommandHandler.cpp
@@
-127,7
+127,7
@@
bool CSLCommandHandler::HandleActiveSource(const cec_command &command)
{
uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
{
uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
- bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress(
false
) && primary->IsActiveSource());
+ bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress() && primary->IsActiveSource());
m_processor->SetActiveSource(iAddress);
if (bSendPowerOffState)
m_processor->SetActiveSource(iAddress);
if (bSendPowerOffState)
diff --git
a/src/lib/implementations/VLCommandHandler.cpp
b/src/lib/implementations/VLCommandHandler.cpp
index 59146973d7de5b6006f253946c9964abe2217a71..e8cf7c8c4d01f0aede754d5c2c71f76d94185c50 100644
(file)
--- a/
src/lib/implementations/VLCommandHandler.cpp
+++ b/
src/lib/implementations/VLCommandHandler.cpp
@@
-133,7
+133,7
@@
bool CVLCommandHandler::TransmitPendingActiveSourceCommands(void)
if (bTransmitCommand)
{
CLibCEC::AddLog(CEC_LOG_DEBUG, "transmitting delayed activate source command");
if (bTransmitCommand)
{
CLibCEC::AddLog(CEC_LOG_DEBUG, "transmitting delayed activate source command");
- return CCECCommandHandler::TransmitActiveSource(m_busDevice->GetLogicalAddress(), m_busDevice->GetPhysicalAddress(
false, true
));
+ return CCECCommandHandler::TransmitActiveSource(m_busDevice->GetLogicalAddress(), m_busDevice->GetPhysicalAddress());
}
return true;
}
}
return true;
}