cec: also send 'image view on' before setting the active source
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 6eeb38df53a6d4fc25cecf3a554b61de7e04f0f1..0ea5e8adb36c403cbb59e6c0a48bf1dc92245f7a 100644 (file)
@@ -211,7 +211,6 @@ bool CCECProcessor::Initialise(void)
 
   /* get the vendor id from the TV, so we are using the correct handler */
   m_busDevices[CECDEVICE_TV]->RequestVendorId();
-  ReplaceHandlers();
 
   if (m_iPhysicalAddress != 0)
   {
@@ -406,7 +405,6 @@ bool CCECProcessor::FindLogicalAddresses(void)
 
 void CCECProcessor::ReplaceHandlers(void)
 {
-  CLockObject lock(m_mutex);
   if (!IsInitialised())
     return;
   for (uint8_t iPtr = 0; iPtr <= CECDEVICE_PLAYBACKDEVICE3; iPtr++)
@@ -461,7 +459,8 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
   m_busDevices[addr]->SetActiveSource();
   if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF)
   {
-    bReturn = m_busDevices[addr]->TransmitActiveSource();
+    bReturn = m_busDevices[addr]->TransmitImageViewOn() &&
+        m_busDevices[addr]->TransmitActiveSource();
 
     if (bReturn)
     {
@@ -1369,3 +1368,23 @@ bool CCECProcessor::SetStreamPath(uint16_t iPhysicalAddress)
   // stream path changes are sent by the TV
   return m_busDevices[CECDEVICE_TV]->GetHandler()->TransmitSetStreamPath(iPhysicalAddress);
 }
+
+bool CCECProcessor::GetCurrentConfiguration(libcec_configuration *configuration)
+{
+  configuration->iPhysicalAddress = m_iPhysicalAddress;
+  configuration->iHDMIPort = m_iHDMIPort;
+  configuration->baseDevice = m_iBaseDevice;
+  snprintf(configuration->strDeviceName, 13, "%s", m_strDeviceName.c_str());
+  configuration->deviceTypes = m_types;
+  return true;
+}
+
+bool CCECProcessor::CanPersistConfiguration(void)
+{
+  return m_communication->GetFirmwareVersion() >= 2;
+}
+
+bool CCECProcessor::PersistConfiguration(libcec_configuration *configuration)
+{
+  return m_communication->PersistConfiguration(configuration);
+}