1. Media Framework Hierarchy
(1) Application layer
Music, Videoplayer
(2) Java layer
Mediaplayer:frameworks/base/media/java/android/media/mediaplayer.java
(3) JNI
Jni_mediaplayer--libmedia_jni.so
Frameworks/base/media/jni/android_media_player.cpp
(4) Server Proxyer
Libmedia--libmedia.so
Frameworks/av/media/libmedia/mediaplayer.cpp
(5) Server
Libmediaplayerservice-- libmediaplayerservice. So
frameworks/av/media/libmediaplayerservice/
(6) Protocal
Http/rtsp/httplive
(7.1) Stagefright
Libstagefright-- libstagefright. So
Frameworks/av/media/libstagefright/stagefrightplayer.cpp
(7.2) Nuplayer
Ps:
Streaming Media calls Nuplayer, local play calls Stagefright,stagefright calls Awesomeplayer corresponding interface, and finally calls Nuplayer.
Following the current trend, Nuplayer will completely replace Awesomeplayer.
2. MediaPlayer Classes Structure
Interface Definition:
IMediaPlayerService.h
IMediaPlayerClient.h
MediaPlayer.h
Framework implementation:
MediaPlayer.cpp
MediaPlayerService.cpp
Meidaplayer the implementation of the specific function in Pvplayer (library libopencoreplayer.so).
3. Stagefright
Stagefright is the module that handles the video: Libstagefright, whose core is not awesomeplayer.
1.mediaPlayerservice call Stagefright the corresponding interface
2.Stagefright call Awesomeplayer the corresponding interface
3.AwesomePlayer call Omxcode to read ES data and decode the processing
4.OMXCodec call MediaSource's read function to get audio and video data
5.OMXCodec call Android Iomx interface, is actually stagefrightde in the OMX implementation
6. OMX calls Omxmaster, and Omxmaster calls Omxpluginbase interface, here can also get the external codec plug-in, and finally call the corresponding decoding set to complete the decoding, different decoding components are not the same, the following will be introduced
7. After the decoding is complete, the bare stream data returned by OMXCODEC will call the render module in the Awesomeplayer to render, thus providing the user with the screen
Android Media Framework Master