Re: [PATCH 0/6] Serialize and unserialize Medias to strings
- From: "Juan A. Suarez Romero" <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: Re: [PATCH 0/6] Serialize and unserialize Medias to strings
- Date: Tue, 01 Jun 2010 13:07:42 +0200
On Fri, 2010-05-28 at 10:50 +0200, Juan A. Suarez Romero wrote:
> This set of patches adds a new feature to GrlMedia:
>
> * grl_media_serialize()
> * grl_media_unserialize()
>
Finally I've merged this new feature in master.
These are the changes I did after some comments:
- Added a new function, grl_plugin_registry_get_metadata_keys()
function, which returns a list with all registered keys in registry.
- grl_media_serialize() is a wrapper over
grl_media_serialize_extended(), performing a basic serialization.
- grl_media_serialize_extended() now uses a GrlMediaSerializeType to
specify how to perform the serialization.
Right now there are 3 approaches:
- GRL_MEDIA_SERIALIZE_BASIC: it is the old way
grl_media_serialize(media, FALSE). It uses only "id" and "source" to
perform serialization, getting rid of remaining keys.
- GRL_MEDIA_SERIALIZE_FULL: it is the old way grl_media_serialize(media,
TRUE). It uses all available keys to perform serialization.
- GRL_MEDIA_SERIALIZE_PARTIAL: it uses "id", "source", and a list of
user-specified keys to perform serialization. Remaining keys are
ignored.
When using GRL_MEDIA_SERIALIZE_PARTIAL, a third parameter is required, a
GList with the keys to take in account. E.g.:
GList *keylist = grl_metadata_key_list_new (GRL_METADATA_KEY_TITLE,
GRL_METADATA_KEY_URL, NULL);
gchar *serial = grl_media_serialize (media,
GRL_MEDIA_SERIALIZE_PARTIAL, keylist);
g_list_free (keylist);
J.A.
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]