wrap gst_plugin_get_version so it returns a tuple

Original commit message from CVS:
wrap gst_plugin_get_version so it returns a tuple
This commit is contained in:
Thomas Vander Stichele 2005-04-12 16:29:49 +00:00
parent 9bc2116de6
commit dd901080d7
3 changed files with 38 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2005-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gst.defs:
* gst/gst.override:
wrap gst_plugin_get_version so it returns a tuple
2005-04-12 Thomas Vander Stichele <thomas at apestaart dot org> 2005-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
* testsuite/test_probe.py: * testsuite/test_probe.py:

View file

@ -3756,6 +3756,12 @@
(return-type "const-gchar*") (return-type "const-gchar*")
) )
(define-method get_version
(of-object "GstPlugin")
(c-name "gst_plugin_get_version")
(return-type "const-gchar*")
)
(define-method get_module (define-method get_module
(of-object "GstPlugin") (of-object "GstPlugin")
(c-name "gst_plugin_get_module") (c-name "gst_plugin_get_module")

View file

@ -99,7 +99,6 @@ ignore
gst_alloc_trace_list gst_alloc_trace_list
gst_alloc_trace_get gst_alloc_trace_get
gst_error_get_message gst_error_get_message
gst_object_default_deep_notify
gst_object_check_uniqueness gst_object_check_uniqueness
gst_object_replace gst_object_replace
gst_parse_launchv gst_parse_launchv
@ -739,3 +738,29 @@ _wrap_gst_probe_perform(PyGBoxed *self, PyObject *args, PyObject *kwargs)
return PyBool_FromLong(gst_probe_perform(self->boxed, &data)); return PyBool_FromLong(gst_probe_perform(self->boxed, &data));
} }
%%
override gst_plugin_get_version
static PyObject *
_wrap_gst_plugin_get_version(PyGObject *self)
{
PyObject *tuple;
const gchar *version;
gchar **items, **p;
gint i = 0;
gint count = 0;
version = gst_plugin_get_version((GstPlugin *) self->obj);
items = g_strsplit(version, ".", 4);
for (p = items; *p; ++p) ++count;
tuple = PyTuple_New(count);
for (p = items; *p; ++p) {
PyObject *item;
item = PyInt_FromString(*p, NULL, 10);
PyTuple_SetItem(tuple, i, item);
i++;
}
g_strfreev(items);
return tuple;
}