1. In the previous introduction, from Java to mediaplayer --- binder --- mediaplayerservice: The client has already been clarified. However, in mediaplayerservice: client <mediaplayerservice: Create-> new client/mediaplayerservice: Client: setdatasource-> getplayertype/createplayer-> Android: createplayer>, Android:: After createplayer, save the newly created real player to mediaplayerservice: mplayer in client.
2. What is the real player?
According to my understanding, there are pvplayer, stagefrightplayer, midifile, and vorbisplayer. Each player processes different media types and completes division of work through the return values of getplayertype (const char * URL. Each player has its own expertise and does what it is good. For detailed division of labor, see the code sp <mediaplayerbase> createplayer (player_type
Playertype, void * cookie,
Notify_callback_f notifyfunc) function.
3. What should I do if I want to implement hardware Demux and hardware decoder on my own chip (for example, for TS stream in the set-top box?
According to my understanding, there are two methods:
1) implement all the interface functions based on the mediaplayerinterface, create a xxplayer, and add it to Android: createplayer. The specific implementation of each interface function is the same as that of the previous implementation in the Linux environment. It is simple and the previous achievements can be used.
2) Write extractor and decoder plug-ins in the current player (such as stagefrightplayer.
To implement the second solution, you must first understand the architecture of stagefrightplayer. Why do you need to know both of them, because how to do it depends on your chief architect or CTO.