GNOME Bugzilla – Bug 677916
g-i: MemoryError raised using Gst.DebugMessage()
Last modified: 2012-06-12 09:35:38 UTC
Using the object Gst.DebugMessage() causes a MemoryError on python. I am using Ubuntu 12.10 with Gstreamer 0.11.91-2. This is the exaple code: #!/usr/bin/env python # -*- coding: utf-8; tab-width: 4; mode: python -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet import sys import gi try: gi.require_version('Gst', '1.0') from gi.repository import Gst except ValueError: print 'Could not find required Gstreamer 1.0 library.' sys.exit(1) # Setup GStreamer Gst.init(None) Gst.init_check(None) print Gst.version_string(), Gst.version() Gst.debug_set_active(True) # If activated, debugging messages are sent to the debugging handlers. Gst.DebugMessage() Running the example shows this traceback GStreamer 1.0.0 (1L, 0L, 0L, 0L) Traceback (most recent call last):
+ Trace 230345
Gst.DebugMessage() MemoryError
> Using the object Gst.DebugMessage() causes a MemoryError on python. There is no such object, certainly not one you can instantiate like this. What makes you think this should work? What would the corresponding C code look like?
It is not a object, it seems a record. On gir file: <record name="DebugMessage" c:type="GstDebugMessage" disguised="1"> <method name="get" c:identifier="gst_debug_message_get"> <doc xml:whitespace="preserve">Gets the string representation of a #GstDebugMessage. This function is used in debug handlers to extract the message.</doc> <return-value transfer-ownership="none"> <doc xml:whitespace="preserve">the string representation of a #GstDebugMessage.</doc> <type name="utf8" c:type="gchar*"/> </return-value> </method> </record> Required as parameter on: <function name="debug_log_default" c:identifier="gst_debug_log_default"> The parameter: <parameter name="message" transfer-ownership="none"> <doc xml:whitespace="preserve">the message</doc> <type name="DebugMessage" c:type="GstDebugMessage*"/> </parameter> And it appears as callback too on: <callback name="LogFunction" c:type="GstLogFunction">
Still, this simply doesn't make sense, sorry. The logging system is not properly annotated, I don't know if it can be used yet with bindings. I'll re-name the other bug accordingly.