Service side includes 3 components: Service, Service_client and Service_Impementation
Service: it will be regiestered to ServiceManager, so Client can locate it, then call Service to create an Service_Client.
Service_Client: it will handle each play command ( start, stop, seek, etc. ) from Client. it is actually a peer of Client on Service side.
Serivce_Implemenation: it is the function doer, Service_Client will call it when receiving Client request. In other words, Service_Client is an adapter from Client to Serivce_Implemenation
Client: Running on Apps process Called by Java via JNI or other native apps to request video play.
Call sequences
Below diagram shows the sequences of 3 catagories
1) Create:
Apps -> MediaPlayer -> MediaPlayerServcie -> MediaPlayerServcie::Client -> MediaPlayerBase ( concrete class is like: StagefrightPlayer )
2) Start ( Call forward)
Apps -> MediaPlayer ->MediaPlayerServcie::Client-> MediaPlayerBase (StagefrightPlayer)
3) Call back
MediaPlayerBase (StagefrightPlayer) -> MediaPlayerServcie::Client ->MediaPlayer
(check more from the diagram)