编译的环境是ubuntu 12.04,要安装好java,配置好环境变量,按照http://wiki.videolan.org/AndroidCompile配置好,就可以编译了。


2014/03/26日更新结束

[plain] 
     view plain 
    copy 
     
     
   
 
  
1. export JAVA_HOME=/home/sunlit/jdk1.6.0_38/  
2. export PATH=$JAVA_HOME/bin:$PATH  
3. export classPath=/home/sunlit/jdk1.6.0_38/  
4. export ANDROID_SDK=/home/sunlit/sdk  
5. export ANDROID_NDK=/home/sunlit/android-ndk-r8c  
6. export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools  
7. export ANDROID_ABI=armeabi-v7a  
 
 

2014/03/26日更新开始

 
 
在ubuntu下编译vlc  
  https://wiki.videolan.org/AndroidCompile/ 
  

         安装工具 
  
 
  

              sudo apt-get install ant autoconf automake autopoint cmake gawk gcc g++ libtool m4 patch pkg-config ragel subversion yasm git 
   

          切换vlc android 版本到 0.1.x-bugfix 
   
 
   

                git clone 
      
    git://git.videolan.org/vlc-ports/android.git 
   
 
   

                cd android 
   
 
   

                git branch -r 
   
 
   

                git checkout 0.1.x-bugfix 
   
 
 

2014/03/26日更新结束
 
 
 
  
 
 
为了在android vlc上增加截图和保存视频的功能
截图:
要对android/configure.sh进行修改 删掉其中的-disable-sout
另外保存图片为png格式,需要让ffmpeg增加-enable-encoder=png的编码器(在android/vlc/contrib/src/ffmpeg/rules.mak中修改)

2014/03/26日更新开始
 
  
 
 FFMPEGCONF += --disable-encoders --disable-muxers
 
 

                   ->FFMPEGCONF += --disable-encoders --enable-encoder=png 
  
 
 
2014/03/26日更新结束

在libvlcjni.c中增加函数:
 
 
 
    [cpp] 
     view plain 
    copy 
     
     
   
 
  
1. jboolean Java_org_videolan_libvlc_LibVLC_takeSnapShot(JNIEnv *env, jobject thiz,jint number, jstring path, jint width,jint height)  
2. {  
3.     jboolean isCopy;  
4.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
5. /* Get C string */
6. const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);  
7.   
8. if
9. if(libvlc_video_take_snapshot(mp, (int)number,psz_path , (int)width,(int)height)==0)  
10. return
11. return
12.   
13. }  
 
 

在LibVlc.java中增加native函数的接口
 
 
 
    [java] 
     view plain 
    copy 
     
     
   
 
  
1. private native boolean takeSnapShot( int num, String file, int width, int
 和调用方法 
 
 
    [java] 
     view plain 
    copy 
     
     
   
 
  
1. public boolean takeSnapShot(String file, int width, int
2. return takeSnapShot(0, file, width, height);  
3. }  
 
 

 编译后就可以使用。调用LibVlc.java中的takeSnapShot就可以实现截图了。 
 
录制视频:
2014/03/26日更新开始
 
 
• 打上视频录制的补丁 https://patches.videolan.org/patch/606/

• 把patch文件放到/android/vlc中 使用命令patch -p1 < xxxx.patch  查出其中的失败的地方 手动修改
• 修改vlc-android/jni/libvlcjni.c  
      
在文件末尾添加
• 


[cpp] view plaincopy1. jboolean Java_org_videolan_libvlc_LibVLC_takeSnapShot(JNIEnv *env, jobject thiz,jint number, jstring path, jint width,jint height)  
2. {  
3.     jboolean isCopy;  
4.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
5. /* Get C string */
6. const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);  
7.   
8. if
9. if(libvlc_video_take_snapshot(mp, (int)number,psz_path , (int)width,(int)height)==0)  
10. return
11. return
12.   
13. }  
14.   
15. jboolean Java_org_videolan_libvlc_LibVLC_videoRecordStart(JNIEnv *env, jobject thiz,jstring path)  
16. {  
17.     jboolean isCopy;  
18.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
19. /* Get C string */
20. const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);  
21. //const char* psz_filename=(*env)->GetStringUTFChars(env, filename, &isCopy);
22. if
23. if(libvlc_media_player_record_start(mp,psz_path)==0)  
24. return
25. return
26. }  
27.   
28. jboolean Java_org_videolan_libvlc_LibVLC_videoRecordStop(JNIEnv *env, jobject thiz)  
29. {  
30.     jboolean isCopy;  
31.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
32. /* Get C string */
33. if
34. if(libvlc_media_player_record_stop(mp)==0)  
35. return
36. return
37. }  
38.   
39. jboolean Java_org_videolan_libvlc_LibVLC_videoIsRecording(JNIEnv *env, jobject thiz)  
40. {  
41.     jboolean isCopy;  
42.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
43. if
44. if(libvlc_media_player_is_recording(mp))  
45. return
46. return
47. }  
48. jboolean Java_org_videolan_libvlc_LibVLC_videoIsRecordable(JNIEnv *env, jobject thiz)  
49. {  
50.     jboolean isCopy;  
51.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
52. if
53. if(libvlc_media_player_is_recordable(mp))  
54. return
55. return
56. }  
57.   
58. jint Java_org_videolan_libvlc_LibVLC_getState(JNIEnv *env, jobject thiz)  
59. {  
60.     libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
61. if
62.         libvlc_state_t state=libvlc_media_player_get_state(mp);  
63. return
64.     }  
65. else
66. return
67. }  
68. 
2014/03/26日更新结束
         
 
编译的环境是ubuntu 12.04,要安装好java,配置好环境变量,按照http://wiki.videolan.org/AndroidCompile配置好,就可以编译了。
 
 
 
    [plain] 
     view plain 
    copy 
     
     
   
 
  
