diff options
Diffstat (limited to 'package')
21 files changed, 140 insertions, 1800 deletions
diff --git a/package/ffmpeg/Makefile b/package/ffmpeg/Makefile index 2a85119ae..b0fc60920 100644 --- a/package/ffmpeg/Makefile +++ b/package/ffmpeg/Makefile @@ -4,9 +4,9 @@ include ${ADK_TOPDIR}/rules.mk PKG_NAME:= ffmpeg -PKG_VERSION:= 2.6.2 +PKG_VERSION:= 2.6.3 PKG_RELEASE:= 1 -PKG_HASH:= 889e3aa069b724dc95cbfc79ef83322a8a39d9f6225f39fad1b47294fc1f29ba +PKG_HASH:= 59eb98c1b5896ac29abc0385f7c875d1b4942d695818818d418ee71eea1e0cfb PKG_DESCR:= record, convert and stream audio & video PKG_SECTION:= libs/video PKG_FDEPENDS:= libpthread diff --git a/package/imx-gpu-viv/Makefile b/package/imx-gpu-viv/Makefile index df9ba77a4..bed3e116a 100644 --- a/package/imx-gpu-viv/Makefile +++ b/package/imx-gpu-viv/Makefile @@ -27,8 +27,12 @@ imx-gpu-viv-install: $(INSTALL_DIR) $(IDIR_IMX_GPU_VIV)/usr/lib $(CP) $(WRKBUILD)/gpu-core/usr/lib/lib*.so* \ $(IDIR_IMX_GPU_VIV)/usr/lib + $(CP) $(WRKBUILD)/g2d/usr/lib/lib*.so* \ + $(IDIR_IMX_GPU_VIV)/usr/lib $(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/include $(CP) $(WRKBUILD)/gpu-core/usr/include/* \ $(STAGING_TARGET_DIR)/usr/include + $(CP) $(WRKBUILD)/g2d/usr/include/* \ + $(STAGING_TARGET_DIR)/usr/include include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/kodi/Makefile b/package/kodi/Makefile index 330fd453e..3bf0a031e 100644 --- a/package/kodi/Makefile +++ b/package/kodi/Makefile @@ -4,11 +4,11 @@ include $(ADK_TOPDIR)/rules.mk PKG_NAME:= kodi -PKG_VERSION:= 7cc53a9a3da77869d1d5d3d3d9971b4bd1641b50 -PKG_RELEASE:= 2 +PKG_VERSION:= ff25ea118e3580bb1ebcbb7c450ed933da1782be +PKG_RELEASE:= 1 PKG_DESCR:= software media player PKG_SECTION:= mm/video -PKG_DEPENDS:= boost python2 libstdcxx glibc-gconv +PKG_DEPENDS:= boost python2 libstdcxx glibc-gconv libsquish PKG_DEPENDS+= libass libmpeg2 libmad libdbus libglew mesalib PKG_DEPENDS+= libjpeg-turbo libogg libvorbis libmodplug libcurl PKG_DEPENDS+= libflac libbz2 libtiff liblzo libopenssl libnettle @@ -25,12 +25,12 @@ PKG_BUILDDEP+= libsamplerate taglib libjasper lame libmicrohttpd PKG_BUILDDEP+= eudev alsa-lib glib glu libmodplug libgtk2 PKG_BUILDDEP+= libgpg-error dbus libxslt libvorbis PKG_BUILDDEP+= swig-host sdl-host sdl-image-host liblzo-host -PKG_BUILDDEP+= zip-host unzip-host +PKG_BUILDDEP+= zip-host unzip-host libsquish PKG_URL:= http://kodi.tv/ PKG_SITES:= https://github.com/xbmc/xbmc.git PKG_FLAVOURS_KODI:= WITH_SMB WITH_NFS WITH_SSH WITH_AVAHI WITH_CEC -PKG_FLAVOURS_KODI+= WITH_AFP WITH_WEBSERVER WITH_RTMP WITH_BLURAY +PKG_FLAVOURS_KODI+= WITH_WEBSERVER WITH_RTMP WITH_BLURAY WITH_LIRC PKGFD_WITH_SMB:= enable samba support PKGFB_WITH_SMB:= samba @@ -47,15 +47,15 @@ PKGFS_WITH_AVAHI:= libavahi PKGFD_WITH_CEC:= enable cec support PKGFB_WITH_CEC:= libcec PKGFS_WITH_CEC:= libcec -PKGFD_WITH_AFP:= enable afp support -PKGFB_WITH_AFP:= afpfs-ng -PKGFS_WITH_AFP:= libafpclient PKGFD_WITH_RTMP:= enable rtmp support PKGFB_WITH_RTMP:= rtmpdump PKGFS_WITH_RTMP:= librtmp PKGFD_WITH_BLURAY:= enable bluray support PKGFB_WITH_BLURAY:= libbluray PKGFS_WITH_BLURAY:= libbluray +PKGFD_WITH_LIRC:= enable lirc support +PKGFB_WITH_LIRC:= lirc +PKGFS_WITH_LIRC:= lirc PKGFD_WITH_WEBSERVER:= enable internal webserver support # libiconv missing, freescale GL libraries linked against glibc @@ -124,11 +124,6 @@ CONFIGURE_ARGS+= --enable-libbluray else CONFIGURE_ARGS+= --disable-libbluray endif -ifneq ($(ADK_PACKAGE_KODI_WITH_AFP),) -CONFIGURE_ARGS+= --enable-afpclient -else -CONFIGURE_ARGS+= --disable-afpclient -endif ifneq ($(ADK_PACKAGE_KODI_WITH_SMB),) CONFIGURE_ARGS+= --enable-samba else @@ -154,6 +149,11 @@ CONFIGURE_ARGS+= --enable-rtmp else CONFIGURE_ARGS+= --disable-rtmp endif +ifneq ($(ADK_PACKAGE_KODI_WITH_LIRC),) +CONFIGURE_ARGS+= --enable-lirc +else +CONFIGURE_ARGS+= --disable-lirc +endif ifneq ($(ADK_PACKAGE_KODI_WITH_AVAHI),) CONFIGURE_ARGS+= --enable-avahi else @@ -169,33 +169,30 @@ ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y) CONFIGURE_ARGS+= --with-platform=raspberry-pi \ --enable-player=omxplayer \ --enable-gles \ - --disable-sdl \ --disable-x11 endif ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y) CONFIGURE_ARGS+= --with-platform=raspberry-pi \ --enable-player=omxplayer \ --enable-gles \ - --disable-sdl \ --disable-x11 endif ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y) CONFIGURE_ARGS+= --disable-x11 \ - --disable-sdl \ --enable-gles \ --enable-codec=imxvpu endif pre-configure: (cd $(WRKBUILD)/lib/cpluff && env PATH='$(AUTOTOOL_PATH)' ./autogen.sh) - -pre-build: - $(SED) "s#@@STAGING_HOST_DIR@@#$(STAGING_HOST_DIR)#" \ - $(WRKBUILD)/tools/TexturePacker/Makefile.in PATH='$(HOST_PATH)' \ make CXX="${HOST_CXX}" CC="${HOST_CC}" CFLAGS="${HOST_CFLAGS}" \ CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \ -C $(WRKBUILD)/tools/depends/native/JsonSchemaBuilder + PATH='$(HOST_PATH)' \ + make CXX="${HOST_CXX}" CC="${HOST_CC}" CFLAGS="${HOST_CFLAGS}" \ + CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \ + -C $(WRKBUILD)/tools/depends/native/TexturePacker kodi-install: $(INSTALL_DIR) $(IDIR_KODI)/usr/lib/kodi/addons diff --git a/package/kodi/patches/patch-configure_in b/package/kodi/patches/patch-configure_in deleted file mode 100644 index dfd4a32ae..000000000 --- a/package/kodi/patches/patch-configure_in +++ /dev/null @@ -1,50 +0,0 @@ ---- xbmc-14.0-Helix.orig/configure.in 2014-12-22 17:11:35.000000000 -0600 -+++ xbmc-14.0-Helix/configure.in 2014-12-28 02:47:04.799045092 -0600 -@@ -55,13 +55,6 @@ AC_DEFUN([XB_ADD_CODEC], - # check for library basenames - AC_DEFUN([XB_FIND_SONAME], - [ -- if echo "$host" | grep -q freebsd ; then -- AC_MSG_CHECKING([for lib$2 soname]) -- $1_SONAME=[`ldconfig -r | sed -n "s;.* \(/.*lib$2\.so.*\)$;\1;p" | head -n 1`] -- if test x$$1_SONAME != x ; then -- $1_SONAME=[`basename $$1_SONAME`] -- fi -- elif [[ "$host_vendor" != "apple" ]]; then - AC_MSG_CHECKING([for lib$2 soname]) - $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS $4 -l$2 -Wl,-M 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}') - if [[ -z $$1_FILENAME ]]; then -@@ -71,24 +64,6 @@ AC_DEFUN([XB_FIND_SONAME], - if [[ ! -z $$1_FILENAME ]]; then - $1_SONAME=$($OBJDUMP -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}') - fi -- else -- AC_MSG_CHECKING([for lib$2 dylib]) -- gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] -- env_lib_path=[`echo $LDFLAGS | sed 's/-L[ ]*//g'`] -- if test "$cross_compiling" = yes; then -- host_lib_path="" -- else -- host_lib_path="/usr/lib /usr/local/lib" -- fi -- for path in $gcc_lib_path $env_lib_path $host_lib_path; do -- lib=[`ls -- $path/lib$2.dylib 2>/dev/null`] -- if test x$lib != x; then -- # we want the path/name that is embedded in the dylib -- $1_FILENAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`] -- $1_SONAME=[`basename $$1_FILENAME`] -- fi -- done -- fi - if [[ -z "$$1_SONAME" ]]; then - AC_MSG_RESULT([no]) - if test -z "$3" || test "x${$3}" = "xyes"; then -@@ -1015,7 +990,7 @@ if test "$use_gles" = "yes"; then - AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."]) - AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."]) - AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.) -- LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util" -+ LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lkhrn_static -lpthread -lm" - else - AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) - AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) diff --git a/package/kodi/patches/patch-tools_Linux_kodi_sh_in b/package/kodi/patches/patch-tools_Linux_kodi_sh_in deleted file mode 100644 index 2d0e188d1..000000000 --- a/package/kodi/patches/patch-tools_Linux_kodi_sh_in +++ /dev/null @@ -1,39 +0,0 @@ ---- kodi-14.0rc2.orig/tools/Linux/kodi.sh.in 2014-12-05 19:38:43.000000000 -0600 -+++ kodi-14.0rc2/tools/Linux/kodi.sh.in 2014-12-07 08:33:01.128418001 -0600 -@@ -86,15 +86,7 @@ print_crash_report() - echo -n " Kernel: " >> $FILE - uname -rvs >> $FILE - echo -n " Release: " >> $FILE -- if [ -f /etc/os-release ]; then -- . /etc/os-release -- echo $NAME $VERSION >> $FILE -- elif command_exists lsb_release; then -- echo >> $FILE -- lsb_release -a 2> /dev/null | sed -e 's/^/ /' >> $FILE -- else -- echo "lsb_release not available" >> $FILE -- fi -+ echo OpenADK >> $FILE - echo "############## END SYSTEM INFO ##############" >> $FILE - echo >> $FILE - echo "############### STACK TRACE #################" >> $FILE -@@ -138,19 +130,6 @@ print_crash_report() - } - - migrate_home --python @datadir@/${bin_name}/FEH.py $SAVED_ARGS --RET=$? --if [ $RET -ne 0 ]; then -- exit $RET --fi -- --if command_exists gdb; then -- # Output warning in case ulimit is unsupported by shell -- eval ulimit -c unlimited -- if [ ! $? = "0" ]; then -- echo "${bin_name}: ulimit is unsupported by this shell" 1>&2 -- fi --fi - - LOOP=1 - while [ $(( $LOOP )) = "1" ] diff --git a/package/kodi/patches/patch-tools_TexturePacker_Makefile_in b/package/kodi/patches/patch-tools_TexturePacker_Makefile_in deleted file mode 100644 index 0fe1e0875..000000000 --- a/package/kodi/patches/patch-tools_TexturePacker_Makefile_in +++ /dev/null @@ -1,13 +0,0 @@ ---- xbmc-14.0-Helix.orig/tools/TexturePacker/Makefile.in 2014-12-22 17:11:35.000000000 -0600 -+++ xbmc-14.0-Helix/tools/TexturePacker/Makefile.in 2014-12-27 13:48:57.427472564 -0600 -@@ -33,5 +33,10 @@ $(TARGET): $(SRCS) @abs_top_srcdir@/xbmc - # TexturePacker run native on build system, build it with native tools - make -C @abs_top_srcdir@/lib/libsquish/ libsquish-native.so - $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $(DEFINES) $(NATIVE_ARCH) $(SRCS) $(LDFLAGS_FOR_BUILD) -o $(TARGET) -+ifeq ($(findstring Darwin,$(shell uname -s)),Darwin) -+ install_name_tool -change /usr/lib/libSDL_image-1.2.0.dylib \ -+ /home/wbx/myapp/host_x86_64-linux-gnu/usr/lib/libSDL_image-1.2.0.dylib \ -+ $(TARGET) -+endif - - include @abs_top_srcdir@/Makefile.include diff --git a/package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp b/package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp deleted file mode 100644 index 4f24390f7..000000000 --- a/package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp +++ /dev/null @@ -1,13 +0,0 @@ ---- xbmc-14.0-Helix.orig/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp 2014-12-22 17:11:35.000000000 -0600 -+++ xbmc-14.0-Helix/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp 2014-12-25 13:38:23.629060371 -0600 -@@ -538,8 +538,8 @@ void CDVDDemuxFFmpeg::Reset() - void CDVDDemuxFFmpeg::Flush() - { - // naughty usage of an internal ffmpeg function -- if (m_pFormatContext) -- av_read_frame_flush(m_pFormatContext); -+ //if (m_pFormatContext) -+ // av_read_frame_flush(m_pFormatContext); - - m_currentPts = DVD_NOPTS_VALUE; - diff --git a/package/libcec/Makefile b/package/libcec/Makefile index 917aca375..dcbba4d8d 100644 --- a/package/libcec/Makefile +++ b/package/libcec/Makefile @@ -4,15 +4,14 @@ include $(ADK_TOPDIR)/rules.mk PKG_NAME:= libcec -PKG_VERSION:= 2.2.0 -PKG_RELEASE:= 2 -PKG_HASH:= da8a0c5acf2f9134e38d7993c08d960b7da2a9ea6b6b557a9d788361884b8396 +PKG_VERSION:= 185559110dc88aeca0915a90b3b369d2d42c0f7c +PKG_RELEASE:= 1 PKG_DESCR:= control your device with your tv remote control PKG_SECTION:= libs/video -PKG_DEPENDS:= libudev -PKG_BUILDDEP:= eudev +PKG_DEPENDS:= libudev libplatform +PKG_BUILDDEP:= eudev cmake-host platform PKG_URL:= http://libcec.pulse-eight.com/ -PKG_SITES:= http://openadk.org/distfiles/ +PKG_SITES:= https://github.com/Pulse-Eight/libcec.git PKG_OPTS:= dev PKG_DEPENDS_RASPBERRY_PI:= bcm28xx-vc @@ -25,19 +24,13 @@ include $(ADK_TOPDIR)/mk/package.mk $(eval $(call PKG_template,LIBCEC,libcec,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -AUTOTOOL_STYLE:= autoreconf -ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y) -CONFIGURE_ARGS+= --enable-imx6 -endif -ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y) -CONFIGURE_ARGS+= --enable-rpi \ - --with-rpi-include-path=$(STAGING_TARGET_DIR)/opt/vc/include \ - --with-rpi-lib-path=$(STAGING_TARGET_DIR)/opt/vc/lib -endif -ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y) -CONFIGURE_ARGS+= --enable-rpi \ - --with-rpi-include-path=$(STAGING_TARGET_DIR)/opt/vc/include \ - --with-rpi-lib-path=$(STAGING_TARGET_DIR)/opt/vc/lib +WRKBUILD= $(WRKDIR)/$(PKG_NAME)-obj +TARGET_LDFLAGS+= -ltinfo + +CONFIG_STYLE:= cmake +CMAKE_FLAGS+= -DSKIP_PYTHON_WRAPPER=1 -DBUILD_SHARED_LIBS=1 +ifeq ($(ADK_TARGET_BOARD_BCM28XX),y) +CMAKE_FLAGS+= -DHAVE_RPI_API=1 endif libcec-install: diff --git a/package/libcec/patches/libcec-imx6-support.patch b/package/libcec/patches/libcec-imx6-support.patch deleted file mode 100644 index 8519abb85..000000000 --- a/package/libcec/patches/libcec-imx6-support.patch +++ /dev/null @@ -1,831 +0,0 @@ -diff -Naur libcec-2.2.0/configure.ac libcec-2.2.0.patch/configure.ac ---- libcec-2.2.0/configure.ac 2014-11-01 01:51:37.000000000 +0100 -+++ libcec-2.2.0.patch/configure.ac 2014-11-10 23:14:45.210162950 +0100 -@@ -100,6 +100,14 @@ - esac - fi - -+## i.MX6 support -+AC_ARG_ENABLE([imx6], -+ [AS_HELP_STRING([--enable-imx6], -+ [enable support for freescale i.MX6 (default is no)])], -+ [use_imx6=$enableval], -+ [use_imx6=no]) -+ -+ - ## add the top dir and include to the include path, so we can include config.h and cec.h - CPPFLAGS="$CPPFLAGS -I\$(abs_top_srcdir)/src -I\$(abs_top_srcdir)/include" - -@@ -306,6 +314,17 @@ - fi - - -+## mark i.MX6 support as available -+if test "x$use_imx6" != "xno"; then -+ AC_DEFINE([HAVE_IMX_API],[1],[Define to 1 to include i.MX6 support]) -+ AM_CONDITIONAL(USE_IMX_API, true) -+ features="$features\n i.MX6 support :\t\t\tyes" -+ LIB_INFO="$LIB_INFO 'i.MX6'" -+else -+ AM_CONDITIONAL(USE_IMX_API, false) -+ features="$features\n i.MX6 support :\t\t\tno" -+fi -+ - ## check if our build system is complete - AC_CHECK_HEADER(algorithm,,AC_MSG_ERROR($msg_required_header_missing)) - AC_CHECK_HEADER(ctype.h,,AC_MSG_ERROR($msg_required_header_missing)) -diff -Naur libcec-2.2.0/include/cectypes.h libcec-2.2.0.patch/include/cectypes.h ---- libcec-2.2.0/include/cectypes.h 2014-10-28 16:20:50.000000000 +0100 -+++ libcec-2.2.0.patch/include/cectypes.h 2014-11-10 23:21:37.347945493 +0100 -@@ -307,6 +307,17 @@ - #define CEC_EXYNOS_VIRTUAL_COM "Exynos" - - /*! -+ * the path to use for the i.MX CEC wire -+ */ -+#define CEC_IMX_PATH "/dev/mxc_hdmi_cec" -+ -+/*! -+ * the name of the virtual COM port to use for the i.MX CEC wire -+ */ -+#define CEC_IMX_VIRTUAL_COM "i.MX" -+ -+ -+/*! - * Mimimum client version - */ - #define CEC_MIN_LIB_VERSION 2 -@@ -888,7 +899,8 @@ - ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2, - ADAPTERTYPE_RPI = 0x100, - ADAPTERTYPE_TDA995x = 0x200, -- ADAPTERTYPE_EXYNOS = 0x300 -+ ADAPTERTYPE_EXYNOS = 0x300, -+ ADAPTERTYPE_IMX = 0x400 - } cec_adapter_type; - - typedef struct cec_menu_language -diff -Naur libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp libcec-2.2.0.patch/src/lib/adapter/AdapterFactory.cpp ---- libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp 2014-10-28 16:20:50.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/AdapterFactory.cpp 2014-11-10 23:18:08.761485552 +0100 -@@ -57,6 +57,11 @@ - #include "Exynos/ExynosCECAdapterCommunication.h" - #endif - -+#if defined(HAVE_IMX_API) -+#include "IMX/IMXCECAdapterDetection.h" -+#include "IMX/IMXCECAdapterCommunication.h" -+#endif -+ - using namespace std; - using namespace CEC; - -@@ -127,7 +132,22 @@ - #endif - - --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) -+ -+#if defined(HAVE_IMX_API) -+ if (iAdaptersFound < iBufSize && CIMXCECAdapterDetection::FindAdapter() && -+ (!strDevicePath || !strcmp(strDevicePath, CEC_IMX_VIRTUAL_COM))) -+ { -+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_IMX_PATH); -+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_IMX_VIRTUAL_COM); -+ deviceList[iAdaptersFound].iVendorId = IMX_ADAPTER_VID; -+ deviceList[iAdaptersFound].iProductId = IMX_ADAPTER_PID; -+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_IMX; -+ iAdaptersFound++; -+ } -+#endif -+ -+ -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_IMX_API) - #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" - #endif - -@@ -151,11 +171,16 @@ - return new CRPiCECAdapterCommunication(m_lib->m_cec); - #endif - -+#if defined(HAVE_IMX_API) -+ if (!strcmp(strPort, CEC_IMX_VIRTUAL_COM)) -+ return new CIMXCECAdapterCommunication(m_lib->m_cec); -+#endif -+ - #if defined(HAVE_P8_USB) - return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate); - #endif - --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_IMX_API) - return NULL; - #endif - } -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h libcec-2.2.0.patch/src/lib/adapter/IMX/AdapterMessageQueue.h ---- libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/AdapterMessageQueue.h 2014-11-10 23:14:45.214162390 +0100 -@@ -0,0 +1,134 @@ -+#pragma once -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * This program is dual-licensed; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ * Alternatively, you can license this library under a commercial license, -+ * please contact Pulse-Eight Licensing for more information. -+ * -+ * For more information contact: -+ * Pulse-Eight Licensing <license@pulse-eight.com> -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "lib/platform/threads/mutex.h" -+ -+namespace CEC -+{ -+ using namespace PLATFORM; -+ -+ class CAdapterMessageQueueEntry -+ { -+ public: -+ CAdapterMessageQueueEntry(const cec_command &command) -+ : m_bWaiting(true), m_retval((uint32_t)-1), m_bSucceeded(false) -+ { -+ m_hash = hashValue( -+ uint32_t(command.opcode_set ? command.opcode : CEC_OPCODE_NONE), -+ command.initiator, command.destination); -+ } -+ -+ virtual ~CAdapterMessageQueueEntry(void) {} -+ -+ /*! -+ * @brief Query result from worker thread -+ */ -+ uint32_t Result() const -+ { -+ return m_retval; -+ } -+ -+ /*! -+ * @brief Signal waiting threads -+ */ -+ void Broadcast(void) -+ { -+ CLockObject lock(m_mutex); -+ m_condition.Broadcast(); -+ } -+ -+ /*! -+ * @brief Signal waiting thread(s) when message matches this entry -+ */ -+ bool CheckMatch(uint32_t opcode, cec_logical_address initiator, -+ cec_logical_address destination, uint32_t response) -+ { -+ uint32_t hash = hashValue(opcode, initiator, destination); -+ -+ if (hash == m_hash) -+ { -+ CLockObject lock(m_mutex); -+ -+ m_retval = response; -+ m_bSucceeded = true; -+ m_condition.Signal(); -+ return true; -+ } -+ -+ return false; -+ } -+ -+ /*! -+ * @brief Wait for a response to this command. -+ * @param iTimeout The timeout to use while waiting. -+ * @return True when a response was received before the timeout passed, false otherwise. -+ */ -+ bool Wait(uint32_t iTimeout) -+ { -+ CLockObject lock(m_mutex); -+ -+ bool bReturn = m_bSucceeded ? true : m_condition.Wait(m_mutex, m_bSucceeded, iTimeout); -+ m_bWaiting = false; -+ return bReturn; -+ } -+ -+ /*! -+ * @return True while a thread is waiting for a signal or isn't waiting yet, false otherwise. -+ */ -+ bool IsWaiting(void) -+ { -+ CLockObject lock(m_mutex); -+ return m_bWaiting; -+ } -+ -+ /*! -+ * @return Hash value for given cec_command -+ */ -+ static uint32_t hashValue(uint32_t opcode, -+ cec_logical_address initiator, -+ cec_logical_address destination) -+ { -+ return 1 | ((uint32_t)initiator << 8) | -+ ((uint32_t)destination << 16) | ((uint32_t)opcode << 16); -+ } -+ -+ 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 */ -+ uint32_t m_hash; -+ uint32_t m_retval; -+ bool m_bSucceeded; -+ }; -+ -+}; -diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp ---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 1970-01-01 01:00:00.000000000 +0100 -+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 2014-11-10 23:14:45.217161982 +0100 -@@ -0,0 +1,328 @@ -+/* -+ * This file is part of the libCEC(R) library. -+ * -+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. -+ * libCEC(R) is an original work, containing original code. -+ * -+ * libCEC(R) is a trademark of Pulse-Eight Limited. -+ * -+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin -+ * -+ * You can redistribute this file and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * -+ */ -+ -+#include "env.h" -+ -+#if defined(HAVE_IMX_API) -+#include "IMXCECAdapterCommunication.h" -+ -+#include "lib/CECTypeUtils.h" -+#include "lib/LibCEC.h" -+#include "lib/platform/sockets/cdevsocket.h" -+#include "lib/platform/util/StdString.h" -+#include "lib/platform/util/buffer.h" -+ -+/* -+ * Ioctl definitions from kernel header -+ */ -+#define HDMICEC_IOC_MAGIC 'H' -+#define HDMICEC_IOC_SETLOGICALADDRESS _IOW(HDMICEC_IOC_MAGIC, 1, unsigned char) -+#define HDMICEC_IOC_STARTDEVICE _IO(HDMICEC_IOC_MAGIC, 2) -+#define HDMICEC_IOC_STOPDEVICE _IO(HDMICEC_IOC_MAGIC, 3) -+#define HDMICEC_IOC_GETPHYADDRESS _IOR(HDMICEC_IOC_MAGIC, 4, unsigned char[4]) -+ -+#define MAX_CEC_MESSAGE_LEN 17 -+ -+#define MESSAGE_TYPE_RECEIVE_SUCCESS 1 -+#define MESSAGE_TYPE_NOACK 2 -+#define MESSAGE_TYPE_DISCONNECTED 3 -+#define MESSAGE_TYPE_CONNECTED 4 -+#define MESSAGE_TYPE_SEND_SUCCESS 5 -+ -+typedef struct hdmi_cec_event{ -+ int event_type; -+ int msg_len; -+ unsigned char msg[MAX_CEC_MESSAGE_LEN]; -+}hdmi_cec_event; -+ -+ -+using namespace std; -+using namespace CEC; -+using namespace PLATFORM; -+ -+#include "AdapterMessageQueue.h" -+ -+#define LIB_CEC m_callback->GetLib() -+ -+// these are defined in nxp private header file -+#define CEC_MSG_SUCCESS 0x00 /*Message transmisson Succeed*/ -+#define CEC_CSP_OFF_STATE 0x80 /*CSP in Off State*/ -+#define CEC_BAD_REQ_SERVICE 0x81 /*Bad .req service*/ -+#define CEC_MSG_FAIL_UNABLE_TO_ACCESS 0x82 /*Message transmisson failed: Unable to access CEC line*/ -+#define CEC_MSG_FAIL_ARBITRATION_ERROR 0x83 /*Message transmisson failed: Arbitration error*/ -+#define CEC_MSG_FAIL_BIT_TIMMING_ERROR 0x84 /*Message transmisson failed: Bit timming error*/ -+#define CEC_MSG_FAIL_DEST_NOT_ACK 0x85 /*Message transmisson failed: Destination Address not aknowledged*/ -+#define CEC_MSG_FAIL_DATA_NOT_ACK 0x86 /*Message transmisson failed: Databyte not acknowledged*/ -+ -+ -+CIMXCECAdapterCommunication::CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback) : -+ IAdapterCommunication(callback)/*, -+ m_bLogicalAddressChanged(false)*/ -+{ -+ CLockObject lock(m_mutex); -+ -+ m_iNextMessage = 0; -+ //m_logicalAddresses.Clear(); -+ m_logicalAddress = CECDEVICE_UNKNOWN; -+ m_bLogicalAddressRegistered = false; -+ m_bInitialised = false; -+ m_dev = new CCDevSocket(CEC_IMX_PATH); -+} -+ -+CIMXCECAdapterCommunication::~CIMXCECAdapterCommunication(void) -+{ -+ Close(); -+ -+ CLockObject lock(m_mutex); -+ delete m_dev; -+ m_dev = 0; -+} -+ -+bool CIMXCECAdapterCommunication::IsOpen(void) -+{ -+ return IsInitialised() && m_dev->IsOpen(); -+} -+ -+bool CIMXCECAdapterCommunication::Open(uint32_t iTimeoutMs, bool UNUSED(bSkipChecks), bool bStartListening) -+{ -+ if (m_dev->Open(iTimeoutMs)) -+ { -+ if (!bStartListening || CreateThread()) { -+ if (m_dev->Ioctl(HDMICEC_IOC_STARTDEVICE, NULL) == 0) { -+ m_bInitialised = true; -+ return true; -+ } -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to start device\n", __func__); -+ } -+ m_dev->Close(); -+ } -+ -+ return false; -+} -+ -+ -+void CIMXCECAdapterCommunication::Close(void) -+{ -+ StopThread(0); -+ -+ CLockObject lock(m_mutex); -+ if (!m_bInitialised) { -+ return; -+ } -+ if (m_dev->Ioctl(HDMICEC_IOC_STOPDEVICE, NULL) != 0) { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to stop device\n", __func__); -+ } -+ m_dev->Close(); -+ m_bInitialised = false; -+} -+ -+ -+std::string CIMXCECAdapterCommunication::GetError(void) const -+{ -+ std::string strError(m_strError); -+ return strError; -+} -+ -+ -+cec_adapter_message_state CIMXCECAdapterCommunication::Write( -+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply)) -+{ -+ //cec_frame frame; -+ unsigned char message[MAX_CEC_MESSAGE_LEN]; -+ int msg_len = 1; -+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR; -+ -+ if ((size_t)data.parameters.size + data.opcode_set + 1 > sizeof(message)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__); -+ return ADAPTER_MESSAGE_STATE_ERROR; -+ } -+ -+ message[0] = (data.initiator << 4) | (data.destination & 0x0f); -+ if (data.opcode_set) -+ { -+ message[1] = data.opcode; -+ msg_len++; -+ memcpy(&message[2], data.parameters.data, data.parameters.size); -+ msg_len+=data.parameters.size; -+ } -+ -+ if (m_dev->Write(message, msg_len) == msg_len) -+ { -+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED; -+ } -+ else -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: sent command error !", __func__); -+ -+ return rc; -+} -+ -+ -+uint16_t CIMXCECAdapterCommunication::GetFirmwareVersion(void) -+{ -+ /* FIXME add ioctl ? */ -+ return 0; -+} -+ -+ -+cec_vendor_id CIMXCECAdapterCommunication::GetVendorId(void) -+{ -+ return CEC_VENDOR_UNKNOWN; -+} -+ -+ -+uint16_t CIMXCECAdapterCommunication::GetPhysicalAddress(void) -+{ -+ uint32_t info; -+ uint16_t phy_addr; -+ -+ if (m_dev->Ioctl(HDMICEC_IOC_GETPHYADDRESS, &info) != 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_GETPHYADDRESS failed !", __func__); -+ return CEC_INVALID_PHYSICAL_ADDRESS; -+ } -+ /* Rebuild 16 bit raw value from fsl 32 bits value */ -+ phy_addr = ((info & 0x0f) << 12) | (info & 0x0f00) | -+ ((info & 0x0f0000) >> 12) | ((info & 0x0f000000) >> 24); -+ -+ return phy_addr; -+} -+ -+ -+cec_logical_addresses CIMXCECAdapterCommunication::GetLogicalAddresses(void) -+{ -+ cec_logical_addresses addresses; -+ addresses.Clear(); -+ -+ CLockObject lock(m_mutex); -+ if ((m_logicalAddress & (CECDEVICE_UNKNOWN | CECDEVICE_UNREGISTERED)) == 0) -+ addresses.Set(m_logicalAddress); -+ -+ return addresses; -+} -+ -+void CIMXCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress)) -+{ -+ UnregisterLogicalAddress(); -+} -+ -+bool CIMXCECAdapterCommunication::UnregisterLogicalAddress(void) -+{ -+ CLockObject lock(m_mutex); -+ if (!m_bLogicalAddressRegistered) -+ return true; -+ -+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, (void *)CECDEVICE_BROADCAST) != 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__); -+ return false; -+ } -+ -+ m_logicalAddress = CECDEVICE_UNKNOWN; -+ m_bLogicalAddressRegistered = false; -+ return true; -+} -+ -+bool CIMXCECAdapterCommunication::RegisterLogicalAddress(const cec_logical_address address) -+{ -+ CLockObject lock(m_mutex); -+ -+ if (m_logicalAddress == address && m_bLogicalAddressRegistered) -+ { -+ return true; -+ } -+ -+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, (void *)address) != 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__); -+ return false; -+ } -+ -+ m_logicalAddress = address; -+ m_bLogicalAddressRegistered = true; -+ return true; -+} -+ -+bool CIMXCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses) -+{ -+ int log_addr = addresses.primary; -+ |