Hi,
We compiled ffmpeg for neon as per the link:
http://www.roman10.net/how-to-build-ffmpeg-for-android/
We see a crash at avcodec_decode_video2 in our wrapper class.
We modified the compile script build_android.sh according to the
suggestions given in Android Developer forums:
http://groups.google.com/group/android-developers/browse_frm/thread/6c961b827ab493dc.
And this is
build_android.sd that we are using now. But we are still
seeing the crash.
PREBUILT=/home/arun/android/android-ndk-r6b/toolchains/arm-linux-
androideabi-4.4.3/prebuilt/linux-x86
PLATFORM=/home/arun/android/android-ndk-r6b/platforms/android-9/arch-
arm
CPU=armv7-a
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -
mtune=cortex-a8"
PREFIX=./android/$CPU
ADDITIONAL_CONFIGURE_FLAG=--enable-neon
./configure --target-os=linux \
--prefix=$PREFIX \
--enable-cross-compile \
--extra-libs="-lgcc" \
--arch=arm \
--cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--nm=$PREBUILT/bin/arm-linux-androideabi-nm \
--sysroot=$PLATFORM \
--extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -
Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -
fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
--disable-shared \
--enable-static \
--extra-ldflags="-Wl,-malign-double -rpath-link=$PLATFORM/usr/lib
-
L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \
--disable-everything \
--enable-demuxer=h264 \
--disable-ffplay \
--enable-protocol=file \
--enable-avformat \
--enable-avcodec \
--enable-decoder=rawvideo \
--enable-decoder=mjpeg \
--enable-decoder=h263 \
--enable-decoder=mpeg4 \
--enable-decoder=h264 \
--enable-parser=h264 \
--disable-network \
--enable-zlib \
--disable-avfilter \
--disable-avdevice \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j4 install
$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a
inverse.o
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -
L
$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -
z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/
libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a
libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog
--warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/
arm-
linux-androideabi/4.4.3/libgcc.a
And the Android.mk is as follows:
LOCAL_PATH := $(call my-dir)
FFMPEG:= /home/arun/ffmpegneon1103/android/armv7-a/lib
include $(CLEAR_VARS)
LOCAL_MODULE := OnVRView
LOCAL_SRC_FILES := OnVRView.cpp
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS := -DHAVE_NEON=1
LOCAL_MODULE := OnVRView
LOCAL_SRC_FILES += VideoDecoder.cpp.neon
LOCAL_ARM_NEON := true
endif
LOCAL_C_INCLUDES := /home/arun/ffmpegneon1103/android/armv7-a/include
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES := cpufeatures
LOCAL_LDLIBS := -llog -L$(FFMPEG) -lswresample -lavformat -
lavcodec -lswscale -lavutil -Werror
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cpufeatures)
This requires any changes?
Thank you,
B.Arunkumar.