read

Some weeks ago, Maemo 5 Beta 2 SDK was announced. Eleven weeks passed since the first version. During this time, we have been working hard in MAFW, the multimedia framework that comes in Maemo 5. Most of the work we did consisted of bugfixing and improving the framework, while keeping as much as possible the current API.

What are the main differences in MAFW between Beta 1 and Beta 2? Basically bugfixes and improvements, but other changes happened too. Let’s summarize the changes in the new versions of mafw, mafw-shared, mafw-tracker-source, mafw-upnp-source, mafw-iradio-source, mafw-gst-renderer and mafw-test-gui:

  • Volume is now managed through PulseAudio.

  • The uPnP source now can handle uPnP servers with transcoding support (like Rygel). Thus, mafw-upnp-source is able to provide all the links from a specific uPnP item, and mafw-gst-renderer will use the link that can be played.

  • Added new metadata keys.

  • Added new error codes.

  • Added a new function to get the current media’s object ID and its metadata from the renderer (mafw_renderer_get_current_metadata). So far, the way to get metadata from an object ID was through the source’s API. But sometimes renderers are able to find new information while they are playing. An example is when playing an internet stream. This information was sent at the same time it was discovered, but now this new function allows to query it at any moment.

  • Added a new function to get metadata from several media’s object ID at the same time (mafw_source_get_metadatas). In previous releases, mafw_source_get_metadata function was provided to get metadata from a single object ID; if several metadatas for several objects were needed, we had to invoke mafw_source_get_metadata several times. As it is quite common trying to get metadata from several object IDs, we have added a new function that works like mafw_source_get_metadata, but allows to specify several objects instead just one.

  • Sources can now notify clients when they are updating. Imagine that suddenly, thousands of multimedia clips are available. Sources can take a while until all this clips are available to be used (for example, after copying them). In our case, mafw-tracker-source uses tracker to index all the clips, and tracker could take a while to index all the new clips. How a source can notify the client that it is updating its content (or specifically in the case of mafw-tracker-source, that tracker is indexing the new elements)? We have added a new signal to sources, updating, that it is used to notify when the source is updating. It does it by telling the percentage of completeness, how may elements has been processed, how many items remain to be processed, and the estimated time to finish the update. Besides this new signal, a new function has been provided, mafw_source_get_update_progress, which can be used to ask at any moment if a source is updating. All these new functions are meant to those sources that can take some time to update their content; therefore, not all sources uses this signal (right now, only mafw-tracker-source use it).

  • Extended MAFW_METADATA_KEY_CHILDCOUNT. This is, perhaps the only break in the API. Browsing in MAFW sources is thought to be hierarchical. In the case of mafw-tracker-source, for example, below Music category are Playlists, Songs, Genres, Artists and Albums. When entering in Genres category, a list of all available genres are shown. At the same time, browsing through one of the genres, the list of all artists for that genre are obtained. Following one of those artists, we would get the list of albums for that artist and genre. And finally, browsing through a specific genre, artist and album, the list of all clips for that genre, artist and album will be obtained. MAFW_METADATA_KEY_CHILDCOUNT listed the number of elements in a branch. For example, the value of this key for the Genres category was the number of available genres, while the value for a specific genre was the number of artists in that genre, and its value for an artist got the number of albums for that artist in that genre. But how to get the number of albums of a specific genre? So far, it was not possible to do it in a direct way, and workarounds were needed. But we changed this childcount key, so it now uses a parameter to tell at which level are we interested. Thus, for example, when requesting metadata from a specific genre, MAFW_METADATA_KEY_CHILDCOUNT_1 is the number of artists in that genre, MAFW_METADATA_KEY_CHILDCOUNT_2 is the number of albums in that genre, and MAFW_METADATA_KEY_CHILDCOUNT_3 is the number of clips in that genre. Up to 9 levels are provided in MAFW, but the user can use the macro MAFW_METADATA_KEY_CHILDCOUNT to build the level she wants. Of course, it’s up to the source to be able to resolve the value for that level. It’s worth to mention that this is a compatibility breakage, as in previous versions MAFW_METADATA_KEY_CHILDCOUNT was a proper metadata key, but now it’s a macro to build new keys. Therefore, applications based in previous MAFW releases that were using this key must update to use the equivalent one, MAFW_METADATA_KEY_CHILDCOUNT_1.

As it can be seen, few changes happened, and most of the work was targeted to fix bugs and to improve the framework. We tried to keep the same functionality as possible. This helps people trying to implement their own player, providing a stable platform were to develop. So give it a try and implement your own player or utility for Maemo 5!

Blog Logo

Juan A. Suárez


Published

Image

Words from the Inside

Uninteresting things from an uninteresting developer

Back to Overview