diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2014-12-26 22:47:00 +0000 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2014-12-26 22:47:00 +0000 |
commit | 75b81e54d1e9831a92e846dc043975361c63ac4c (patch) | |
tree | cf251df83d69a044892dc96a39c92dca9891ca67 | |
parent | 70f1bcc450407f8373d8690ea9c674bdff9c2741 (diff) | |
parent | f515694d75aa1638bdf2125b21e068d1181e7dc1 (diff) | |
download | tracker-75b81e54d1e9831a92e846dc043975361c63ac4c.tar.gz |
Merge branch 'sam/functional-test-40x-fixes'
4 files changed, 33 insertions, 5 deletions
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c index a15967b7e..7d52e0b3c 100644 --- a/src/tracker-extract/tracker-extract-gstreamer.c +++ b/src/tracker-extract/tracker-extract-gstreamer.c @@ -1418,6 +1418,28 @@ discoverer_shutdown (MetadataExtractor *extractor) g_object_unref (extractor->discoverer); } +static gchar * +get_discoverer_required_plugins_message (GstDiscovererInfo *info) +{ + GString *str; + gchar **plugins; + gchar *plugins_str; + + plugins = (gchar **) + gst_discoverer_info_get_missing_elements_installer_details (info); + + if (g_strv_length((gchar **)plugins) == 0) { + str = g_string_new ("No information available on which plugin is required."); + } else { + str = g_string_new("Required plugins: "); + plugins_str = g_strjoinv (", ", (gchar **)plugins); + g_string_append (str, plugins_str); + g_free (plugins_str); + } + + return g_string_free (str, FALSE); +} + static gboolean discoverer_init_and_run (MetadataExtractor *extractor, const gchar *uri) @@ -1426,6 +1448,7 @@ discoverer_init_and_run (MetadataExtractor *extractor, const GstTagList *discoverer_tags; GError *error = NULL; GList *l; + gchar *required_plugins_message; extractor->duration = -1; extractor->audio_channels = -1; @@ -1467,8 +1490,15 @@ discoverer_init_and_run (MetadataExtractor *extractor, } if (error) { - g_warning ("Call to gst_discoverer_discover_uri() failed: %s", - error->message); + if (gst_discoverer_info_get_result(info) == GST_DISCOVERER_MISSING_PLUGINS) { + required_plugins_message = get_discoverer_required_plugins_message (info); + g_warning ("Missing a GStreamer plugin for %s. %s", uri, + required_plugins_message); + g_free (required_plugins_message); + } else { + g_warning ("Call to gst_discoverer_discover_uri() failed: %s", + error->message); + } gst_discoverer_info_unref (info); g_error_free (error); return FALSE; diff --git a/tests/functional-tests/common/utils/writebacktest.py b/tests/functional-tests/common/utils/writebacktest.py index ce6f2c7f4..801434aef 100644 --- a/tests/functional-tests/common/utils/writebacktest.py +++ b/tests/functional-tests/common/utils/writebacktest.py @@ -83,7 +83,7 @@ class CommonTrackerWritebackTest (ut.TestCase): # tracker-extract. The extractor adds nie:contentCreated for # image resources, so know once this property is set the # extraction is complete. - self.system.store.await_resource_inserted('nfo:Image', url=url, required_property='nie:contentCreated') + self.system.store.await_resource_inserted('nfo:Image', url=url, required_property='nfo:width') await_resource_extraction (self.get_test_filename_jpeg()) await_resource_extraction (self.get_test_filename_tiff()) diff --git a/tests/functional-tests/test-extraction-data/images/roi.expected b/tests/functional-tests/test-extraction-data/images/roi.expected index 65d1331be..7f8d879d8 100644 --- a/tests/functional-tests/test-extraction-data/images/roi.expected +++ b/tests/functional-tests/test-extraction-data/images/roi.expected @@ -6,7 +6,6 @@ Comment=JPG with regions of interest in the XMP [Metadata] a=nfo:Image a=nmm:Photo -nie_title=roi nfo_hasRegionOfInterest=@URNUUID@ nfo_width=128 nfo_height=128 diff --git a/tests/functional-tests/test-extraction-data/images/roi2.expected b/tests/functional-tests/test-extraction-data/images/roi2.expected index c4e06c85f..52cf25233 100644 --- a/tests/functional-tests/test-extraction-data/images/roi2.expected +++ b/tests/functional-tests/test-extraction-data/images/roi2.expected @@ -7,7 +7,6 @@ ExpectedFailure= [Metadata] a=nfo:Image a=nmm:Photo -nie_title=roi2 nfo_hasRegionOfInterest=@URNUUID@ nfo_width=128 nfo_height=128 |