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:
d55f263
)
cec: added an 'send inactive source' option to libcec_configuration, only supported...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 27 Feb 2012 20:25:46 +0000
(21:25 +0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Mon, 27 Feb 2012 20:25:46 +0000
(21:25 +0100)
include/cectypes.h
patch
|
blob
|
blame
|
history
src/cec-config/cec-config.cpp
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/LibCEC.cpp
patch
|
blob
|
blame
|
history
diff --git
a/include/cectypes.h
b/include/cectypes.h
index 91fd94d098aee5445a141b3ccf1991838240cc6d..76056cd63458701285c5c5d1fe9c741c7cd50de9 100644
(file)
--- a/
include/cectypes.h
+++ b/
include/cectypes.h
@@
-79,6
+79,7
@@
namespace CEC {
#define CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN 1
#define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
#define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY 1
#define CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN 1
#define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
#define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY 1
+#define CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE 1
#define CEC_DEFAULT_TRANSMIT_RETRY_WAIT 500
#define CEC_DEFAULT_TRANSMIT_TIMEOUT 1000
#define CEC_DEFAULT_TRANSMIT_RETRY_WAIT 500
#define CEC_DEFAULT_TRANSMIT_TIMEOUT 1000
@@
-946,13
+947,15
@@
typedef struct ICECCallbacks
typedef enum cec_client_version
{
CEC_CLIENT_VERSION_PRE_1_5 = 0,
typedef enum cec_client_version
{
CEC_CLIENT_VERSION_PRE_1_5 = 0,
- CEC_CLIENT_VERSION_1_5_0 = 0x1500
+ CEC_CLIENT_VERSION_1_5_0 = 0x1500,
+ CEC_CLIENT_VERSION_1_5_1 = 0x1501
} cec_client_version;
typedef enum cec_server_version
{
CEC_SERVER_VERSION_PRE_1_5 = 0,
} cec_client_version;
typedef enum cec_server_version
{
CEC_SERVER_VERSION_PRE_1_5 = 0,
- CEC_SERVER_VERSION_1_5_0 = 0x1500
+ CEC_SERVER_VERSION_1_5_0 = 0x1500,
+ CEC_SERVER_VERSION_1_5_1 = 0x1501
} cec_server_version;
typedef struct libcec_configuration
} cec_server_version;
typedef struct libcec_configuration
@@
-976,6
+979,7
@@
typedef struct libcec_configuration
uint8_t bActivateSource; /*!< make libCEC the active source on the bus when starting the player application */
uint8_t bPowerOffScreensaver; /*!< put devices in standby mode when activating the screensaver */
uint8_t bPowerOffOnStandby; /*!< put this PC in standby mode when the TV is switched off */
uint8_t bActivateSource; /*!< make libCEC the active source on the bus when starting the player application */
uint8_t bPowerOffScreensaver; /*!< put devices in standby mode when activating the screensaver */
uint8_t bPowerOffOnStandby; /*!< put this PC in standby mode when the TV is switched off */
+ uint8_t bSendInactiveSource; /*!< send an 'inactive source' message when stopping the player. added in 1.5.1 */
void * callbackParam; /*!< the object to pass along with a call of the callback methods. NULL to ignore */
ICECCallbacks * callbacks; /*!< the callback methods to use. set this to NULL when not using callbacks */
void * callbackParam; /*!< the object to pass along with a call of the callback methods. NULL to ignore */
ICECCallbacks * callbacks; /*!< the callback methods to use. set this to NULL when not using callbacks */
@@
-1001,11
+1005,12
@@
typedef struct libcec_configuration
#if CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN == 1
powerOffDevices.Set(CECDEVICE_BROADCAST);
#endif
#if CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN == 1
powerOffDevices.Set(CECDEVICE_BROADCAST);
#endif
-
#if CEC_DEFAULT_SETTING_ACTIVATE_SOURCE == 1
-
wakeDevices.Set(CECDEVICE_TV);
-
#endif
+ #if CEC_DEFAULT_SETTING_ACTIVATE_SOURCE == 1
+ wakeDevices.Set(CECDEVICE_TV);
+ #endif
bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
bPowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
bPowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
+ bSendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
callbackParam = NULL;
callbacks = NULL;
callbackParam = NULL;
callbacks = NULL;
diff --git
a/src/cec-config/cec-config.cpp
b/src/cec-config/cec-config.cpp
index d0840cec926546a56c6e1660c82cb832279f9de1..c46bbacf6f4f638bca702d0b0f0d27ce55224e2a 100644
(file)
--- a/
src/cec-config/cec-config.cpp
+++ b/
src/cec-config/cec-config.cpp
@@
-410,7
+410,15
@@
int main (int UNUSED(argc), char *UNUSED(argv[]))
string input;
getline(cin, input);
cin.clear();
string input;
getline(cin, input);
cin.clear();
- g_config.bPowerOffOnStandby = (input == "y" || input == "Y");
+ g_config.bPowerOffOnStandby = (input == "y" || input == "Y") ? 1 : 0;
+ }
+
+ {
+ PrintToStdOut("Do you want to send an inactive source message when stopping the application (y/n)?");
+ string input;
+ getline(cin, input);
+ cin.clear();
+ g_config.bSendInactiveSource = (input == "y" || input == "Y") ? 1 : 0;
}
PrintToStdOut("\n\n=== USB-CEC Adapter Configuration Summary ===");
}
PrintToStdOut("\n\n=== USB-CEC Adapter Configuration Summary ===");
@@
-421,7
+429,8
@@
int main (int UNUSED(argc), char *UNUSED(argv[]))
PrintToStdOut("Make the adapter the active source when starting XBMC: %s", g_config.bActivateSource ? "yes" : "no");
PrintToStdOut("Power off devices when stopping XBMC: %s", g_config.powerOffDevices.IsSet(CECDEVICE_BROADCAST) ? "yes" : "no");
PrintToStdOut("Put devices in standby mode when activating screensaver: %s", g_config.bPowerOffScreensaver ? "yes" : "no");
PrintToStdOut("Make the adapter the active source when starting XBMC: %s", g_config.bActivateSource ? "yes" : "no");
PrintToStdOut("Power off devices when stopping XBMC: %s", g_config.powerOffDevices.IsSet(CECDEVICE_BROADCAST) ? "yes" : "no");
PrintToStdOut("Put devices in standby mode when activating screensaver: %s", g_config.bPowerOffScreensaver ? "yes" : "no");
- PrintToStdOut("Put this PC in standby mode when the TV is switched off: %s\n\n", g_config.bPowerOffOnStandby ? "yes" : "no");
+ PrintToStdOut("Put this PC in standby mode when the TV is switched off: %s", g_config.bPowerOffOnStandby ? "yes" : "no");
+ PrintToStdOut("Seend an inactive source message when stopping XBMC: %s\n\n", g_config.bSendInactiveSource ? "yes" : "no");
if (g_parser->CanPersistConfiguration())
{
if (g_parser->CanPersistConfiguration())
{
@@
-446,18
+455,29
@@
int main (int UNUSED(argc), char *UNUSED(argv[]))
configOutput.open("usb_2548_1001.xml");
if (configOutput.is_open())
{
configOutput.open("usb_2548_1001.xml");
if (configOutput.is_open())
{
+ CStdString strWakeDevices;
+ for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
+ if (g_config.wakeDevices[iPtr])
+ strWakeDevices.AppendFormat(" %d" + iPtr);
+ CStdString strStandbyDevices;
+ for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
+ if (g_config.powerOffDevices[iPtr])
+ strStandbyDevices.AppendFormat(" %d" + iPtr);
+
configOutput <<
"<settings>\n" <<
configOutput <<
"<settings>\n" <<
- "\t<setting id=\"cec_hdmi_port\" value=\"" << g_config.iHDMIPort << "\" />\n" <<
- "\t<setting id=\"connected_device\" value=\"" << (int)g_config.baseDevice << "\" />\n" <<
- "\t<setting id=\"physical_address\" value=\"" << hex << g_config.iPhysicalAddress << "\" />\n" <<
- "\t<setting id=\"use_tv_menu_language\" value=\"" << (int)g_config.bUseTVMenuLanguage << "\" />\n" <<
- "\t<setting id=\"cec_power_on_startup\" value=\"" << (int)g_config.bActivateSource << "\" />\n" <<
- "\t<setting id=\"cec_power_off_shutdown\" value=\"" << (int)(g_config.powerOffDevices.IsSet(CECDEVICE_BROADCAST) ? 1 : 0) << "\" />\n" <<
+ "\t<setting id=\"enabled\" value=\"1\" />\n" <<
+ "\t<setting id=\"activate_source\" value=\"" << (int)g_config.bActivateSource << "\" />\n" <<
+ "\t<setting id=\"wake_devices\" value=\"" << strWakeDevices.Trim().c_str() << "\" />\n" <<
+ "\t<setting id=\"standby_devices\" value=\"" << strStandbyDevices.Trim().c_str() << "\" />\n" <<
"\t<setting id=\"cec_standby_screensaver\" value=\"" << (int)g_config.bPowerOffScreensaver << "\" />\n" <<
"\t<setting id=\"standby_pc_on_tv_standby\" value=\"" << (int)g_config.bPowerOffOnStandby << "\" />\n" <<
"\t<setting id=\"cec_standby_screensaver\" value=\"" << (int)g_config.bPowerOffScreensaver << "\" />\n" <<
"\t<setting id=\"standby_pc_on_tv_standby\" value=\"" << (int)g_config.bPowerOffOnStandby << "\" />\n" <<
- "\t<setting id=\"enabled\" value=\"1\" />\n" <<
+ "\t<setting id=\"use_tv_menu_language\" value=\"" << (int)g_config.bUseTVMenuLanguage << "\" />\n" <<
+ "\t<setting id=\"physical_address\" value=\"" << hex << g_config.iPhysicalAddress << "\" />\n" <<
+ "\t<setting id=\"cec_hdmi_port\" value=\"" << g_config.iHDMIPort << "\" />\n" <<
+ "\t<setting id=\"connected_device\" value=\"" << (int)g_config.baseDevice << "\" />\n" <<
"\t<setting id=\"port\" value=\"\" />\n" <<
"\t<setting id=\"port\" value=\"\" />\n" <<
+ "\t<setting id=\"send_inactive_source\" value=\"" << (int)g_config.bSendInactiveSource << "\" />\n" <<
"</settings>";
configOutput.close();
"</settings>";
configOutput.close();
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index 5b6fb033bebc3ceab5ea0984203b8c415a46046c..cf7b5b4ec62f0d046483464d8528c09bdf55b9e3 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-60,7
+60,7
@@
CCECProcessor::CCECProcessor(CLibCEC *controller, libcec_configuration *configur
m_logicalAddresses.Clear();
CreateBusDevices();
m_configuration.Clear();
m_logicalAddresses.Clear();
CreateBusDevices();
m_configuration.Clear();
- m_configuration.serverVersion =
CEC_SERVER_VERSION_1_5_0
;
+ m_configuration.serverVersion =
configuration->serverVersion
;
SetConfiguration(configuration);
if (m_configuration.tvVendor != CEC_VENDOR_UNKNOWN)
SetConfiguration(configuration);
if (m_configuration.tvVendor != CEC_VENDOR_UNKNOWN)
@@
-78,7
+78,7
@@
CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, con
m_iLastTransmission(0)
{
m_configuration.Clear();
m_iLastTransmission(0)
{
m_configuration.Clear();
- m_configuration.serverVersion
= CEC_SERVER_VERSION_1_5_0
;
+ m_configuration.serverVersion
= CEC_SERVER_VERSION_1_5_1
;
// client version < 1.5.0
m_configuration.clientVersion = (uint32_t)CEC_CLIENT_VERSION_PRE_1_5;
// client version < 1.5.0
m_configuration.clientVersion = (uint32_t)CEC_CLIENT_VERSION_PRE_1_5;
@@
-1372,6
+1372,8
@@
const char *CCECProcessor::ToString(const cec_client_version version)
return "pre-1.5";
case CEC_CLIENT_VERSION_1_5_0:
return "1.5.0";
return "pre-1.5";
case CEC_CLIENT_VERSION_1_5_0:
return "1.5.0";
+ case CEC_CLIENT_VERSION_1_5_1:
+ return "1.5.1";
default:
return "Unknown";
}
default:
return "Unknown";
}
@@
-1385,6
+1387,8
@@
const char *CCECProcessor::ToString(const cec_server_version version)
return "pre-1.5";
case CEC_SERVER_VERSION_1_5_0:
return "1.5.0";
return "pre-1.5";
case CEC_SERVER_VERSION_1_5_0:
return "1.5.0";
+ case CEC_SERVER_VERSION_1_5_1:
+ return "1.5.1";
default:
return "Unknown";
}
default:
return "Unknown";
}
@@
-1560,6
+1564,10
@@
bool CCECProcessor::SetConfiguration(const libcec_configuration *configuration)
m_configuration.bPowerOffScreensaver = configuration->bPowerOffScreensaver;
m_configuration.bPowerOffOnStandby = configuration->bPowerOffOnStandby;
m_configuration.bPowerOffScreensaver = configuration->bPowerOffScreensaver;
m_configuration.bPowerOffOnStandby = configuration->bPowerOffOnStandby;
+ // client version 1.5.1
+ if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_5_1)
+ m_configuration.bSendInactiveSource = configuration->bSendInactiveSource;
+
// ensure that there is at least 1 device type set
if (m_configuration.deviceTypes.IsEmpty())
m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
// ensure that there is at least 1 device type set
if (m_configuration.deviceTypes.IsEmpty())
m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
@@
-1598,6
+1606,10
@@
bool CCECProcessor::GetCurrentConfiguration(libcec_configuration *configuration)
configuration->bPowerOffScreensaver = m_configuration.bPowerOffScreensaver;
configuration->bPowerOffOnStandby = m_configuration.bPowerOffOnStandby;
configuration->bPowerOffScreensaver = m_configuration.bPowerOffScreensaver;
configuration->bPowerOffOnStandby = m_configuration.bPowerOffOnStandby;
+ // client version 1.5.1
+ if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_5_1)
+ configuration->bSendInactiveSource = m_configuration.bSendInactiveSource;
+
return true;
}
return true;
}
diff --git
a/src/lib/LibCEC.cpp
b/src/lib/LibCEC.cpp
index a289b75c47fe9bda4b0cfc051c85b74a4fd88364..4f7fea203372b9768cd47a67080ee38500b854fd 100644
(file)
--- a/
src/lib/LibCEC.cpp
+++ b/
src/lib/LibCEC.cpp
@@
-59,8
+59,8
@@
CLibCEC::CLibCEC(libcec_configuration *configuration) :
m_callbacks(configuration->callbacks),
m_cbParam(configuration->callbackParam)
{
m_callbacks(configuration->callbacks),
m_cbParam(configuration->callbackParam)
{
+ configuration->serverVersion = CEC_SERVER_VERSION_1_5_1;
m_cec = new CCECProcessor(this, configuration);
m_cec = new CCECProcessor(this, configuration);
- configuration->serverVersion = CEC_SERVER_VERSION_1_5_0;
}
CLibCEC::~CLibCEC(void)
}
CLibCEC::~CLibCEC(void)