From cd92be0cd1b2104a33ed9d0dc2d615682d2488d4 Mon Sep 17 00:00:00 2001 From: Alex Deryskyba Date: Fri, 12 Dec 2014 02:06:20 +0100 Subject: [PATCH] Add support for libamcodec - interface library for Amlogic hardware media codecs --- packages/mediacenter/kodi/package.mk | 2 + packages/multimedia/libamcodec/package.mk | 50 +++++++++++++++++++++++ tools/mkpkg/mkpkg_libamcodec | 43 +++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 packages/multimedia/libamcodec/package.mk create mode 100755 tools/mkpkg/mkpkg_libamcodec diff --git a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk index 519194c1ce..8a01689cee 100644 --- a/packages/mediacenter/kodi/package.mk +++ b/packages/mediacenter/kodi/package.mk @@ -269,6 +269,8 @@ if [ ! "$KODIPLAYER_DRIVER" = default ]; then KODI_CXXFLAGS="$KODI_CXXFLAGS $BCM2835_INCLUDES" elif [ "$KODIPLAYER_DRIVER" = libfslvpuwrap ]; then KODI_CODEC="--enable-codec=imxvpu" + elif [ "$KODIPLAYER_DRIVER" = libamcodec ]; then + KODI_CODEC="--enable-codec=amcodec" else KODI_OPENMAX="--disable-openmax" fi diff --git a/packages/multimedia/libamcodec/package.mk b/packages/multimedia/libamcodec/package.mk new file mode 100644 index 0000000000..813b201ac0 --- /dev/null +++ b/packages/multimedia/libamcodec/package.mk @@ -0,0 +1,50 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv) +# +# OpenELEC is free software: 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. +# +# OpenELEC 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 OpenELEC. If not, see . +################################################################################ + +PKG_NAME="libamcodec" +PKG_VERSION="75f23da" +PKG_REV="1" +PKG_ARCH="arm" +PKG_LICENSE="other" +PKG_SITE="http://openlinux.amlogic.com" +PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_DEPENDS_TARGET="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="multimedia" +PKG_SHORTDESC="libamcodec: Interface library for Amlogic media codecs" +PKG_LONGDESC="libamplayer: Interface library for Amlogic media codecs" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +make_target() { + make -C amavutils CC="$CC" PREFIX="$SYSROOT_PREFIX/usr" + mkdir -p $SYSROOT_PREFIX/usr/lib + cp -PR amavutils/*.so $SYSROOT_PREFIX/usr/lib + + make -C amadec CC="$CC" PREFIX="$SYSROOT_PREFIX/usr" CROSS_PREFIX="$TARGET_PREFIX" install + make -C amcodec CC="$CC" HEADERS_DIR="$SYSROOT_PREFIX/usr/include/amcodec" PREFIX="$SYSROOT_PREFIX/usr" CROSS_PREFIX="$TARGET_PREFIX" install +} + +makeinstall_target() { + mkdir -p $INSTALL/usr/lib + cp -PR amavutils/*.so $INSTALL/usr/lib + + make -C amadec PREFIX="$INSTALL/usr" install + make -C amcodec HEADERS_DIR="$INSTALL/usr/include/amcodec" PREFIX="$INSTALL/usr" install +} diff --git a/tools/mkpkg/mkpkg_libamcodec b/tools/mkpkg/mkpkg_libamcodec new file mode 100755 index 0000000000..672c48d50c --- /dev/null +++ b/tools/mkpkg/mkpkg_libamcodec @@ -0,0 +1,43 @@ +#!/bin/sh +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; 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, 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +echo "getting sources..." + if [ ! -d libamcodec.git ]; then + git clone https://github.com/codesnake/libamcodec.git libamcodec.git + fi + + cd libamcodec.git + git pull + GIT_REV=`git log -n1 --format=%h` + cd .. + +echo "copying sources..." + rm -rf libamcodec-$GIT_REV + cp -R libamcodec.git libamcodec-$GIT_REV + +echo "cleaning sources..." + rm -rf libamcodec-$GIT_REV/.git + +echo "packing sources..." + tar cvJf libamcodec-$GIT_REV.tar.xz libamcodec-$GIT_REV + +echo "remove temporary sourcedir..." + rm -rf libamcodec-$GIT_REV