Answer the question
In order to leave comments, you need to log in
GStreamer+Ruby(mingw32) bundle does not work properly on Windows
GStreamer works fine on Linux (Lubuntu), but fails on Windows (XP):
require 'gtk2'
require 'gst'
def os_family
case RUBY_PLATFORM
when /ix/i, /ux/i, /gnu/i, /sysv/i, /solaris/i, /sunos/i, /bsd/i
'unix'
when /win/i, /ming/i
'windows'
else
'other'
end
end
Gst.init
pipeline = Gst::Pipeline.new('pipeline1')
videosrc = Gst::ElementFactory.make('videotestsrc', 'videosrc1')
videoconvert = Gst::ElementFactory.make('autovideoconvert', 'videoconvert1')
videosink = Gst::ElementFactory.make('autovideosink', 'videosink1');
pipeline.add(videosrc, videoconvert, videosink)
videosrc >> videoconvert >> videosink
window = Gtk::Window.new('Video test')
window.signal_connect("destroy") { pipeline.stop; Gtk.main_quit }
window.set_default_size(320, 240)
window.show_all
pipeline.bus.add_watch do |bus, message|
if (message and message.structure and message.structure.name \
and (message.structure.name == 'prepare-xwindow-id'))
Gdk::Threads.synchronize do
Gdk::Display.default.sync
if not window.destroyed? and window.window
win_id = nil
if os_family=='windows'
win_id = window.window.handle
else
win_id = window.window.xid
end
imagesink = message.src
imagesink.set_property("force-aspect-ratio", true)
imagesink.set_xwindow_id(win_id)
end
end
end
true
end
pipeline.play
Gtk.main
Answer the question
In order to leave comments, you need to log in
very confused. What does not work then?) On a screw hosting is not initialized?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question