mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
validate: action: Expose the .report_error() method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1586>
This commit is contained in:
parent
b941e9c56a
commit
5fccc0bc82
2 changed files with 11 additions and 2 deletions
|
@ -72,10 +72,20 @@ impl Action {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn report_error(&self, error_message: &str) {
|
||||||
|
if let Some(scenario) = self.scenario() {
|
||||||
|
scenario.upcast_ref::<crate::Reporter>().report_action(
|
||||||
|
self,
|
||||||
|
glib::Quark::from_str("scenario::execution-error"),
|
||||||
|
error_message,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(alias = "gst_validate_execute_action")]
|
#[doc(alias = "gst_validate_execute_action")]
|
||||||
pub fn execute(self) -> Result<crate::ActionSuccess, crate::ActionError> {
|
pub fn execute(self) -> Result<crate::ActionSuccess, crate::ActionError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let action: *mut ffi::GstValidateAction = self.to_glib_full();
|
let action: *mut ffi::GstValidateAction = self.into_glib_ptr();
|
||||||
let action_type = ffi::gst_validate_get_action_type((*action).type_);
|
let action_type = ffi::gst_validate_get_action_type((*action).type_);
|
||||||
|
|
||||||
let res = ffi::gst_validate_execute_action(action_type, action);
|
let res = ffi::gst_validate_execute_action(action_type, action);
|
||||||
|
|
|
@ -339,7 +339,6 @@ impl<'a> ActionTypeBuilder<'a> {
|
||||||
glib::Quark::from_str("scenario::execution-error"),
|
glib::Quark::from_str("scenario::execution-error"),
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
|
|
||||||
return ffi::GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
|
return ffi::GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue