mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
Object::set_name() should not accept NULL
This commit is contained in:
parent
55c8cf69f3
commit
d182584c25
2 changed files with 9 additions and 5 deletions
|
@ -445,6 +445,12 @@ trait_name = "GstObjectExt"
|
||||||
[object.function.return]
|
[object.function.return]
|
||||||
nullable = false
|
nullable = false
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_name"
|
||||||
|
[[object.function.parameter]]
|
||||||
|
name = "name"
|
||||||
|
nullable = false
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "get_path_string"
|
name = "get_path_string"
|
||||||
[object.function.return]
|
[object.function.return]
|
||||||
|
|
|
@ -86,7 +86,7 @@ pub trait GstObjectExt {
|
||||||
|
|
||||||
fn set_control_rate(&self, control_rate: ClockTime);
|
fn set_control_rate(&self, control_rate: ClockTime);
|
||||||
|
|
||||||
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Result<(), glib::error::BoolError>;
|
fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> Result<(), glib::error::BoolError>;
|
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> Result<(), glib::error::BoolError>;
|
||||||
|
|
||||||
|
@ -202,11 +202,9 @@ impl<O: IsA<Object> + IsA<glib::object::Object>> GstObjectExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Result<(), glib::error::BoolError> {
|
fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError> {
|
||||||
let name = name.into();
|
|
||||||
let name = name.to_glib_none();
|
|
||||||
unsafe {
|
unsafe {
|
||||||
glib::error::BoolError::from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.0), "Failed to set object name")
|
glib::error::BoolError::from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.to_glib_none().0), "Failed to set object name")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue