ijkplayer修改动态库名称(目前最新版本0.8.8)
了解ijkplayer的朋友都知道,底层有三个动态库,分别是libijkffmpeg.so、libijksdl.so、libijkplayer.so。一般出于避免重名冲突和便于区分的考虑都会修改它们的名称。接下来我就依次介绍如何修改三个动态库的名称。
1.libijkffmpeg.so,首先找到ijkplayer/android/contrib/tools/do-compile-ffmpeg.sh文件,替换其中的两处libijkffmpeg.so,修改成自己想要的名称libijkffmpeg***.so。
-
FF_C_OBJ_FILES=
-
FF_ASM_OBJ_FILES=
-
for MODULE_DIR in $FF_MODULE_DIRS
-
do
-
C_OBJ_FILES="$MODULE_DIR/*.o"
-
if ls $C_OBJ_FILES 1> /dev/null 2>&1; then
-
echo "link $MODULE_DIR/*.o"
-
FF_C_OBJ_FILES="$FF_C_OBJ_FILES $C_OBJ_FILES"
-
fi
-
-
for ASM_SUB_DIR in $FF_ASSEMBLER_SUB_DIRS
-
do
-
ASM_OBJ_FILES="$MODULE_DIR/$ASM_SUB_DIR/*.o"
-
if ls $ASM_OBJ_FILES 1> /dev/null 2>&1; then
-
echo "link $MODULE_DIR/$ASM_SUB_DIR/*.o"
-
FF_ASM_OBJ_FILES="$FF_ASM_OBJ_FILES $ASM_OBJ_FILES"
-
fi
-
done
-
done
-
-
$CC -lm -lz -shared --sysroot=$FF_SYSROOT -Wl,--no-undefined -Wl,-z,noexecstack $FF_EXTRA_LDFLAGS \
-
-Wl,-soname,libijkffmpeg***.so \
-
$FF_C_OBJ_FILES \
-
$FF_ASM_OBJ_FILES \
-
$FF_DEP_LIBS \
-
-o $FF_PREFIX/libijkffmpeg***.so
-
-
mysedi() {
-
f=$1
-
exp=$2
-
n=`basename $f`
-
cp $f /tmp/$n
-
sed $exp /tmp/$n > $f
-
rm /tmp/$n
-
}
同时,修改对应的Android.mk文件:
-
LOCAL_PATH := $(call my-dir)
-
-
include $(CLEAR_VARS)
-
LOCAL_MODULE := ijkffmpeg***
-
LOCAL_SRC_FILES := $(MY_APP_FFMPEG_OUTPUT_PATH)/libijkffmpeg***.so
-
include $(PREBUILT_SHARED_LIBRARY)
2.libijksdl.so,找到ijkplayer/ijkmedia/ijksdl/Android.mk文件,修改ijkffmpeg和ijksdk的名称分别为ijkffmpeg***、ijksdk***。
-
LOCAL_SRC_FILES += android/ijksdl_vout_android_nativewindow.c
-
LOCAL_SRC_FILES += android/ijksdl_vout_android_surface.c
-
LOCAL_SRC_FILES += android/ijksdl_vout_overlay_android_mediacodec.c
-
-
LOCAL_SHARED_LIBRARIES := ijkffmpeg***
-
LOCAL_STATIC_LIBRARIES := cpufeatures yuv_static ijkj4a
-
-
LOCAL_MODULE := ijksdl***
-
include $(BUILD_SHARED_LIBRARY)
-
-
$(call import-module,android/cpufeatures)
3.libijkplayer.so,找到ijkplayer/ijkmedia/ijkplayer/Android.mk文件,修改ijkffmpeg、ijksdk和ijkplayer的名称分别为ijkffmpeg***、ijksdk***、ijkplayer***。
-
OCAL_SRC_FILES += ijkavutil/ijktree.c
-
LOCAL_SRC_FILES += ijkavutil/ijkfifo.c
-
LOCAL_SRC_FILES += ijkavutil/ijkstl.cpp
-
-
LOCAL_SHARED_LIBRARIES := ijkffmpeg*** ijksdl***
-
LOCAL_STATIC_LIBRARIES := android-ndk-profiler ijksoundtouch
-
-
LOCAL_MODULE := ijkplayer***
-
-
VERSION_SH = $(LOCAL_PATH)/version.sh
-
VERSION_H = ijkversion.h
-
$(info $(shell ($(VERSION_SH) $(LOCAL_PATH) $(VERSION_H))))
-
include $(BUILD_SHARED_LIBRARY)
至此,就可以重新运行脚本编译ijkplayer的三个底层动态库了。
文章来源: liuzhen.blog.csdn.net,作者:Data-Mining,版权归原作者所有,如需转载,请联系作者。
原文链接:liuzhen.blog.csdn.net/article/details/82732492
- 点赞
- 收藏
- 关注作者
评论(0)