[Bug 660612] New: Bus broken with PyGI (message is None aka no EOS): missing GstMessage annotation?

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Sep 30 20:52:01 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=660612
  GStreamer | gstreamer (core) | 0.10.35

           Summary: Bus broken with PyGI (message is None aka no EOS):
                    missing GstMessage annotation?
    Classification: Platform
           Product: GStreamer
           Version: 0.10.35
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: jderose at novacut.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


So I was able to port the Novacut renderer to PyGI save for one problem I
wasn't able to work around: the message bus is broken under PyGI and I'm not
getting an EOS signal.  The render actually works fine, I just don't know when
it's done.

I finally came of with two illustrative test cases, which hopefully will allow
someone with more G-I knowledge to spot the problem.

Here is the working case for the static python-gst bindings:

#!/usr/bin/python

from gi.repository import GObject
GObject.threads_init()

from gi.repository import Gst
Gst.init(None)

mainloop = GObject.MainLoop()
pipeline = Gst.Pipeline()

def on_eos(bus, msg):
    print('eos: {!r}'.format(msg))
    pipeline.set_state(gst.STATE_NULL)
    mainloop.quit()

def on_message(bus, msg):
    print('message: {!r}'.format(msg))

bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message::eos', on_eos)
bus.connect('message', on_message)

bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message::eos', on_eos)

src = Gst.ElementFactory.make('videotestsrc', None)
src.set_property('num-buffers', 120)
sink = Gst.ElementFactory.make('fakesink', None)
pipeline.add(src)
pipeline.add(sink)
src.link(sink)

pipeline.set_state(Gst.State.PLAYING)
mainloop.run()


And here is the broken PyGI case:

#!/usr/bin/python

from gi.repository import GObject
GObject.threads_init()

from gi.repository import Gst
Gst.init(None)

mainloop = GObject.MainLoop()
pipeline = Gst.Pipeline()

def on_eos(bus, msg):
    print('eos: {!r}'.format(msg))
    pipeline.set_state(gst.STATE_NULL)
    mainloop.quit()

def on_message(bus, msg):
    print('message: {!r}'.format(msg))

bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message::eos', on_eos)
bus.connect('message', on_message)

bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message::eos', on_eos)

src = Gst.ElementFactory.make('videotestsrc', None)
src.set_property('num-buffers', 10)
sink = Gst.ElementFactory.make('fakesink', None)
pipeline.add(src)
pipeline.add(sink)
src.link(sink)

pipeline.set_state(Gst.State.PLAYING)
mainloop.run()


Here is the trace when I try to run the broken PyGI case:

jderose at jgd-ws:~/bzr/novacut/trunk$ ./eos-bug-pygi.py
./eos-bug-pygi.py:37: Warning: g_value_get_object: assertion
`G_VALUE_HOLDS_OBJECT (value)' failed
  mainloop.run()
message: None
message: None
message: None
message: None
message: None
message: None
message: None
message: None
message: None
message: None
message: None
message: None
message: None
Traceback (most recent call last):
  File "./eos-bug-pygi.py", line 18, in on_message
    print('message: {!r}'.format(msg))
TypeError: unknown type GstMessage

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list