Skip to content

Commit 782c32d

Browse files
committed
ffmpeg2: activate ssl/https support if openssl is compiled
1 parent e385710 commit 782c32d

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

recipes/ffmpeg2/recipe.sh

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
VERSION_ffmpeg2=${VERSION_ffmpeg2:-2.7.1}
66
URL_ffmpeg2=http://ffmpeg.org/releases/ffmpeg-$VERSION_ffmpeg2.tar.bz2
77
DEPS_ffmpeg2=(sdl)
8+
DEPS_OPTIONAL_ffmpeg2=(openssl)
89
MD5_ffmpeg2=
910
BUILD_ffmpeg2=$BUILD_PATH/ffmpeg2/$(get_directory $URL_ffmpeg2)
1011
RECIPE_ffmpeg2=$RECIPES_PATH/ffmpeg2
@@ -30,20 +31,35 @@ function build_ffmpeg2() {
3031
# configure
3132
DEST=build/ffmpeg
3233

34+
# openssl activated ?
35+
SSL_CFLAGS=""
36+
SSL_LDFLAGS=""
37+
if [ "X$BUILD_openssl" != "X" ]; then
38+
debug "Activate flags for openssl / ffmpeg2"
39+
SSL_CFLAGS="-I$BUILD_openssl/include/"
40+
SSL_LDFLAGS="-L$BUILD_openssl/"
41+
fi
42+
3343
for version in $ARCH_ffmpeg2; do
3444

3545
FLAGS="--disable-everything"
3646
FLAGS="$FLAGS --enable-parser=h264,aac"
3747
FLAGS="$FLAGS --enable-decoder=h263,h264,aac"
3848
FLAGS="$FLAGS --enable-filter=aresample,resample,crop"
39-
FLAGS="$FLAGS --enable-protocol=file,http"
49+
FLAGS="$FLAGS --enable-protocol=file,http,https,tls_openssl"
4050
FLAGS="$FLAGS --enable-demuxer=sdp --enable-pic"
4151
FLAGS="$FLAGS --enable-small"
4252
FLAGS="$FLAGS --enable-hwaccels"
4353
FLAGS="$FLAGS --disable-static --enable-shared"
4454
# libpostproc is GPL: https://ffmpeg.org/pipermail/ffmpeg-user/2012-February/005162.html
4555
FLAGS="$FLAGS --enable-gpl"
4656

57+
# enable openssl if needed
58+
if [ "X$BUILD_openssl" != "X" ]; then
59+
FLAGS="$FLAGS --enable-openssl --enable-nonfree"
60+
FLAGS="$FLAGS --enable-protocol=https,tls_openssl"
61+
fi
62+
4763
# needed to prevent _ffmpeg.so: version node not found for symbol av_init_packet@LIBAVFORMAT_52
4864
# /usr/bin/ld: failed to set dynamic section sizes: Bad value
4965
FLAGS="$FLAGS --disable-symver"
@@ -60,19 +76,17 @@ function build_ffmpeg2() {
6076

6177
case "$version" in
6278
x86)
63-
64-
EXTRA_CFLAGS=""
65-
#EXTRA_LDFLAGS="-Wl,-Bsymbolic"
66-
EXTRA_LDFLAGS=""
79+
EXTRA_CFLAGS="$SSL_CFLAGS"
80+
EXTRA_LDFLAGS="$SSL_LDFLAGS"
6781
ABI="x86"
6882
;;
6983
armv7a)
7084
ARM_FLAGS="--target-os=android --cross-prefix=arm-linux-androideabi- --arch=arm"
7185
ARM_FLAGS="$ARM_FLAGS --sysroot=$NDKPLATFORM"
7286
FLAGS="$ARM_FLAGS $FLAGS"
7387
FLAGS="$FLAGS --enable-neon"
74-
EXTRA_CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fPIC -DANDROID"
75-
EXTRA_LDFLAGS=""
88+
EXTRA_CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fPIC -DANDROID $SSL_CFLAGS"
89+
EXTRA_LDFLAGS="$SSL_LDFLAGS"
7690
ABI="armeabi-v7a"
7791
;;
7892
*)

0 commit comments

Comments
 (0)