alarm/libcec-imx6 to 3.1.0-1

This commit is contained in:
moonman 2016-02-10 21:51:21 -07:00
parent 26360d16e6
commit 4840b86a83
3 changed files with 74 additions and 86 deletions

View file

@ -1,7 +1,6 @@
diff --git a/include/cectypes.h b/include/cectypes.h
index 0a90d0e..88b10f7 100644
--- a/include/cectypes.h
+++ b/include/cectypes.h
diff -ruN a/include/cectypes.h b/include/cectypes.h
--- a/include/cectypes.h 2016-01-19 17:52:02.000000000 -0700
+++ b/include/cectypes.h 2016-02-10 20:45:49.278919009 -0700
@@ -299,6 +299,16 @@
#define CEC_TDA995x_VIRTUAL_COM "CuBox"
@ -19,7 +18,7 @@ index 0a90d0e..88b10f7 100644
* the path to use for the Exynos HDMI CEC device
*/
#define CEC_EXYNOS_PATH "/dev/CEC"
@@ -876,7 +886,8 @@
@@ -877,7 +887,8 @@
ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
ADAPTERTYPE_RPI = 0x100,
ADAPTERTYPE_TDA995x = 0x200,
@ -29,11 +28,10 @@ index 0a90d0e..88b10f7 100644
} cec_adapter_type;
/** force exporting through swig */
diff --git a/src/libcec/CECTypeUtils.h b/src/libcec/CECTypeUtils.h
index 64f5c21..800c4f0 100644
--- a/src/libcec/CECTypeUtils.h
+++ b/src/libcec/CECTypeUtils.h
@@ -765,6 +765,8 @@ namespace CEC
diff -ruN a/src/libcec/CECTypeUtils.h b/src/libcec/CECTypeUtils.h
--- a/src/libcec/CECTypeUtils.h 2016-01-19 17:52:02.000000000 -0700
+++ b/src/libcec/CECTypeUtils.h 2016-02-10 20:45:49.278919009 -0700
@@ -766,6 +766,8 @@
return "Raspberry Pi";
case ADAPTERTYPE_TDA995x:
return "TDA995x";
@ -42,10 +40,9 @@ index 64f5c21..800c4f0 100644
default:
return "unknown";
}
diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp
index d585154..34159b2 100644
--- a/src/libcec/adapter/AdapterFactory.cpp
+++ b/src/libcec/adapter/AdapterFactory.cpp
diff -ruN a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp
--- a/src/libcec/adapter/AdapterFactory.cpp 2016-01-19 17:52:02.000000000 -0700
+++ b/src/libcec/adapter/AdapterFactory.cpp 2016-02-10 20:45:49.283918932 -0700
@@ -53,6 +53,11 @@
#include "TDA995x/TDA995xCECAdapterCommunication.h"
#endif
@ -58,7 +55,7 @@ index d585154..34159b2 100644
#if defined(HAVE_EXYNOS_API)
#include "Exynos/ExynosCECAdapterDetection.h"
#include "Exynos/ExynosCECAdapterCommunication.h"
@@ -114,6 +119,19 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
@@ -114,6 +119,19 @@
}
#endif
@ -78,7 +75,7 @@ index d585154..34159b2 100644
#if defined(HAVE_EXYNOS_API)
if (iAdaptersFound < iBufSize && CExynosCECAdapterDetection::FindAdapter())
{
@@ -127,7 +145,7 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
@@ -127,7 +145,7 @@
#endif
@ -87,7 +84,7 @@ index d585154..34159b2 100644
#error "libCEC doesn't have support for any type of adapter. please check your build system or configuration"
#endif
@@ -151,11 +169,17 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
@@ -151,11 +169,17 @@
return new CRPiCECAdapterCommunication(m_lib->m_cec);
#endif
@ -106,11 +103,9 @@ index d585154..34159b2 100644
return NULL;
#endif
}
diff --git a/src/libcec/adapter/IMX/AdapterMessageQueue.h b/src/libcec/adapter/IMX/AdapterMessageQueue.h
new file mode 100644
index 0000000..c8bcf71
--- /dev/null
+++ b/src/libcec/adapter/IMX/AdapterMessageQueue.h
diff -ruN a/src/libcec/adapter/IMX/AdapterMessageQueue.h b/src/libcec/adapter/IMX/AdapterMessageQueue.h
--- a/src/libcec/adapter/IMX/AdapterMessageQueue.h 1969-12-31 17:00:00.000000000 -0700
+++ b/src/libcec/adapter/IMX/AdapterMessageQueue.h 2016-02-10 20:45:49.283918932 -0700
@@ -0,0 +1,135 @@
+#pragma once
+/*
@ -146,11 +141,11 @@ index 0000000..c8bcf71
+ */
+
+#include "env.h"
+#include "platform/threads/mutex.h"
+#include "p8-platform/threads/mutex.h"
+
+namespace CEC
+{
+ using namespace PLATFORM;
+ using namespace P8PLATFORM;
+
+ class CAdapterMessageQueueEntry
+ {
@ -239,19 +234,17 @@ index 0000000..c8bcf71
+
+ private:
+ bool m_bWaiting; /**< true while a thread is waiting or when it hasn't started waiting yet */
+ PLATFORM::CCondition<bool> m_condition; /**< the condition to wait on */
+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this class */
+ P8PLATFORM::CCondition<bool> m_condition; /**< the condition to wait on */
+ P8PLATFORM::CMutex m_mutex; /**< mutex for changes to this class */
+ uint32_t m_hash;
+ uint32_t m_retval;
+ bool m_bSucceeded;
+ };
+
+};
diff --git a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp
new file mode 100644
index 0000000..1f70989
--- /dev/null
+++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp
diff -ruN a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp
--- a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp 1969-12-31 17:00:00.000000000 -0700
+++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.cpp 2016-02-10 20:45:49.283918932 -0700
@@ -0,0 +1,326 @@
+/*
+ * This file is part of the libCEC(R) library.
@ -285,7 +278,7 @@ index 0000000..1f70989
+#if defined(HAVE_IMX6_API)
+#include "IMXCECAdapterCommunication.h"
+
+#include "platform/sockets/cdevsocket.h"
+#include "p8-platform/sockets/cdevsocket.h"
+#include "CECTypeUtils.h"
+#include "LibCEC.h"
+
@ -315,7 +308,7 @@ index 0000000..1f70989
+
+using namespace std;
+using namespace CEC;
+using namespace PLATFORM;
+using namespace P8PLATFORM;
+
+#include "AdapterMessageQueue.h"
+
@ -579,11 +572,9 @@ index 0000000..1f70989
+}
+
+#endif // HAVE_IMX6_API
diff --git a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h
new file mode 100644
index 0000000..ce5c4cb
--- /dev/null
+++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h
diff -ruN a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h
--- a/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h 1969-12-31 17:00:00.000000000 -0700
+++ b/src/libcec/adapter/IMX/IMXCECAdapterCommunication.h 2016-02-10 20:45:49.283918932 -0700
@@ -0,0 +1,119 @@
+#pragma once
+/*
@ -615,9 +606,9 @@ index 0000000..ce5c4cb
+
+#if defined(HAVE_IMX6_API)
+
+#include "platform/threads/mutex.h"
+#include "platform/threads/threads.h"
+#include "platform/sockets/socket.h"
+#include "p8-platform/threads/mutex.h"
+#include "p8-platform/threads/threads.h"
+#include "p8-platform/sockets/socket.h"
+#include "adapter/AdapterCommunication.h"
+#include <map>
+
@ -626,7 +617,7 @@ index 0000000..ce5c4cb
+
+
+
+namespace PLATFORM
+namespace P8PLATFORM
+{
+ class CCDevSocket;
+};
@ -636,7 +627,7 @@ index 0000000..ce5c4cb
+{
+ class CAdapterMessageQueueEntry;
+
+ class CIMXCECAdapterCommunication : public IAdapterCommunication, public PLATFORM::CThread
+ class CIMXCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread
+ {
+ public:
+ /*!
@ -677,7 +668,7 @@ index 0000000..ce5c4cb
+ bool RegisterLogicalAddress(const cec_logical_address address);
+ ///}
+
+ /** @name PLATFORM::CThread implementation */
+ /** @name P8PLATFORM::CThread implementation */
+ ///{
+ void *Process(void);
+ ///}
@ -691,12 +682,12 @@ index 0000000..ce5c4cb
+ //cec_logical_addresses m_logicalAddresses;
+ cec_logical_address m_logicalAddress;
+
+ PLATFORM::CMutex m_mutex;
+ PLATFORM::CCDevSocket *m_dev; /**< the device connection */
+ P8PLATFORM::CMutex m_mutex;
+ P8PLATFORM::CCDevSocket *m_dev; /**< the device connection */
+ bool m_bLogicalAddressRegistered;
+ bool m_bInitialised;
+
+ PLATFORM::CMutex m_messageMutex;
+ P8PLATFORM::CMutex m_messageMutex;
+ uint32_t m_iNextMessage;
+ std::map<uint32_t, CAdapterMessageQueueEntry *> m_messages;
+ };
@ -704,11 +695,9 @@ index 0000000..ce5c4cb
+};
+
+#endif
diff --git a/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp
new file mode 100644
index 0000000..6c93c45
--- /dev/null
+++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp
diff -ruN a/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp
--- a/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp 1969-12-31 17:00:00.000000000 -0700
+++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.cpp 2016-02-10 20:45:49.283918932 -0700
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libCEC(R) library.
@ -752,11 +741,9 @@ index 0000000..6c93c45
+}
+
+#endif
diff --git a/src/libcec/adapter/IMX/IMXCECAdapterDetection.h b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h
new file mode 100644
index 0000000..d54891d
--- /dev/null
+++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h
diff -ruN a/src/libcec/adapter/IMX/IMXCECAdapterDetection.h b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h
--- a/src/libcec/adapter/IMX/IMXCECAdapterDetection.h 1969-12-31 17:00:00.000000000 -0700
+++ b/src/libcec/adapter/IMX/IMXCECAdapterDetection.h 2016-02-10 20:45:49.283918932 -0700
@@ -0,0 +1,36 @@
+#pragma once
+/*

View file

@ -1,6 +1,7 @@
--- a/src/libcec/CMakeLists.txt 2015-05-21 16:05:34.321349131 +0200
+++ b/src/libcec/CMakeLists.txt 2015-05-21 16:16:48.186086036 +0200
@@ -96,6 +96,9 @@
diff -ruN a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt
--- a/src/libcec/CMakeLists.txt 2016-01-19 17:52:02.000000000 -0700
+++ b/src/libcec/CMakeLists.txt 2016-02-10 20:42:52.894739494 -0700
@@ -100,6 +100,9 @@
adapter/RPi/RPiCECAdapterMessageQueue.h
adapter/RPi/RPiCECAdapterCommunication.h
adapter/RPi/RPiCECAdapterDetection.h
@ -10,17 +11,18 @@
CECInputBuffer.h
platform/util/baudrate.h
platform/util/edid.h
--- a/src/libcec/cmake/CheckPlatformSupport.cmake 2015-05-21 16:09:28.778514006 +0200
+++ b/src/libcec/cmake/CheckPlatformSupport.cmake 2015-05-21 16:19:42.733309082 +0200
@@ -10,6 +10,7 @@
# HAVE_RPI_API 1 if Raspberry Pi is supported
# HAVE_TDA995X_API 1 if TDA995X is supported
# HAVE_EXYNOS_API 1 if Exynos is supported
+# HAVE_IMX6_API 1 if iMX.6 is supported
diff -ruN a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake
--- a/src/libcec/cmake/CheckPlatformSupport.cmake 2016-01-19 17:52:02.000000000 -0700
+++ b/src/libcec/cmake/CheckPlatformSupport.cmake 2016-02-10 20:43:38.414527995 -0700
@@ -9,6 +9,7 @@
# HAVE_RPI_API 1 if Raspberry Pi is supported
# HAVE_TDA995X_API 1 if TDA995X is supported
# HAVE_EXYNOS_API 1 if Exynos is supported
+# HAVE_IMX6_API 1 if iMX.6 is supported
# HAVE_P8_USB 1 if Pulse-Eight devices are supported
# HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected
#
@@ -108,6 +109,18 @@
# HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported
@@ -132,6 +133,18 @@
else()
set(HAVE_EXYNOS_API 0)
endif()
@ -39,10 +41,11 @@
endif()
# rt
--- a/src/libcec/cmake/DisplayPlatformSupport.cmake 2015-05-21 16:27:55.323461384 +0200
+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake 2015-05-21 16:27:55.343471443 +0200
diff -ruN a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake
--- a/src/libcec/cmake/DisplayPlatformSupport.cmake 2016-01-19 17:52:02.000000000 -0700
+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake 2016-02-10 20:42:52.899739541 -0700
@@ -44,6 +44,12 @@
message(STATUS "Exynos support: no")
message(STATUS "DRM support: no")
endif()
+if (HAVE_IMX6_API)
@ -54,9 +57,10 @@
if (HAVE_PYTHON)
message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})")
else()
--- a/src/libcec/env.h.in 2015-05-28 08:24:20.283040169 +0200
+++ b/src/libcec/env.h.in 2015-05-28 08:24:20.287040168 +0200
@@ -63,6 +63,9 @@
diff -ruN a/src/libcec/env.h.in b/src/libcec/env.h.in
--- a/src/libcec/env.h.in 2016-01-19 17:52:02.000000000 -0700
+++ b/src/libcec/env.h.in 2016-02-10 20:42:52.899739541 -0700
@@ -69,6 +69,9 @@
/* Define to 1 for TDA995x support */
#cmakedefine HAVE_TDA995X_API @HAVE_TDA995X_API@
@ -64,5 +68,5 @@
+#cmakedefine HAVE_IMX6_API @HAVE_IMX6_API@
+
/* Define to 1 for Exynos support */
#cmakedefine HAVE_TDA995X_API @HAVE_TDA995X_API@
#cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@

