*/
virtual void Close(void) = 0;
-// XXX XBMC Eden for Windows has been built against 1.2.0 and Ubuntu against 1.5.2
-// we accidently broke the abi between these versions, and this will ensure the upgrade will still work
-#if !defined(_WIN32) && !defined(_WIN64)
- /*!
- * @brief Set and enable the callback methods. If this method is not called, the GetNext...() methods will have to be used.
- * @param cbParam Parameter to pass to callback methods.
- * @param callbacks The callbacks to set.
- * @return True when enabled, false otherwise.
- */
- virtual bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) = 0;
-#endif
-
/*!
* @brief Try to find all connected CEC adapters.
* @param deviceList The vector to store device descriptors in.
virtual bool StartBootloader(void) = 0;
//@}
- /*!
- * @deprecated Use libcec_configuration instead
- * @return Get the minimal version of libCEC that this version of libCEC can interface with.
- */
- virtual int8_t GetMinLibVersion(void) const = 0;
-
- /*!
- * @deprecated Use libcec_configuration instead
- * @return Get the major version of libCEC.
- */
- virtual int8_t GetLibVersionMajor(void) const = 0;
-
- /*!
- * @deprecated Use libcec_configuration instead
- * @return Get the minor version of libCEC.
- */
- virtual int8_t GetLibVersionMinor(void) const = 0;
-
- /*!
- * @deprecated Use callback methods instead
- * @brief Get the next log message in the queue, if there is one.
- * @param message The next message.
- * @return True if a message was passed, false otherwise.
- */
- virtual bool GetNextLogMessage(cec_log_message *message) = 0;
-
- /*!
- * @deprecated Use callback methods instead
- * @brief Get the next keypress in the queue, if there is one.
- * @param key The next keypress.
- * @return True if a key was passed, false otherwise.
- */
- virtual bool GetNextKeypress(cec_keypress *key) = 0;
-
- /*!
- * @deprecated Use callback methods instead
- * @brief Get the next CEC command that was received by the adapter.
- * @param command The next command.
- * @return True when a command was passed, false otherwise.
- */
- virtual bool GetNextCommand(cec_command *command) = 0;
-
/*!
* @brief Transmit a raw CEC command over the CEC line.
* @param data The command to send.
*/
virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS) = 0;
-// XXX XBMC Eden for Windows has been built against 1.2.0 and Ubuntu against 1.5.2
-// we accidently broke the abi between these versions, and this will ensure the upgrade will still work
-#if !defined(_WIN32) && !defined(_WIN64)
- /*!
- * @deprecated Use libcec_configuration instead.
- * @brief Enable physical address detection (if the connected adapter supports this).
- * @return True when physical address detection was enabled, false otherwise.
- */
- virtual bool EnablePhysicalAddressDetection(void) = 0;
-
- /*!
- * @brief Changes the active HDMI port.
- * @param iBaseDevice The device to which this libCEC is connected.
- * @param iPort The new port number.
- * @return True when changed, false otherwise.
- */
- virtual bool SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort) = 0;
-#endif
-
/*!
* @brief Power on the given CEC capable devices. If CECDEVICE_BROADCAST is used, then wakeDevice in libcec_configuration will be used.
* @param address The logical address to power on.
*/
virtual bool SetActiveSource(cec_device_type type = CEC_DEVICE_TYPE_RESERVED) = 0;
- /*!
- * @deprecated Use SetActiveSource() instead
- */
- virtual bool SetActiveView(void) = 0;
-
/*!
* @brief Change the deck control mode, if this adapter is registered as playback or recording device.
* @param mode The new control mode.
*/
virtual cec_power_status GetDevicePowerStatus(cec_logical_address iLogicalAddress) = 0;
-// XXX XBMC Eden for Windows has been built against 1.2.0 and Ubuntu against 1.5.2
-// we accidently broke the abi between these versions, and this will ensure the upgrade will still work
-#if !defined(_WIN32) && !defined(_WIN64)
- /*!
- * @brief Get the physical address of the device with the given logical address.
- * @param iLogicalAddress The device to get the vendor id for.
- * @return The physical address or 0 if it wasn't found.
- */
- virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iLogicalAddress) = 0;
-#endif
-
/*!
* @brief Sends a POLL message to a device, to check if it's present and responding.
* @param iLogicalAddress The device to send the message to.
*/
virtual cec_logical_addresses GetLogicalAddresses(void) = 0;
- virtual const char *ToString(const cec_menu_state state) = 0;
- virtual const char *ToString(const cec_version version) = 0;
- virtual const char *ToString(const cec_power_status status) = 0;
- virtual const char *ToString(const cec_logical_address address) = 0;
- virtual const char *ToString(const cec_deck_control_mode mode) = 0;
- virtual const char *ToString(const cec_deck_info status) = 0;
- virtual const char *ToString(const cec_opcode opcode) = 0;
- virtual const char *ToString(const cec_system_audio_status mode) = 0;
- virtual const char *ToString(const cec_audio_status status) = 0;
- virtual const char *ToString(const cec_vendor_id vendor) = 0;
- virtual const char *ToString(const cec_client_version version) = 0;
- virtual const char *ToString(const cec_server_version version) = 0;
-
/*!
* @brief Get libCEC's current configuration.
* @param configuration The configuration.
*/
virtual bool GetDeviceInformation(const char *strPort, libcec_configuration *config, uint32_t iTimeoutMs = 10000) = 0;
-// XXX XBMC Eden for Windows has been built against 1.2.0 and Ubuntu against 1.5.2
-// we accidently broke the abi between these versions, and this will ensure the upgrade will still work
-#if defined(_WIN32) || defined(_WIN64)
/*!
* @brief Set and enable the callback methods. If this method is not called, the GetNext...() methods will have to be used.
* @param cbParam Parameter to pass to callback methods.
*/
virtual bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks) = 0;
- /*!
- * @deprecated Use libcec_configuration instead.
- * @brief Enable physical address detection (if the connected adapter supports this).
- * @return True when physical address detection was enabled, false otherwise.
- */
- virtual bool EnablePhysicalAddressDetection(void) = 0;
-
/*!
* @brief Changes the active HDMI port.
* @param iBaseDevice The device to which this libCEC is connected.
* @return The physical address or 0 if it wasn't found.
*/
virtual uint16_t GetDevicePhysicalAddress(cec_logical_address iLogicalAddress) = 0;
-#endif
/*!
* @return A string with information about how libCEC was compiled.
*/
virtual const char *GetLibInfo(void) = 0;
- virtual const char *ToString(const cec_user_control_code key) = 0;
-
/*!
* @brief Calling this method will initialise the host on which libCEC is running.
* Calling this method will initialise the host on which libCEC is running. On the RPi, it calls
*/
virtual void InitVideoStandalone(void) = 0;
+ virtual const char *ToString(const cec_menu_state state) = 0;
+ virtual const char *ToString(const cec_version version) = 0;
+ virtual const char *ToString(const cec_power_status status) = 0;
+ virtual const char *ToString(const cec_logical_address address) = 0;
+ virtual const char *ToString(const cec_deck_control_mode mode) = 0;
+ virtual const char *ToString(const cec_deck_info status) = 0;
+ virtual const char *ToString(const cec_opcode opcode) = 0;
+ virtual const char *ToString(const cec_system_audio_status mode) = 0;
+ virtual const char *ToString(const cec_audio_status status) = 0;
+ virtual const char *ToString(const cec_vendor_id vendor) = 0;
+ virtual const char *ToString(const cec_client_version version) = 0;
+ virtual const char *ToString(const cec_server_version version) = 0;
+ virtual const char *ToString(const cec_user_control_code key) = 0;
virtual const char *ToString(const cec_adapter_type type) = 0;
};
};
-/*!
- * @brief Load the CEC adapter library.
- * @param strDeviceName How to present this device to other devices.
- * @param deviceTypes The device types to use on the CEC bus.
- * @return An instance of ICECAdapter or NULL on error.
- */
-extern "C" DECLSPEC void * CECInit(const char *strDeviceName, CEC::cec_device_type_list deviceTypes);
-
-/*!
- * @deprecated
- */
-extern "C" DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
-
/*!
* @brief Unload the CEC adapter library.
*/
extern DECLSPEC int cec_initialise(libcec_configuration *configuration);
#endif
-#ifdef __cplusplus
-extern DECLSPEC int cec_init_typed(const char *strDeviceName, CEC::cec_device_type_list deviceTypes);
-#else
-extern DECLSPEC int cec_init_typed(const char *strDeviceName, cec_device_type_list deviceTypes);
-#endif
-
extern DECLSPEC void cec_destroy(void);
extern DECLSPEC int cec_open(const char *strPort, uint32_t iTimeout);
extern DECLSPEC int cec_start_bootloader(void);
-extern DECLSPEC int8_t cec_get_min_lib_version(void);
-
-extern DECLSPEC int8_t cec_get_lib_version_major(void);
-
-extern DECLSPEC int8_t cec_get_lib_version_minor(void);
-
#ifdef __cplusplus
extern DECLSPEC int cec_power_on_devices(CEC::cec_logical_address address);
#else
extern DECLSPEC int cec_standby_devices(cec_logical_address address);
#endif
-extern DECLSPEC int cec_set_active_view(void);
-
#ifdef __cplusplus
extern DECLSPEC int cec_set_active_source(CEC::cec_device_type type);
#else
extern DECLSPEC int cec_set_menu_state(cec_menu_state state, int bSendUpdate);
#endif
-#ifdef __cplusplus
-extern DECLSPEC int cec_get_next_log_message(CEC::cec_log_message *message);
-#else
-extern DECLSPEC int cec_get_next_log_message(cec_log_message *message);
-#endif
-
-#ifdef __cplusplus
-extern DECLSPEC int cec_get_next_keypress(CEC::cec_keypress *key);
-#else
-extern DECLSPEC int cec_get_next_keypress(cec_keypress *key);
-#endif
-
-#ifdef __cplusplus
-extern DECLSPEC int cec_get_next_command(CEC::cec_command *command);
-#else
-extern DECLSPEC int cec_get_next_command(cec_command *command);
-#endif
-
#ifdef __cplusplus
extern DECLSPEC int cec_transmit(const CEC::cec_command *data);
#else
extern DECLSPEC cec_osd_name cec_get_device_osd_name(cec_logical_address iAddress);
#endif
-extern DECLSPEC int cec_enable_physical_address_detection(void);
-
#ifdef __cplusplus
extern DECLSPEC int cec_set_stream_path_logical(CEC::cec_logical_address iAddress);
#else
HINSTANCE g_libCEC = NULL;
-/*!
- * @brief Create a new libCEC instance.
- * @param strDeviceName The name of the primary device to pass to other CEC devices.
- * @param types The list of device types to register on the bus.
- * @param strLib The name of and/or path to libCEC
- * @return An instance of libCEC or NULL when it failed to load.
- */
-CEC::ICECAdapter *LibCecInit(const char *strDeviceName, CEC::cec_device_type_list types, const char *strLib = NULL)
-{
- if (!g_libCEC)
-#if defined(_WIN64)
- g_libCEC = LoadLibrary(strLib ? strLib : "libcec.x64.dll");
-#else
- g_libCEC = LoadLibrary(strLib ? strLib : "libcec.dll");
-#endif
- if (!g_libCEC)
- return NULL;
-
- typedef void* (__cdecl*_LibCecInit)(const char *, CEC::cec_device_type_list);
- _LibCecInit LibCecInit;
- LibCecInit = (_LibCecInit) (GetProcAddress(g_libCEC, "CECInit"));
- if (!LibCecInit)
- return NULL;
- return static_cast< CEC::ICECAdapter* > (LibCecInit(strDeviceName, types));
-}
-
/*!
* @brief Create a new libCEC instance.
* @param configuration The configuration to pass to libCEC
void *g_libCEC = NULL;
-/*!
- * @brief Create a new libCEC instance.
- * @param strDeviceName The name of the primary device to pass to other CEC devices.
- * @param types The list of device types to register on the bus.
- * @param strLib The name of and/or path to libCEC
- * @return An instance of libCEC or NULL when it failed to load.
- */
-CEC::ICECAdapter *LibCecInit(const char *strDeviceName, CEC::cec_device_type_list types, const char *strLib = NULL)
-{
- if (!g_libCEC)
- {
-#if defined(__APPLE__)
- g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY);
-#else
- g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY);
-#endif
- if (!g_libCEC)
- {
- cout << dlerror() << endl;
- return NULL;
- }
- }
-
- typedef void* _LibCecInit(const char *, CEC::cec_device_type_list);
- _LibCecInit* LibCecInit = (_LibCecInit*) dlsym(g_libCEC, "CECInit");
- if (!LibCecInit)
- {
- cout << "cannot find CECInit" << endl;
- return NULL;
- }
-
- return (CEC::ICECAdapter*) LibCecInit(strDeviceName, types);
-}
-
/*!
* @brief Create a new libCEC instance.
* @param configuration The configuration to pass to libCEC
int32_t transmit_timeout; /**< the timeout to use in ms */
#ifdef __cplusplus
- // @todo re-add in v2.0 (breaks ABI)
- //cec_command(void)
- //{
- // Clear();
- //}
+ cec_command(void)
+ {
+ Clear();
+ }
cec_command &operator =(const struct cec_command &command)
{
cec_device_type types[5]; /**< the list of device types */
#ifdef __cplusplus
- /*!
- * @deprecated Use Clear() instead.
- * @brief Clear this list.
- */
- void clear(void) { Clear(); }
- /*!
- * @deprecated Use Add() instead.
- * @brief Add a type to this list.
- * @param type The type to add.
- */
- void add(const cec_device_type type) { Add(type); }
-
/*!
* @brief Clear this list.
*/
CBCecSourceActivatedType CBCecSourceActivated;
#ifdef __cplusplus
- // @todo re-add in v2.0 (breaks ABI)
- // ICECCallbacks(void) { Clear(); }
- //~ICECCallbacks(void) { Clear(); };
+ ICECCallbacks(void) { Clear(); }
+ ~ICECCallbacks(void) { Clear(); };
void Clear(void)
{
cec_adapter_type adapterType; /*!< type of the CEC adapter that we're connected to. added in 1.8.2 */
#ifdef __cplusplus
- // @todo re-add in v2.0 (breaks ABI)
- // libcec_configuration(void) { Clear(); }
- //~libcec_configuration(void) { Clear(); }
+ libcec_configuration(void) { Clear(); }
+ ~libcec_configuration(void) { Clear(); }
bool operator==(const libcec_configuration &other) const
{
adapterType = ADAPTERTYPE_UNKNOWN;
memset(strDeviceName, 0, 13);
- deviceTypes.clear();
+ deviceTypes.Clear();
logicalAddresses.Clear();
wakeDevices.Clear();
powerOffDevices.Clear();
g_callbacks.CBCecCommand = &CecCommand;
g_config.callbacks = &g_callbacks;
- g_config.deviceTypes.add(type);
+ g_config.deviceTypes.Add(type);
g_parser = LibCecInitialise(&g_config);
if (!g_parser)
return m_processor ? m_processor->PingAdapter() : false;
}
-bool CCECClient::GetNextLogMessage(cec_log_message *message)
-{
- return (m_logBuffer.Pop(*message));
-}
-
-bool CCECClient::GetNextKeypress(cec_keypress *key)
-{
- return m_keyBuffer.Pop(*key);
-}
-
-bool CCECClient::GetNextCommand(cec_command *command)
-{
- return m_commandBuffer.Pop(*command);
-}
-
std::string CCECClient::GetConnectionInfo(void)
{
CStdString strLog;
void CCECClient::CallbackAddCommand(const cec_command &command)
{
- {
- CLockObject lock(m_cbMutex);
- if (m_configuration.callbacks && m_configuration.callbacks->CBCecCommand)
- {
- m_configuration.callbacks->CBCecCommand(m_configuration.callbackParam, command);
- return;
- }
- }
- m_commandBuffer.Push(command);
+ CLockObject lock(m_cbMutex);
+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecCommand)
+ m_configuration.callbacks->CBCecCommand(m_configuration.callbackParam, command);
}
void CCECClient::CallbackAddKey(const cec_keypress &key)
{
- {
- CLockObject lock(m_cbMutex);
- if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress)
- {
- m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key);
- return;
- }
- }
- m_keyBuffer.Push(key);
+ CLockObject lock(m_cbMutex);
+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress)
+ m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key);
}
void CCECClient::CallbackAddLog(const cec_log_message &message)
{
- {
- CLockObject lock(m_cbMutex);
- if (m_configuration.callbacks && m_configuration.callbacks->CBCecLogMessage)
- {
- m_configuration.callbacks->CBCecLogMessage(m_configuration.callbackParam, message);
- return;
- }
- }
- m_logBuffer.Push(message);
+ CLockObject lock(m_cbMutex);
+ if (m_configuration.callbacks && m_configuration.callbacks->CBCecLogMessage)
+ m_configuration.callbacks->CBCecLogMessage(m_configuration.callbackParam, message);
}
void CCECClient::CallbackConfigurationChanged(const libcec_configuration &config)
// client-specific part of ICECAdapter
virtual bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks);
virtual bool PingAdapter(void);
- virtual bool GetNextLogMessage(cec_log_message *message); /**< @deprecated will be removed in v2.0 */
- virtual bool GetNextKeypress(cec_keypress *key); /**< @deprecated will be removed in v2.0 */
- virtual bool GetNextCommand(cec_command *command); /**< @deprecated will be removed in v2.0 */
virtual bool Transmit(const cec_command &data, bool bIsReply);
virtual bool SetLogicalAddress(const cec_logical_address iLogicalAddress);
virtual bool SetPhysicalAddress(const uint16_t iPhysicalAddress);
virtual int CallbackMenuStateChanged(const cec_menu_state newState);
virtual void CallbackSourceActivated(bool bActivated, const cec_logical_address logicalAddress);
- CCECProcessor * m_processor; /**< a pointer to the processor */
- libcec_configuration m_configuration; /**< the configuration of this client */
- bool m_bInitialised; /**< true when initialised, false otherwise */
- bool m_bRegistered; /**< true when registered in the processor, false otherwise */
- PLATFORM::CMutex m_mutex; /**< mutex for changes to this instance */
- PLATFORM::CMutex m_cbMutex; /**< mutex that is held when doing anything with callbacks */
- cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */
- int64_t m_buttontime; /**< the timestamp when the button was pressed (in seconds since epoch), or 0 if none was pressed. */
- int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */
- PLATFORM::SyncedBuffer<cec_log_message> m_logBuffer; /**< @deprecated will be removed in v2.0. buffer for log messages */
- PLATFORM::SyncedBuffer<cec_keypress> m_keyBuffer; /**< @deprecated will be removed in v2.0. buffer for keypresses */
- PLATFORM::SyncedBuffer<cec_command> m_commandBuffer; /**< @deprecated will be removed in v2.0. buffer for commands */
+ CCECProcessor * m_processor; /**< a pointer to the processor */
+ libcec_configuration m_configuration; /**< the configuration of this client */
+ bool m_bInitialised; /**< true when initialised, false otherwise */
+ bool m_bRegistered; /**< true when registered in the processor, false otherwise */
+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this instance */
+ PLATFORM::CMutex m_cbMutex; /**< mutex that is held when doing anything with callbacks */
+ cec_user_control_code m_iCurrentButton; /**< the control code of the button that's currently held down (if any) */
+ int64_t m_buttontime; /**< the timestamp when the button was pressed (in seconds since epoch), or 0 if none was pressed. */
+ int64_t m_iPreventForwardingPowerOffCommand; /**< prevent forwarding standby commands until this time */
};
}
return addresses;
}
-bool CLibCEC::GetNextLogMessage(cec_log_message *message)
-{
- return m_client ? m_client->GetNextLogMessage(message) : false;
-}
-
-bool CLibCEC::GetNextKeypress(cec_keypress *key)
-{
- return m_client ? m_client->GetNextKeypress(key) : false;
-}
-
-bool CLibCEC::GetNextCommand(cec_command *command)
-{
- return m_client ? m_client->GetNextCommand(command) : false;
-}
-
cec_device_type CLibCEC::GetType(cec_logical_address address)
{
return CCECTypeUtils::GetType(address);
(*it)->Alert(type, param);
}
-bool CLibCEC::SetActiveView(void)
-{
- AddLog(CEC_LOG_WARNING, "deprecated method %s called", __FUNCTION__);
- return SetActiveSource();
-}
-
-bool CLibCEC::EnablePhysicalAddressDetection(void)
-{
- AddLog(CEC_LOG_WARNING, "deprecated method %s called", __FUNCTION__);
- return true;
-}
-
CCECClient *CLibCEC::RegisterClient(libcec_configuration &configuration)
{
if (!m_cec)
return CECInitialise(&configuration);
}
-void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress /* = CEC::CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */)
-{
- libcec_configuration configuration; configuration.Clear();
-
- // client version < 1.5.0
- snprintf(configuration.strDeviceName, 13, "%s", strDeviceName);
- configuration.iPhysicalAddress = iPhysicalAddress;
- configuration.deviceTypes.Add(CCECTypeUtils::GetType(iLogicalAddress));
-
- return CECInitialise(&configuration);
-}
-
bool CECStartBootloader(void)
{
bool bReturn(false);
{
return CCECTypeUtils::ToString(type);
}
-
-// no longer being used
-void CLibCEC::AddKey(const cec_keypress &UNUSED(key)) {}
-void CLibCEC::ConfigurationChanged(const libcec_configuration &UNUSED(config)) {}
-void CLibCEC::SetCurrentButton(cec_user_control_code UNUSED(iButtonCode)) {}
-CLibCEC *CLibCEC::GetInstance(void) { return NULL; }
-void CLibCEC::SetInstance(CLibCEC *UNUSED(instance)) {}
bool PingAdapter(void);
bool StartBootloader(void);
- int8_t GetMinLibVersion(void) const { return CEC_MIN_LIB_VERSION; };
- int8_t GetLibVersionMajor(void) const { return CEC_LIB_VERSION_MAJOR; };
- int8_t GetLibVersionMinor(void) const { return CEC_LIB_VERSION_MINOR; };
-
- bool GetNextLogMessage(cec_log_message *message);
- bool GetNextKeypress(cec_keypress *key);
- bool GetNextCommand(cec_command *command);
-
bool Transmit(const cec_command &data);
bool SetLogicalAddress(cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1);
bool SetPhysicalAddress(uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
bool PowerOnDevices(cec_logical_address address = CECDEVICE_TV);
bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST);
- bool SetActiveView(void);
bool SetActiveSource(cec_device_type type = CEC_DEVICE_TYPE_RESERVED);
bool SetDeckControlMode(cec_deck_control_mode mode, bool bSendUpdate = true);
bool SetDeckInfo(cec_deck_info info, bool bSendUpdate = true);
bool SendKeypress(cec_logical_address iDestination, cec_user_control_code key, bool bWait = true);
bool SendKeyRelease(cec_logical_address iDestination, bool bWait = true);
cec_osd_name GetDeviceOSDName(cec_logical_address iAddress);
- bool EnablePhysicalAddressDetection(void);
cec_logical_address GetActiveSource(void);
bool IsActiveSource(cec_logical_address iAddress);
bool SetStreamPath(cec_logical_address iAddress);
//@}
void AddLog(const cec_log_level level, const char *strFormat, ...);
- static void AddKey(void) {} //UNUSED
- static void AddKey(const cec_keypress &key); //UNUSED
void AddCommand(const cec_command &command);
- static void ConfigurationChanged(const libcec_configuration &config); //UNUSED
- static void SetCurrentButton(cec_user_control_code iButtonCode); //UNUSED
void CheckKeypressTimeout(void);
void Alert(const libcec_alert type, const libcec_parameter ¶m);
- static CLibCEC *GetInstance(void); //UNUSED
- static void SetInstance(CLibCEC *instance); //UNUSED
static bool IsValidPhysicalAddress(uint16_t iPhysicalAddress);
CCECClient *RegisterClient(libcec_configuration &configuration);
CCECProcessor * m_cec;
protected:
- int64_t m_iStartTime;
- cec_user_control_code m_iCurrentButton; //UNUSED
- int64_t m_buttontime; //UNUSED
- PLATFORM::SyncedBuffer<cec_log_message> m_logBuffer; //UNUSED
- PLATFORM::SyncedBuffer<cec_keypress> m_keyBuffer; //UNUSED
- PLATFORM::SyncedBuffer<cec_command> m_commandBuffer; //UNUSED
- ICECCallbacks * m_callbacks; //UNUSED
- void * m_cbParam; //UNUSED
- PLATFORM::CMutex m_mutex;
- PLATFORM::CMutex m_logMutex; //UNUSED
-
+ int64_t m_iStartTime;
+ PLATFORM::CMutex m_mutex;
CCECClient * m_client;
std::vector<CCECClient *> m_clients;
};
return (cec_parser != NULL) ? 1 : 0;
}
-int cec_init_typed(const char *strDeviceName, cec_device_type_list deviceTypes)
-{
- cec_parser = (ICECAdapter *) CECInit(strDeviceName, deviceTypes);
- return (cec_parser != NULL) ? 1 : 0;
-}
-
void cec_destroy(void)
{
cec_close();
return -1;
}
-int8_t cec_get_min_lib_version(void)
-{
- if (cec_parser)
- return cec_parser->GetMinLibVersion();
- return -1;
-}
-
-int8_t cec_get_lib_version_major(void)
-{
- if (cec_parser)
- return cec_parser->GetLibVersionMajor();
- return -1;
-}
-
-int8_t cec_get_lib_version_minor(void)
-{
- if (cec_parser)
- return cec_parser->GetLibVersionMinor();
- return -1;
-}
-
-int cec_get_next_log_message(cec_log_message *message)
-{
- if (cec_parser)
- return cec_parser->GetNextLogMessage(message) ? 1 : 0;
- return -1;
-}
-
-int cec_get_next_keypress(cec_keypress *key)
-{
- if (cec_parser)
- return cec_parser->GetNextKeypress(key) ? 1 : 0;
- return -1;
-}
-
-int cec_get_next_command(cec_command *command)
-{
- if (cec_parser)
- return cec_parser->GetNextCommand(command) ? 1 : 0;
- return -1;
-}
-
int cec_transmit(const CEC::cec_command *data)
{
if (cec_parser)
return -1;
}
-int cec_set_active_view(void)
-{
- if (cec_parser)
- return cec_parser->SetActiveView() ? 1 : 0;
- return -1;
-}
-
int cec_set_active_source(cec_device_type type)
{
if (cec_parser)
return retVal;
}
-int cec_enable_physical_address_detection(void)
-{
- return cec_parser ? (cec_parser->EnablePhysicalAddressDetection() ? 1 : 0) : -1;
-}
-
int cec_set_stream_path_logical(CEC::cec_logical_address iAddress)
{
return cec_parser ? (cec_parser->SetStreamPath(iAddress) ? 1 : 0) : -1;
{
if (!g_bSingleCommand)
cout << "== using device type 'playback device'" << endl;
- g_config.deviceTypes.add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
+ g_config.deviceTypes.Add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
}
else if (!strcmp(argv[iArgPtr + 1], "r"))
{
if (!g_bSingleCommand)
cout << "== using device type 'recording device'" << endl;
- g_config.deviceTypes.add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
+ g_config.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
}
else if (!strcmp(argv[iArgPtr + 1], "t"))
{
if (!g_bSingleCommand)
cout << "== using device type 'tuner'" << endl;
- g_config.deviceTypes.add(CEC_DEVICE_TYPE_TUNER);
+ g_config.deviceTypes.Add(CEC_DEVICE_TYPE_TUNER);
}
else if (!strcmp(argv[iArgPtr + 1], "a"))
{
if (!g_bSingleCommand)
cout << "== using device type 'audio system'" << endl;
- g_config.deviceTypes.add(CEC_DEVICE_TYPE_AUDIO_SYSTEM);
+ g_config.deviceTypes.Add(CEC_DEVICE_TYPE_AUDIO_SYSTEM);
}
else
{
{
if (!g_bSingleCommand)
cout << "No device type given. Using 'recording device'" << endl;
- g_config.deviceTypes.add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
+ g_config.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
}
ICECAdapter *parser = LibCecInitialise(&g_config);