Integration of libmp3lame

pull/14/head
Javernaut 5 years ago
parent 48e4e77450
commit b26f55b2b8
  1. 2
      .travis.yml
  2. 6
      scripts/export-build-variables.sh
  3. 7
      scripts/ffmpeg/build.sh
  4. 4
      scripts/ffmpeg/download.sh
  5. 22
      scripts/libmp3lame/build.sh
  6. 17
      scripts/libmp3lame/download.sh
  7. 30
      scripts/parse-arguments.sh

@ -8,4 +8,4 @@ before_install:
# Keeping track of the NDK version that was used # Keeping track of the NDK version that was used
- cat $ANDROID_NDK_HOME/source.properties - cat $ANDROID_NDK_HOME/source.properties
script: script:
- bash -e ffmpeg-android-maker.sh - bash -e ffmpeg-android-maker.sh --enable-libmp3lame

@ -67,8 +67,9 @@ export SIZE=${CROSS_PREFIX_WITH_PATH}size
export STRINGS=${CROSS_PREFIX_WITH_PATH}strings export STRINGS=${CROSS_PREFIX_WITH_PATH}strings
export STRIP=${CROSS_PREFIX_WITH_PATH}strip export STRIP=${CROSS_PREFIX_WITH_PATH}strip
export TARGET=${TARGET_TRIPLE_MACHINE_CC}-linux-${TARGET_TRIPLE_OS}${ANDROID_PLATFORM}
# The name for compiler is slightly different, so it is defined separatly. # The name for compiler is slightly different, so it is defined separatly.
export CC=${TOOLCHAIN_PATH}/bin/${TARGET_TRIPLE_MACHINE_CC}-linux-${TARGET_TRIPLE_OS}${ANDROID_PLATFORM}-clang export CC=${TOOLCHAIN_PATH}/bin/${TARGET}-clang
export CXX=${CC}++ export CXX=${CC}++
# TODO consider abondaning this strategy of defining the name of the clang wrapper # TODO consider abondaning this strategy of defining the name of the clang wrapper
# in favour of just passing -mstackrealign and -fno-addrsig depending on # in favour of just passing -mstackrealign and -fno-addrsig depending on
@ -76,3 +77,6 @@ export CXX=${CC}++
# Special variable for the yasm assembler # Special variable for the yasm assembler
export YASM=${TOOLCHAIN_PATH}/bin/yasm export YASM=${TOOLCHAIN_PATH}/bin/yasm
# A variable to which certain dependencies can add -l arguments during build.sh
export FFMPEG_EXTRA_LD_FLAGS=

@ -18,6 +18,10 @@ do
ADDITIONAL_COMPONENTS+=" --enable-$LIBARY_NAME" ADDITIONAL_COMPONENTS+=" --enable-$LIBARY_NAME"
done done
# Referencing dependencies without pkgconfig
DEP_CFLAGS="-I${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/include"
DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS"
# Everything that goes below ${EXTRA_BUILD_CONFIGURATION_FLAGS} is my project-specific. # Everything that goes below ${EXTRA_BUILD_CONFIGURATION_FLAGS} is my project-specific.
# You are free to enable/disable whatever you actually need. # You are free to enable/disable whatever you actually need.
@ -29,7 +33,8 @@ done
--sysroot=${SYSROOT_PATH} \ --sysroot=${SYSROOT_PATH} \
--cross-prefix=${CROSS_PREFIX_WITH_PATH} \ --cross-prefix=${CROSS_PREFIX_WITH_PATH} \
--cc=${CC} \ --cc=${CC} \
--extra-cflags="-O3 -fPIC" \ --extra-cflags="-O3 -fPIC $DEP_CFLAGS" \
--extra-ldflags="$DEP_LD_FLAGS" \
--enable-shared \ --enable-shared \
--disable-static \ --disable-static \
--pkg-config=$(which pkg-config) \ --pkg-config=$(which pkg-config) \

