From 9cfb83d6a205f927d4fab98f3933d19fcff17694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 11 Jul 2017 19:29:16 +0300 Subject: [PATCH] Add Source support to GstBus, and the sync message handler --- Cargo.lock | 228 +----------------- Gir_Gst.toml | 7 + examples/Cargo.toml | 4 - examples/src/launch_glib_main.rs | 44 ++-- gstreamer/src/auto/alias.rs | 5 +- gstreamer/src/auto/bin.rs | 2 +- gstreamer/src/auto/bus.rs | 8 +- gstreamer/src/auto/clock.rs | 2 +- gstreamer/src/auto/device.rs | 2 +- gstreamer/src/auto/device_monitor.rs | 2 +- gstreamer/src/auto/device_provider.rs | 2 +- gstreamer/src/auto/device_provider_factory.rs | 2 +- gstreamer/src/auto/element.rs | 2 +- gstreamer/src/auto/element_factory.rs | 2 +- gstreamer/src/auto/enums.rs | 38 ++- gstreamer/src/auto/flags.rs | 2 +- gstreamer/src/auto/functions.rs | 2 +- gstreamer/src/auto/mod.rs | 3 +- gstreamer/src/auto/object.rs | 2 +- gstreamer/src/auto/pad.rs | 2 +- gstreamer/src/auto/pad_template.rs | 2 +- gstreamer/src/auto/pipeline.rs | 2 +- gstreamer/src/auto/plugin.rs | 2 +- gstreamer/src/auto/stream.rs | 2 +- gstreamer/src/auto/stream_collection.rs | 2 +- gstreamer/src/auto/u_r_i_handler.rs | 2 +- gstreamer/src/caps.rs | 2 +- gstreamer/src/lib.rs | 1 + 28 files changed, 108 insertions(+), 268 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74faad97a..8fa2ff01d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,19 +7,7 @@ dependencies = [ "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gstreamer-sys 0.1.1 (git+https://github.com/sdroege/gstreamer-sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "atk-sys" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -27,157 +15,44 @@ name = "bitflags" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "c_vec" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cairo-rs" -version = "0.1.3" -source = "git+https://github.com/gtk-rs/cairo#ef0c3315a57b5cd7134801779c111c6b7d84a410" -dependencies = [ - "c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", - "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cairo-sys-rs" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/cairo#ef0c3315a57b5cd7134801779c111c6b7d84a410" -dependencies = [ - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "examples" version = "0.1.0" dependencies = [ "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gstreamer 0.1.0", - "gstreamer-sys 0.1.1 (git+https://github.com/sdroege/gstreamer-sys)", - "gtk 0.1.3 (git+https://github.com/gtk-rs/gtk)", -] - -[[package]] -name = "gdk" -version = "0.5.3" -source = "git+https://github.com/gtk-rs/gdk#6f6487a46874be4e96659f6697b480a8345d2690" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)", - "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", - "gdk-pixbuf 0.1.3 (git+https://github.com/gtk-rs/gdk-pixbuf)", - "gdk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gio 0.1.3 (git+https://github.com/gtk-rs/gio)", - "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pango 0.1.3 (git+https://github.com/gtk-rs/pango)", -] - -[[package]] -name = "gdk-pixbuf" -version = "0.1.3" -source = "git+https://github.com/gtk-rs/gdk-pixbuf#191812c0157e798dd680a34120bb1a5512bdb23f" -dependencies = [ - "gdk-pixbuf-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gdk-pixbuf-sys" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gdk-sys" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", - "gdk-pixbuf-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gio" -version = "0.1.3" -source = "git+https://github.com/gtk-rs/gio#c410bf7ca4561b6ee9a48e605474824e3eff85e5" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gio-sys" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "glib" version = "0.1.3" -source = "git+https://github.com/gtk-rs/glib#f874842c0a660165c08c2b522551cd6673431b39" +source = "git+https://github.com/gtk-rs/glib#aaad1963ea3b1b45c62a3f49a7a1ed0a7f3b12ab" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "glib-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" +source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gobject-sys" version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" +source = "git+https://github.com/gtk-rs/sys#9354d21dfdb9174bfecafbd75cf2a7c0c8ba5759" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -189,47 +64,7 @@ dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "gtk" -version = "0.1.3" -source = "git+https://github.com/gtk-rs/gtk#bdf8319b8457dcca0b894ef1563fc0fc55ba2b45" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)", - "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", - "gdk 0.5.3 (git+https://github.com/gtk-rs/gdk)", - "gdk-pixbuf 0.1.3 (git+https://github.com/gtk-rs/gdk-pixbuf)", - "gdk-pixbuf-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gdk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gio 0.1.3 (git+https://github.com/gtk-rs/gio)", - "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gtk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pango 0.1.3 (git+https://github.com/gtk-rs/pango)", -] - -[[package]] -name = "gtk-sys" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" -dependencies = [ - "atk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)", - "gdk-pixbuf-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gdk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -240,63 +75,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.24" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "pango" -version = "0.1.3" -source = "git+https://github.com/gtk-rs/pango#e60e984a7e22e73c7de42adb5a485dde665a43e2" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib 0.1.3 (git+https://github.com/gtk-rs/glib)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", -] - -[[package]] -name = "pango-sys" -version = "0.3.4" -source = "git+https://github.com/gtk-rs/sys#113444397b56ffda5214ffcc5a2ed80c25020fe5" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)", - "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pkg-config" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - [metadata] -"checksum atk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" -"checksum c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6237ac5a4b1e81c213c24c6437964c61e646df910a914b4ab1487b46df20bd13" -"checksum cairo-rs 0.1.3 (git+https://github.com/gtk-rs/cairo)" = "" -"checksum cairo-sys-rs 0.3.4 (git+https://github.com/gtk-rs/cairo)" = "" -"checksum gdk 0.5.3 (git+https://github.com/gtk-rs/gdk)" = "" -"checksum gdk-pixbuf 0.1.3 (git+https://github.com/gtk-rs/gdk-pixbuf)" = "" -"checksum gdk-pixbuf-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" -"checksum gdk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" -"checksum gio 0.1.3 (git+https://github.com/gtk-rs/gio)" = "" -"checksum gio-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum glib 0.1.3 (git+https://github.com/gtk-rs/glib)" = "" "checksum glib-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum gobject-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum gstreamer-sys 0.1.1 (git+https://github.com/sdroege/gstreamer-sys)" = "" -"checksum gtk 0.1.3 (git+https://github.com/gtk-rs/gtk)" = "" -"checksum gtk-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" -"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" -"checksum pango 0.1.3 (git+https://github.com/gtk-rs/pango)" = "" -"checksum pango-sys 0.3.4 (git+https://github.com/gtk-rs/sys)" = "" +"checksum libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "30885bcb161cf67054244d10d4a7f4835ffd58773bc72e07d35fecf472295503" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 272c22b95..e986ceeb7 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -47,10 +47,12 @@ generate = [ "Gst.StreamFlags", "Gst.PadLinkReturn", "Gst.ProgressType", + "Gst.BusSyncReply", ] manual = [ "GLib.Error", + "GLib.Source", "Gst.Message", "Gst.Structure", ] @@ -100,6 +102,11 @@ trait = false # Uses enum as flags ignore = true + [[object.function]] + name = "create_watch" + # More convenient manual implementation + ignore = true + [[object]] name = "Gst.Caps" status = "manual" diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 711971ebf..7fb4c8351 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -5,11 +5,7 @@ authors = ["Sebastian Dröge "] [dependencies] glib = { version = "0.1.3", git = "https://github.com/gtk-rs/glib" } -gtk = { version = "0.1.3", git = "https://github.com/gtk-rs/gtk" } gstreamer = { path = "../gstreamer" } -glib-sys = { version = "0.3.4", git = "https://github.com/gtk-rs/sys" } -gobject-sys = { version = "0.3.4", git = "https://github.com/gtk-rs/sys" } -gstreamer-sys = { version = "0.1.1", git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } [[bin]] name = "launch" diff --git a/examples/src/launch_glib_main.rs b/examples/src/launch_glib_main.rs index e841c45e5..78614a7ee 100644 --- a/examples/src/launch_glib_main.rs +++ b/examples/src/launch_glib_main.rs @@ -1,16 +1,16 @@ extern crate gstreamer as gst; use gst::*; +use gst::ObjectExt as GstObjectExt; -extern crate gtk; +extern crate glib; +use glib::*; use std::u64; fn main() { gst::init().unwrap(); - // FIXME: Use glib crate once it has mainloop/etc bindings - // https://github.com/gtk-rs/glib/issues/168 - gtk::init().unwrap(); + let main_loop = MainLoop::new(None, false); let pipeline = gst::parse_launch("audiotestsrc ! autoaudiosink").unwrap(); let bus = pipeline.get_bus().unwrap(); @@ -18,22 +18,30 @@ fn main() { let ret = pipeline.set_state(gst::State::Playing); assert_ne!(ret, gst::StateChangeReturn::Failure); - bus.add_signal_watch(); - bus.connect_message(|_, msg| match msg.view() { - MessageView::Eos => gtk::main_quit(), - MessageView::Error(err) => { - println!( - "Error from {}: {} ({:?})", - msg.get_src().get_path_string(), - err.get_error(), - err.get_debug() - ); - gtk::main_quit(); - } - _ => (), + let main_loop_clone = main_loop.clone(); + + //bus.add_signal_watch(); + //bus.connect_message(move |_, msg| { + bus.add_watch(move |_, msg| { + let main_loop = &main_loop_clone; + match msg.view() { + MessageView::Eos => main_loop.quit(), + MessageView::Error(err) => { + println!( + "Error from {}: {} ({:?})", + msg.get_src().get_path_string(), + err.get_error(), + err.get_debug() + ); + main_loop.quit(); + } + _ => (), + }; + + glib::Continue(true) }); - gtk::main(); + main_loop.run(); let ret = pipeline.set_state(gst::State::Null); assert_ne!(ret, gst::StateChangeReturn::Failure); diff --git a/gstreamer/src/auto/alias.rs b/gstreamer/src/auto/alias.rs index ed26d3760..c90bf0287 100644 --- a/gstreamer/src/auto/alias.rs +++ b/gstreamer/src/auto/alias.rs @@ -1,5 +1,8 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT +#[allow(unused_imports)] +use auto::*; + pub type ClockTime = u64; pub type ElementFactoryListType = u64; diff --git a/gstreamer/src/auto/bin.rs b/gstreamer/src/auto/bin.rs index eaf5ec87d..1b63342ac 100644 --- a/gstreamer/src/auto/bin.rs +++ b/gstreamer/src/auto/bin.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Element; diff --git a/gstreamer/src/auto/bus.rs b/gstreamer/src/auto/bus.rs index 96ac247da..b4bc97fb8 100644 --- a/gstreamer/src/auto/bus.rs +++ b/gstreamer/src/auto/bus.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use ClockTime; @@ -51,10 +51,6 @@ impl Bus { // unsafe { TODO: call ffi::gst_bus_async_signal_func() } //} - //pub fn create_watch(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_bus_create_watch() } - //} - pub fn disable_sync_message_emission(&self) { unsafe { ffi::gst_bus_disable_sync_message_emission(self.to_glib_none().0); @@ -107,7 +103,7 @@ impl Bus { // unsafe { TODO: call ffi::gst_bus_set_sync_handler() } //} - //pub fn sync_signal_handler>>(&self, message: &mut Message, data: P) -> /*Ignored*/BusSyncReply { + //pub fn sync_signal_handler>>(&self, message: &mut Message, data: P) -> BusSyncReply { // unsafe { TODO: call ffi::gst_bus_sync_signal_handler() } //} diff --git a/gstreamer/src/auto/clock.rs b/gstreamer/src/auto/clock.rs index ae5ce9638..13093d217 100644 --- a/gstreamer/src/auto/clock.rs +++ b/gstreamer/src/auto/clock.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use ClockTime; diff --git a/gstreamer/src/auto/device.rs b/gstreamer/src/auto/device.rs index cd9344f96..beb0c3845 100644 --- a/gstreamer/src/auto/device.rs +++ b/gstreamer/src/auto/device.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Caps; diff --git a/gstreamer/src/auto/device_monitor.rs b/gstreamer/src/auto/device_monitor.rs index 1c1862582..9c0dfe81a 100644 --- a/gstreamer/src/auto/device_monitor.rs +++ b/gstreamer/src/auto/device_monitor.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Bus; diff --git a/gstreamer/src/auto/device_provider.rs b/gstreamer/src/auto/device_provider.rs index 485a6ee06..60b7377fa 100644 --- a/gstreamer/src/auto/device_provider.rs +++ b/gstreamer/src/auto/device_provider.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Bus; diff --git a/gstreamer/src/auto/device_provider_factory.rs b/gstreamer/src/auto/device_provider_factory.rs index 7180c1704..68a84929b 100644 --- a/gstreamer/src/auto/device_provider_factory.rs +++ b/gstreamer/src/auto/device_provider_factory.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use DeviceProvider; diff --git a/gstreamer/src/auto/element.rs b/gstreamer/src/auto/element.rs index 7d77671d8..80565a462 100644 --- a/gstreamer/src/auto/element.rs +++ b/gstreamer/src/auto/element.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Bus; diff --git a/gstreamer/src/auto/element_factory.rs b/gstreamer/src/auto/element_factory.rs index 1986d783c..7880aea73 100644 --- a/gstreamer/src/auto/element_factory.rs +++ b/gstreamer/src/auto/element_factory.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Caps; diff --git a/gstreamer/src/auto/enums.rs b/gstreamer/src/auto/enums.rs index af5f9b228..c4514a17a 100644 --- a/gstreamer/src/auto/enums.rs +++ b/gstreamer/src/auto/enums.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use ffi; @@ -46,6 +46,42 @@ impl FromGlib for BufferingMode { } } +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +pub enum BusSyncReply { + Drop, + Pass, + Async, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for BusSyncReply { + type GlibType = ffi::GstBusSyncReply; + + fn to_glib(&self) -> ffi::GstBusSyncReply { + match *self { + BusSyncReply::Drop => ffi::GST_BUS_DROP, + BusSyncReply::Pass => ffi::GST_BUS_PASS, + BusSyncReply::Async => ffi::GST_BUS_ASYNC, + BusSyncReply::__Unknown(value) => unsafe{std::mem::transmute(value)} + } + } +} + +#[doc(hidden)] +impl FromGlib for BusSyncReply { + fn from_glib(value: ffi::GstBusSyncReply) -> Self { + skip_assert_initialized!(); + match value as i32 { + 0 => BusSyncReply::Drop, + 1 => BusSyncReply::Pass, + 2 => BusSyncReply::Async, + value => BusSyncReply::__Unknown(value), + } + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum CoreError { Failed, diff --git a/gstreamer/src/auto/flags.rs b/gstreamer/src/auto/flags.rs index d8747ce9e..3a6b5fd02 100644 --- a/gstreamer/src/auto/flags.rs +++ b/gstreamer/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use ffi; diff --git a/gstreamer/src/auto/functions.rs b/gstreamer/src/auto/functions.rs index 212c7f352..fe9f33259 100644 --- a/gstreamer/src/auto/functions.rs +++ b/gstreamer/src/auto/functions.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Bin; diff --git a/gstreamer/src/auto/mod.rs b/gstreamer/src/auto/mod.rs index 695fac582..c91ef7ddc 100644 --- a/gstreamer/src/auto/mod.rs +++ b/gstreamer/src/auto/mod.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT mod bin; @@ -74,6 +74,7 @@ pub use self::u_r_i_handler::URIHandlerExt; mod enums; pub use self::enums::BufferingMode; +pub use self::enums::BusSyncReply; pub use self::enums::CoreError; pub use self::enums::FlowReturn; pub use self::enums::Format; diff --git a/gstreamer/src/auto/object.rs b/gstreamer/src/auto/object.rs index d5fdd5591..20b91d16a 100644 --- a/gstreamer/src/auto/object.rs +++ b/gstreamer/src/auto/object.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use ClockTime; diff --git a/gstreamer/src/auto/pad.rs b/gstreamer/src/auto/pad.rs index 86ef8070c..c5d15c79b 100644 --- a/gstreamer/src/auto/pad.rs +++ b/gstreamer/src/auto/pad.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Caps; diff --git a/gstreamer/src/auto/pad_template.rs b/gstreamer/src/auto/pad_template.rs index bb31e1f48..fba43bf27 100644 --- a/gstreamer/src/auto/pad_template.rs +++ b/gstreamer/src/auto/pad_template.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Caps; diff --git a/gstreamer/src/auto/pipeline.rs b/gstreamer/src/auto/pipeline.rs index 07f0f9a9f..9371dbb02 100644 --- a/gstreamer/src/auto/pipeline.rs +++ b/gstreamer/src/auto/pipeline.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Bin; diff --git a/gstreamer/src/auto/plugin.rs b/gstreamer/src/auto/plugin.rs index db568330f..c7fd8d2ff 100644 --- a/gstreamer/src/auto/plugin.rs +++ b/gstreamer/src/auto/plugin.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Error; diff --git a/gstreamer/src/auto/stream.rs b/gstreamer/src/auto/stream.rs index 72f0ddaca..b553eda09 100644 --- a/gstreamer/src/auto/stream.rs +++ b/gstreamer/src/auto/stream.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT #[cfg(feature = "v1_10")] diff --git a/gstreamer/src/auto/stream_collection.rs b/gstreamer/src/auto/stream_collection.rs index 2eab96070..800bac510 100644 --- a/gstreamer/src/auto/stream_collection.rs +++ b/gstreamer/src/auto/stream_collection.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Object; diff --git a/gstreamer/src/auto/u_r_i_handler.rs b/gstreamer/src/auto/u_r_i_handler.rs index 549d0520e..55f8af4ee 100644 --- a/gstreamer/src/auto/u_r_i_handler.rs +++ b/gstreamer/src/auto/u_r_i_handler.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (33e9567+) from gir-files (???) +// This file was generated by gir (7504fb6) from gir-files (???) // DO NOT EDIT use Error; diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index 3b1c29738..485305ac5 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -230,7 +230,7 @@ mod tests { fn test_simple() { gst::init(); - let caps = CapsRef::new_simple( + let caps = Caps::new_simple( "foo/bar", &[ ("int", 12.into()), diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 75c226724..61facbfd1 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -55,6 +55,7 @@ pub use caps::Caps; mod element; mod bin; +mod bus; pub use bin::BinExtManual; use std::ptr;