DeviceMonitor/Provider::start() should return a Result

This commit is contained in:
Sebastian Dröge 2017-12-18 09:44:32 +02:00
parent 48958d381e
commit 5dd89d01e2
3 changed files with 16 additions and 6 deletions

View file

@ -379,6 +379,11 @@ status = "generate"
[object.function.return] [object.function.return]
nullable = false nullable = false
[[object.function]]
name = "start"
[object.function.return]
bool_return_is_error = "Failed to start"
[[object]] [[object]]
name = "Gst.DeviceMonitor" name = "Gst.DeviceMonitor"
status = "generate" status = "generate"
@ -387,6 +392,11 @@ status = "generate"
[object.function.return] [object.function.return]
nullable = false nullable = false
[[object.function]]
name = "start"
[object.function.return]
bool_return_is_error = "Failed to start"
[[object]] [[object]]
name = "Gst.Device" name = "Gst.Device"
status = "generate" status = "generate"

View file

@ -62,7 +62,7 @@ pub trait DeviceMonitorExt {
fn set_show_all_devices(&self, show_all: bool); fn set_show_all_devices(&self, show_all: bool);
fn start(&self) -> bool; fn start(&self) -> Result<(), glib::error::BoolError>;
fn stop(&self); fn stop(&self);
@ -120,9 +120,9 @@ impl<O: IsA<DeviceMonitor> + IsA<glib::object::Object>> DeviceMonitorExt for O {
} }
} }
fn start(&self) -> bool { fn start(&self) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
from_glib(ffi::gst_device_monitor_start(self.to_glib_none().0)) glib::error::BoolError::from_glib(ffi::gst_device_monitor_start(self.to_glib_none().0), "Failed to start")
} }
} }

View file

@ -60,7 +60,7 @@ pub trait DeviceProviderExt {
fn hide_provider(&self, name: &str); fn hide_provider(&self, name: &str);
fn start(&self) -> bool; fn start(&self) -> Result<(), glib::error::BoolError>;
fn stop(&self); fn stop(&self);
@ -120,9 +120,9 @@ impl<O: IsA<DeviceProvider> + IsA<glib::object::Object>> DeviceProviderExt for O
} }
} }
fn start(&self) -> bool { fn start(&self) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
from_glib(ffi::gst_device_provider_start(self.to_glib_none().0)) glib::error::BoolError::from_glib(ffi::gst_device_provider_start(self.to_glib_none().0), "Failed to start")
} }
} }