Skip to content

Commit

Permalink
Add targets to fetch and build ffmpeg on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Collett committed Nov 23, 2012
1 parent 32147b6 commit 8553ee1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
3 changes: 3 additions & 0 deletions jni/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ffmpeg-android
stamp.c
*~
34 changes: 25 additions & 9 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@ include $(CLEAR_VARS)
LOCAL_MODULE := decoder-jni
LOCAL_CPPFLAGS := -D__STDC_CONSTANT_MACROS
LOCAL_C_INCLUDES := ffmpeg-android/build/ffmpeg/${TARGET_ARCH_ABI}/include
LOCAL_SRC_FILES := decoder-jni.c
LOCAL_STATIC_LIBRARIES += \
avcodec \
avcore \
avutil \
swscale \
#
LOCAL_LDLIBS += \
LOCAL_SRC_FILES := stamp.c decoder-jni.c
LOCAL_STATIC_LIBRARIES :=

LOCAL_LDLIBS += -Lffmpeg-android/build/ffmpeg/${TARGET_ARCH_ABI}/lib \
-ljnigraphics \
-lavformat \
-lavcodec \
-lavcore \
-lavutil \
-lswscale \
#

$(LOCAL_PATH)/stamp.c: $(LOCAL_PATH)/ffmpeg-android/build/ffmpeg/armeabi
echo "Generate file"
touch stamp.c

$(LOCAL_PATH)/ffmpeg-android/build/ffmpeg/${TARGET_ARCH_ABI}: $(LOCAL_PATH)/ffmpeg-android/ffmpeg
echo ANDROIDNDK="$(NDK_ROOT)"
cd ffmpeg-android && ANDROIDNDK="$(NDK_ROOT)" FFMPEG_ARCHS="armv7a" ./build-h264-aac.sh
cd ffmpeg-android/build/ffmpeg/ && ln -s armeabi-v7a ${TARGET_ARCH_ABI}

$(LOCAL_PATH)/ffmpeg-android/ffmpeg: $(LOCAL_PATH)/ffmpeg-android
cd ffmpeg-android && ./extract.sh

$(LOCAL_PATH)/ffmpeg-android:
git clone git://github.com/tito/ffmpeg-android.git

include $(BUILD_SHARED_LIBRARY)

include ffmpeg-android/Android.mk

0 comments on commit 8553ee1

Please sign in to comment.