[PATCH 1/1] [fake-metadata] support resolve_async



Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez igalia com>
---
 src/fake-metadata/grl-fake-metadata.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/fake-metadata/grl-fake-metadata.c b/src/fake-metadata/grl-fake-metadata.c
index 25e0e17..f4366da 100644
--- a/src/fake-metadata/grl-fake-metadata.c
+++ b/src/fake-metadata/grl-fake-metadata.c
@@ -49,6 +49,11 @@ static GrlFakeMetadataSource *grl_fake_metadata_source_new (void);
 static void grl_fake_metadata_source_resolve (GrlMetadataSource *source,
                                               GrlMetadataSourceResolveSpec *rs);
 
+static void grl_fake_metadata_source_resolve_async (GrlMetadataSource *source,
+                                                    const GList *keys,
+                                                    GrlMedia *media,
+                                                    GrlMetadataResolutionFlags flags);
+
 static void grl_fake_metadata_source_set_metadata (GrlMetadataSource *source,
 						   GrlMetadataSourceSetMetadataSpec *sms);
 
@@ -109,6 +114,7 @@ grl_fake_metadata_source_class_init (GrlFakeMetadataSourceClass * klass)
   metadata_class->supported_keys = grl_fake_metadata_source_supported_keys;
   metadata_class->key_depends = grl_fake_metadata_source_key_depends;
   metadata_class->resolve = grl_fake_metadata_source_resolve;
+  metadata_class->resolve_async = grl_fake_metadata_source_resolve_async;
   metadata_class->set_metadata = grl_fake_metadata_source_set_metadata;
   metadata_class->writable_keys = grl_fake_metadata_source_writable_keys;
 }
@@ -241,6 +247,24 @@ grl_fake_metadata_source_resolve (GrlMetadataSource *source,
 }
 
 static void
+grl_fake_metadata_source_resolve_async (GrlMetadataSource *source,
+                                        const GList *keys,
+                                        GrlMedia *media,
+                                        GrlMetadataResolutionFlags flags)
+{
+  g_debug (G_STRFUNC);
+
+  const GList *iter;
+
+  iter = keys;
+  while (iter) {
+    GrlKeyID key_id = POINTER_TO_GRLKEYID (iter->data);
+    fill_metadata (GRL_MEDIA (media), key_id);
+    iter = g_list_next (iter);
+  }
+}
+
+static void
 grl_fake_metadata_source_set_metadata (GrlMetadataSource *source,
 				       GrlMetadataSourceSetMetadataSpec *sms)
 {
-- 
1.7.0



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