OSDN Git Service

update README, adding howto build, run etc
[android-x86/external-stagefright-plugins.git] / README
1 ================================================================================
2 Stagefright Plugins for Android
3 ================================================================================
4
5 1. Enhance the Android multimedia framework providing additional Plugins for
6    user interaction
7 2. FFmpeg provides demuxers and av codecs;
8 3. SDL provides basic library: thread, mutex, and timer, but all of sdl should 
9    be removed;
10 4. NamExtractor is a extractor plugin, it would be loaded by Stagefright when 
11    Stagefright started.
12 5. NamExtractor will load FFmpegExtractor, MplayerExtractor and VLCExtractor.
13    but only FFmpegExtractor is implemented now.
14 6. FFmpegExtractor is the reference to "ffmpeg/ffplay" to achieve. 
15
16 ================================================================================
17 Why is named nam[NamExtractor]?
18 ================================================================================
19
20 Namtso, or Lake Nam, is one of the three holy lakes in Tibet Autonomous Region
21 and should not be missed by any traveler to Tibet. In Tibetan, Namtso means
22 "Heavenly Lake." It is famous for its high altitude and imposing scenery.
23
24 I used to travel there in 2011 Sep.
25
26 ================================================================================
27 Requirements
28 ================================================================================
29
30 CyanogenMod 9.x (Ice Cream Sandwich)
31 http://wiki.cyanogenmod.com/wiki/Galaxy_Nexus_(GSM):_Compile_CyanogenMod_(Linux)
32
33 FFMPEG-0.11.1
34 git://android.git.linaro.org/platform/external/ffmpeg.git
35
36 SDL-1.3.0
37 git@github.com:omxcodec/android_external_sdl.git
38
39 ================================================================================
40  How to build
41 ================================================================================
42
43 1. Get the Source
44    clone cm-9.1.0 source from CyanogenMod git:
45        repo init -u git://github.com/CyanogenMod/android.git -b cm-9.1.0
46    plz ref: http://wiki.cyanogenmod.com/wiki/Galaxy_Nexus_(GSM):_Compile_CyanogenMod_(Linux)
47
48    clone my sources from the omxcodec{github} git!
49    in your "android/external" folder, run:
50    stagefright-plugins:
51        git clone git@github.com:omxcodec/stagefright-plugins.git stagefright-plugins
52    ffmpeg:
53        git clone git@github.com:omxcodec/android_external_ffmpeg.git ffmpeg -b linaro-0.11.1
54    sdl:
55        git clone git@github.com:omxcodec/android_external_sdl.git sdl
56
57    in your "android/external" folder, run:
58    cp stagefright-plugins/repo/local_manifest.xml ../.repo
59    cd ..      // go to android folder
60    repo sync  // sync "frameworks_base" code again!
61               // of course, you can merge my android_external_ffmpeg code instread of 
62               // "repo sync" frameworks_base. once you do, so you should pay attention to the
63               // "USES_NAM" flag, it is only in the "android/frameworks/base" directory
64  
65 2. Compile
66    add USES_NAM flag to COMMON_GLOBAL_CFLAGS in android build system
67        vi vendor/samsung/maguro/BoardConfigVendor.mk and add these lines to it
68            USES_NAM := true
69            ifdef USES_NAM
70                COMMON_GLOBAL_CFLAGS += -DUSES_NAM
71            endif
72
73    ffmpeg:
74    cd android/external/ffmpeg
75    mm ffmpeg  // NOT "mm", plz FIXME!
76
77    cd android/external/sdl
78    mm
79
80    cd android/external/stagefright-plugins
81    mm
82
83 3. Install
84    adb root
85    adb remount
86    adb sync // sync your android build system to your phone or pad
87    reboot   // reboot your phone or pad
88
89 4. Run
90    get test media files:
91        wget http://movies.apple.com/media/us/ipad/2012/tv-spots/apple-ipad-this_good-us-20120307_848x480.mov
92        wget http://movies.apple.com/media/us/ipad/2012/80ba527a-1a34-4f70-aae8-14f87ab76eea/tours/apple-ipad-feature-us-20120307_848x480.mp4
93
94    let us suppose your media files locate at "/sdcard/Movies/" folder. one console window, you should run:
95        adb logcat
96    and other cosole window, you should run:
97    test NamExtractor and FFmpegExtractor plugins:
98        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
99        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
100    test SoftFFmpegVideo decoder plugin:
101        cd android/external/stagefright-plugins/tools folder, run
102        adb root
103        ./install // install my scripts
104        adb root && adb shell set-vdec-sw1       // let omxcode choose software decoder
105        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-this_good-us-20120307_848x480.mov -t video/*
106        adb shell am start -a android.intent.action.VIEW -d file:///mnt/sdcard/Movies/apple-ipad-feature-us-20120307_848x480.mp4 -t video/*
107
108    run it and enjoy!
109
110 ================================================================================
111  Known issues
112 ================================================================================
113 1. audio codec to be integrated
114 2. some media file do not have h263 extradata(FFmpegExtractor)
115 3. some .mov movies do not av resync when seeking
116
117 If you need help with the library, or just want to discuss nam related issues, 
118 you can contact me: Michael Chen (omxcodec@gmail.com)
119