[tracker/wip/extract-graphs: 5/11] tracker-extract: Pass the graph down to extract modules



commit a44d6d63a06d10d745ecdb03e5a643334e93ae58
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 25 17:29:33 2011 +0200

    tracker-extract: Pass the graph down to extract modules
    
    The passed TrackerExtractInfo will now contain the graph that should
    be used for data modifications

 src/tracker-extract/tracker-controller.c |    6 ++++--
 src/tracker-extract/tracker-extract.c    |   11 ++++++++---
 src/tracker-extract/tracker-extract.h    |    1 +
 3 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/src/tracker-extract/tracker-controller.c b/src/tracker-extract/tracker-controller.c
index 20558a3..08d6266 100644
--- a/src/tracker-extract/tracker-controller.c
+++ b/src/tracker-extract/tracker-controller.c
@@ -500,7 +500,8 @@ handle_method_call_get_metadata (TrackerController     *controller,
 	request = tracker_dbus_request_begin (NULL, "%s (%s, %s)", __FUNCTION__, uri, mime);
 
 	data = metadata_data_new (controller, uri, mime, invocation, request);
-	tracker_extract_file (priv->extractor, uri, mime, data->cancellable,
+	tracker_extract_file (priv->extractor, uri, mime, graph,
+	                      data->cancellable,
 	                      get_metadata_cb, data);
 	priv->ongoing_tasks = g_list_prepend (priv->ongoing_tasks, data);
 }
@@ -691,7 +692,8 @@ handle_method_call_get_metadata_fast (TrackerController     *controller,
 			data = metadata_data_new (controller, uri, mime, invocation, request);
 			data->fd = fd;
 
-			tracker_extract_file (priv->extractor, uri, mime, data->cancellable,
+			tracker_extract_file (priv->extractor, uri, mime, graph,
+			                      data->cancellable,
 			                      get_metadata_fast_cb, data);
 			priv->ongoing_tasks = g_list_prepend (priv->ongoing_tasks, data);
 		} else {
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index f2c3ad5..1726bde 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -86,6 +86,7 @@ typedef struct {
 	GAsyncResult *res;
 	gchar *file;
 	gchar *mimetype;
+	gchar *graph;
 
 	TrackerMimetypeInfo *mimetype_handlers;
 
@@ -290,7 +291,7 @@ get_file_metadata (TrackerExtractTask  *task,
 	*info_out = NULL;
 
 	file = g_file_new_for_uri (task->file);
-	info = tracker_extract_info_new (file, task->mimetype, NULL);
+	info = tracker_extract_info_new (file, task->mimetype, task->graph);
 	g_object_unref (file);
 
 #ifdef HAVE_LIBSTREAMANALYZER
@@ -391,6 +392,7 @@ static TrackerExtractTask *
 extract_task_new (TrackerExtract *extract,
                   const gchar    *uri,
                   const gchar    *mimetype,
+                  const gchar    *graph,
                   GCancellable   *cancellable,
                   GAsyncResult   *res,
                   GError        **error)
@@ -426,6 +428,7 @@ extract_task_new (TrackerExtract *extract,
 	task->res = (res) ? g_object_ref (res) : NULL;
 	task->file = g_strdup (uri);
 	task->mimetype = g_strdup (mimetype);
+	task->graph = g_strdup (graph);
 	task->extract = extract;
 
 	if (task->cancellable) {
@@ -710,6 +713,7 @@ void
 tracker_extract_file (TrackerExtract      *extract,
                       const gchar         *file,
                       const gchar         *mimetype,
+                      const gchar         *graph,
                       GCancellable        *cancellable,
                       GAsyncReadyCallback  cb,
                       gpointer             user_data)
@@ -730,7 +734,8 @@ tracker_extract_file (TrackerExtract      *extract,
 
 	res = g_simple_async_result_new (G_OBJECT (extract), cb, user_data, NULL);
 
-	task = extract_task_new (extract, file, mimetype, cancellable, G_ASYNC_RESULT (res), &error);
+	task = extract_task_new (extract, file, mimetype, graph,
+	                         cancellable, G_ASYNC_RESULT (res), &error);
 
 	if (error) {
 		g_warning ("Could not get mimetype, %s", error->message);
@@ -761,7 +766,7 @@ tracker_extract_get_metadata_by_cmdline (TrackerExtract *object,
 
 	g_return_if_fail (uri != NULL);
 
-	task = extract_task_new (object, uri, mime, NULL, NULL, &error);
+	task = extract_task_new (object, uri, mime, NULL, NULL, NULL, &error);
 
 	if (error) {
 		g_printerr ("Extraction failed, %s\n", error->message);
diff --git a/src/tracker-extract/tracker-extract.h b/src/tracker-extract/tracker-extract.h
index 700702a..4bb39a9 100644
--- a/src/tracker-extract/tracker-extract.h
+++ b/src/tracker-extract/tracker-extract.h
@@ -56,6 +56,7 @@ TrackerExtract *tracker_extract_new                     (gboolean
 void            tracker_extract_file                    (TrackerExtract         *extract,
                                                          const gchar            *file,
                                                          const gchar            *mimetype,
+                                                         const gchar            *graph,
                                                          GCancellable           *cancellable,
                                                          GAsyncReadyCallback     cb,
                                                          gpointer                user_data);



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