[Bug 660612] 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:56:49 PDT 2011


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

--- Comment #1 from Jason Gerard DeRose <jderose at novacut.com> 2011-10-01 03:56:46 UTC ---
Oops, crap, got my copy+paste mixed up:

Working static test case:

#!/usr/bin/python

import gobject
gobject.threads_init()

import gst

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)

src = gst.element_factory_make('videotestsrc')
src.set_property('num-buffers', 10)
sink = gst.element_factory_make('fakesink')
pipeline.add(src)
pipeline.add(sink)
src.link(sink)

pipeline.set_state(gst.STATE_PLAYING)
mainloop.run()


Broken PyGI test 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()

-- 
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