commit intermediate wrapper updates

Original commit message from CVS:
commit intermediate wrapper updates
This commit is contained in:
Thomas Vander Stichele 2005-09-18 11:06:42 +00:00
parent ed59668d25
commit c8f8cd37b9
5 changed files with 47 additions and 38 deletions

View file

@ -1,3 +1,10 @@
2005-09-18 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gst-types.defs:
* gst/gst.override:
* testsuite/test_registry.py:
commit intermediate wrapper updates
2005-09-16 Andy Wingo <wingo@pobox.com> 2005-09-16 Andy Wingo <wingo@pobox.com>
* gst/gst.defs (registry_get_default): Renamed from * gst/gst.defs (registry_get_default): Renamed from

2
common

@ -1 +1 @@
Subproject commit 39250a956e1dfc010fe9f9d93ca1e2c3a343cdca Subproject commit 3f8b422d851dc64797cdd97dd7a2014acd751386

View file

@ -202,9 +202,9 @@
(gtype-id "GST_TYPE_CAPS") (gtype-id "GST_TYPE_CAPS")
) )
(define-boxed Plugin (define-object Plugin
(in-module "Gst") (in-module "Gst")
(parent "GObject") (parent "GstObject")
(c-name "GstPlugin") (c-name "GstPlugin")
(gtype-id "GST_TYPE_PLUGIN") (gtype-id "GST_TYPE_PLUGIN")
) )

View file

@ -694,55 +694,51 @@ _wrap_gst_main_quit(PyObject *self)
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
%% %%
override gst_registry_pool_plugin_list noargs override gst_registry_get_plugin_list
static PyObject * static PyObject *
_wrap_gst_registry_pool_plugin_list(PyGObject *self) _wrap_gst_registry_get_plugin_list (PyGObject *self)
{ {
GstRegistry *registry;
GList *l, *plugins; GList *l, *plugins;
PyObject *list; PyObject *list;
plugins = gst_registry_pool_plugin_list(); registry = GST_REGISTRY (self->obj);
list = PyList_New(0); plugins = gst_registry_get_plugin_list (registry);
list = PyList_New (0);
for (l = plugins; l; l = l->next) { for (l = plugins; l; l = l->next) {
GstPlugin *plugin = (GstPlugin*)l->data; GstPlugin *plugin = (GstPlugin *) l->data;
PyList_Append(list, PyList_Append (list, pygobject_new (G_OBJECT (plugin)));
pyg_boxed_new(GST_TYPE_PLUGIN, plugin, TRUE, TRUE));
} }
g_list_free(plugins); g_list_free (plugins);
return list; return list;
} }
%%
override gst_registry_pool_feature_list
static PyObject * static PyObject *
_wrap_gst_registry_pool_feature_list(PyGObject *self, PyObject *args) _wrap_gst_registry_get_feature_list (PyGObject *self)
{ {
GstRegistry *registry;
GList *l, *features; GList *l, *features;
PyObject *pygtype, *list; PyObject *list;
GType gtype;
if (!PyArg_ParseTuple(args, "O:registry_pool_feature_list", registry = GST_REGISTRY (self->obj);
&pygtype))
return NULL;
gtype = pyg_type_from_object (pygtype); features = gst_registry_get_feature_list (registry);
if (!gtype)
return NULL;
features = gst_registry_pool_feature_list(gtype);
list = PyList_New(0); list = PyList_New (0);
for (l = features; l; l = l->next) { for (l = features; l; l = l->next) {
GstPluginFeature *feature = (GstPluginFeature*)l->data; GstPluginFeature *feature = (GstPluginFeature *) l->data;
PyList_Append(list, pygobject_new (G_OBJECT (feature))); PyList_Append (list, pygobject_new (G_OBJECT (feature)));
} }
g_list_free(features); g_list_free (features);
return list; return list;
} }
%% %%
override gst_xml_new noargs override gst_xml_new noargs

View file

@ -23,16 +23,22 @@
import sys import sys
from common import gst, unittest from common import gst, unittest
class RegistryPoolTest(unittest.TestCase): class RegistryTest(unittest.TestCase):
def testGetDefault(self):
registry = gst.registry_get_default()
def testPluginList(self): def testPluginList(self):
plugins = gst.registry_pool_plugin_list() registry = gst.registry_get_default()
elements = map(lambda p: p.get_name(), plugins) plugins = registry.get_plugin_list()
assert 'gstcoreelements' in elements names = map(lambda p: p.get_name(), plugins)
self.failUnless('gstcoreelements' in names)
def testFeatureList(self): def testFeatureList(self):
plugins = gst.registry_pool_feature_list(gst.ElementFactory) registry = gst.registry_get_default()
elements = map(lambda p: p.get_name(), plugins) features = registry.get_feature_list()
assert 'fakesink' in elements, elements elements = map(lambda f: f.get_name(), features)
self.failUnless('fakesink' in elements)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()