1. export JAVA_HOME=/home/sunlit/jdk1.6.0_38/  
2. export PATH=$JAVA_HOME/bin:$PATH  
3. export classPath=/home/sunlit/jdk1.6.0_38/  
4. export ANDROID_SDK=/home/sunlit/sdk  
5. export ANDROID_NDK=/home/sunlit/android-ndk-r8c  
6. export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools  
7. export ANDROID_ABI=armeabi-v7a  
 
 

2014/03/26日更新开始

 
 
在ubuntu下编译vlc  
  https://wiki.videolan.org/AndroidCompile/ 
  

         安装工具 
  
 
  

              sudo apt-get install ant autoconf automake autopoint cmake gawk gcc g++ libtool m4 patch pkg-config ragel subversion yasm git 
   

          切换vlc android 版本到 0.1.x-bugfix 
   
 
   

                git clone 
      
    git://git.videolan.org/vlc-ports/android.git 
   
 
   

                cd android 
   
 
   

                git branch -r 
   
 
   

                git checkout 0.1.x-bugfix 
   
 
 

2014/03/26日更新结束
 
 
 
  
 
 
为了在android vlc上增加截图和保存视频的功能
截图:
要对android/configure.sh进行修改 删掉其中的-disable-sout
另外保存图片为png格式,需要让ffmpeg增加-enable-encoder=png的编码器(在android/vlc/contrib/src/ffmpeg/rules.mak中修改)

2014/03/26日更新开始
 
  
 
 FFMPEGCONF += --disable-encoders --disable-muxers
 
 

                   ->FFMPEGCONF += --disable-encoders --enable-encoder=png 
  
 
 
2014/03/26日更新结束

在libvlcjni.c中增加函数:
 
 
 
    [cpp] 
     view plain 
    copy 
     
     
   
 
  
1. jboolean Java_org_videolan_libvlc_LibVLC_takeSnapShot(JNIEnv *env, jobject thiz,jint number, jstring path, jint width,jint height)  
2. {  
3.     jboolean isCopy;  
4.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
5. /* Get C string */
6. const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);  
7.   
8. if
9. if(libvlc_video_take_snapshot(mp, (int)number,psz_path , (int)width,(int)height)==0)  
10. return
11. return
12.   
13. }  
 
 

在LibVlc.java中增加native函数的接口
 
 
 
    [java] 
     view plain 
    copy 
     
     
   
 
  
1. private native boolean takeSnapShot( int num, String file, int width, int
 和调用方法 
 
 
    [java] 
     view plain 
    copy 
     
     
   
 
  
1. public boolean takeSnapShot(String file, int width, int
2. return takeSnapShot(0, file, width, height);  
3. }  
 
 

 编译后就可以使用。调用LibVlc.java中的takeSnapShot就可以实现截图了。 
 
录制视频:
2014/03/26日更新开始
 
 
• 打上视频录制的补丁 https://patches.videolan.org/patch/606/

• 把patch文件放到/android/vlc中 使用命令patch -p1 < xxxx.patch  查出其中的失败的地方 手动修改
• 修改vlc-android/jni/libvlcjni.c  
      
在文件末尾添加
• 


[cpp] view plaincopy1. jboolean Java_org_videolan_libvlc_LibVLC_takeSnapShot(JNIEnv *env, jobject thiz,jint number, jstring path, jint width,jint height)  
2. {  
3.     jboolean isCopy;  
4.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
5. /* Get C string */
6. const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);  
7.   
8. if
9. if(libvlc_video_take_snapshot(mp, (int)number,psz_path , (int)width,(int)height)==0)  
10. return
11. return
12.   
13. }  
14.   
15. jboolean Java_org_videolan_libvlc_LibVLC_videoRecordStart(JNIEnv *env, jobject thiz,jstring path)  
16. {  
17.     jboolean isCopy;  
18.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
19. /* Get C string */
20. const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);  
21. //const char* psz_filename=(*env)->GetStringUTFChars(env, filename, &isCopy);
22. if
23. if(libvlc_media_player_record_start(mp,psz_path)==0)  
24. return
25. return
26. }  
27.   
28. jboolean Java_org_videolan_libvlc_LibVLC_videoRecordStop(JNIEnv *env, jobject thiz)  
29. {  
30.     jboolean isCopy;  
31.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
32. /* Get C string */
33. if
34. if(libvlc_media_player_record_stop(mp)==0)  
35. return
36. return
37. }  
38.   
39. jboolean Java_org_videolan_libvlc_LibVLC_videoIsRecording(JNIEnv *env, jobject thiz)  
40. {  
41.     jboolean isCopy;  
42.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
43. if
44. if(libvlc_media_player_is_recording(mp))  
45. return
46. return
47. }  
48. jboolean Java_org_videolan_libvlc_LibVLC_videoIsRecordable(JNIEnv *env, jobject thiz)  
49. {  
50.     jboolean isCopy;  
51.    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
52. if
53. if(libvlc_media_player_is_recordable(mp))  
54. return
55. return
56. }  
57.   
58. jint Java_org_videolan_libvlc_LibVLC_getState(JNIEnv *env, jobject thiz)  
59. {  
60.     libvlc_media_player_t *mp = getMediaPlayer(env, thiz);  
61. if
62.         libvlc_state_t state=libvlc_media_player_get_state(mp);  
63. return
64.     }  
65. else
66. return
67. }