validate: action: Expose the .report_error() method

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1586>
This commit is contained in:
Thibault Saunier 2024-10-30 21:47:01 -03:00 committed by GStreamer Marge Bot
parent b941e9c56a
commit 5fccc0bc82
2 changed files with 11 additions and 2 deletions

View file

@ -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")]
pub fn execute(self) -> Result<crate::ActionSuccess, crate::ActionError> {
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 res = ffi::gst_validate_execute_action(action_type, action);

View file

@ -339,7 +339,6 @@ impl<'a> ActionTypeBuilder<'a> {
glib::Quark::from_str("scenario::execution-error"),
err,
);
return ffi::GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
}