Advertisement
rotrevrep

GtkGst unref error

Sep 28th, 2015
3,294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void main (string[] args) {
  2.         X.init_threads();
  3.         Gst.init (ref args);
  4.         Gtk.init (ref args);
  5.        
  6.         var sink = Gst.ElementFactory.make ("gtksink", "sink");
  7.         var playbin = Gst.ElementFactory.make ("playbin", "bin");
  8.         playbin["video-sink"] = sink;
  9.         playbin["uri"] = "http://hd2.lagrosseradio.info:8200";
  10.         Gtk.Widget area;
  11.         sink.get ("widget", out area);
  12.         var win = new Gtk.Window();
  13.         var bar = new Gtk.HeaderBar();
  14.         bar.title = "Test";
  15.         bar.show_close_button = true;
  16.         win.set_titlebar (bar);
  17.         win.add (area);
  18.         win.realize.connect (() => {
  19.                 playbin.set_state (Gst.State.PLAYING);
  20.         });
  21.         win.set_size_request (400, 300);
  22.         win.show_all();
  23.         Gtk.main();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement