From: Lars Op den Kamp Date: Wed, 8 Feb 2012 23:07:48 +0000 (+0100) Subject: cec: removed deprecated CECCreate() method X-Git-Tag: upstream/2.2.0~1^2~35^2~134 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a4b8e3f0b62e289ad5e0e6bf58949bbdeed1c623;p=deb_libcec.git cec: removed deprecated CECCreate() method --- diff --git a/include/cec.h b/include/cec.h index a916389..8780857 100644 --- a/include/cec.h +++ b/include/cec.h @@ -390,16 +390,6 @@ namespace CEC */ extern "C" DECLSPEC void * CECInit(const char *strDeviceName, CEC::cec_device_type_list devicesTypes); -/*! - * @deprecated Please use CECInit() instead - * @brief Load the CEC adapter library. - * @param strDeviceName How to present this device to other devices. - * @param iLogicalAddress The logical of this device. PLAYBACKDEVICE1 by default. - * @param iPhysicalAddress The physical address of this device. 0x1000 by default. - * @return An instance of ICECAdapter or NULL on error. - */ -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 c19f1a7..a720e7f 100644 --- a/include/cecc.h +++ b/include/cecc.h @@ -40,19 +40,12 @@ extern "C" { #endif -#ifdef __cplusplus -extern DECLSPEC int cec_init(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress); -#else -extern DECLSPEC int cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress); -#endif - #ifdef __cplusplus extern DECLSPEC int cec_init_typed(const char *strDeviceName, CEC::cec_device_type_list devicesTypes); #else extern DECLSPEC int cec_init_typed(const char *strDeviceName, cec_device_type_list devicesTypes); #endif - extern DECLSPEC void cec_destroy(void); extern DECLSPEC int cec_open(const char *strPort, uint32_t iTimeout); diff --git a/include/cecloader.h b/include/cecloader.h index 3e48b26..33a2e3f 100644 --- a/include/cecloader.h +++ b/include/cecloader.h @@ -40,28 +40,6 @@ HINSTANCE g_libCEC = NULL; -/*! - * @deprecated Please use LibCecInit() instead - */ -CEC::ICECAdapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS, 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*_CreateLibCec)(const char *, uint8_t, uint16_t); - _CreateLibCec CreateLibCec; - CreateLibCec = (_CreateLibCec) (GetProcAddress(g_libCEC, "CECCreate")); - if (!CreateLibCec) - return NULL; - return static_cast< CEC::ICECAdapter* > (CreateLibCec(strName, (uint8_t) iLogicalAddress, iPhysicalAddress)); -} - /*! * @brief Create a new libCEC instance. * @param strDeviceName The name of the primary device to pass to other CEC devices. diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 06f8477..1ecbd86 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -47,25 +47,6 @@ using namespace CEC; using namespace std; using namespace PLATFORM; -CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) : - m_bInitialised(false), - m_iHDMIPort(CEC_DEFAULT_HDMI_PORT), - m_iBaseDevice((cec_logical_address)CEC_DEFAULT_BASE_DEVICE), - m_strDeviceName(strDeviceName), - m_communication(NULL), - m_controller(controller), - m_bMonitor(false), - m_iStandardLineTimeout(3), - m_iRetryLineTimeout(3), - m_iLastTransmission(0) -{ - m_logicalAddresses.Clear(); - m_logicalAddresses.Set(iLogicalAddress); - m_types.clear(); - for (int iPtr = 0; iPtr <= 16; iPtr++) - m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0); -} - CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types) : m_bInitialised(false), m_iHDMIPort(CEC_DEFAULT_HDMI_PORT), diff --git a/src/lib/CECProcessor.h b/src/lib/CECProcessor.h index 24c02bb..53d9f6b 100644 --- a/src/lib/CECProcessor.h +++ b/src/lib/CECProcessor.h @@ -46,7 +46,6 @@ namespace CEC class CCECProcessor : public PLATFORM::CThread, public IAdapterCommunicationCallback { public: - CCECProcessor(CLibCEC *controller, const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types); virtual ~CCECProcessor(void); diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index 30a3221..e0cb4ea 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -52,16 +52,6 @@ CLibCEC::CLibCEC(const char *strDeviceName, cec_device_type_list types) : m_cec = new CCECProcessor(this, strDeviceName, types); } -CLibCEC::CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) : - m_iStartTime(GetTimeMs()), - m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), - m_buttontime(0), - m_callbacks(NULL), - m_cbParam(NULL) -{ - m_cec = new CCECProcessor(this, strDeviceName, iLogicalAddress, iPhysicalAddress); -} - CLibCEC::~CLibCEC(void) { Close(); @@ -467,13 +457,6 @@ void CLibCEC::SetInstance(CLibCEC *instance) g_libCEC_instance = instance; } -void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress /*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS */) -{ - CLibCEC *lib = new CLibCEC(strDeviceName, iLogicalAddress, iPhysicalAddress); - CLibCEC::SetInstance(lib); - return static_cast< void* > (lib); -} - void * CECInit(const char *strDeviceName, CEC::cec_device_type_list types) { CLibCEC *lib = new CLibCEC(strDeviceName, types); diff --git a/src/lib/LibCEC.h b/src/lib/LibCEC.h index ad2eca9..78881d9 100644 --- a/src/lib/LibCEC.h +++ b/src/lib/LibCEC.h @@ -48,7 +48,6 @@ namespace CEC */ //@{ CLibCEC(const char *strDeviceName, cec_device_type_list types); - CLibCEC(const char *strDeviceName, cec_logical_address iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS); virtual ~CLibCEC(void); virtual bool Open(const char *strPort, uint32_t iTimeout = 10000); diff --git a/src/lib/LibCECC.cpp b/src/lib/LibCECC.cpp index 1a7b045..2b5357c 100644 --- a/src/lib/LibCECC.cpp +++ b/src/lib/LibCECC.cpp @@ -42,12 +42,6 @@ using namespace std; //@{ ICECAdapter *cec_parser; -int cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress) -{ - cec_parser = (ICECAdapter *) CECCreate(strDeviceName, iLogicalAddress, iPhysicalAddress); - return (cec_parser != NULL) ? 1 : 0; -} - int cec_init_typed(const char *strDeviceName, cec_device_type_list devicesTypes) { cec_parser = (ICECAdapter *) CECInit(strDeviceName, devicesTypes);