View file

@ -11,8 +11,8 @@ buildarch=4
pkgname=libcec-imx6
_pkgname=libcec
pkgver=3.0.1
pkgrel=4
pkgver=3.1.0
pkgrel=1
pkgdesc="Pulse-Eight's libcec for the Pulse-Eight USB-CEC adapter (IMX6)"
arch=('armv7h')
url="http://libcec.pulse-eight.com/"
@ -23,20 +23,17 @@ provides=('libcec')
conflicts=('libcec')
source=("$_pkgname-$pkgver.tar.gz::https://github.com/Pulse-Eight/$_pkgname/archive/$_pkgname-$pkgver.tar.gz"
'0001-add-imx-support-1.patch'
'0002-add-imx-support-2.patch'
'https://github.com/Pulse-Eight/libcec/commit/2f32a9debc1f148b5dfcfc463480f1432bb71725.patch')
'0002-add-imx-support-2.patch')
sha256sums=('7e3670c8949a1964d6e5481f56dfff838857da10bdc60b506f6e9b7f117e253e'
'1105f457f49c4caa0791de11a321dde11df086c06017c6a4a23c8a17502f01ef'
'5faf57652d8c0c83ca37fecc961c50b268f0f2b4092da31c56cc6874040593d9'
'83ca3b742831aa2e05297d11e238a0b0d1035a6404f60a6610acc8381d1c17ea')
sha256sums=('09109d21a1b03f42c9e341d12600f2e4c41038d640269fa75408e2d36126f921'
'21d061ddeebd29bd1478e8fd2add19221964dbc0211bfd4df4538adab968c426'
'202312c72171a8198eac3e328cc17473d0fd40b51eff99162b004139b188a1d4')
prepare() {
cd "$_pkgname-$_pkgname-$pkgver"
patch -Np1 -i ../0001-add-imx-support-1.patch
patch -Np1 -i ../0002-add-imx-support-2.patch
patch -Np1 -i ../2f32a9debc1f148b5dfcfc463480f1432bb71725.patch
}
build() {