MAFW Manual |
---|
Renderers are used to control media playback, and they are designed so that any of them can play content from any source, and can be thought of as a GStreamer chain, although this might usually not be the actual case.
MafwRenderer is a subclass of MafwExtension, so, it inherits its semantics. Thus, renderers have name, uuid and plugin properties and support run-time properties too. This class is intended to be an abstract base class for any renderer and it provides various playback-related operations: mafw_renderer_play, mafw_renderer_stop, mafw_renderer_pause, mafw_renderer_resume, etc. that any application can use to control media playback in a particular renderer.
An application can assign a playlist to a renderer. When this is done, the renderer will take over the responsibility for managing it properly, saving some effort to the application developer. For example, the renderer can detect an "end of stream" situation and move automatically to the next item in the playlist, it can readjust automatically when the playlist is being edited, rewind the playlist automatically when the end of the playlist has been reached or even restart playback if the user has enabled the repeat mode in the playlist.
The application can also control playlist playback, commanding the renderer to move to any item in the playlist at any moment.
Whenever a relevant change happens in the renderer, it notifies the application about it, so it can react properly. For example, if a renderer stops playing it notifies about its state change, so that the application can enable and/or disable options according to this situation. Renderers must emit signals when their state, their playlist or the media they are ready to play change.
Renderers also emit signals to inform about buffering progress ("buffering-info") in the case of media streams, and metadata in the case the renderer is able to extract metadata from the media it is playing.