From 9647ce88956491059f3714072077291ca611d80b Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 13 Mar 2023 16:52:29 -0300 Subject: [PATCH] validate: reporter: Add a report_action() method Part-of: --- gstreamer-validate/src/lib.rs | 3 +++ gstreamer-validate/src/reporter.rs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 gstreamer-validate/src/reporter.rs diff --git a/gstreamer-validate/src/lib.rs b/gstreamer-validate/src/lib.rs index 3934a6bf3..d8f48a20d 100644 --- a/gstreamer-validate/src/lib.rs +++ b/gstreamer-validate/src/lib.rs @@ -50,6 +50,9 @@ pub use enums::*; mod action; pub use action::{Action, ActionRef}; +mod reporter; +pub use reporter::*; + // Re-export all the traits in a prelude module, so that applications // can always "use gst_validate::prelude::*" without getting conflicts pub mod prelude { diff --git a/gstreamer-validate/src/reporter.rs b/gstreamer-validate/src/reporter.rs new file mode 100644 index 000000000..41eaf4c9d --- /dev/null +++ b/gstreamer-validate/src/reporter.rs @@ -0,0 +1,16 @@ +use glib::translate::*; + +use crate::action::Action; + +impl crate::Reporter { + pub fn report_action(&self, action: &Action, issue_id: crate::IssueId, message: &str) { + unsafe { + ffi::gst_validate_report_action( + self.to_glib_none().0, + action.to_glib_none().0, + issue_id.into_glib(), + message.to_glib_none().0, + ); + } + } +}