前言
突然想整整VLC-Android,然后就下一个玩玩看,这里记录点遇到的问题。
声明
欢迎转载,但请保留文章原始出处:)
博客园:http://www.cnblogs.com
农民伯伯: http://over140.cnblogs.com
正文
本文vlc-android的版本为:2.2.0-pre1 Weatherwax
一般按照官网来就行(https://wiki.videolan.org/AndroidCompile),以下是遇到的几个问题:
1、环境变量配置
export ANDROID_NDK=/Users/nmbb/Android/android-ndk-r9d
export ANDROID_SDK=/Users/nmbb/Android/android-sdk-macosx
export PATH=PANDROID_SDK/platform-tools:$ANDROID_SDK/tools
export ANDROID_ABI=armeabi-v7a
export ANDROID_SDK=/Users/nmbb/Android/android-sdk-macosx
export PATH=PANDROID_SDK/platform-tools:$ANDROID_SDK/tools
export ANDROID_ABI=armeabi-v7a
2、编译错误
如果遇到sed: RE error: illegal byte sequence,增加 export LANG=C 即可。
3、不编译jar和apk
注释掉Makefile的下面三行:
# git rev-parse --short HEAD > $(SRC)/assets/revision.txt
# ./gen-env.sh $(SRC)
# (V(SRC) && ant (AN(ANT_TARGET)
4、少了iomx-jbmr2.so和iomx-kk.so
解注释Makefile下面这行
LIBVLC_LIBS += libiomx-kk libiomx-jbmr2
但是注意说明:
# The following iomx libs are used for DEBUG only.
# (after android Jelly Bean, we prefer to use MediaCodec instead of iomx)
# (after android Jelly Bean, we prefer to use MediaCodec instead of iomx)
5、 让VLC显示缓冲进度
5.1 解注释 EventHandler的如下行:
public static final int MediaPlayerBuffering = 0x103;
5.2 修改jni/libvlcjni.c,增加如下行389行:
static const libvlc_event_type_t mp_events[] = {
libvlc_MediaPlayerPlaying,
libvlc_MediaPlayerPaused,
libvlc_MediaPlayerEndReached,
libvlc_MediaPlayerStopped,
libvlc_MediaPlayerVout,
libvlc_MediaPlayerPositionChanged,
libvlc_MediaPlayerTimeChanged,
libvlc_MediaPlayerEncounteredError,
libvlc_MediaPlayerBuffering
};
libvlc_MediaPlayerPlaying,
libvlc_MediaPlayerPaused,
libvlc_MediaPlayerEndReached,
libvlc_MediaPlayerStopped,
libvlc_MediaPlayerVout,
libvlc_MediaPlayerPositionChanged,
libvlc_MediaPlayerTimeChanged,
libvlc_MediaPlayerEncounteredError,
libvlc_MediaPlayerBuffering
};
然后重新编译生成so。截止到发文章,这个还没来得及测,参考这篇文章:
vlc-android 获取MediaPlayerEncounteredError,MediaPlayerBuffering等各种事件的响应 http://blog.csdn.net/memegood123/article/details/8769008
6、系列文章
结束
先不管VLC的功能如何,至少API设计的很烂。