The Media Manager component implements the media service. It handles multiple media players concurrently by starting and managing one instance of the Streamer component for each player requested by the applications.
The Media Manager component provides three services which are exposed through the TOI.
The media service supports playback of a wide variety of media stream formats. It has to keep track of each individual media player instance and dynamically reallocate the necessary hardware resources between them as the user switches between the corresponding applications.
The Media Manager component depends on the presence of many services in the platform.
The Media Manager component uses the name service to locate the other services it needs. The Media Manager also registers the media and video mixer service interfaces in the name service.
Like all platform components implementing public interfaces, the Media Manager is managed by the internal platform service. The Media Manager component registers with the platform service on startup when it has become fully initialized and ready to handle requests on its interfaces.
The Media Manager component relies heavily on the Streamer component to actually do something meaningful with the media streams. One streamer handles at most one media stream at a time.
The Media Manager component implements a callback interface which is used by streamers when they have started and are fully initialized and ready to handle requests from applications. This interface is used for communication between streamer and media manager only.
The Media Manager manages one instance of the Streamer for each media player requested by the applications. The streamers are separate processes and the Media Manager component uses the internal process service to keep track of all the details regarding these child processes. The process service notifies the Media Manager immediately if a streamer process exits for some reason.
The Media Manager component relies on events from the application service to handle its limited resources. The media manager has to be constantly updated about which application is in front so it can assign each resource to the application which has the most use for it.
If a streamer exits unexpectedly, the Media Manager reports an instance failure to the application service, identifying the application associated with the streamer that failed. The application service will stop the application and notify the platform components about this event. When the Media Manager eventually receives this message, it will remove the reference to the application and kill all its streamers that might remain. Note that the Media Manager always makes the assumption that the application shares state with its streamers, and therefore maintains a strict association between application and its streamers. If any of them fails, all of them have to go. With this behaviour, applications can assume that their media player instances are available and working at all times, and they do not have to worry about elaborate schemes for recovering from a crashed media player instance.
The Media Manager component is a platform component which implements interfaces exported through the TOI. As such it has to follow the general rules for all exposed components. TODO! Write these rules.
The Media Manager component is started with one mandatory argument which specifies the command string the Media Manager must use when creating new streamer instances. Assuming the streamer executable is found in /usr/bin with the name streamer the following example should be valid.
mediamanager /usr/bin/streamer
The Media Manager component requires the name service to be running and accessible when it starts. Furthermore, the following services must be registered with the name service:
This implies that the components implementing the services listed above has to be started prior to starting the Media Manager component.
On startup, the Media Manager component always starts a streamer before it registers with the platform service. As a consequence, the platform service will not be able to start the Media Manager component if the Media Manager cannot start streamers. This could be the case if the platform is incorrectly configured.