Advertisement
rotrevrep

simple video player

Sep 15th, 2013
3,193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.64 KB | None | 0 0
  1. void main(string[] args){
  2.     Gtk.init(ref args);
  3.     Gst.init(ref args);
  4.     var win = new Gtk.Window();
  5.     uint val = 0;
  6.     uint *handle = &val;
  7.     win.realize.connect(() => {
  8.         handle = (uint*)Gdk.X11Window.get_xid(win.get_window());
  9.     });
  10.     var e = Gst.ElementFactory.make("playbin","playbin");
  11.     e.bus.add_watch(0,(bus,message) => {
  12.         if(Gst.Video.is_video_overlay_prepare_window_handle_message(message))
  13.                     (message.src as Gst.Video.Overlay).set_window_handle(handle);
  14.                 return true;
  15.     });
  16.     e["uri"] = args[1];
  17.     e.set_state(Gst.State.PLAYING);
  18.     win.destroy.connect(Gtk.main_quit);
  19.     win.show_all();
  20.     Gtk.main();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement