mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
add debug methods to gst.Object
Original commit message from CVS: add debug methods to gst.Object
This commit is contained in:
parent
4babdda09c
commit
4132069a83
4 changed files with 105 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-09-08 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gst.defs:
|
||||
* gst/gst.override:
|
||||
* testsuite/test_element.py:
|
||||
add debug methods to gst.Object
|
||||
|
||||
2005-09-08 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gst.defs:
|
||||
|
|
48
gst/gst.defs
48
gst/gst.defs
|
@ -2910,6 +2910,54 @@
|
|||
)
|
||||
)
|
||||
|
||||
;; OBJECT DEBUGGING FUNCTIONS FROM PYTHON
|
||||
;; The c functions don't actually exist
|
||||
|
||||
(define-method log
|
||||
(of-object "GstObject")
|
||||
(c-name "gst_object_log")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("gchar *" "msg")
|
||||
)
|
||||
)
|
||||
|
||||
(define-method debug
|
||||
(of-object "GstObject")
|
||||
(c-name "gst_object_debug")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("gchar *" "msg")
|
||||
)
|
||||
)
|
||||
|
||||
(define-method info
|
||||
(of-object "GstObject")
|
||||
(c-name "gst_object_info")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("gchar *" "msg")
|
||||
)
|
||||
)
|
||||
|
||||
(define-method warning
|
||||
(of-object "GstObject")
|
||||
(c-name "gst_object_warning")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("gchar *" "msg")
|
||||
)
|
||||
)
|
||||
|
||||
(define-method error
|
||||
(of-object "GstObject")
|
||||
(c-name "gst_object_error")
|
||||
(return-type "none")
|
||||
(parameters
|
||||
'("gchar *" "msg")
|
||||
)
|
||||
)
|
||||
|
||||
;; From ../gstreamer/gst/gstpad.h
|
||||
|
||||
(define-function gst_pad_get_type
|
||||
|
|
|
@ -963,6 +963,7 @@ _wrap_gst_flow_get_name(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
%%
|
||||
override gst_log args
|
||||
static PyObject *
|
||||
|
@ -985,16 +986,52 @@ _wrap_gst_info (PyObject *whatever, PyObject *string)
|
|||
return pygst_debug_log (whatever, string, GST_LEVEL_INFO);
|
||||
}
|
||||
%%
|
||||
override gst_warning
|
||||
override gst_warning args
|
||||
static PyObject *
|
||||
_wrap_gst_warning (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_WARNING);
|
||||
}
|
||||
%%
|
||||
override gst_error
|
||||
override gst_error args
|
||||
static PyObject *
|
||||
_wrap_gst_error (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_ERROR);
|
||||
}
|
||||
|
||||
%%
|
||||
override gst_object_log args
|
||||
static PyObject *
|
||||
_wrap_gst_object_log (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_LOG);
|
||||
}
|
||||
%%
|
||||
override gst_object_debug args
|
||||
static PyObject *
|
||||
_wrap_gst_object_debug (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_DEBUG);
|
||||
}
|
||||
%%
|
||||
override gst_object_info args
|
||||
static PyObject *
|
||||
_wrap_gst_object_info (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_INFO);
|
||||
}
|
||||
%%
|
||||
override gst_object_warning args
|
||||
static PyObject *
|
||||
_wrap_gst_object_warning (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_WARNING);
|
||||
}
|
||||
%%
|
||||
override gst_object_error args
|
||||
static PyObject *
|
||||
_wrap_gst_object_error (PyObject *whatever, PyObject *string)
|
||||
{
|
||||
return pygst_debug_log (whatever, string, GST_LEVEL_ERROR);
|
||||
}
|
||||
|
|
|
@ -175,5 +175,16 @@ class QueueTest(unittest.TestCase):
|
|||
assert isinstance(queue, gst.Queue)
|
||||
assert queue.get_name() == 'queue0'
|
||||
|
||||
class DebugTest(unittest.TestCase):
|
||||
def testDebug(self):
|
||||
e = gst.element_factory_make('fakesrc')
|
||||
e.error('I am an error string')
|
||||
e.warning('I am a warning string')
|
||||
e.info('I am an info string')
|
||||
e.debug('I am a debug string')
|
||||
e.log('I am a log string')
|
||||
e.debug('I am a formatted %s %s' % ('log', 'string'))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in a new issue