From 6286e496bafdfe003f918f5e24802a75ce352d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 7 Feb 2019 09:54:03 +0200 Subject: [PATCH] Fix build with GLib and GTK changes --- gst-plugin-threadshare/src/appsrc.rs | 21 ++++++++++++++------- gst-plugin-togglerecord/Cargo.toml | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gst-plugin-threadshare/src/appsrc.rs b/gst-plugin-threadshare/src/appsrc.rs index 64f5ea88..816e8e7e 100644 --- a/gst-plugin-threadshare/src/appsrc.rs +++ b/gst-plugin-threadshare/src/appsrc.rs @@ -513,11 +513,12 @@ impl ObjectSubclass for AppSrc { klass.install_properties(&PROPERTIES); - klass.add_action_signal( + klass.add_signal_with_class_handler( "push-buffer", + glib::SignalFlags::RUN_LAST | glib::SignalFlags::ACTION, &[gst::Buffer::static_type()], bool::static_type(), - |args| { + |_, args| { let element = args[0].get::().unwrap(); let buffer = args[1].get::().unwrap(); let appsrc = Self::from_instance(&element); @@ -526,11 +527,17 @@ impl ObjectSubclass for AppSrc { }, ); - klass.add_action_signal("end-of-stream", &[], bool::static_type(), |args| { - let element = args[0].get::().unwrap(); - let appsrc = Self::from_instance(&element); - Some(appsrc.end_of_stream(&element).to_value()) - }); + klass.add_signal_with_class_handler( + "end-of-stream", + glib::SignalFlags::RUN_LAST | glib::SignalFlags::ACTION, + &[], + bool::static_type(), + |_, args| { + let element = args[0].get::().unwrap(); + let appsrc = Self::from_instance(&element); + Some(appsrc.end_of_stream(&element).to_value()) + }, + ); } fn new_with_class(klass: &subclass::simple::ClassStruct) -> Self { diff --git a/gst-plugin-togglerecord/Cargo.toml b/gst-plugin-togglerecord/Cargo.toml index f4628704..652fa5a5 100644 --- a/gst-plugin-togglerecord/Cargo.toml +++ b/gst-plugin-togglerecord/Cargo.toml @@ -8,7 +8,7 @@ license = "LGPL-2.1+" glib = { git = "https://github.com/gtk-rs/glib", features = ["subclassing"] } gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["subclassing"] } gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } -gtk = { git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true } +gtk = { git = "https://github.com/gtk-rs/gtk", optional = true } gio = { git = "https://github.com/gtk-rs/gio", optional = true } parking_lot = "0.7"