summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2017-11-08 10:38:57 -0300
committerThibault Saunier <tsaunier@gnome.org>2019-03-07 20:59:29 +0000
commit54920276b0b9cfc10c083fcf4708901a2395e1a7 (patch)
treef69f2507700d844fc01eac9d333198a7c4000a08 /tools
parent6a8c15f3bdc7077b1e5954580c25f99e1b112ead (diff)
downloadgstreamer-plugins-base-54920276b0b9cfc10c083fcf4708901a2395e1a7.tar.gz
discoverer: Implement GstDiscovererInfo caching
This uses the gst_discoverer_info_from/to_variant API and saves the variants on disc (in the user data cache dir) allowing much faster retrieval of the information after the cache has been built. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/398
Diffstat (limited to 'tools')
-rw-r--r--tools/gst-discoverer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c
index c794324a6..106ec99c6 100644
--- a/tools/gst-discoverer.c
+++ b/tools/gst-discoverer.c
@@ -582,9 +582,12 @@ main (int argc, char **argv)
GError *err = NULL;
GstDiscoverer *dc;
gint timeout = 10;
+ gboolean use_cache = FALSE;
GOptionEntry options[] = {
{"async", 'a', 0, G_OPTION_ARG_NONE, &async,
"Run asynchronously", NULL},
+ {"use-cache", 'a', 0, G_OPTION_ARG_NONE, &use_cache,
+ "Use GstDiscovererInfo from our cache.", NULL},
{"timeout", 't', 0, G_OPTION_ARG_INT, &timeout,
"Specify timeout (in seconds, default 10)", "T"},
/* {"elem", 'e', 0, G_OPTION_ARG_NONE, &elem_seek, */
@@ -626,6 +629,8 @@ main (int argc, char **argv)
exit (1);
}
+ g_object_set (dc, "use-cache", use_cache, NULL);
+
if (!async) {
gint i;
for (i = 1; i < argc; i++)