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:
dfb0803
)
cec: fixed - mark a device as active source before transmitting the active source...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Fri, 9 Dec 2011 10:37:45 +0000
(11:37 +0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Fri, 9 Dec 2011 10:37:45 +0000
(11:37 +0100)
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.h
patch
|
blob
|
blame
|
history
src/lib/LibCEC.cpp
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/CECCommandHandler.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/SLCommandHandler.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index a3c22df3169ad9f3851b3b34a30fd38c22cd96c7..565d226493e08c96a316338180332befaa4aa5f4 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-176,12
+176,6
@@
bool CCECProcessor::TryLogicalAddress(cec_logical_address address)
{
if (m_busDevices[address]->TryLogicalAddress())
{
{
if (m_busDevices[address]->TryLogicalAddress())
{
- /* only set our OSD name and active source for the primary device */
- if (m_logicalAddresses.IsEmpty())
- {
- m_busDevices[address]->m_strDeviceName = m_strDeviceName;
- m_busDevices[address]->m_bActiveSource = true;
- }
m_logicalAddresses.Set(address);
return true;
}
m_logicalAddresses.Set(address);
return true;
}
@@
-262,6
+256,10
@@
void *CCECProcessor::Process(void)
}
else
{
}
else
{
+ /* only set our OSD name and active source for the primary device */
+ m_busDevices[m_logicalAddresses.primary]->m_strDeviceName = m_strDeviceName;
+ m_busDevices[m_logicalAddresses.primary]->m_bActiveSource = true;
+
SetAckMask(m_logicalAddresses.AckMask());
CLockObject lock(&m_mutex);
SetAckMask(m_logicalAddresses.AckMask());
CLockObject lock(&m_mutex);
@@
-331,8
+329,8
@@
bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
}
}
}
}
- bReturn = m_busDevices[addr]->TransmitActiveSource() &&
-
SetStreamPath(m_busDevices[addr]->GetPhysicalAddress(false)
);
+ m_busDevices[addr]->SetActiveSource();
+
bReturn = m_busDevices[addr]->TransmitActiveSource(
);
if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE))
if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE))
@@
-343,6
+341,20
@@
bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
return bReturn;
}
return bReturn;
}
+bool CCECProcessor::SetActiveSource(uint16_t iStreamPath)
+{
+ bool bReturn(false);
+
+ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath);
+ if (device)
+ {
+ device->SetActiveSource();
+ bReturn = true;
+ }
+
+ return bReturn;
+}
+
void CCECProcessor::SetStandardLineTimeout(uint8_t iTimeout)
{
CLockObject lock(&m_mutex);
void CCECProcessor::SetStandardLineTimeout(uint8_t iTimeout)
{
CLockObject lock(&m_mutex);
@@
-460,20
+472,6
@@
bool CCECProcessor::PhysicalAddressInUse(uint16_t iPhysicalAddress)
return false;
}
return false;
}
-bool CCECProcessor::SetStreamPath(uint16_t iStreamPath)
-{
- bool bReturn(false);
-
- CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath);
- if (device)
- {
- device->SetActiveDevice();
- bReturn = true;
- }
-
- return bReturn;
-}
-
bool CCECProcessor::TransmitInactiveSource(void)
{
if (!IsRunning())
bool CCECProcessor::TransmitInactiveSource(void)
{
if (!IsRunning())
@@
-590,7
+588,7
@@
bool CCECProcessor::PollDevice(cec_logical_address iAddress)
uint8_t CCECProcessor::VolumeUp(void)
{
uint8_t status = 0;
uint8_t CCECProcessor::VolumeUp(void)
{
uint8_t status = 0;
- if (Is
Active
Device(CECDEVICE_AUDIOSYSTEM))
+ if (Is
Present
Device(CECDEVICE_AUDIOSYSTEM))
status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeUp();
return status;
status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeUp();
return status;
@@
-599,7
+597,7
@@
uint8_t CCECProcessor::VolumeUp(void)
uint8_t CCECProcessor::VolumeDown(void)
{
uint8_t status = 0;
uint8_t CCECProcessor::VolumeDown(void)
{
uint8_t status = 0;
- if (Is
Active
Device(CECDEVICE_AUDIOSYSTEM))
+ if (Is
Present
Device(CECDEVICE_AUDIOSYSTEM))
status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeDown();
return status;
status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->VolumeDown();
return status;
@@
-608,7
+606,7
@@
uint8_t CCECProcessor::VolumeDown(void)
uint8_t CCECProcessor::MuteAudio(void)
{
uint8_t status = 0;
uint8_t CCECProcessor::MuteAudio(void)
{
uint8_t status = 0;
- if (Is
Active
Device(CECDEVICE_AUDIOSYSTEM))
+ if (Is
Present
Device(CECDEVICE_AUDIOSYSTEM))
status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->MuteAudio();
return status;
status = ((CCECAudioSystem *)m_busDevices[CECDEVICE_AUDIOSYSTEM])->MuteAudio();
return status;
@@
-933,12
+931,12
@@
cec_logical_addresses CCECProcessor::GetActiveDevices(void)
return addresses;
}
return addresses;
}
-bool CCECProcessor::Is
Active
Device(cec_logical_address address)
+bool CCECProcessor::Is
Present
Device(cec_logical_address address)
{
return m_busDevices[address]->GetStatus() == CEC_DEVICE_STATUS_PRESENT;
}
{
return m_busDevices[address]->GetStatus() == CEC_DEVICE_STATUS_PRESENT;
}
-bool CCECProcessor::Is
Active
DeviceType(cec_device_type type)
+bool CCECProcessor::Is
Present
DeviceType(cec_device_type type)
{
for (unsigned int iPtr = 0; iPtr < 15; iPtr++)
{
{
for (unsigned int iPtr = 0; iPtr < 15; iPtr++)
{
diff --git
a/src/lib/CECProcessor.h
b/src/lib/CECProcessor.h
index d2aa22206b046f3309e51ef22156df42686d10f6..a0e0e73b8b5e95113305d0f1473acbf326bbf787 100644
(file)
--- a/
src/lib/CECProcessor.h
+++ b/
src/lib/CECProcessor.h
@@
-70,8
+70,8
@@
namespace CEC
virtual cec_logical_addresses GetActiveDevices(void);
virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress);
virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.IsSet(address); }
virtual cec_logical_addresses GetActiveDevices(void);
virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iAddress);
virtual bool HasLogicalAddress(cec_logical_address address) const { return m_logicalAddresses.IsSet(address); }
- virtual bool Is
Active
Device(cec_logical_address address);
- virtual bool Is
Active
DeviceType(cec_device_type type);
+ virtual bool Is
Present
Device(cec_logical_address address);
+ virtual bool Is
Present
DeviceType(cec_device_type type);
virtual uint16_t GetPhysicalAddress(void) const;
virtual uint64_t GetLastTransmission(void) const { return m_iLastTransmission; }
virtual bool IsStarted(void) const { return m_bStarted; }
virtual uint16_t GetPhysicalAddress(void) const;
virtual uint64_t GetLastTransmission(void) const { return m_iLastTransmission; }
virtual bool IsStarted(void) const { return m_bStarted; }
@@
-87,7
+87,7
@@
namespace CEC
virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress);
virtual bool SetMenuState(cec_menu_state state, bool bSendUpdate = true);
virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress);
virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress);
virtual bool SetMenuState(cec_menu_state state, bool bSendUpdate = true);
virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress);
- virtual bool Set
StreamPath
(uint16_t iStreamPath);
+ virtual bool Set
ActiveSource
(uint16_t iStreamPath);
virtual bool SwitchMonitoring(bool bEnable);
virtual bool PollDevice(cec_logical_address iAddress);
virtual uint8_t VolumeUp(void);
virtual bool SwitchMonitoring(bool bEnable);
virtual bool PollDevice(cec_logical_address iAddress);
virtual uint8_t VolumeUp(void);
diff --git
a/src/lib/LibCEC.cpp
b/src/lib/LibCEC.cpp
index f43071c32025314bb0a0956805c25d2175edbce4..0ca0188bfa0b596847beafcfdeb7622cb7b78e18 100644
(file)
--- a/
src/lib/LibCEC.cpp
+++ b/
src/lib/LibCEC.cpp
@@
-267,14
+267,14
@@
cec_logical_addresses CLibCEC::GetActiveDevices(void)
bool CLibCEC::IsActiveDevice(cec_logical_address iAddress)
{
if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
bool CLibCEC::IsActiveDevice(cec_logical_address iAddress)
{
if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST)
- return m_cec->Is
Active
Device(iAddress);
+ return m_cec->Is
Present
Device(iAddress);
return false;
}
bool CLibCEC::IsActiveDeviceType(cec_device_type type)
{
if (m_cec && type >= CEC_DEVICE_TYPE_TV && type <= CEC_DEVICE_TYPE_AUDIO_SYSTEM)
return false;
}
bool CLibCEC::IsActiveDeviceType(cec_device_type type)
{
if (m_cec && type >= CEC_DEVICE_TYPE_TV && type <= CEC_DEVICE_TYPE_AUDIO_SYSTEM)
- return m_cec->Is
Active
DeviceType(type);
+ return m_cec->Is
Present
DeviceType(type);
return false;
}
return false;
}
diff --git
a/src/lib/devices/CECBusDevice.cpp
b/src/lib/devices/CECBusDevice.cpp
index 8b4278119746c13a710102d3906958a063696d11..f03f0cba0bbf590fd6d2baa325a5b6d56a595df2 100644
(file)
--- a/
src/lib/devices/CECBusDevice.cpp
+++ b/
src/lib/devices/CECBusDevice.cpp
@@
-440,7
+440,7
@@
void CCECBusDevice::SetInactiveDevice(void)
m_bActiveSource = false;
}
m_bActiveSource = false;
}
-void CCECBusDevice::SetActive
Devi
ce(void)
+void CCECBusDevice::SetActive
Sour
ce(void)
{
CLockObject lock(&m_writeMutex);
{
CLockObject lock(&m_writeMutex);
diff --git
a/src/lib/devices/CECBusDevice.h
b/src/lib/devices/CECBusDevice.h
index 14f3302952b6cdefcd85a10e943ab2786af6cc21..f1786f948d7725008aa1135501846f1974d2948b 100644
(file)
--- a/
src/lib/devices/CECBusDevice.h
+++ b/
src/lib/devices/CECBusDevice.h
@@
-76,7
+76,7
@@
namespace CEC
virtual void SetInactiveDevice(void);
virtual void SetInactiveDevice(void);
- virtual void SetActive
Devi
ce(void);
+ virtual void SetActive
Sour
ce(void);
virtual bool TryLogicalAddress(void);
virtual void SetDeviceStatus(const cec_bus_device_status newStatus);
virtual bool TryLogicalAddress(void);
virtual void SetDeviceStatus(const cec_bus_device_status newStatus);
diff --git
a/src/lib/implementations/CECCommandHandler.cpp
b/src/lib/implementations/CECCommandHandler.cpp
index 5c6a52f0abc2e9d4d82ea2b1e944f8361cf5a077..c7b030543ca044a137b78e8947009e98fabb39c7 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.cpp
+++ b/
src/lib/implementations/CECCommandHandler.cpp
@@
-178,7
+178,7
@@
bool CCECCommandHandler::HandleActiveSource(const cec_command &command)
if (command.parameters.size == 2)
{
uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
if (command.parameters.size == 2)
{
uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
- return m_processor->Set
StreamPath
(iAddress);
+ return m_processor->Set
ActiveSource
(iAddress);
}
return true;
}
return true;
@@
-319,7
+319,7
@@
bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &comm
bool CCECCommandHandler::HandleImageViewOn(const cec_command &command)
{
bool CCECCommandHandler::HandleImageViewOn(const cec_command &command)
{
- m_processor->
SetStreamPath(m_processor->m_busDevices[command.initiator]->GetPhysicalAddress(false)
);
+ m_processor->
m_busDevices[command.initiator]->SetActiveSource(
);
return true;
}
return true;
}
@@
-409,7
+409,7
@@
bool CCECCommandHandler::HandleRoutingInformation(const cec_command &command)
if (command.parameters.size == 2)
{
uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
if (command.parameters.size == 2)
{
uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
- m_processor->Set
StreamPath
(iNewAddress);
+ m_processor->Set
ActiveSource
(iNewAddress);
}
return false;
}
return false;
@@
-464,14
+464,12
@@
bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command)
strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- if (m_processor->SetStreamPath(iStreamAddress))
+ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress);
+ if (device)
{
{
- CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress);
- if (device)
- {
- return device->TransmitActiveSource() &&
- device->TransmitMenuState(command.initiator);
- }
+ device->SetActiveSource();
+ return device->TransmitActiveSource() &&
+ device->TransmitMenuState(command.initiator);
}
}
return false;
}
}
return false;
@@
-491,7
+489,7
@@
bool CCECCommandHandler::HandleSystemAudioModeRequest(const cec_command &command
uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
CCECBusDevice *newActiveDevice = GetDeviceByPhysicalAddress(iNewAddress);
if (newActiveDevice)
uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
CCECBusDevice *newActiveDevice = GetDeviceByPhysicalAddress(iNewAddress);
if (newActiveDevice)
-
m_processor->SetStreamPath(newActiveDevice->GetPhysicalAddress(false)
);
+
newActiveDevice->SetActiveSource(
);
return ((CCECAudioSystem *) device)->TransmitSetSystemAudioMode(command.initiator);
}
else
return ((CCECAudioSystem *) device)->TransmitSetSystemAudioMode(command.initiator);
}
else
@@
-545,7
+543,7
@@
bool CCECCommandHandler::HandleSetSystemAudioMode(const cec_command &command)
bool CCECCommandHandler::HandleTextViewOn(const cec_command &command)
{
bool CCECCommandHandler::HandleTextViewOn(const cec_command &command)
{
- m_processor->
SetStreamPath(m_processor->m_busDevices[command.initiator]->GetPhysicalAddress(false)
);
+ m_processor->
m_busDevices[command.initiator]->SetActiveSource(
);
return true;
}
return true;
}
diff --git
a/src/lib/implementations/SLCommandHandler.cpp
b/src/lib/implementations/SLCommandHandler.cpp
index c23099eb0d2c408ba0ef6f37f7fccdef7055dcae..0f007176d623f9e83732abbef114790b97446d28 100644
(file)
--- a/
src/lib/implementations/SLCommandHandler.cpp
+++ b/
src/lib/implementations/SLCommandHandler.cpp
@@
-145,8
+145,8
@@
void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
void CSLCommandHandler::HandleVendorCommandSLConnect(const cec_command &command)
{
m_bSLEnabled = true;
void CSLCommandHandler::HandleVendorCommandSLConnect(const cec_command &command)
{
m_bSLEnabled = true;
+ m_processor->m_busDevices[command.initiator]->SetActiveSource();
m_processor->m_busDevices[command.destination]->TransmitActiveSource();
m_processor->m_busDevices[command.destination]->TransmitActiveSource();
- m_processor->SetStreamPath(m_processor->m_busDevices[command.destination]->GetPhysicalAddress(false));
TransmitVendorCommand05(command.destination, command.initiator);
TransmitDeckStatus(command.initiator);
}
TransmitVendorCommand05(command.destination, command.initiator);
TransmitDeckStatus(command.initiator);
}