mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
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:
parent
9bc2116de6
commit
dd901080d7
3 changed files with 38 additions and 1 deletions
|
@ -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>
|
||||
|
||||
* testsuite/test_probe.py:
|
||||
|
|
|
@ -3756,6 +3756,12 @@
|
|||
(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
|
||||
(of-object "GstPlugin")
|
||||
(c-name "gst_plugin_get_module")
|
||||
|
|
|
@ -99,7 +99,6 @@ ignore
|
|||
gst_alloc_trace_list
|
||||
gst_alloc_trace_get
|
||||
gst_error_get_message
|
||||
gst_object_default_deep_notify
|
||||
gst_object_check_uniqueness
|
||||
gst_object_replace
|
||||
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));
|
||||
}
|
||||
%%
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue