Writing multimedia applications with Grilo

Embed Size (px)

Citation preview

Writing multimedia applications with Grilo

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. Surez [email protected]

Writing multimedia applications with Grilo

Opening

Sources

Sources

Grilo

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

PluginsProvides access to multimedia content

Extendable

Grilo

SOURCESOURCESOURCESOURCESOURCEMEDIASOURCESOURCEMETADATAKEYS

creates

contains

provides

YoutubeJamendoFlickrIMDB...

AudioVideoImage...

TitleArtistAlbum...

Totem

Totem

Requirements

Define what we needType of contentAny kind?

Only video? Music?

Metadata keysURL

Title

Thumbnail

... 55 metadata keys

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

Information to show

- Title- Author- Duration- Thumbnail- URL- Title- Author- Duration- Thumbnail- URLBrowseSearch

Invoke Grilo

- Title- Author- Duration- Thumbnail- URL- Title- Author- Duration- Thumbnail- URLBrowseSearch

Problems

Two problems to solveSource not handling some keys

Too much expensive to retrieve some keys

Totem

Flags to control content retrievalNormal: provides the known requested contentGRL_RESOLVE_NORMAL

Fast only: provides the known requested content that does not penalize the operation in terms of performanceGRL_RESOLVE_FAST_ONLY

Full: provides the known requested content using all the available sourcesGRL_RESOLVE_FULL

Reduce the problems

Request content in chunks

Request fast only in first iteration

While current chunk is visibleAsk for each visible media element the discarded keys (using full flag)

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

GNOME Music

GNOME Music

Cover Art

GNOME Music

Music defines its own structure

Grilo's one is different

Does not have concept of Artist or AlbumThey are boxes

Needs to sort the results

GNOME Music

Approaches

Request content from Tracker directlyCreate Grilo Media elements to add missing information (Cover Art)

Instruct Grilo's Tracker plugin how to construct the mediasUse query() function

Very specific to the plugin

In case of Tracker plugin, use SPARQL to make the queryFirst column is the media to build

Use alias to map each SPARQL column to specific metadata keys

GNOME Photos

Tracker

MinerMinerMinerGrilo-basedMiner

hello

Closing

Other use-cases

Application to upload audio/video content to web servicesstore() function

Mediaplayer with auto-resumeplayback-interrupted-time key

store_metadata() functionMetadata Store source handles it

Show me a code

Resources

Wikihttp://live.gnome.org/Grilo

Source codegit://git.gnome.org/grilo

git://git.gnome.org/grilo-plugins

IRC#grilo at irc.gnome.org

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