Well, I figured it out. Thanks for the responses. I had tried to override the
____gsignals___
attribute in my Gst.Pipeline object. Every time I tried to create the object, it was always reset to "{}". I finally created a separate class just for the signals.
class PipeSignals(GObject.Object):
# create signals for this pipeline
__gsignals__ = {
'updatedSourceFPS': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_FLOAT,)),
'updatedCaptureCount': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_INT,)),
'updatedCaptureTime':(GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_FLOAT,)),
'captureFinished': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ()),
'pipelineError': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING,))
}
def __init__(self):
GObject.Object.__init__(self)
When I create my Pipeline object, I create the signals object:
self.pipesignals = PipeSignals()
I connect to one of them with:
self.pipeline.pipesignals.connect('updatedSourceFPS', self.on_fps_update)
and emit the signal when the time comes:
self.pipesignals.emit('updatedSourceFPS', fps)
And I update my status bar in on_fps_update().
def on_fps_update(self, signal, fps):
self.statusbar.pop(self.statusid)
self.statusbar.push(self.statusid, 'fps: {:.3f}'.format(fps))
return