grilo: easy access to online multimedia content (linuxcon europe 2012)

24
Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona Juan A. Suarez Romero <[email protected]>

Upload: igalia

Post on 11-Nov-2014

946 views

Category:

Technology


2 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Grilo: Easy Access to Online Multimedia Content

LinuxCon Europe 2012, Barcelona

Juan A. Suarez Romero <[email protected]>

Page 2: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Grilo: Easy Access to Online Multimedia Content

Introduction

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 3: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

About me

Juan A. Suárez RomeroComputer engineer, Coruña UniversityWorking at Igalia since 2007Experience in multimediaInvolved in Maemo and MeeGoCo-author of MAFW

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 4: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Outline

1 Current problems

2 Grilo

3 Conclusions

4 Thank you!

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 5: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Grilo: Easy Access to Online Multimedia Content

Current problems

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 6: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Many sources of content

Online/offline sourcesDifferent protocol/APISources that do notprovide content(meta-information)

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 7: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Many different devices

Different screen sizesDifferent hardwarecomponentsDifferent platforms

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 8: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Current approach

Develop one application per serviceEach application with different UXNot easily scalable: new sources require new applicationsExpensive maintenance

In some cases, one application attending more than oneservice

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

Page 9: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

What we need?

Stop reinventing the wheel!

Platform-level solution for accessing multimedia contentProvide homogeneous access to all contentScalable with new sources of informationCollaboration!Consistent user experience

Users care about the content, not the provider

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 10: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Grilo: Easy Access to Online Multimedia Content

Grilo

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 11: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

What is Grilo?

Framework focused on making discovery and browsingeasy for application developers

A single, high-level API for all the sourcesA collection plugins that provides access to the sourcesAn extendable system to provide more plugins

http://live.gnome.org/Grilo

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 12: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Architecture overview

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 13: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Media types and Keys

Collection of keys andvaluesSeveral keys provided bycore: title, URL, author, . . .

Plugins can extend themwith new keys

Support for multiplevaluesSupport for relationsbetween keys

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 14: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Plugins and Sources

Key component of thesystemPlugins are dynamicallyloaded by corePlugins create one or moresourcesSources support multipleoperations

Browse, Search, Store,Remove, . . .

All operations are optional

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 15: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Plugins and Sources

Sources perform two mainroles:

Provide new mediacontentEnrich already existentmedia content

Sources collaborate amongthem to solve the requests

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 16: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Example of collaboration

Developer wants to show content from UPnP server andplay itThey need the url to play, a title and a thumbnail to show

1 Perform the request through core API2 Core checks if the requested keys are supported by the

sourcethumbnail is not supported by UPnP source

3 Checks which sources are able to resolve thumbnail keyCoverArt source is able toBut it requires to know two keys: artist and album

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 17: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Example of collaboration

4 Core checks if those required keys are supported byoriginal UPnP source

If not, repeat the process as in the case of thumbnail5 Perform the request in the UPnP source with the keys

requested plus the new keys6 When the results arrive, send them to CoverArt source to

include the thumbnail7 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

Page 18: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Implementing applications

Main language is COther 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

Page 19: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Code example

1 # ! / usr / b i n / python23 import sys4 from gi . r e p o s i t o r y import Grl56 def main ( argv ) :7 i f len ( argv ) < 1 :8 print " Usage : make_l is t . py <se arc h_ te x t >"9 return 1

1011 Grl . i n i t ( [ ] )12 r e g i s t r y = Grl . Reg is t ry . g e t _ d e f a u l t ( )13 r e g i s t r y . l o a d _ a l l _ p l u g i n s ( )14 keys = [ Grl .METADATA_KEY_DURATION,15 Grl . METADATA_KEY_TITLE,16 Grl .METADATA_KEY_URL]17 opt ions = Grl . OperationOptions . new( None)18 opt ions . se t_count ( 2 0 0 ) ;19 r e s u l t s = Grl . mult iple_search_sync ( None , argv [ 0 ] , keys , opt ions )2021 print " #EXT3MU"22 for 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 print " #EXT3INF : " + s t r ( media . get_durat ion ( ) ) + " , " + media . g e t _ t i t l e ( )25 print media . g e t _ u r l ( )2627 i f __name__ == " __main__ " :28 main ( sys . argv [ 1 : ] )

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 20: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Implementing plugins

Plugins must be written in CAdding support for writing plugins declaratively (in XML)Adding support for other languages (Lua)

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 21: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Grilo: Easy Access to Online Multimedia Content

Conclusions

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 22: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Resources

Wikihttp://live.gnome.org/Grilo

Source codehttp://git.gnome.org/browse/grilohttp://git.gnome.org/browse/grilo-pluginshttp://git.gnome.org/browse/grilomm

IRC#grilo at irc.gnome.org

Mailing listhttp://mail.gnome.org/mailman/listinfo/grilo-list

Do not miss our booth in ground floor (in front of Rossiniroom)

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 23: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

Grilo: Easy Access to Online Multimedia Content

Thank you!

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona

Page 24: Grilo: Easy Access to Online Multimedia Content (LinuxCon Europe 2012)

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 Studiohttp://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 ownbrands

Grilo: Easy Access to Online Multimedia Content LinuxCon Europe 2012, Barcelona