|
From: NAKAJIMA T. <nak...@ni...> - 2013-02-03 15:45:15
|
中島です。
GObject Introspectionを使ったGStreamerサンプルの移植に挑戦しています。
Gst.initは無事通ったのですが、以下報告させてください。
ほとんどTutorialにあるHello Worldと変わらないコードですが、
playbin = Gst::ElementFactory.make("playbin")
bus = playbin.bus
bus.add_watch do |bus, message|
(イベント捕捉)
end
だと、add_watchのところで以下のエラーが起きます。
/home/nakajima/Projects/ruby/gtk/ruby-gnome2/gobject-introspection/lib/gobject-introspection/loader.rb:243:in
`invoke': no implicit conversion from nil to integer (TypeError)
from
/home/nakajima/Projects/ruby/gtk/ruby-gnome2/gobject-introspection/lib/gobject-introspection/loader.rb:243:in
`block in load_method_info'
from helloworld.rb:32:in `<main>'
intパラメータを要求しているようなので、priorityかなと思い
bus.add_watch(GLib::PRIORITY_DEFAULT) do |bus, message|
にしたところ、次のエラーに変わりました。
/home/nakajima/Projects/ruby/gtk/ruby-gnome2/gobject-introspection/lib/gobject-introspection/loader.rb:243:in
`invoke': TODO: GSourceFunc callback is only supported.
(NotImplementedError)
from
/home/nakajima/Projects/ruby/gtk/ruby-gnome2/gobject-introspection/lib/gobject-introspection/loader.rb:243:in
`block in load_method_info'
from helloworld.rb:32:in `<main>'
GSourceFuncのcallbackでない(?)と怒られているようですが、ブロックで
渡しているところが違うのでしょうか。
なおGst-1.0.girによると、add_watchは
<parameters>
<parameter name="func" transfer-ownership="none" closure="1">
<doc xml:whitespace="preserve">A function to call when a message is
received.</doc>
<type name="BusFunc" c:type="GstBusFunc"/>
</parameter>
<parameter name="user_data" transfer-ownership="none">
<doc xml:whitespace="preserve">user data passed to @func.</doc>
<type name="gpointer" c:type="gpointer"/>
</parameter>
</parameters>
なので、priorityを渡したのも違っているのかもしれませんけど。(?)
|