@ -14,7 +14,7 @@ function ensureSourcesTar() {
TARGET_FILE_NAME=ffmpeg-${FFMPEG_SOURCE_VALUE}.tar.bz2 TARGET_FILE_NAME=ffmpeg-${FFMPEG_SOURCE_VALUE}.tar.bz2
curl https://www.ffmpeg.org/releases/${TARGET_FILE_NAME} --output ${TARGET_FILE_NAME} curl https://www.ffmpeg.org/releases/${TARGET_FILE_NAME} --output ${TARGET_FILE_NAME}
tar xzf ${TARGET_FILE_NAME} -C . tar xf ${TARGET_FILE_NAME} -C .
rm ${TARGET_FILE_NAME} rm ${TARGET_FILE_NAME}
fi fi
@ -60,7 +60,7 @@ case ${FFMPEG_SOURCE_TYPE} in
# ensureSourcesBranch ${SECOND_ARGUMENT} # ensureSourcesBranch ${SECOND_ARGUMENT}
# ;; # ;;
TAR) TAR)
echo "Using FFmpeg source archive ${FFMPEG_FALLBACK_VERSION}" echo "Using FFmpeg source archive ${FFMPEG_SOURCE_VALUE}"
ensureSourcesTar ensureSourcesTar
;; ;;
esac esac

@ -0,0 +1,22 @@
./configure \
--prefix=${BUILD_DIR_EXTERNAL}/${ANDROID_ABI} \
--target=${TARGET} \
--host=${TARGET} \
--with-sysroot=${SYSROOT_PATH} \
--disable-shared \
--enable-static \
--with-pic \
--disable-analyzer-hooks \
--disable-decoder \
--disable-gtktest \
--disable-frontend \
CC=${CC} \
LD=${LD} \
AR=${AR} \
RANLIB=${RANLIB}
export FFMPEG_EXTRA_LD_FLAGS="${FFMPEG_EXTRA_LD_FLAGS} -lmp3lame"
make clean
make -j${HOST_NPROC}
make install

@ -0,0 +1,17 @@
# Script to download Lame's source code
# Exports SOURCES_DIR_libmp3lame - path where actual sources are stored
LAME_VERSION=3.100
echo "Using libmp3lame $LAME_VERSION"
LAME_SOURCES=lame-${LAME_VERSION}
if [[ ! -d "$LAME_SOURCES" ]]; then
TARGET_FILE_NAME=lame-${LAME_VERSION}.tar.gz
curl http://downloads.videolan.org/pub/contrib/lame/${TARGET_FILE_NAME} --output ${TARGET_FILE_NAME}
tar xf ${TARGET_FILE_NAME} -C .
rm ${TARGET_FILE_NAME}
fi
export SOURCES_DIR_libmp3lame=$(pwd)/${LAME_SOURCES}

@ -5,7 +5,7 @@
# See the end of this file for more description # See the end of this file for more description
EXTERNAL_LIBRARIES=() EXTERNAL_LIBRARIES=()
SOURCE_TYPE=TAR SOURCE_TYPE=TAR
SOURCE_VALUE="4.2.1" SOURCE_VALUE=4.2.1
API_LEVEL=16 API_LEVEL=16
for artument in "$@" for artument in "$@"
@ -17,17 +17,17 @@ do
shift shift
;; ;;
# Checkout the particular tag in the FFmpeg's git repository # Checkout the particular tag in the FFmpeg's git repository
--source-git-tag=*) # --source-git-tag=*)
SOURCE_TYPE=GIT_TAG # SOURCE_TYPE=GIT_TAG
SOURCE_VALUE="${artument#*=}" # SOURCE_VALUE="${artument#*=}"
shift # shift
;; # ;;
# Checkout the particular branch in the FFmpeg's git repository # Checkout the particular branch in the FFmpeg's git repository
--source-git-branch=*) # --source-git-branch=*)
SOURCE_TYPE=GIT_BRANCH # SOURCE_TYPE=GIT_BRANCH
SOURCE_VALUE="${artument#*=}" # SOURCE_VALUE="${artument#*=}"
shift # shift
;; # ;;
# Download the particular tar archive by its version # Download the particular tar archive by its version
--source-tar=*) --source-tar=*)
SOURCE_TYPE=TAR SOURCE_TYPE=TAR
@ -43,10 +43,10 @@ do
# EXTERNAL_LIBRARIES+=( "libdav1d" ) # EXTERNAL_LIBRARIES+=( "libdav1d" )
# shift # shift
# ;; # ;;
# --enable-libmp3lame) --enable-libmp3lame)
# EXTERNAL_LIBRARIES+=( "libmp3lame" ) EXTERNAL_LIBRARIES+=( "libmp3lame" )
# shift shift
# ;; ;;
*) *)
echo "Unknown argument $artument" echo "Unknown argument $artument"
;; ;;

Loading…
Cancel
Save