Re: media_from_site API



On Fri, 2010-12-03 at 10:27 +0000, Iago Toral wrote:
> 
>  we got a feature request to add the possibility of querying a source
> to 
>  provide the media representing a certain web url, for example, the 
>  GrlMEdia representing this media:
>  http://www.youtube.com/watch?v=UMCGeP-LVKs
> 
>  Use case would be any app that deals with web content, could be a
> web 
>  browser or a plugin for a web browser for example. When it is
> playing 
>  back media from a site supported in grilo (like Youtube), it could
> use 
>  this feature to get a GrlMedia object from that web uri, and then
> use 
>  that GrlMedia to do fancy stuff, like for example, in the case of
> the 
>  web browser, opening the media in an external media player.
> 
>  Although the requester is already using another library to get this 
>  done, I think the feature makes sense in Grilo and would interesting
> to 
>  have support for that in the framework. 


Sorry for being late. I know you have already proposed an
implementation, so forget about this if you think it isn't worth.


When I saw this feature request, I was thinking about a way of doing it
more generic.

So my idea was to have a function similar to grl_media_source_metadata()
to do it.

The API for the proposed function would be

guint
grl_multiple_source_inverse_metadata (const GList *sources,
                                 GrlKeyID *field,
                                 GValue *value,
                                 const GList *keys,
                                 GrlMetadataResolutionFlags flags,
                                 GrlMediaSourceMetadataCb callback,
                                 gpointer user_data);


So for the case of youtube, you'd use GRL_METADATA_KEY_SITE as field and
the appropriate value. And it would return in the callback the GrlMedia
already filled with the requested keys.

Each source would register which keys they support for inverse
resolution.

This would allow for future extensions if plugins can resolve medias by
other fields besides the site url.


	J.A.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]