Skip to content

Commit 24c0143

Browse files
committed
add ffmpeg recipe for ffmpeg-android
1 parent 7d314e6 commit 24c0143

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

recipes/ffmpeg/recipe.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
VERSION_ffmpeg=
4+
URL_ffmpeg=
5+
DEPS_ffmpeg=(python sdl)
6+
MD5_ffmpeg=
7+
BUILD_ffmpeg=$BUILD_PATH/ffmpeg/ffmpeg-android
8+
RECIPE_ffmpeg=$RECIPES_PATH/ffmpeg
9+
10+
function prebuild_ffmpeg() {
11+
cd $BUILD_PATH/ffmpeg
12+
13+
if [ ! -d ffmpeg-android ]; then
14+
# initial clone
15+
try git clone git://github.com/tito/ffmpeg-android
16+
try cd ffmpeg-android
17+
try ./extract.sh
18+
fi
19+
}
20+
21+
function build_ffmpeg() {
22+
cd $BUILD_ffmpeg
23+
24+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/ffmpeg" ]; then
25+
return
26+
fi
27+
28+
# build ffmpeg
29+
export NDK=$ANDROIDNDK
30+
if [ ! -f $BUILD_ffmpeg/build/ffmpeg/armeabi-v7a/lib/libavcodec.a ]; then
31+
try ./build.sh
32+
fi
33+
34+
push_arm
35+
36+
# build python extension
37+
export JNI_PATH=$JNI_PATH
38+
export CFLAGS="$CFLAGS -I$JNI_PATH/sdl/include -I$JNI_PATH/sdl_mixer/"
39+
export LDFLAGS="$LDFLAGS -lm -L$LIBS_PATH"
40+
try cd $BUILD_ffmpeg/python
41+
try find . -iname '*.pyx' -exec cython {} \;
42+
try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v
43+
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
44+
45+
pop_arm
46+
}
47+
48+
function postbuild_ffmpeg() {
49+
true
50+
}

0 commit comments

Comments
 (0)