利用ffmpeg和SDL实现一个跨android版本的音视频播放器
- - ITeye博客绝对原创:转载请注明出处. 1:从 http://www.libsdl.org/tmp/下载SDL for android 版本(我下载的是 SDL-1.3.tar.gz ). 2:从 https://github.com/havlenapetr/FFMpeg下载 havlenapetr 的ffmpeg for android版本.
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := main SDL_PATH := ../SDL LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(SDL_PATH)/include \ $(LOCAL_PATH)/../libffmpeg \ # Add your application source files here... LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \ tutorial08.c LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES LOCAL_SHARED_LIBRARIES := SDL LOCAL_STATIC_LIBRARIES := libavformat libavcodec libavutil libpostproc libswscale LOCAL_LDLIBS := -ldl -lGLESv2 -llog include $(BUILD_SHARED_LIBRARY)
// Load the .so static { System.loadLibrary("SDL"); //System.loadLibrary("SDL_image"); //System.loadLibrary("SDL_mixer"); //System.loadLibrary("SDL_ttf"); System.loadLibrary("main"); }
// Runs SDL_main() String avPath = Environment.getExternalStorageDirectory()+File.separator+"DancingQueen.mp4"; SDLActivity.nativeInit(avPath); //Log.v("SDL", "SDL thread terminated");