From 2d4e263cf51412a7c7195e80290b972ad567e0ed Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 28 Sep 2012 18:06:03 +0200 Subject: [PATCH] removed deprecated methods and fields --- include/cec.h | 141 ++++------------------------------ include/cecc.h | 34 -------- include/cecloader.h | 60 --------------- include/cectypes.h | 33 +++----- src/cec-config/cec-config.cpp | 2 +- src/lib/CECClient.cpp | 51 +++--------- src/lib/CECClient.h | 24 +++--- src/lib/LibCEC.cpp | 46 ----------- src/lib/LibCEC.h | 29 +------ src/lib/LibCECC.cpp | 60 --------------- src/testclient/main.cpp | 10 +-- 11 files changed, 48 insertions(+), 442 deletions(-) diff --git a/include/cec.h b/include/cec.h index e92ebab..e7ee890 100644 --- a/include/cec.h +++ b/include/cec.h @@ -60,18 +60,6 @@ namespace CEC */ 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. @@ -94,48 +82,6 @@ namespace CEC 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. @@ -157,25 +103,6 @@ namespace CEC */ 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. @@ -197,11 +124,6 @@ namespace CEC */ 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. @@ -277,17 +199,6 @@ namespace CEC */ 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. @@ -391,19 +302,6 @@ namespace CEC */ 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. @@ -449,9 +347,6 @@ namespace CEC */ 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. @@ -460,13 +355,6 @@ namespace CEC */ 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. @@ -481,15 +369,12 @@ namespace CEC * @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 @@ -501,23 +386,23 @@ namespace CEC */ 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. */ diff --git a/include/cecc.h b/include/cecc.h index 60b54bd..5241e73 100644 --- a/include/cecc.h +++ b/include/cecc.h @@ -46,12 +46,6 @@ extern DECLSPEC int cec_initialise(CEC::libcec_configuration *configuration); 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); @@ -74,12 +68,6 @@ extern DECLSPEC int cec_ping_adapters(void); 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 @@ -92,8 +80,6 @@ extern DECLSPEC int cec_standby_devices(CEC::cec_logical_address address); 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 @@ -120,24 +106,6 @@ extern DECLSPEC int cec_set_menu_state(CEC::cec_menu_state state, int bSendUpdat 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 @@ -256,8 +224,6 @@ extern DECLSPEC CEC::cec_osd_name cec_get_device_osd_name(CEC::cec_logical_addre 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 diff --git a/include/cecloader.h b/include/cecloader.h index 7a7dce6..de138cc 100644 --- a/include/cecloader.h +++ b/include/cecloader.h @@ -40,32 +40,6 @@ 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 @@ -145,40 +119,6 @@ bool LibCecBootloader(const char *strLib = NULL) 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 diff --git a/include/cectypes.h b/include/cectypes.h index f50c8db..621e19f 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -770,11 +770,10 @@ typedef struct cec_command 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) { @@ -896,18 +895,6 @@ typedef struct cec_device_type_list 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. */ @@ -1162,9 +1149,8 @@ typedef struct ICECCallbacks 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) { @@ -1256,9 +1242,8 @@ struct libcec_configuration 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 { @@ -1329,7 +1314,7 @@ struct libcec_configuration adapterType = ADAPTERTYPE_UNKNOWN; memset(strDeviceName, 0, 13); - deviceTypes.clear(); + deviceTypes.Clear(); logicalAddresses.Clear(); wakeDevices.Clear(); powerOffDevices.Clear(); diff --git a/src/cec-config/cec-config.cpp b/src/cec-config/cec-config.cpp index 29bdf59..36bdb21 100644 --- a/src/cec-config/cec-config.cpp +++ b/src/cec-config/cec-config.cpp @@ -166,7 +166,7 @@ bool OpenConnection(cec_device_type type = CEC_DEVICE_TYPE_RECORDING_DEVICE) 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) diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index fea8ed7..9dc9bff 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -1065,21 +1065,6 @@ bool CCECClient::PingAdapter(void) 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; @@ -1430,41 +1415,23 @@ void CCECClient::SourceDeactivated(const cec_logical_address logicalAddress) 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) diff --git a/src/lib/CECClient.h b/src/lib/CECClient.h index f19e818..e757464 100644 --- a/src/lib/CECClient.h +++ b/src/lib/CECClient.h @@ -127,9 +127,6 @@ namespace CEC // 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); @@ -301,17 +298,14 @@ namespace CEC 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 m_logBuffer; /**< @deprecated will be removed in v2.0. buffer for log messages */ - PLATFORM::SyncedBuffer m_keyBuffer; /**< @deprecated will be removed in v2.0. buffer for keypresses */ - PLATFORM::SyncedBuffer 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 */ }; } diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index 252e1dc..1c6cf9d 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -342,21 +342,6 @@ cec_logical_addresses CLibCEC::GetLogicalAddresses(void) 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); @@ -484,18 +469,6 @@ void CLibCEC::Alert(const libcec_alert type, const libcec_parameter ¶m) (*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) @@ -566,18 +539,6 @@ void * CECInit(const char *strDeviceName, CEC::cec_device_type_list types) 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); @@ -653,10 +614,3 @@ const char *CLibCEC::ToString(const cec_adapter_type type) { 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)) {} diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index fa4e632..8ce02ab 100644 --- a/src/lib/LibCEC.h +++ b/src/lib/LibCEC.h @@ -59,21 +59,12 @@ namespace CEC 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); @@ -97,7 +88,6 @@ namespace CEC 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); @@ -132,15 +122,9 @@ namespace CEC //@} 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); @@ -154,17 +138,8 @@ namespace CEC CCECProcessor * m_cec; protected: - int64_t m_iStartTime; - cec_user_control_code m_iCurrentButton; //UNUSED - int64_t m_buttontime; //UNUSED - PLATFORM::SyncedBuffer m_logBuffer; //UNUSED - PLATFORM::SyncedBuffer m_keyBuffer; //UNUSED - PLATFORM::SyncedBuffer 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 m_clients; }; diff --git a/src/lib/LibCECC.cpp b/src/lib/LibCECC.cpp index 2576da0..9f501cc 100644 --- a/src/lib/LibCECC.cpp +++ b/src/lib/LibCECC.cpp @@ -49,12 +49,6 @@ int cec_initialise(libcec_configuration *configuration) 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(); @@ -103,48 +97,6 @@ int cec_start_bootloader(void) 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) @@ -180,13 +132,6 @@ int cec_standby_devices(cec_logical_address address /* = CECDEVICE_BROADCAST */) 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) @@ -367,11 +312,6 @@ cec_osd_name cec_get_device_osd_name(cec_logical_address iAddress) 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; diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index f1687ba..8150b8e 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -988,25 +988,25 @@ bool ProcessCommandLineArguments(int argc, char *argv[]) { 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 { @@ -1165,7 +1165,7 @@ int main (int argc, char *argv[]) { 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); -- 2.34.1