[Gstreamer-openmax] [PATCH 4/4] plugin: store element_table in plugin cache

Felipe Contreras felipe.contreras at nokia.com
Mon Mar 8 15:26:27 PST 2010


Probably more efficient.

Signed-off-by: Felipe Contreras <felipe.contreras at nokia.com>
---
 omx/gstomx.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/omx/gstomx.c b/omx/gstomx.c
index cc15ecf..11cd18b 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 *new, *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, new);
 
+    gst_plugin_set_cache_data (plugin, new);
+
     element_table = new;
 }
 
-- 
1.7.0.2





More information about the Gstreamer-openmax mailing list