Re: [PATCH 2/3] tests: added a small test program for local-metadata
- From: Iago Toral <itoral igalia com>
- To: <grilo-list gnome org>
- Subject: Re: [PATCH 2/3] tests: added a small test program for local-metadata
- Date: Thu, 27 Jan 2011 08:17:44 +0000
On Wed, 26 Jan 2011 19:32:27 +0100, Guillaume Emont <gemont igalia com>
wrote:
(...)
+static GrlMedia *
+make_grl_image (const gchar *path)
+{
+ GFile *file;
+ GrlMedia *media;
+ gchar *full_path, *uri;
+
+
+ file = g_file_new_for_path (path);
+
+ media = grl_media_image_new ();
+
+ full_path = g_file_get_path (file);
+ grl_media_set_id (media, full_path);
+ g_free (full_path);
+
+ uri = g_file_get_uri (file);
+ grl_media_set_url (media, uri);
+ g_free (uri);
+
+ return media;
+}
Not that it is very important, but just in case you missed it, you
could've used this instead for creating the media object:
GrlMedia *
grl_media_source_get_media_from_uri_sync (GrlMediaSource *source,
const gchar *uri,
const GList *keys,
GrlMetadataResolutionFlags
flags,
GError **error)
basically, it does the same thing without you having to set the media
id directly in the GrlMedia in the client code.
Iago
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]