2004-07-15 Johan Dahlin <johan@gnome.org>
+ * testsuite/registry.py: Add some basic tests
+
+ * gst/gst.override: Don't ignore all gst_registry_* symbols
+ (_wrap_gst_registry_pool_plugin_list): Impl.
+ (_wrap_gst_registry_pool_feature_list): Impl.
+
+ * gst/gst-types.defs (Plugin): Add as a boxed
+
* gst/__init__.py: Use DLFCN instead of dl to help python
installations without the dl module (gentoo for instance)
'("gchar*" "message"))
)
+(define-boxed Plugin
+ (in-module "Gst")
+ (parent "GObject")
+ (c-name "GstPlugin")
+ (gtype-id "GST_TYPE_PLUGIN")
+)
(define-boxed Structure
(in-module "Gst")
gst_debug_*
gst_init*
gst_interface_*
- gst_registry_*
gst_tag_list_get_*
gst_value_*
gst_xml_*
{
return _wrap_gst_element_factory_make(NULL, args, kwargs);
}
+%%
+override gst_registry_pool_plugin_list noargs
+static PyObject *
+_wrap_gst_registry_pool_plugin_list(PyGObject *self)
+{
+ GList *l, *plugins;
+ PyObject *list;
+
+ plugins = gst_registry_pool_plugin_list();
+
+ list = PyList_New(0);
+ for (l = plugins; l; l = l->next) {
+ GstPlugin *plugin = (GstPlugin*)l->data;
+ PyList_Append(list,
+ pyg_boxed_new(GST_TYPE_PLUGIN, plugin, TRUE, TRUE));
+ }
+ g_list_free(plugins);
+
+ return list;
+}
+%%
+override gst_registry_pool_feature_list
+static PyObject *
+_wrap_gst_registry_pool_feature_list(PyGObject *self, PyObject *args)
+{
+ GList *l, *features;
+ PyObject *pygtype, *list;
+ GType gtype;
+
+ if (!PyArg_ParseTuple(args, "O:registry_pool_feature_list",
+ &pygtype))
+ return NULL;
+
+ gtype = pyg_type_from_object (pygtype);
+ if (!gtype)
+ return NULL;
+
+ features = gst_registry_pool_feature_list(gtype);
+
+ list = PyList_New(0);
+ for (l = features; l; l = l->next) {
+ GstPluginFeature *feature = (GstPluginFeature*)l->data;
+ PyList_Append(list, pygobject_new (G_OBJECT (feature)));
+
+ }
+ g_list_free(features);
+
+ return list;
+}
--- /dev/null
+import sys
+from common import gst, unittest
+
+class RegistryPoolTest(unittest.TestCase):
+ def testPluginList(self):
+ plugins = gst.registry_pool_plugin_list()
+ elements = map(lambda p: p.get_name(), plugins)
+ assert 'gstcoreelements' in elements
+
+ def testFeatureList(self):
+ plugins = gst.registry_pool_feature_list(gst.ElementFactory)
+ elements = map(lambda p: p.get_name(), plugins)
+ assert 'fakesink' in elements, elements
+
+if __name__ == "__main__":
+ unittest.main()
--- /dev/null
+import sys
+from common import gst, unittest
+
+class RegistryPoolTest(unittest.TestCase):
+ def testPluginList(self):
+ plugins = gst.registry_pool_plugin_list()
+ elements = map(lambda p: p.get_name(), plugins)
+ assert 'gstcoreelements' in elements
+
+ def testFeatureList(self):
+ plugins = gst.registry_pool_feature_list(gst.ElementFactory)
+ elements = map(lambda p: p.get_name(), plugins)
+ assert 'fakesink' in elements, elements
+
+if __name__ == "__main__":
+ unittest.main()