android 多媒体框架

本文详细探讨了Android多媒体框架中的StagefrightPlayer和NuPlayer架构,包括AudioPlayer、MediaExtractor、MediaCodec等组件的工作流程。在问题背景中,通过分析dlna测试中adts文件播放失败的问题,发现了因服务器返回的Content-Length缺失导致的错误。在StagefrightPlayer中,当mInputBuffer读取错误时,追溯到AACExtractor中getAdtsFrameLength函数的frameSize计算问题,最终发现异常服务器使用了chunked传输编码,未提供Content-Length,从而引发播放问题。
摘要由CSDN通过智能技术生成

http://blog.csdn.net/matrix_laboratory/article/details/39322749

mediaplayer:

ImediaPlayer:BnMediaPlayer(MediaPlayerService.)、BpMediaPlayer(ImediaPlayer)

MediaPlayerClient:BnMediaPlayerClient(MediaPlayer)、BpMediaPlayerClient(IMediaPlayerClient)

IMediaPlayerService:BnMediaPlayerService(MediaPlayerService)、BpMediaPlayerService(IMediaPlayerService)

 

StagefrightPlayer架构:

AudioPlayer.cpp     AweSomePlayer.cpp                                                                                                                                          (notifyListener_l(MEDIA_SEEK_COMPLETE);)

AudioCallBack  -->notifyAudioEOS--->postAudioEOS--->postCheckAudioStatusEvent--->onCheckAudioStatus--->postStreamDoneEvent_l-->onStreamDone-->notifyListener_l

 

MediaPlayerInterface      StagefrightPlayer.cpp   MediaPlayerFactory   MediaPlayerService                      (IMediaPlayerClient)MediaPlayer   

--->sendEvent------------->(setNotifyCallback)--->(createPlayer)--------->(createPlayer)---------->notify---->notify---->

 

android_media_MediaPlayer.cpp(JNIMediaPlayerListener: public MediaPlayerListener)                                           MediaPlayer.java

-->env->CallStaticVoidMethod(fields.post_event = env->GetStaticMethodID(clazz, "postEventFromNative",))----->postEventFromNative--->EventHandler

 

NuPlayer架构:

ACodec.cpp             NuPlayerDecoder.cpp      MediaCodec.cpp                                                                                 

NuPlayerDecoder.cpp                                               NuPlayerRenderer.cpp                      

 (kWhatCodecNotify)           ("callback", &callback)              ("callbackID", CB_OUTPUT_AVAILABLE)     (MediaCodec::CB_OUTPUT_AVAILABLE)                                                        (kWhatOutputBufferDrained)                                    

onMessageReceived(BaseState)-->onOMXMessage-->(MediaCodec:mCodec->setNotificationMessage(kWhatCodecNotify))-->onOMXFillBufferDone--->{onConfigure(setCallback)--->setCallback--->onMessageReceived(kWhatSetCallback)}-->onMessageReceived(kWhatDrainThisBuffer)-->onOutputBufferAvailable--->onMessageReceived(kWhatCodecNotify)-->handleAnOutputBuffer-->q

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值