mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
gst/gst.*: Added new function gst.TIME_ARGS which returns the string representation of a GstClockTime
Original commit message from CVS: * gst/gst.defs: * gst/gst.override: Added new function gst.TIME_ARGS which returns the string representation of a GstClockTime
This commit is contained in:
parent
bda994c4cd
commit
0ca0d99781
3 changed files with 42 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-11-08 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* gst/gst.defs:
|
||||
* gst/gst.override:
|
||||
Added new function gst.TIME_ARGS which returns the string
|
||||
representation of a GstClockTime
|
||||
|
||||
2005-11-04 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* gst/gstelement.override:
|
||||
|
|
|
@ -6196,7 +6196,13 @@
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
(define-function TIME_ARGS
|
||||
(c-name "GST_TIME_ARGS")
|
||||
(return-type "gchar*")
|
||||
(parameters
|
||||
'("GstClockTime" "time")
|
||||
)
|
||||
)
|
||||
|
||||
;; From ../gstreamer/gst/gstvalue.h
|
||||
|
||||
|
|
|
@ -837,3 +837,31 @@ _wrap_gst_object_error (PyObject *whatever, PyObject *string)
|
|||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_ERROR, TRUE);
|
||||
}
|
||||
%%
|
||||
override GST_TIME_ARGS kwargs
|
||||
static PyObject *
|
||||
_wrap_GST_TIME_ARGS(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "time", NULL };
|
||||
PyObject *py_time = NULL;
|
||||
PyObject *string;
|
||||
gchar *ret;
|
||||
guint64 time;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:time_to_string", kwlist, &PyLong_Type, &py_time))
|
||||
return NULL;
|
||||
time = PyLong_AsUnsignedLongLong(py_time);
|
||||
ret = g_strdup_printf("%"GST_TIME_FORMAT, GST_TIME_ARGS(time));
|
||||
|
||||
if (!ret) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
if (!(string = PyString_FromString(ret))) {
|
||||
g_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
g_free(ret);
|
||||
return string;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue