Skip to content

Commit

Permalink
ffmpeg: rework, part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
awiouy committed Jun 23, 2016
1 parent 9b3d478 commit e4888b9
Showing 1 changed file with 24 additions and 34 deletions.
58 changes: 24 additions & 34 deletions packages/multimedia/ffmpeg/package.mk
Expand Up @@ -34,10 +34,10 @@ PKG_LONGDESC="FFmpeg is a complete, cross-platform solution to record, convert a
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"

# configure GPU drivers and dependencies:
get_graphicdrivers
# Dependencies
get_graphicdrivers

if [ "$VAAPI_SUPPORT" = yes ]; then
if [ "$VAAPI_SUPPORT" = "yes" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libva-intel-driver"
FFMPEG_VAAPI="--enable-vaapi"
else
Expand All @@ -51,7 +51,7 @@ else
FFMPEG_VDPAU="--disable-vdpau"
fi

if [ "$DEBUG" = yes ]; then
if [ "$DEBUG" = "yes" ]; then
FFMPEG_DEBUG="--enable-debug --disable-stripping"
else
FFMPEG_DEBUG="--disable-debug --enable-stripping"
Expand All @@ -63,55 +63,48 @@ fi

case "$TARGET_ARCH" in
arm)
FFMPEG_CPU=""
FFMPEG_TABLES="--enable-hardcoded-tables"
FFMPEG_PIC="--enable-pic"
;;
x86_64)
FFMPEG_CPU=""
FFMPEG_TABLES="--disable-hardcoded-tables"
FFMPEG_PIC="--enable-pic"
;;
FFMPEG_TABLES="--enable-hardcoded-tables"
;;
*)
FFMPEG_TABLES="--disable-hardcoded-tables"
;;
esac

case "$TARGET_FPU" in
neon*)
FFMPEG_FPU="--enable-neon"
;;
vfp*)
FFMPEG_FPU=""
;;
FFMPEG_FPU="--enable-neon"
;;
*)
FFMPEG_FPU=""
;;
FFMPEG_FPU="--disable-neon"
;;
esac

pre_configure_target() {
cd $ROOT/$PKG_BUILD
rm -rf .$TARGET_NAME

# ffmpeg fails building with LTO support
# ffmpeg fails building for x86_64 with LTO support
strip_lto

# ffmpeg fails running with GOLD support
strip_gold


if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
export CFLAGS="-I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux -DRPI=1 $CFLAGS"
export FFMPEG_LIBS="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
CFLAGS="-I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux -DRPI=1 $CFLAGS"
FFMPEG_LIBS="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
fi
}

configure_target() {
./configure --prefix=/usr \
--cpu=$TARGET_CPU \
--arch=$TARGET_ARCH \
./configure --prefix="/usr" \
--cpu="$TARGET_CPU" \
--arch="$TARGET_ARCH" \
--enable-cross-compile \
--cross-prefix=$TARGET_PREFIX \
--sysroot=$SYSROOT_PREFIX \
--cross-prefix="$TARGET_PREFIX" \
--sysroot="$SYSROOT_PREFIX" \
--sysinclude="$SYSROOT_PREFIX/usr/include" \
--target-os="linux" \
--extra-version="$PKG_VERSION" \
--nm="$NM" \
--ar="$AR" \
--as="$CC" \
Expand All @@ -122,10 +115,8 @@ configure_target() {
--host-ldflags="$HOST_LDFLAGS" \
--host-libs="-lm" \
--extra-cflags="$CFLAGS" \
--extra-ldflags="$LDFLAGS -fPIC" \
--extra-ldflags="$LDFLAGS" \
--extra-libs="$FFMPEG_LIBS" \
--extra-version="" \
--build-suffix="" \
--disable-static \
--enable-shared \
--enable-gpl \
Expand All @@ -134,7 +125,7 @@ configure_target() {
--enable-logging \
--disable-doc \
$FFMPEG_DEBUG \
$FFMPEG_PIC \
--enable-pic \
--pkg-config="$ROOT/$TOOLCHAIN/bin/pkg-config" \
--enable-optimizations \
--disable-extra-warnings \
Expand Down Expand Up @@ -215,7 +206,6 @@ configure_target() {
--enable-zlib \
--enable-asm \
--disable-altivec \
$FFMPEG_CPU \
$FFMPEG_FPU \
--enable-yasm \
--disable-symver
Expand Down

0 comments on commit e4888b9

Please sign in to comment.