Skip to content

Commit

Permalink
Merge branch 'release/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
befovy committed Feb 21, 2020
2 parents 1469587 + 9899c7e commit 805b97a
Show file tree
Hide file tree
Showing 29 changed files with 745 additions and 65 deletions.
12 changes: 10 additions & 2 deletions NEWS.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
tag next
--------------------------------
---
### 0.5.1 (2020-02-21)

### Features

* add libsrt compile support for Android and mac ([#14](https://github.com/befovy/ijkplayer/issues/14)) ([f7764b6](https://github.com/befovy/ijkplayer/commit/f7764b6cd8b4da84910e57b94c0cd5614feb08e7))
* add consumerProguardFiles fix minify crash, add test sign ([48859d7](https://github.com/befovy/ijkplayer/commit/48859d71f567067218d287ed439d448b2946bbdb))
* add missing constant ([30b8baa](https://github.com/befovy/ijkplayer/commit/30b8baa52f5de50cb997189be472ee7fe513c1c1))

---

tag f0.5.0 (2020-01-06)
--------------------------------
Expand Down
1 change: 1 addition & 0 deletions android/contrib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build
ffmpeg-*
libsoxr-*
openssl-*
libsrt-*
103 changes: 103 additions & 0 deletions android/contrib/compile-libsrt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#! /usr/bin/env bash
#
# Copyright (C) 2013-2014 Zhang Rui <bbcallen@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#----------
UNI_BUILD_ROOT=`pwd`
FF_TARGET=$1
set -e
set +x

FF_ACT_ARCHS_32="armv5 armv7a x86"
FF_ACT_ARCHS_64="armv5 armv7a arm64 x86 x86_64"
FF_ACT_ARCHS_ALL=$FF_ACT_ARCHS_64

echo_archs() {
echo "===================="
echo "[*] check archs"
echo "===================="
echo "FF_ALL_ARCHS = $FF_ACT_ARCHS_ALL"
echo "FF_ACT_ARCHS = $*"
echo ""
}

echo_usage() {
echo "Usage:"
echo " compile-libsrt.sh armv5|armv7a|arm64|x86|x86_64"
echo " compile-libsrt.sh all|all32"
echo " compile-libsrt.sh all64"
echo " compile-libsrt.sh clean"
echo " compile-libsrt.sh check"
exit 1
}

echo_nextstep_help() {
#----------
echo ""
echo "--------------------"
echo "[*] Finished"
echo "--------------------"
echo "# to continue to build ffmpeg, run script below,"
echo "sh compile-ffmpeg.sh "
echo "# to continue to build ijkplayer, run script below,"
echo "sh compile-ijk.sh "
}

#----------
case "$FF_TARGET" in
"")
echo_archs armv7a
sh tools/do-compile-libsrt.sh armv7a
;;
armv5|armv7a|arm64|x86|x86_64)
echo_archs $FF_TARGET
sh tools/do-compile-libsrt.sh $FF_TARGET
echo_nextstep_help
;;
all32)
echo_archs $FF_ACT_ARCHS_32
for ARCH in $FF_ACT_ARCHS_32
do
sh tools/do-compile-libsrt.sh $ARCH
done
echo_nextstep_help
;;
all|all64)
echo_archs $FF_ACT_ARCHS_64
for ARCH in $FF_ACT_ARCHS_64
do
sh tools/do-compile-libsrt.sh $ARCH
done
echo_nextstep_help
;;
clean)
echo_archs FF_ACT_ARCHS_64
for ARCH in $FF_ACT_ARCHS_ALL
do
if [ -d libsrt-$ARCH ]; then
cd libsrt-$ARCH && git clean -xdf && cd -
fi
done
rm -rf ./build/libsrt-*
;;
check)
echo_archs FF_ACT_ARCHS_ALL
;;
*)
echo_usage
exit 1
;;
esac
44 changes: 35 additions & 9 deletions android/contrib/tools/do-compile-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fi


FF_BUILD_ROOT=`pwd`
FF_ANDROID_PLATFORM=android-9
FF_ANDROID_PLATFORM=android-14


FF_BUILD_NAME=
Expand All @@ -52,6 +52,9 @@ FF_DEP_OPENSSL_LIB=
FF_DEP_LIBSOXR_INC=
FF_DEP_LIBSOXR_LIB=

FF_DEP_LIBSRT_INC=
FF_DEP_LIBSRT_LIB=

FF_CFG_FLAGS=

FF_EXTRA_CFLAGS=
Expand Down Expand Up @@ -79,6 +82,7 @@ if [ "$FF_ARCH" = "armv7a" ]; then
FF_BUILD_NAME=ffmpeg-armv7a
FF_BUILD_NAME_OPENSSL=openssl-armv7a
FF_BUILD_NAME_LIBSOXR=libsoxr-armv7a
FF_BUILD_NAME_LIBSRT=libsrt-armv7a
FF_SOURCE=$FF_BUILD_ROOT/$FF_BUILD_NAME

FF_CROSS_PREFIX=arm-linux-androideabi
Expand All @@ -97,6 +101,7 @@ elif [ "$FF_ARCH" = "armv5" ]; then
FF_BUILD_NAME=ffmpeg-armv5
FF_BUILD_NAME_OPENSSL=openssl-armv5
FF_BUILD_NAME_LIBSOXR=libsoxr-armv5
FF_BUILD_NAME_LIBSRT=libsrt-armv5
FF_SOURCE=$FF_BUILD_ROOT/$FF_BUILD_NAME

FF_CROSS_PREFIX=arm-linux-androideabi
Expand All @@ -113,6 +118,7 @@ elif [ "$FF_ARCH" = "x86" ]; then
FF_BUILD_NAME=ffmpeg-x86
FF_BUILD_NAME_OPENSSL=openssl-x86
FF_BUILD_NAME_LIBSOXR=libsoxr-x86
FF_BUILD_NAME_LIBSRT=libsrt-x86
FF_SOURCE=$FF_BUILD_ROOT/$FF_BUILD_NAME

FF_CROSS_PREFIX=i686-linux-android
Expand All @@ -131,6 +137,7 @@ elif [ "$FF_ARCH" = "x86_64" ]; then
FF_BUILD_NAME=ffmpeg-x86_64
FF_BUILD_NAME_OPENSSL=openssl-x86_64
FF_BUILD_NAME_LIBSOXR=libsoxr-x86_64
FF_BUILD_NAME_LIBSRT=libsrt-x86_64
FF_SOURCE=$FF_BUILD_ROOT/$FF_BUILD_NAME

FF_CROSS_PREFIX=x86_64-linux-android
Expand All @@ -149,6 +156,7 @@ elif [ "$FF_ARCH" = "arm64" ]; then
FF_BUILD_NAME=ffmpeg-arm64
FF_BUILD_NAME_OPENSSL=openssl-arm64
FF_BUILD_NAME_LIBSOXR=libsoxr-arm64
FF_BUILD_NAME_LIBSRT=libsrt-arm64
FF_SOURCE=$FF_BUILD_ROOT/$FF_BUILD_NAME

FF_CROSS_PREFIX=aarch64-linux-android
Expand All @@ -158,7 +166,6 @@ elif [ "$FF_ARCH" = "arm64" ]; then

FF_EXTRA_CFLAGS="$FF_EXTRA_CFLAGS"
FF_EXTRA_LDFLAGS="$FF_EXTRA_LDFLAGS"

FF_ASSEMBLER_SUB_DIRS="aarch64 neon"

else
Expand All @@ -175,15 +182,20 @@ if [ ! -d $FF_SOURCE ]; then
exit 1
fi

FF_TOOLCHAIN_PATH=$FF_BUILD_ROOT/build/$FF_BUILD_NAME/toolchain
FF_TOOLCHAIN_PATH=$FF_BUILD_ROOT/build/toolchain-$FF_ARCH
FF_MAKE_TOOLCHAIN_FLAGS="$FF_MAKE_TOOLCHAIN_FLAGS --install-dir=$FF_TOOLCHAIN_PATH"

