From e41fb76d2d075ca0b6f74ab1f27661321464f5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 24 Jun 2017 12:02:24 +0300 Subject: [PATCH] Use new bool_return_is_error configuration for various functions And ignore some wrong bindings. --- Gir_Gst.toml | 151 ++++++++++++++++++++++++++++++++-- gstreamer/src/auto/bin.rs | 24 +++--- gstreamer/src/auto/bus.rs | 10 --- gstreamer/src/auto/clock.rs | 12 +-- gstreamer/src/auto/element.rs | 48 +++++------ gstreamer/src/auto/mod.rs | 2 + gstreamer/src/auto/object.rs | 19 +++-- gstreamer/src/auto/pad.rs | 30 +++---- 8 files changed, 214 insertions(+), 82 deletions(-) diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 3555fb625..f063a5a04 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -12,19 +12,13 @@ external_libraries = [ ] generate = [ - "Gst.Object", - "Gst.Bus", - "Gst.Clock", "Gst.ClockTime", - "Gst.Element", - "Gst.Bin", "Gst.Pipeline", "Gst.State", "Gst.StateChangeReturn", "Gst.StateChange", "Gst.SeekFlags", "Gst.SeekType", - "Gst.Pad", "Gst.FlowReturn", "Gst.PadDirection", "Gst.PadTemplate", @@ -39,3 +33,148 @@ manual = [ "GLib.Error", #"Gst.Message", ] + +[[object]] +name = "Gst.Bin" +status = "generate" + [[object.function]] + name = "add" + [object.function.return] + bool_return_is_error = "Failed to add element" + + [[object.function]] + name = "remove" + [object.function.return] + bool_return_is_error = "Failed to remove element" + + [[object.function]] + name = "recalculate_latency" + [object.function.return] + bool_return_is_error = "Failed to recalculate latency" + + [[object.function]] + name = "sync_children_states" + [object.function.return] + bool_return_is_error = "Failed to sync children states" + +[[object]] +name = "Gst.Bus" +status = "generate" + [[object.function]] + name = "remove_watch" + # Needs manual bindings and GSource support in glib-rs + ignore = true + +[[object]] +name = "Gst.Clock" +status = "generate" + [[object.function]] + name = "set_master" + [object.function.return] + bool_return_is_error = "Failed to set master clock" + + [[object.function]] + name = "wait_for_sync" + [object.function.return] + bool_return_is_error = "Timed out waiting for sync" + +[[object]] +name = "Gst.Element" +status = "generate" + [[object.function]] + name = "add_pad" + [object.function.return] + bool_return_is_error = "Failed to add pad" + + [[object.function]] + name = "remove_pad" + [object.function.return] + bool_return_is_error = "Failed to remove pad" + + [[object.function]] + name = "link" + [object.function.return] + bool_return_is_error = "Failed to link elements" + + [[object.function]] + name = "link_pads" + [object.function.return] + bool_return_is_error = "Failed to link pads" + + [[object.function]] + name = "seek" + [object.function.return] + bool_return_is_error = "Failed to seek" + + [[object.function]] + name = "seek_simple" + [object.function.return] + bool_return_is_error = "Failed to seek" + + [[object.function]] + name = "set_clock" + [object.function.return] + bool_return_is_error = "Failed to set clock" + + [[object.function]] + name = "sync_state_with_parent" + [object.function.return] + bool_return_is_error = "Failed to sync state with parent" + +[[object]] +name = "Gst.Object" +status = "generate" + [[object.function]] + name = "set_name" + [object.function.return] + bool_return_is_error = "Failed to set object name" + + [[object.function]] + name = "set_parent" + [object.function.return] + bool_return_is_error = "Failed to set parent object" + + [[object.function]] + name = "sync_values" + [object.function.return] + bool_return_is_error = "Failed to sync values" + +[[object]] +name = "Gst.Pad" +status = "generate" + [[object.function]] + name = "link_maybe_ghosting" + [object.function.return] + bool_return_is_error = "Failed to link pad, possibly ghosting" + + [[object.function]] + name = "unlink" + [object.function.return] + bool_return_is_error = "Failed to unlink pad" + + [[object.function]] + name = "pause_task" + [object.function.return] + bool_return_is_error = "Failed to pause pad task" + + [[object.function]] + name = "stop_task" + [object.function.return] + bool_return_is_error = "Failed to stop pad task" + + [[object.function]] + name = "set_active" + [object.function.return] + bool_return_is_error = "Failed to activate pad" + +[[object]] +name = "Gst.*" +status = "generate" + [[object.function]] + name = "update_registry" + [object.function.return] + bool_return_is_error = "Failed to update registry" + + [[object.function]] + name = "util_dump_mem" + ignore = true diff --git a/gstreamer/src/auto/bin.rs b/gstreamer/src/auto/bin.rs index f1901d2bf..c71428167 100644 --- a/gstreamer/src/auto/bin.rs +++ b/gstreamer/src/auto/bin.rs @@ -36,7 +36,7 @@ impl Bin { } pub trait BinExt { - fn add>(&self, element: &P) -> bool; + fn add>(&self, element: &P) -> Result<(), glib::error::BoolError>; //fn add_many>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); @@ -63,9 +63,9 @@ pub trait BinExt { //fn iterate_sources(&self) -> /*Ignored*/Option; - fn recalculate_latency(&self) -> bool; + fn recalculate_latency(&self) -> Result<(), glib::error::BoolError>; - fn remove>(&self, element: &P) -> bool; + fn remove>(&self, element: &P) -> Result<(), glib::error::BoolError>; //fn remove_many>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); @@ -73,7 +73,7 @@ pub trait BinExt { //fn set_suppressed_flags(&self, flags: /*Ignored*/ElementFlags); #[cfg(feature = "v1_6")] - fn sync_children_states(&self) -> bool; + fn sync_children_states(&self) -> Result<(), glib::error::BoolError>; fn get_property_async_handling(&self) -> bool; @@ -97,9 +97,9 @@ pub trait BinExt { } impl + IsA> BinExt for O { - fn add>(&self, element: &P) -> bool { + fn add>(&self, element: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_bin_add(self.to_glib_none().0, element.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_bin_add(self.to_glib_none().0, element.to_glib_none().0), "Failed to add element") } } @@ -160,15 +160,15 @@ impl + IsA> BinExt for O { // unsafe { TODO: call ffi::gst_bin_iterate_sources() } //} - fn recalculate_latency(&self) -> bool { + fn recalculate_latency(&self) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_bin_recalculate_latency(self.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_bin_recalculate_latency(self.to_glib_none().0), "Failed to recalculate latency") } } - fn remove>(&self, element: &P) -> bool { + fn remove>(&self, element: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_bin_remove(self.to_glib_none().0, element.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_bin_remove(self.to_glib_none().0, element.to_glib_none().0), "Failed to remove element") } } @@ -182,9 +182,9 @@ impl + IsA> BinExt for O { //} #[cfg(feature = "v1_6")] - fn sync_children_states(&self) -> bool { + fn sync_children_states(&self) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_bin_sync_children_states(self.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_bin_sync_children_states(self.to_glib_none().0), "Failed to sync children states") } } diff --git a/gstreamer/src/auto/bus.rs b/gstreamer/src/auto/bus.rs index f66b8e7e3..1d01ecd93 100644 --- a/gstreamer/src/auto/bus.rs +++ b/gstreamer/src/auto/bus.rs @@ -53,9 +53,6 @@ pub trait BusExt { fn remove_signal_watch(&self); - #[cfg(feature = "v1_6")] - fn remove_watch(&self) -> bool; - fn set_flushing(&self, flushing: bool); //fn set_sync_handler<'a, P: Into>, Q: Into>>(&self, func: P, user_data: Q, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify); @@ -144,13 +141,6 @@ impl> BusExt for O { } } - #[cfg(feature = "v1_6")] - fn remove_watch(&self) -> bool { - unsafe { - from_glib(ffi::gst_bus_remove_watch(self.to_glib_none().0)) - } - } - fn set_flushing(&self, flushing: bool) { unsafe { ffi::gst_bus_set_flushing(self.to_glib_none().0, flushing.to_glib()); diff --git a/gstreamer/src/auto/clock.rs b/gstreamer/src/auto/clock.rs index 0a7cfa107..c8b249a54 100644 --- a/gstreamer/src/auto/clock.rs +++ b/gstreamer/src/auto/clock.rs @@ -94,7 +94,7 @@ pub trait ClockExt { fn set_calibration(&self, internal: ClockTime, external: ClockTime, rate_num: ClockTime, rate_denom: ClockTime); - fn set_master<'a, P: IsA + 'a, Q: Into>>(&self, master: Q) -> bool; + fn set_master<'a, P: IsA + 'a, Q: Into>>(&self, master: Q) -> Result<(), glib::error::BoolError>; fn set_resolution(&self, resolution: ClockTime) -> ClockTime; @@ -111,7 +111,7 @@ pub trait ClockExt { fn unadjust_with_calibration(&self, external_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime; #[cfg(feature = "v1_6")] - fn wait_for_sync(&self, timeout: ClockTime) -> bool; + fn wait_for_sync(&self, timeout: ClockTime) -> Result<(), glib::error::BoolError>; fn get_property_window_size(&self) -> i32; @@ -226,11 +226,11 @@ impl + IsA> ClockExt for O { } } - fn set_master<'a, P: IsA + 'a, Q: Into>>(&self, master: Q) -> bool { + fn set_master<'a, P: IsA + 'a, Q: Into>>(&self, master: Q) -> Result<(), glib::error::BoolError> { let master = master.into(); let master = master.to_glib_none(); unsafe { - from_glib(ffi::gst_clock_set_master(self.to_glib_none().0, master.0)) + glib::error::BoolError::from_glib(ffi::gst_clock_set_master(self.to_glib_none().0, master.0), "Failed to set master clock") } } @@ -271,9 +271,9 @@ impl + IsA> ClockExt for O { } #[cfg(feature = "v1_6")] - fn wait_for_sync(&self, timeout: ClockTime) -> bool { + fn wait_for_sync(&self, timeout: ClockTime) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_clock_wait_for_sync(self.to_glib_none().0, timeout)) + glib::error::BoolError::from_glib(ffi::gst_clock_wait_for_sync(self.to_glib_none().0, timeout), "Timed out waiting for sync") } } diff --git a/gstreamer/src/auto/element.rs b/gstreamer/src/auto/element.rs index 17f6e303c..abec71330 100644 --- a/gstreamer/src/auto/element.rs +++ b/gstreamer/src/auto/element.rs @@ -69,7 +69,7 @@ impl Element { pub trait ElementExt { fn abort_state(&self); - fn add_pad>(&self, pad: &P) -> bool; + fn add_pad>(&self, pad: &P) -> Result<(), glib::error::BoolError>; #[cfg(feature = "v1_10")] fn add_property_deep_notify_watch<'a, P: Into>>(&self, property_name: P, include_value: bool) -> libc::c_ulong; @@ -123,13 +123,13 @@ pub trait ElementExt { //fn iterate_src_pads(&self) -> /*Ignored*/Option; - fn link>(&self, dest: &P) -> bool; + fn link>(&self, dest: &P) -> Result<(), glib::error::BoolError>; //fn link_filtered<'a, P: IsA, Q: Into>>(&self, dest: &P, filter: Q) -> bool; //fn link_many>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> bool; - fn link_pads<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, srcpadname: P, dest: &Q, destpadname: R) -> bool; + fn link_pads<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, srcpadname: P, dest: &Q, destpadname: R) -> Result<(), glib::error::BoolError>; //fn link_pads_filtered<'a, 'b, 'c, P: Into>, Q: IsA, R: Into>, S: Into>>(&self, srcpadname: P, dest: &Q, destpadname: R, filter: S) -> bool; @@ -158,16 +158,16 @@ pub trait ElementExt { fn release_request_pad>(&self, pad: &P); - fn remove_pad>(&self, pad: &P) -> bool; + fn remove_pad>(&self, pad: &P) -> Result<(), glib::error::BoolError>; #[cfg(feature = "v1_10")] fn remove_property_notify_watch(&self, watch_id: libc::c_ulong); //fn request_pad<'a, 'b, P: Into>, Q: Into>>(&self, templ: &PadTemplate, name: P, caps: Q) -> Option; - fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> bool; + fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> Result<(), glib::error::BoolError>; - fn seek_simple(&self, format: Format, seek_flags: SeekFlags, seek_pos: i64) -> bool; + fn seek_simple(&self, format: Format, seek_flags: SeekFlags, seek_pos: i64) -> Result<(), glib::error::BoolError>; //fn send_event(&self, event: /*Ignored*/&mut Event) -> bool; @@ -175,7 +175,7 @@ pub trait ElementExt { fn set_bus(&self, bus: &Bus); - fn set_clock>(&self, clock: &P) -> bool; + fn set_clock>(&self, clock: &P) -> Result<(), glib::error::BoolError>; //fn set_context(&self, context: /*Ignored*/&mut Context); @@ -185,7 +185,7 @@ pub trait ElementExt { fn set_state(&self, state: State) -> StateChangeReturn; - fn sync_state_with_parent(&self) -> bool; + fn sync_state_with_parent(&self) -> Result<(), glib::error::BoolError>; fn unlink>(&self, dest: &P); @@ -207,9 +207,9 @@ impl + IsA> ElementExt for O { } } - fn add_pad>(&self, pad: &P) -> bool { + fn add_pad>(&self, pad: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_add_pad(self.to_glib_none().0, pad.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_element_add_pad(self.to_glib_none().0, pad.to_glib_none().0), "Failed to add pad") } } @@ -348,9 +348,9 @@ impl + IsA> ElementExt for O { // unsafe { TODO: call ffi::gst_element_iterate_src_pads() } //} - fn link>(&self, dest: &P) -> bool { + fn link>(&self, dest: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_link(self.to_glib_none().0, dest.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_element_link(self.to_glib_none().0, dest.to_glib_none().0), "Failed to link elements") } } @@ -362,13 +362,13 @@ impl + IsA> ElementExt for O { // unsafe { TODO: call ffi::gst_element_link_many() } //} - fn link_pads<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, srcpadname: P, dest: &Q, destpadname: R) -> bool { + fn link_pads<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, srcpadname: P, dest: &Q, destpadname: R) -> Result<(), glib::error::BoolError> { let srcpadname = srcpadname.into(); let srcpadname = srcpadname.to_glib_none(); let destpadname = destpadname.into(); let destpadname = destpadname.to_glib_none(); unsafe { - from_glib(ffi::gst_element_link_pads(self.to_glib_none().0, srcpadname.0, dest.to_glib_none().0, destpadname.0)) + glib::error::BoolError::from_glib(ffi::gst_element_link_pads(self.to_glib_none().0, srcpadname.0, dest.to_glib_none().0, destpadname.0), "Failed to link pads") } } @@ -445,9 +445,9 @@ impl + IsA> ElementExt for O { } } - fn remove_pad>(&self, pad: &P) -> bool { + fn remove_pad>(&self, pad: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_remove_pad(self.to_glib_none().0, pad.to_glib_full())) + glib::error::BoolError::from_glib(ffi::gst_element_remove_pad(self.to_glib_none().0, pad.to_glib_full()), "Failed to remove pad") } } @@ -462,15 +462,15 @@ impl + IsA> ElementExt for O { // unsafe { TODO: call ffi::gst_element_request_pad() } //} - fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> bool { + fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_seek(self.to_glib_none().0, rate, format.to_glib(), flags.to_glib(), start_type.to_glib(), start, stop_type.to_glib(), stop)) + glib::error::BoolError::from_glib(ffi::gst_element_seek(self.to_glib_none().0, rate, format.to_glib(), flags.to_glib(), start_type.to_glib(), start, stop_type.to_glib(), stop), "Failed to seek") } } - fn seek_simple(&self, format: Format, seek_flags: SeekFlags, seek_pos: i64) -> bool { + fn seek_simple(&self, format: Format, seek_flags: SeekFlags, seek_pos: i64) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_seek_simple(self.to_glib_none().0, format.to_glib(), seek_flags.to_glib(), seek_pos)) + glib::error::BoolError::from_glib(ffi::gst_element_seek_simple(self.to_glib_none().0, format.to_glib(), seek_flags.to_glib(), seek_pos), "Failed to seek") } } @@ -490,9 +490,9 @@ impl + IsA> ElementExt for O { } } - fn set_clock>(&self, clock: &P) -> bool { + fn set_clock>(&self, clock: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_set_clock(self.to_glib_none().0, clock.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_element_set_clock(self.to_glib_none().0, clock.to_glib_none().0), "Failed to set clock") } } @@ -518,9 +518,9 @@ impl + IsA> ElementExt for O { } } - fn sync_state_with_parent(&self) -> bool { + fn sync_state_with_parent(&self) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_element_sync_state_with_parent(self.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_element_sync_state_with_parent(self.to_glib_none().0), "Failed to sync state with parent") } } diff --git a/gstreamer/src/auto/mod.rs b/gstreamer/src/auto/mod.rs index 743484996..1a0feb2cd 100644 --- a/gstreamer/src/auto/mod.rs +++ b/gstreamer/src/auto/mod.rs @@ -70,6 +70,8 @@ mod alias; pub use self::alias::ClockTime; pub use self::alias::ElementFactoryListType; +pub mod functions; + #[doc(hidden)] pub mod traits { pub use super::BinExt; diff --git a/gstreamer/src/auto/object.rs b/gstreamer/src/auto/object.rs index 9a30162da..743cf9582 100644 --- a/gstreamer/src/auto/object.rs +++ b/gstreamer/src/auto/object.rs @@ -4,6 +4,7 @@ use ClockTime; use Error; use ffi; +use glib; use glib::object::IsA; use glib::translate::*; @@ -73,13 +74,13 @@ pub trait ObjectExt { fn set_control_rate(&self, control_rate: ClockTime); - fn set_name<'a, P: Into>>(&self, name: P) -> bool; + fn set_name<'a, P: Into>>(&self, name: P) -> Result<(), glib::error::BoolError>; - fn set_parent>(&self, parent: &P) -> bool; + fn set_parent>(&self, parent: &P) -> Result<(), glib::error::BoolError>; fn suggest_next_sync(&self) -> ClockTime; - fn sync_values(&self, timestamp: ClockTime) -> bool; + fn sync_values(&self, timestamp: ClockTime) -> Result<(), glib::error::BoolError>; fn unparent(&self); @@ -186,17 +187,17 @@ impl> ObjectExt for O { } } - fn set_name<'a, P: Into>>(&self, name: P) -> bool { + fn set_name<'a, P: Into>>(&self, name: P) -> Result<(), glib::error::BoolError> { let name = name.into(); let name = name.to_glib_none(); unsafe { - from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.0)) + glib::error::BoolError::from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.0), "Failed to set object name") } } - fn set_parent>(&self, parent: &P) -> bool { + fn set_parent>(&self, parent: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_object_set_parent(self.to_glib_none().0, parent.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_object_set_parent(self.to_glib_none().0, parent.to_glib_none().0), "Failed to set parent object") } } @@ -206,9 +207,9 @@ impl> ObjectExt for O { } } - fn sync_values(&self, timestamp: ClockTime) -> bool { + fn sync_values(&self, timestamp: ClockTime) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_object_sync_values(self.to_glib_none().0, timestamp)) + glib::error::BoolError::from_glib(ffi::gst_object_sync_values(self.to_glib_none().0, timestamp), "Failed to sync values") } } diff --git a/gstreamer/src/auto/pad.rs b/gstreamer/src/auto/pad.rs index 60b0dc958..e2c9e8b91 100644 --- a/gstreamer/src/auto/pad.rs +++ b/gstreamer/src/auto/pad.rs @@ -133,7 +133,7 @@ pub trait PadExt { //fn link_full>(&self, sinkpad: &P, flags: /*Ignored*/PadLinkCheck) -> /*Ignored*/PadLinkReturn; #[cfg(feature = "v1_10")] - fn link_maybe_ghosting>(&self, sink: &P) -> bool; + fn link_maybe_ghosting>(&self, sink: &P) -> Result<(), glib::error::BoolError>; //#[cfg(feature = "v1_10")] //fn link_maybe_ghosting_full>(&self, sink: &P, flags: /*Ignored*/PadLinkCheck) -> bool; @@ -142,7 +142,7 @@ pub trait PadExt { fn needs_reconfigure(&self) -> bool; - fn pause_task(&self) -> bool; + fn pause_task(&self) -> Result<(), glib::error::BoolError>; //fn peer_query(&self, query: /*Ignored*/&mut Query) -> bool; @@ -190,7 +190,7 @@ pub trait PadExt { //fn set_activatemode_function_full>>(&self, activatemode: /*Unknown conversion*//*Unimplemented*/PadActivateModeFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify); - fn set_active(&self, active: bool) -> bool; + fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>; //fn set_chain_function_full>>(&self, chain: /*Unknown conversion*//*Unimplemented*/PadChainFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify); @@ -219,12 +219,12 @@ pub trait PadExt { //fn sticky_events_foreach>>(&self, foreach_func: /*Unknown conversion*//*Unimplemented*/PadStickyEventsForeachFunction, user_data: P); - fn stop_task(&self) -> bool; + fn stop_task(&self) -> Result<(), glib::error::BoolError>; //#[cfg(feature = "v1_2")] //fn store_sticky_event(&self, event: /*Ignored*/&mut Event) -> FlowReturn; - fn unlink>(&self, sinkpad: &P) -> bool; + fn unlink>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError>; fn use_fixed_caps(&self); @@ -417,9 +417,9 @@ impl + IsA> PadExt for O { //} #[cfg(feature = "v1_10")] - fn link_maybe_ghosting>(&self, sink: &P) -> bool { + fn link_maybe_ghosting>(&self, sink: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_pad_link_maybe_ghosting(self.to_glib_none().0, sink.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_pad_link_maybe_ghosting(self.to_glib_none().0, sink.to_glib_none().0), "Failed to link pad, possibly ghosting") } } @@ -440,9 +440,9 @@ impl + IsA> PadExt for O { } } - fn pause_task(&self) -> bool { + fn pause_task(&self) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_pad_pause_task(self.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_pad_pause_task(self.to_glib_none().0), "Failed to pause pad task") } } @@ -564,9 +564,9 @@ impl + IsA> PadExt for O { // unsafe { TODO: call ffi::gst_pad_set_activatemode_function_full() } //} - fn set_active(&self, active: bool) -> bool { + fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_pad_set_active(self.to_glib_none().0, active.to_glib())) + glib::error::BoolError::from_glib(ffi::gst_pad_set_active(self.to_glib_none().0, active.to_glib()), "Failed to activate pad") } } @@ -625,9 +625,9 @@ impl + IsA> PadExt for O { // unsafe { TODO: call ffi::gst_pad_sticky_events_foreach() } //} - fn stop_task(&self) -> bool { + fn stop_task(&self) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_pad_stop_task(self.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_pad_stop_task(self.to_glib_none().0), "Failed to stop pad task") } } @@ -636,9 +636,9 @@ impl + IsA> PadExt for O { // unsafe { TODO: call ffi::gst_pad_store_sticky_event() } //} - fn unlink>(&self, sinkpad: &P) -> bool { + fn unlink>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError> { unsafe { - from_glib(ffi::gst_pad_unlink(self.to_glib_none().0, sinkpad.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_pad_unlink(self.to_glib_none().0, sinkpad.to_glib_none().0), "Failed to unlink pad") } }