X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=blobdiff_plain;f=src%2Flib%2Fadapter%2FAdapterFactory.cpp;fp=src%2Flib%2Fadapter%2FAdapterFactory.cpp;h=d585154212245e87332eed7bc7e63a861a2a07a4;hp=42cdd0beacb7b088cd3a8935c09d9ad38d536121;hb=b45bdacdeee5c96e0294717fbe2c47a49a110fd1;hpb=81e38211724bc6e8bd7a60f484433053ed682635 diff --git a/src/lib/adapter/AdapterFactory.cpp b/src/lib/adapter/AdapterFactory.cpp index 42cdd0b..d585154 100644 --- a/src/lib/adapter/AdapterFactory.cpp +++ b/src/lib/adapter/AdapterFactory.cpp @@ -52,6 +52,11 @@ #include "TDA995x/TDA995xCECAdapterCommunication.h" #endif +#if defined(HAVE_EXYNOS_API) +#include "Exynos/ExynosCECAdapterDetection.h" +#include "Exynos/ExynosCECAdapterCommunication.h" +#endif + using namespace std; using namespace CEC; @@ -109,6 +114,19 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 } #endif +#if defined(HAVE_EXYNOS_API) + if (iAdaptersFound < iBufSize && CExynosCECAdapterDetection::FindAdapter()) + { + snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_EXYNOS_PATH); + snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_EXYNOS_VIRTUAL_COM); + deviceList[iAdaptersFound].iVendorId = 0; + deviceList[iAdaptersFound].iProductId = 0; + deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_EXYNOS; + iAdaptersFound++; + } +#endif + + #if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" #endif @@ -123,6 +141,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ return new CTDA995xCECAdapterCommunication(m_lib->m_cec); #endif +#if defined(HAVE_EXYNOS_API) + if (!strcmp(strPort, CEC_EXYNOS_VIRTUAL_COM)) + return new CExynosCECAdapterCommunication(m_lib->m_cec); +#endif + #if defined(HAVE_RPI_API) if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM)) return new CRPiCECAdapterCommunication(m_lib->m_cec); @@ -132,7 +155,7 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate); #endif -#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) +#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) return NULL; #endif }