FF_SYSROOT=$FF_TOOLCHAIN_PATH/sysroot
FF_PREFIX=$FF_BUILD_ROOT/build/$FF_BUILD_NAME/output
FF_DEP_OPENSSL_INC=$FF_BUILD_ROOT/build/$FF_BUILD_NAME_OPENSSL/output/include
FF_DEP_OPENSSL_LIB=$FF_BUILD_ROOT/build/$FF_BUILD_NAME_OPENSSL/output/lib
FF_DEP_LIBSOXR_INC=$FF_BUILD_ROOT/build/$FF_BUILD_NAME_LIBSOXR/output/include
FF_DEP_LIBSOXR_LIB=$FF_BUILD_ROOT/build/$FF_BUILD_NAME_LIBSOXR/output/lib
FF_PREFIX=$FF_BUILD_ROOT/build/output-$FF_ARCH

FF_DEP_OPENSSL_INC=$FF_PREFIX/include
FF_DEP_OPENSSL_LIB=$FF_PREFIX/lib

FF_DEP_LIBSOXR_INC=$FF_PREFIX/include
FF_DEP_LIBSOXR_LIB=$FF_PREFIX/lib

FF_DEP_LIBSRT_INC=$FF_PREFIX/include
FF_DEP_LIBSRT_LIB=$FF_PREFIX/lib

case "$UNAME_S" in
CYGWIN_NT-*)
Expand Down Expand Up @@ -214,7 +226,7 @@ echo "[*] check ffmpeg env"
echo "--------------------"
export PATH=$FF_TOOLCHAIN_PATH/bin/:$PATH
#export CC="ccache ${FF_CROSS_PREFIX}-gcc"
export CC="${FF_CROSS_PREFIX}-gcc"
export CC=${FF_CROSS_PREFIX}-gcc
export LD=${FF_CROSS_PREFIX}-ld
export AR=${FF_CROSS_PREFIX}-ar
export STRIP=${FF_CROSS_PREFIX}-strip
Expand Down Expand Up @@ -258,6 +270,19 @@ if [ -f "${FF_DEP_LIBSOXR_LIB}/libsoxr.a" ]; then
FF_DEP_LIBS="$FF_DEP_LIBS -L${FF_DEP_LIBSOXR_LIB} -lsoxr"
fi

if [ -f "${FF_DEP_LIBSRT_LIB}/libsrt.a" ]; then
echo "libsrt detected"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-libsrt"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-protocol=libsrt"

FF_CFLAGS="$FF_CFLAGS -I${FF_DEP_LIBSRT_INC}"
FF_DEP_LIBS="$FF_DEP_LIBS -L${FF_DEP_LIBSRT_LIB} -lsrt -lc -lm -ldl -lcrypto -lssl -lstdc++"
fi

export PKG_CONFIG_PATH="${FF_PREFIX}/lib/pkgconfig"

FF_CFG_FLAGS="$FF_CFG_FLAGS --pkgconfigdir=${FF_PREFIX}/lib/pkgconfig"

FF_CFG_FLAGS="$FF_CFG_FLAGS $COMMON_FF_CFG_FLAGS"

#--------------------
Expand All @@ -269,6 +294,7 @@ FF_CFG_FLAGS="$FF_CFG_FLAGS --cross-prefix=${FF_CROSS_PREFIX}-"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-cross-compile"
FF_CFG_FLAGS="$FF_CFG_FLAGS --target-os=linux"
FF_CFG_FLAGS="$FF_CFG_FLAGS --enable-pic"
FF_CFG_FLAGS="$FF_CFG_FLAGS --pkg-config=pkg-config"
# FF_CFG_FLAGS="$FF_CFG_FLAGS --disable-symver"

if [ "$FF_ARCH" = "x86" ]; then
Expand Down
Loading

0 comments on commit 805b97a

Please sign in to comment.