new package: add package 'libamlplayer-m1'

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-05-26 16:14:22 +02:00
parent a75d5e5f26
commit 7ffef8dc62
6 changed files with 374 additions and 1 deletions

View File

@ -200,7 +200,7 @@ elif [ "$XBMCPLAYER_DRIVER" = "marvell-libgfx" ]; then
XBMC_OPENMAX="--disable-openmax"
XBMC_PLAYER="--with-platform=marvell-dove"
XBMC_CODEC=""
elif [ "$XBMCPLAYER_DRIVER" = "libamlplayer-m3" ]; then
elif [ "$XBMCPLAYER_DRIVER" = "libamlplayer-m1" -o "$XBMCPLAYER_DRIVER" = "libamlplayer-m3" ]; then
XBMC_OPENMAX="--disable-openmax"
XBMC_PLAYER="--enable-player=amlplayer"
XBMC_CODEC="--enable-codec=amcodec"

View File

@ -0,0 +1,162 @@
#!/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
################################################################################
. config/options $1
if [ "$DEBUG" = yes ]; then
AMFFMPEG_DEBUG="--enable-debug --disable-stripping"
else
AMFFMPEG_DEBUG="--disable-debug --enable-stripping"
fi
if [ "$OPTIMIZATIONS" = size ]; then
AMFFMPEG_OPTIM="--disable-small"
else
AMFFMPEG_OPTIM="--disable-small"
fi
case "$TARGET_FPU" in
neon*)
AMFFMPEG_FPU="--enable-neon"
;;
vfp*)
AMFFMPEG_FPU=""
;;
*)
AMFFMPEG_FPU=""
;;
esac
export pkg_config="$ROOT/$TOOLCHAIN/bin/pkg-config"
# ffmpeg fails building with LTO support
strip_lto
# ffmpeg fails running with GOLD support
strip_gold
# dont use -Wl,--as-needed because of linking problems
LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"`
cd $PKG_BUILD/
echo "### building amffmpeg ###"
cd amffmpeg
./configure --prefix=/usr \
--cpu=$TARGET_CPU \
--arch=$TARGET_ARCH \
--enable-cross-compile \
--cross-prefix=$TARGET_PREFIX \
--sysroot=$SYSROOT_PREFIX \
--sysinclude="$SYSROOT_PREFIX/usr/include" \
--target-os="linux" \
--nm="$NM" \
--ar="$AR" \
--as="$CC" \
--cc="$CC" \
--ld="$CC" \
--host-cc="$HOST_CC" \
--host-cflags="$HOST_CFLAGS" \
--host-ldflags="$HOST_LDFLAGS" \
--host-libs="-lm" \
--extra-cflags="$CFLAGS -I$ROOT/$PKG_BUILD/amavutils/include" \
--extra-ldflags="$LDFLAGS" \
--extra-libs="" \
--extra-version="" \
--build-suffix="_aml" \
--disable-static \
--enable-shared \
--enable-gpl \
--disable-doc \
$AMFFMPEG_DEBUG \
--enable-pic \
--disable-ffprobe \
--disable-ffplay \
--disable-ffserver \
--disable-ffmpeg \
--enable-postproc \
--enable-avfilter \
--enable-pthreads \
$AMFFMPEG_OPTIM \
--enable-runtime-cpudetect \
--disable-amd3dnow \
--disable-amd3dnowext \
--disable-mmx \
--disable-mmx2 \
--disable-sse \
--disable-ssse3 \
--disable-armv5te \
--disable-armv6t2 \
--disable-iwmmxt \
--enable-hardcoded-tables \
--disable-encoders \
--disable-muxers \
--disable-bzlib \
--enable-librtmp \
--disable-libschroedinger \
--disable-libspeex \
--disable-libtheora \
--disable-libvo-aacenc \
--disable-libvo-amrwbenc \
--disable-libvorbis \
--disable-libvpx \
--disable-libx264 \
--disable-libxavs \
--disable-libxvid \
--enable-zlib \
--enable-asm \
--disable-altivec \
$AMFFMPEG_FPU \
--disable-vis \
--enable-yasm \
make V=1
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR */lib*.so* $SYSROOT_PREFIX/usr/lib
echo "### building amadec ###"
cd ../amadec
make
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR libamadec.so $SYSROOT_PREFIX/usr/lib
echo "### building amcodec ###"
cd ../amcodec
make -j1
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR libamcodec.so.0.0 $SYSROOT_PREFIX/usr/lib/libamcodec.so
mkdir -p $SYSROOT_PREFIX/usr/include/amlplayer/
cp -PR include/* $SYSROOT_PREFIX/usr/include/amlplayer/
echo "### building amplayer ###"
cd ../amplayer
make -j1 CC="$TARGET_CC" LD="$TARGET_LD" PREFIX="$SYSROOT_PREFIX/usr" -f Makefile.mk
mkdir -p $SYSROOT_PREFIX/usr/lib
cp -PR libamplayer.so $SYSROOT_PREFIX/usr/lib
mkdir -p $SYSROOT_PREFIX/usr/include/amlplayer/
cp -PR player/include/* $SYSROOT_PREFIX/usr/include/amlplayer/

View File

@ -0,0 +1,32 @@
#!/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
################################################################################
. config/options $1
mkdir -p $INSTALL/usr/lib
cp -P $PKG_BUILD/amffmpeg/*/lib*.so* $INSTALL/usr/lib
cp -P $PKG_BUILD/amadec/libamadec.so $INSTALL/usr/lib
cp -P $PKG_BUILD/amcodec/libamcodec.so.0.0 $INSTALL/usr/lib/libamcodec.so
cp -P $PKG_BUILD/amplayer/libamplayer.so $INSTALL/usr/lib
mkdir -p $INSTALL/lib/firmware
cp -P $PKG_BUILD/amadec/firmware/*.bin $INSTALL/lib/firmware

View File

@ -0,0 +1,36 @@
################################################################################
# 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
################################################################################
PKG_NAME="libamlplayer-m1"
PKG_VERSION="e7ba300"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="LGPL"
PKG_SITE="http://openlinux.amlogic.com"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS="alsa-lib rtmpdump"
PKG_BUILD_DEPENDS="toolchain alsa-lib rtmpdump"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"
PKG_SHORTDESC="libamlplayer-m1: tools for Amlogic Meson1 support."
PKG_LONGDESC="libamlplayer-m1: tools for Amlogic Meson1 support."
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"

View File

@ -0,0 +1,100 @@
diff -Naur libamlplayer-m1-e7ba300/amadec/Makefile libamlplayer-m1-e7ba300.patch/amadec/Makefile
--- libamlplayer-m1-e7ba300/amadec/Makefile 2013-05-26 01:08:34.000000000 +0200
+++ libamlplayer-m1-e7ba300.patch/amadec/Makefile 2013-05-26 06:42:39.800719267 +0200
@@ -14,18 +14,16 @@
LDFLAGS += -shared -lpthread -lm -lasound -lrt
-TARGET_DIR=$(shell pwd)/../../../target
-STAGING_DIR=$(shell pwd)/../../../staging
-CFLAGS+=-O2
-CFLAGS+=-I$(shell pwd) -I$(shell pwd)/include -I${STAGING_DIR}/include -I${STAGING_DIR}/usr/include -L${TARGET_DIR}/lib -L${TARGET_DIR}/usr/lib
+CFLAGS+=-O2 -fPIC
+CFLAGS+=-I$(shell pwd) -I$(shell pwd)/include
CFLAGS+=-DALSA_OUT -DENABLE_WAIT_FORMAT
export CC CFLAGS
-all: $(TARGET)
+all: $(TARGET)
$(TARGET): $(TARGET_OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_OBJS:%.o=%.c) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_OBJS:%.o=%.c) -o $@
install:$(TARGET)
-install -m 555 ${TARGET} $(INSTALL_DIR)
diff -Naur libamlplayer-m1-e7ba300/amcodec/include/amports/aformat.h libamlplayer-m1-e7ba300.patch/amcodec/include/amports/aformat.h
--- libamlplayer-m1-e7ba300/amcodec/include/amports/aformat.h 2013-05-26 01:08:34.000000000 +0200
+++ libamlplayer-m1-e7ba300.patch/amcodec/include/amports/aformat.h 2013-05-26 06:42:39.821719205 +0200
@@ -76,7 +76,7 @@
||(afmt == AFORMAT_AMR)\
||(afmt == AFORMAT_ALAC)\
||(afmt == AFORMAT_AC3) \
- ||(afmt == AFORMAT_EAC3) \
+ ||(afmt == AFORMAT_EAC3) \
||(afmt == AFORMAT_APE) \
||(afmt == AFORMAT_FLAC) )
diff -Naur libamlplayer-m1-e7ba300/amcodec/Makefile libamlplayer-m1-e7ba300.patch/amcodec/Makefile
--- libamlplayer-m1-e7ba300/amcodec/Makefile 2013-05-26 01:08:34.000000000 +0200
+++ libamlplayer-m1-e7ba300.patch/amcodec/Makefile 2013-05-26 06:42:39.827719188 +0200
@@ -35,9 +35,6 @@
INCLUDE=${SRCTREE}/include/
#CFLAGS=-O0 -gdwarf-2 -g
CFLAGS=-O2 -I$(SRC)/include -I${SRCTREE}/audio_ctl -I${SRCTREE}/codec -I${SRCTREE}/../amadec/include -fPIC
-CFLAGS+=-mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -march=armv7-a
-
-
target_all= $(TARGET)$(LIB_VERSION)$(LIB_SUB_VERSION)
@@ -51,9 +48,6 @@
$(target_all):$(DIROBJ)
$(call ld_mk,$(OUT_DIR)$@,$^)
-
-
-
include $(SRCTREE)/rules.mk
export CC CPP AS AR LD TOPDIR SRCTREE CFLAGS LDFLAGS Q
diff -Naur libamlplayer-m1-e7ba300/amcodec/rules.mk libamlplayer-m1-e7ba300.patch/amcodec/rules.mk
--- libamlplayer-m1-e7ba300/amcodec/rules.mk 2013-05-26 01:08:34.000000000 +0200
+++ libamlplayer-m1-e7ba300.patch/amcodec/rules.mk 2013-05-26 06:42:39.828719185 +0200
@@ -19,10 +19,10 @@
ld_mk=$(Q)echo "LD $(1) $(2) $(3)";\
$(CC) $(LDFLAGS) \
- --start-group \
+ -Wl,--start-group \
$(2:%-dir=%/build-in.o) \
$(3:%-dir=%/build-in.o) \
- --end-group \
+ -Wl,--end-group \
-o $(1)
clr_mk=$(Q)echo "CLEAN $(1)";\
diff -Naur libamlplayer-m1-e7ba300/amplayer/Makefile.mk libamlplayer-m1-e7ba300.patch/amplayer/Makefile.mk
--- libamlplayer-m1-e7ba300/amplayer/Makefile.mk 2013-05-26 01:08:33.000000000 +0200
+++ libamlplayer-m1-e7ba300.patch/amplayer/Makefile.mk 2013-05-26 06:43:36.590551945 +0200
@@ -33,7 +33,7 @@
-LDFLAGS+= -L$(PREFIX)/lib -lavutil -lavformat -lswscale -lavcodec -lavutil -lm -lpthread -lamcodec
+LDFLAGS+= -L$(PREFIX)/lib -lavutil_aml -lavformat_aml -lswscale_aml -lavcodec_aml -lavutil_aml -lm -lpthread -lamcodec
INSTALL_DIR?=$(PREFIX)/lib
LDFLAGS+=-shared
@@ -48,9 +48,8 @@
CFLAGS+=-I$(SRC)/player/include
endif
-CFLAGS+=-I${SRCTREE}/../amffmpeg -I${SRCTREE}/../amcodec/include -I${SRCTREE}/../amadec/include
+CFLAGS+=-I${SRCTREE}/../amffmpeg -I${SRCTREE}/../amcodec/include -I${SRCTREE}/../amadec/include -I${SRCTREE}/../amavutils/include
CFLAGS+=-fPIC -DENABLE_FREE_SCALE
-CFLAGS+=-mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -march=armv7-a
target_all= $(TARGET)

View File

@ -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 libamlplayer-m1.git ]; then
git clone git://github.com/Pivosgroup/libamplayer-m1.git libamlplayer-m1.git
fi
cd libamlplayer-m1.git
git pull
GIT_REV=`git log -n1 --format=%h`
cd ..
echo "copying sources..."
rm -rf libamlplayer-m1-$GIT_REV
cp -R libamlplayer-m1.git libamlplayer-m1-$GIT_REV
echo "cleaning sources..."
rm -rf libamlplayer-m1-$GIT_REV/.git
echo "packing sources..."
tar cvJf libamlplayer-m1-$GIT_REV.tar.xz libamlplayer-m1-$GIT_REV
echo "remove temporary sourcedir..."
rm -rf libamlplayer-m1-$GIT_REV