Satoshi A. wrote in post #1024748:
1st:
“Windows does not use X.” … I see.
But can I use xid on Windows or can’t?
You can’t. The source is :
#ifdef GDK_WINDOWING_X11
rb_define_method(gdkDrawable, “xid”, gdkdraw_get_xid, 0);
#endif
And, as I said, windows does not use X.
I ran the following snippet on my Windows 7 and I got a xid for a video
window created by playbin2 plugin.
require ‘gtk2’
require ‘gst’
play_bin = Gst::ElementFactory.make(‘playbin2’)
bus = play_bin.bus
bus.add_watch do |bus, message|
case message.type
when Gst::Message::ELEMENT
p message.structure[“xwindow-id”] #=> Got a number, e.g. 18023540
end
true
end
play_bin.uri = ‘file://d/tmp/input.mp4’
window = Gtk::Window.new
window.show_all
play_bin.play
Gtk.main
You do not get a ‘xid’, you retrieve a value from a GstStructure, with
the key ‘xwindow-id’. I don’t know how GStreamer fills this value.
2nd: If the above first questions’s answer is “can’t”,
are there any alternative ways to identify a window on Windows?
A native window handler or somthing…
I’m now looking for the way to embed the video window in my Ruby/GTK2
application.
I found GstXOverlay[*1]. So, I want to know how to identify a window.
I think GstXOverlay is only for X too, but I don’t know much GStreamer.
This discussion http://www.ruby-forum.com/topic/1329197 talks about
that, and it seems no solution was found.
I’m not sure you will be able to do what you want with ruby.
Simon