Grilo Plugins and Ampache.

Hi, Last year as a GSoC intern, we implemented A Music player called Music for the GNOME Desktop Environment.
In this years GSoC, I am trying to extend Music to play music from remote resources such as Ampache, Owncloud and the like. In this blog I’ll try to explain how different sources work in Music and how I am trying to implement the Ampache Source. My mentor for this project is Vadim Rutkovsky. I am working with Arnel A. Borja (my fellow GSoC intern) who is mainly focusing on search.

Music uses Grilo to help users stream music from different sources. Grilo is a framework which provides us with plugin support which helps us to display consolidated media content from different sources in our application. And to implement a new source for the application, we just need to create a new grilo plugin. This ensures that the application code remains same even when new sources are added. For instance, the media from Jamendo and Magnatune that we see in Music is because of their corresponding Grilo plugins. So, the Ampache source I am trying to implement will be a Grilo plugin.

Search output from Jamendo source in Music

Ampache is a web based media streaming server and file manager which helps us to access our music & videos from anywhere, using almost any internet enabled device. Ampache provides us with an XML based API for integration with external web based or desktop applications for streaming media. It provides the output in xml format which needs to be parsed to generate the appropriate media content.

When the project started, we thought of implementing the plugin in Lua, since Grilo has a plugin called Lua Factory which basically tries to simplify all plugin implementations by reducing the boilerplate code necessary if the plugin was implemented in C. But implementing in Lua needed including some external libraries for processing xml and since the libraries could fail to install without any warning, using Lua was not acceptable to us. We finally decided to write the plugin in C. I’ve tried to get some understanding of the Grilo plugins by reading the documentation and source code of plugins that were already written. I had to brush up C which I learnt during first year in college and got myself familiar with Gobject and Gtype systems since they were important in understanding the object oriented and design decisions since the past few days. I’ve started implementing the plugin and I will write extensively about what I learnt in my next blog post.