Creating a renderer

Definition

A renderer is an element capable of playing media elements and playlists of media elements.

As in the case of MAFW sources, in order to create a renderer plugin a shared library should be implemented, as well as a module initializer and a GObject inheriting from MafwRenderer. An example would be very similar to the Mafw source's one.

Of course, the methods that have to be redefined are the ones defined at MafwRenderer, and again, the developer may choose not to provide an implementation for some of them. The MafwRenderer class defines many methods that can be classified like this:

  • Playback: Those used to control playback (play, stop, pause, resume, volume, etc)

  • Playlist management: Those used to assign a playlist to the renderer and manipulate it.

  • Status: Used to query the status of the renderer, like its current playback state or selected media.

  • Position: Used to query the current playback position or set it (seeking).

Signals

Renderers also define some signals that should be taken into account, such as:

  • "playlist-changed", which should be emitted when a new playlist is assigned to the renderer.
  • "media-changed", which should be emitted when new media is selected in the renderer.
  • "state-changed", which should be emitted when the renderer changes from on state to another.
  • "buffering-info", which should be emitted to inform about the buffering progress when playing streams.
  • "metadata-changed", which should be emitted when the renderer obtains metadata information from the currently selected media.