By Juan A. Suárez Romero.
Grilo makes it easier for application developers to access online multimedia content from many different sources, removing the need to implement an interface to each content source type.Grilo is a framework that provides:
- A single, high-level API that abstracts the differences between various media content providers
- A collection of plugins that implement the access to various media providers
- A flexible API to write more plugins. Developers can share efforts and code by writing plugins for the framework that are application agnostic
This talk is targeted at developers with an interest in multimedia and in retrieving remote and local content homogeneously. Attendees can expect to learn what is Grilo and how it can be used and extended. The presentation aims to be useful to the community by allowing developers to join forces in the work needed to access remote multimedia content.
How to Troubleshoot Apps for the Modern Connected Worker
Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)
1. Grilo: Easy Access to Online Multimedia Content
LinuxCon Europe 2012, Barcelona
Juan A. Suarez Romero <jasuarez@igalia.com>
2. Grilo: Easy Access to Online Multimedia Content
Introduction
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
3. About me
Juan A. Suárez Romero
Computer engineer, Coruña University
Working at Igalia since 2007
Experience in multimedia
Involved in Maemo and MeeGo
Co-author of MAFW
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
4. Outline
1 Current problems
2 Grilo
3 Conclusions
4 Thank you!
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
5. Grilo: Easy Access to Online Multimedia Content
Current problems
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
6. Many sources of content
Online/offline sources
Different protocol/API
Sources that do not
provide content
(meta-information)
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
7. Many different devices
Different screen sizes
Different hardware
components
Different platforms
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
8. Current approach
Develop one application per service
Each application with different UX
Not easily scalable: new sources require new applications
Expensive maintenance
In some cases, one application attending more than one
service
Services of the same type (e.g., Photo storage service)
Define a common layer between application and the service
Not shared effort! Reinventing the wheel all time
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
9. What we need?
Stop reinventing the wheel!
Platform-level solution for accessing multimedia content
Provide homogeneous access to all content
Scalable with new sources of information
Collaboration!
Consistent user experience
Users care about the content, not the provider
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
10. Grilo: Easy Access to Online Multimedia Content
Grilo
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
11. What is Grilo?
Framework focused on making discovery and browsing
easy for application developers
A single, high-level API for all the sources
A collection plugins that provides access to the sources
An extendable system to provide more plugins
http://live.gnome.org/Grilo
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
12. Architecture overview
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
13. Media types and Keys
Collection of keys and
values
Several keys provided by
core: title, URL, author, . . .
Plugins can extend them
with new keys
Support for multiple
values
Support for relations
between keys
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
14. Plugins and Sources
Key component of the
system
Plugins are dynamically
loaded by core
Plugins create one or more
sources
Sources support multiple
operations
Browse, Search, Store,
Remove, . . .
All operations are optional
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
15. Plugins and Sources
Sources perform two main
roles:
Provide new media
content
Enrich already existent
media content
Sources collaborate among
them to solve the requests
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
16. Example of collaboration
Developer wants to show content from UPnP server and
play it
They need the url to play, a title and a thumbnail to show
1 Perform the request through core API
2 Core checks if the requested keys are supported by the
source
thumbnail is not supported by UPnP source
3 Checks which sources are able to resolve thumbnail key
CoverArt source is able to
But it requires to know two keys: artist and album
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
17. Example of collaboration
4 Core checks if those required keys are supported by
original UPnP source
If not, repeat the process as in the case of thumbnail
5 Perform the request in the UPnP source with the keys
requested plus the new keys
6 When the results arrive, send them to CoverArt source to
include the thumbnail
7 Send the final results to application
Developer only needs to deal with one provider
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
18. Implementing applications
Main language is C
Other languages supported through gobject introspection
(Python, Javascript, Vala, . . . )
Support for C++ (grilomm)
Some initial support for Qt/QML
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
19. Code example
1 # ! / usr / bin / python
2
3 import sys
4 from g i . r e p o s i t o r y import Grl
5
6 def main ( argv ) :
7 i f l e n ( argv ) < 1 :
8 p r i n t " Usage : m a k e _ l i s t . py < s e a r c h _ t e x t > "
9 return 1
10
11 Grl . i n i t ( [ ] )
12 r e g i s t r y = Grl . R e g i s t r y . g e t _ d e f a u l t ( )
13 registry . load_all_plugins ( )
14 keys = [ Grl .METADATA_KEY_DURATION,
15 Grl . METADATA_KEY_TITLE,
16 Grl .METADATA_KEY_URL]
17 o p t i o n s = Grl . OperationOptions . new ( None )
18 options . set_count ( 2 0 0 ) ;
19 r e s u l t s = Grl . m u l t i p l e _ s e a r c h _ s y n c ( None , argv [ 0 ] , keys , o p t i o n s )
20
21 p r i n t " #EXT3MU"
22 f o r media in r e s u l t s :
23 i f i s i n s t a n c e ( media , Grl . MediaAudio ) :
24 p r i n t " #EXT3INF : " + s t r ( media . g e t _ d u r a t i o n ( ) ) + " , " + media . g e t _ t i t l e ( )
25 p r i n t media . g e t _ u r l ( )
26
27 i f __name__ == " __main__ " :
28 main ( sys . argv [ 1 : ] )
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
20. Implementing plugins
Plugins must be written in C
Adding support for writing plugins declaratively (in XML)
Adding support for other languages (Lua)
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
21. Grilo: Easy Access to Online Multimedia Content
Conclusions
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
22. Resources
Wiki
http://live.gnome.org/Grilo
Source code
http://git.gnome.org/browse/grilo
http://git.gnome.org/browse/grilo-plugins
http://git.gnome.org/browse/grilomm
IRC
#grilo at irc.gnome.org
Mailing list
http://mail.gnome.org/mailman/listinfo/
grilo-list
Do not miss our booth in ground floor (in front of Rossini
room)
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
23. Grilo: Easy Access to Online Multimedia Content
Thank you!
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona
24. Images used in this presentation
Hard Disk Icon by Mazenl77 (CC Attribution)
http://www.iconspedia.com/icon/hard-disk-1600.html
Memory Card Icon by Custom Icon Design Studio
http://www.gettyicons.com/free-icon/103/
pretty-office-2-icon-set/free-memory-card-icon-png
Vimeo, Flickr, Jamendo, YouTube and UpnP logos under copyright of their own
brands
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona