Android Media Framework Master

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.