Class: Gst::Bus

Inherits:
Object
  • Object
show all
Defined in:
lib/gst/bus.rb

Instance Method Summary collapse

Instance Method Details

#add_watch(priority = GLib::PRIORITY_DEFAULT, &block) ⇒ Object



20
21
22
# File 'lib/gst/bus.rb', line 20

def add_watch(priority=GLib::PRIORITY_DEFAULT, &block)
  add_watch_full(priority, &block)
end

#add_watch_fullObject



19
# File 'lib/gst/bus.rb', line 19

alias_method :add_watch_full, :add_watch

#sync_handler(&block) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/gst/bus.rb', line 24

def sync_handler(&block)
  @sync_handler = lambda do |bus, message|
    begin
      block.call(bus, message)
    rescue Exception
      $stderr.puts("An exception is raised in " +
                     "#{self.class}\##{__method__} callback: #{block}")
      $stderr.puts("#{$!.class}: #{$!.message}")
      $stderr.puts($@)
      BusSyncReply::DROP
    end
  end
  set_sync_handler(&@sync_handler)
end