Transcript
Page 1: Writing multimedia applications with Grilo (GUADEC 2013)

static void_g_digicam_manager_class_init (GDigicamManagerClass

*klass){

GObjectClass *object_class = (GObjectClass*) klass;

g_assert (G_DIGICAM_IS_MANAGER_CLASS (klass));

parent_class = g_type_class_peek_parent (klass);

g_type_class_add_private (klass, sizeof (GDigicamManagerPrivate));

/* Override virtual functions */ object_class->finalize = _g_digicam_manager_finalize;

/** * GDigicamManager::focus-done:

* @manager: the gdigicam manager

Juan A. Suárez [email protected]

Writing multimedia applications with Grilo

Page 2: Writing multimedia applications with Grilo (GUADEC 2013)

Opening

Page 3: Writing multimedia applications with Grilo (GUADEC 2013)

Sources

Page 4: Writing multimedia applications with Grilo (GUADEC 2013)

Sources

Page 5: Writing multimedia applications with Grilo (GUADEC 2013)

Grilo

● Framework focused on making discovery and browsing easy for application developers● A single, high-level API for all the sources

● Plugins● Provides access to multimedia content● Extendable

Page 6: Writing multimedia applications with Grilo (GUADEC 2013)

Grilo

SOURCESOURCESOURCE

SOURCESOURCEMEDIASOURCESOURCE

METADATAKEYS

crea

tes

contains

provides

YoutubeJamendoFlickrIMDB...

AudioVideoImage...

TitleArtistAlbum...

Page 7: Writing multimedia applications with Grilo (GUADEC 2013)

Totem

Page 8: Writing multimedia applications with Grilo (GUADEC 2013)

Totem

Page 9: Writing multimedia applications with Grilo (GUADEC 2013)

Requirements

● Define what we need● Type of content

– Any kind?– Only video? Music?

● Metadata keys– URL– Title– Thumbnail– ... 55 metadata keys

Page 10: Writing multimedia applications with Grilo (GUADEC 2013)

Content to show

● Ignore any source that does not provide Videos● In “browse” view, ignore any source that does

not support browsing● In “search” view, ignore any source that does

not support searching

Page 11: Writing multimedia applications with Grilo (GUADEC 2013)

Information to show

- Title- Author- Duration- Thumbnail- URL

- Title- Author- Duration- Thumbnail- URL

Browse Search

Page 12: Writing multimedia applications with Grilo (GUADEC 2013)

Invoke Grilo

- Title- Author- Duration- Thumbnail- URL

- Title- Author- Duration- Thumbnail- URL

Browse Search

Page 13: Writing multimedia applications with Grilo (GUADEC 2013)

Problems

● Two problems to solve● Source not handling some keys● Too much expensive to retrieve some keys

Page 14: Writing multimedia applications with Grilo (GUADEC 2013)

Totem

● Flags to control content retrieval● Normal: provides the known requested content

– GRL_RESOLVE_NORMAL● Fast only: provides the known requested content

that does not penalize the operation in terms of performance– GRL_RESOLVE_FAST_ONLY

● Full: provides the known requested content using all the available sources– GRL_RESOLVE_FULL

Page 15: Writing multimedia applications with Grilo (GUADEC 2013)

Reduce the problems

● Request content in chunks● Request fast only in first iteration● While current chunk is visible

● Ask for each visible media element the discarded keys (using full flag)

● URL key case: slow key and not shown in the UI● Request it when user wants to play

Page 16: Writing multimedia applications with Grilo (GUADEC 2013)

GNOME Music

Page 17: Writing multimedia applications with Grilo (GUADEC 2013)

GNOME MusicCover Art

Page 18: Writing multimedia applications with Grilo (GUADEC 2013)

GNOME Music

● Music defines its own structure

● Grilo's one is different● Does not have concept of “Artist” or “Album”

● They are “boxes”

● Needs to sort the results

Page 19: Writing multimedia applications with Grilo (GUADEC 2013)

GNOME Music

Page 20: Writing multimedia applications with Grilo (GUADEC 2013)

Approaches

● Request content from Tracker directly● Create Grilo Media elements to add missing information

(Cover Art)

● Instruct Grilo's Tracker plugin how to construct the medias

● Use query() function● Very specific to the plugin● In case of Tracker plugin, use SPARQL to make the query

– First column is the media to build– Use alias to map each SPARQL column to specific metadata keys

Page 21: Writing multimedia applications with Grilo (GUADEC 2013)

Closing

Page 22: Writing multimedia applications with Grilo (GUADEC 2013)

Other use-cases

● Application to upload audio/video content to web services● store() function

● Mediaplayer with auto-resume● “playback-interrupted-time” key● store_metadata() function

– Metadata Store source handles it

Page 23: Writing multimedia applications with Grilo (GUADEC 2013)

Show me a code

Page 24: Writing multimedia applications with Grilo (GUADEC 2013)

Resources

● Wiki● http://live.gnome.org/Grilo

● Source code● git://git.gnome.org/grilo● git://git.gnome.org/grilo-plugins

● IRC● #grilo at irc.gnome.org

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


Recommended