summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@nokia.com>2010-03-09 00:56:59 +0200
committerFelipe Contreras <felipe.contreras@nokia.com>2010-03-09 18:39:31 +0200
commit6b238cfa0db6437da40fbc0c845110a9672dcc58 (patch)
tree386ae35a2d459d90a0b5419d2f7d62e0222d2725
parent24148b76ef88b2966cb2b63baa05ac137fe472e9 (diff)
plugin: store element_table in plugin cache
Probably more efficient. Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
-rw-r--r--omx/gstomx.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c
index f8c3ae9..ff232b0 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -130,8 +130,6 @@ get_config_path (void)
"gst-openmax.conf", NULL);
}
-/* TODO: we can cache table w/ gst_plugin_{get,set}_cache_data..
- */
static void
fetch_element_table (GstPlugin *plugin)
{
@@ -139,6 +137,11 @@ fetch_element_table (GstPlugin *plugin)
gchar *config, *s;
GstStructure *tmp, *element;
+ element_table = gst_plugin_get_cache_data (plugin);
+
+ if (element_table)
+ return;
+
path = get_config_path ();
if (!g_file_get_contents (path, &config, NULL, NULL))
@@ -170,6 +173,8 @@ fetch_element_table (GstPlugin *plugin)
GST_DEBUG ("element_table=%" GST_PTR_FORMAT, tmp);
+ gst_plugin_set_cache_data (plugin, tmp);
+
element_table = tmp;
}