MCPcopy Create free account
hub / github.com/GStreamer/gst-python / _bus_watch

Method _bus_watch

old_examples/synchronizer.py:430–465  ·  view source on GitHub ↗
(self, bus, message)

Source from the content-addressed store, hash-verified

428 self._query_id = -1
429
430 def _bus_watch(self, bus, message):
431 if message.type == gst.MESSAGE_ERROR:
432 print 'error', message
433 self._stop_queries()
434 m = gtk.MessageDialog(self.window,
435 gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
436 gtk.MESSAGE_ERROR,
437 gtk.BUTTONS_CLOSE,
438 "Error processing file")
439 gerror, debug = message.parse_error()
440 txt = ('There was an error processing your file: %s\n\n'
441 'Debug information:\n%s' % (gerror, debug))
442 m.format_secondary_text(txt)
443 m.run()
444 m.destroy()
445 self.response(FAILURE)
446 elif message.type == gst.MESSAGE_WARNING:
447 print 'warning', message
448 elif message.type == gst.MESSAGE_EOS:
449 # print 'eos, woot', message.src
450 name = self.touri
451 if name.startswith('file://'):
452 name = name[7:]
453 self.pdialog.set_task('Finished writing %s' % name)
454 self.pdialog.update_position(1,1)
455 self._stop_queries()
456 self.pdialog.set_completed(True)
457 elif message.type == gst.MESSAGE_STATE_CHANGED:
458 if message.src == self:
459 old, new, pending = message.parse_state_changed()
460 if ((old, new, pending) ==
461 (gst.STATE_READY, gst.STATE_PAUSED,
462 gst.STATE_VOID_PENDING)):
463 self.pdialog.set_task('Processing file')
464 self._start_queries()
465 self.set_state(gst.STATE_PLAYING)
466
467 def response(self, response):
468 assert self.resolution == UNKNOWN

Callers

nothing calls this directly

Calls 7

_stop_queriesMethod · 0.95
responseMethod · 0.95
_start_queriesMethod · 0.95
runMethod · 0.45
set_taskMethod · 0.45
update_positionMethod · 0.45
set_completedMethod · 0.45

Tested by

no test coverage detected