OSDN Git Service

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