Commit 5dd89d01 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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

parent 48958d38
......@@ -379,6 +379,11 @@ status = "generate"
[object.function.return]
nullable = false
[[object.function]]
name = "start"
[object.function.return]
bool_return_is_error = "Failed to start"
[[object]]
name = "Gst.DeviceMonitor"
status = "generate"
......@@ -387,6 +392,11 @@ status = "generate"
[object.function.return]
nullable = false
[[object.function]]
name = "start"
[object.function.return]
bool_return_is_error = "Failed to start"
[[object]]
name = "Gst.Device"
status = "generate"
......
......@@ -62,7 +62,7 @@ pub trait DeviceMonitorExt {
fn set_show_all_devices(&self, show_all: bool);
fn start(&self) -> bool;
fn start(&self) -> Result<(), glib::error::BoolError>;
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 {
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")
}
}
......
......@@ -60,7 +60,7 @@ pub trait DeviceProviderExt {
fn hide_provider(&self, name: &str);
fn start(&self) -> bool;
fn start(&self) -> Result<(), glib::error::BoolError>;
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 {
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")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment