To summarize in one line: not all of my libs/armeabi/*.so
files are copied to the device when my application starts. I'll try to explain.
Directory structure
I am trying to get ffmpeg on Android and therefore has the following structure for NDK:
jni βββ Android.mk βββ bambuser_ffmpeg β βββ Android.mk β βββ libavcodec.so β βββ libavcore.so β βββ libavdevice.so β βββ libavfilter.so β βββ libavformat.so β βββ libavutil.so β βββ libswscale.so βββ video βββ Android.mk βββ at_ac_univie_gameclient_video_VideoGLSurfaceView.c βββ at_ac_univie_gameclient_video_VideoGLSurfaceView.h βββ at_ac_univie_gameclient_video_VideoGLSurfaceView_GLRenderer.h
Android.mk Files
The Android.mk
file in bambuser_ffmpeg
says:
include $(CLEAR_VARS) LOCAL_MODULE := bambuser-libavcodec LOCAL_SRC_FILES := libavcodec.so include $(PREBUILT_SHARED_LIBRARY)
The second Android.mk file has the following:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := ffmpeg LOCAL_STATIC_LIBRARIES := bambuser-libavcodec bambuser-libavcore bambuser-libavdevice bambuser-libavfilter bambuser-libavformat bambuser-libavutil bambuser-libswscale LOCAL_SRC_FILES := at_ac_univie_gameclient_video_VideoGLSurfaceView.c LOCAL_C_INCLUDES := $(LOCAL_PATH)/../bambuser_ffmpeg/ LOCAL_LDLIBS := -L$(LOCAL_PATH)/../bambuser_ffmpeg -lavcodec -lavcore -lavdevice -lavfilter -lavformat -lavutil -lswscale -llog -lz -lGLESv1_CM include $(BUILD_SHARED_LIBRARY)
Exit
So, when I run ./ndk-build
, I get this output. It looks good, right?
Prebuilt : libavcodec.so <= jni/bambuser_ffmpeg/ Install : libavcodec.so => libs/armeabi/libavcodec.so Prebuilt : libavcore.so <= jni/bambuser_ffmpeg/ Install : libavcore.so => libs/armeabi/libavcore.so Prebuilt : libavdevice.so <= jni/bambuser_ffmpeg/ Install : libavdevice.so => libs/armeabi/libavdevice.so Prebuilt : libavfilter.so <= jni/bambuser_ffmpeg/ Install : libavfilter.so => libs/armeabi/libavfilter.so Prebuilt : libavformat.so <= jni/bambuser_ffmpeg/ Install : libavformat.so => libs/armeabi/libavformat.so Prebuilt : libavutil.so <= jni/bambuser_ffmpeg/ Install : libavutil.so => libs/armeabi/libavutil.so Prebuilt : libswscale.so <= jni/bambuser_ffmpeg/ Install : libswscale.so => libs/armeabi/libswscale.so Install : libffmpeg.so => libs/armeabi/libffmpeg.so
Problem
When I launched the Android app, it will try to download libffmpeg.so
. Of course, my local libs
directory contains all the necessary libraries, as they were created / copied before:
libs βββ armeabi βββ libavcodec.so βββ libavcore.so βββ libavdevice.so βββ libavfilter.so βββ libavformat.so βββ libavutil.so βββ libffmpeg.so βββ libswscale.so
However, on the device itself there is only my libffmpeg.so
file. It is located at at.ac.univie.gameclient/lib/libffmpeg.so
and is automatically copied there. Where are the other .so
files located and how to get them on the device?
Also, just manually copying them, of course, is not my desired solution.