标签:android mediaplayer stagefright awesomeplayer
(1) 应用层
Music, VideoPlayer
(2) JAVA层
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:
流媒体调用NuPlayer,本地播放调用stagefright,stagefright会调用AwesomePlayer相应的接口,最后调用NuPlayer。
按照目前的趋势,之后NuPlayer将会完全取代AwesomePlayer。
接口定义:
IMediaPlayerService.h
IMediaPlayerClient.h
MediaPlayer.h
框架实现:
MediaPlayer.cpp
MediaPlayerService.cpp
MeidaPlayer的具体功能在PVPlayer(库 libopencoreplayer.so)中的实现。
StageFright是处理视频的模块:libstagefright,其核心未AwesomePlayer。
1.mediaPlayerservice调用Stagefright相应的接口
2.Stagefright调用AwesomePlayer相应的接口
3.AwesomePlayer调用OMXCode读取ES数据,并且进行解码的处理
4.OMXCodec调用MediaSource的read函数来获取音视频的数据
5.OMXCodec调用Android的IOMX接口,其实就是Stagefrightde中的 OMX实现
6. OMX调用OMXMaster,而OMXMaster调用OMXPluginBase的接口,这里也可以获取外部的Codec的插件,最终调用对应的解码组建来完成解码,不同解码组件不太相同,后面会做介绍
7.解码完成后,通过OMXcodec返回的裸码流数据会在Awesomeplayer中调用Render模块,实现渲染,从而给用户提供了画面
标签:android mediaplayer stagefright awesomeplayer
原文地址:http://blog.csdn.net/matrix_laboratory/article/details/44103687