From 5227af5935245221d0845e018756006b1dab3285 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 31 Aug 2022 14:29:08 -0400 Subject: [PATCH] validate: Update from fixed gir --- gst-gir-files | 2 +- gstreamer-validate/src/auto/action.rs | 6 ++--- gstreamer-validate/src/auto/bin_monitor.rs | 8 +++---- .../src/auto/element_monitor.rs | 6 ++--- gstreamer-validate/src/auto/monitor.rs | 10 ++++---- gstreamer-validate/src/auto/pad_monitor.rs | 6 ++--- .../src/auto/pipeline_monitor.rs | 6 ++--- gstreamer-validate/src/auto/report.rs | 2 +- gstreamer-validate/src/auto/reporter.rs | 23 +++++++++++------- gstreamer-validate/src/auto/scenario.rs | 24 +++++++++++-------- gstreamer-validate/src/auto/versions.txt | 2 +- gstreamer-validate/sys/build.rs | 2 +- gstreamer-validate/sys/src/lib.rs | 2 +- gstreamer-validate/sys/tests/abi.rs | 2 +- gstreamer-validate/sys/tests/constant.c | 2 +- gstreamer-validate/sys/tests/layout.c | 2 +- 16 files changed, 57 insertions(+), 48 deletions(-) diff --git a/gst-gir-files b/gst-gir-files index 180ef1b6c..b73d2b6fb 160000 --- a/gst-gir-files +++ b/gst-gir-files @@ -1 +1 @@ -Subproject commit 180ef1b6c0bb1172a76209ba25a3b745ebb7af90 +Subproject commit b73d2b6fbeadfbb58e242d88a82535a4e56dc25d diff --git a/gstreamer-validate/src/auto/action.rs b/gstreamer-validate/src/auto/action.rs index 41a81bc75..45b5b2922 100644 --- a/gstreamer-validate/src/auto/action.rs +++ b/gstreamer-validate/src/auto/action.rs @@ -19,14 +19,14 @@ glib::wrapper! { impl Action { //#[doc(alias = "gst_validate_action_new")] - //pub fn new(scenario: &impl IsA, action_type: /*Ignored*/&mut ActionType, structure: &mut gst::Structure, add_to_lists: bool) -> Action { + //pub fn new(scenario: Option<&impl IsA>, action_type: /*Ignored*/&mut ActionType, structure: &mut gst::Structure, add_to_lists: bool) -> Action { // unsafe { TODO: call ffi:gst_validate_action_new() } //} #[doc(alias = "gst_validate_action_get_scenario")] #[doc(alias = "get_scenario")] pub fn scenario(&self) -> Option { - unsafe { from_glib_none(ffi::gst_validate_action_get_scenario(self.to_glib_none().0)) } + unsafe { from_glib_full(ffi::gst_validate_action_get_scenario(self.to_glib_none().0)) } } #[doc(alias = "gst_validate_action_set_done")] @@ -38,7 +38,7 @@ impl Action { //#[doc(alias = "gst_validate_action_get_clocktime")] //#[doc(alias = "get_clocktime")] - //pub fn is_clocktime(scenario: &impl IsA, action: &Action, name: &str, retval: /*Ignored*/gst::ClockTime) -> bool { + //pub fn clocktime(scenario: &impl IsA, action: &Action, name: &str) -> Option { // unsafe { TODO: call ffi:gst_validate_action_get_clocktime() } //} } diff --git a/gstreamer-validate/src/auto/bin_monitor.rs b/gstreamer-validate/src/auto/bin_monitor.rs index 233ddc05c..857d70f3b 100644 --- a/gstreamer-validate/src/auto/bin_monitor.rs +++ b/gstreamer-validate/src/auto/bin_monitor.rs @@ -33,14 +33,14 @@ impl BinMonitor { pub fn new( bin: &impl IsA, runner: &impl IsA, - parent: &impl IsA, + parent: Option<&impl IsA>, ) -> BinMonitor { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::gst_validate_bin_monitor_new( + from_glib_full(ffi::gst_validate_bin_monitor_new( bin.as_ref().to_glib_none().0, runner.as_ref().to_glib_none().0, - parent.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, )) } } @@ -67,7 +67,7 @@ pub trait BinMonitorExt: 'static { impl> BinMonitorExt for O { fn scenario(&self) -> Option { unsafe { - from_glib_none(ffi::gst_validate_bin_monitor_get_scenario( + from_glib_full(ffi::gst_validate_bin_monitor_get_scenario( self.as_ref().to_glib_none().0, )) } diff --git a/gstreamer-validate/src/auto/element_monitor.rs b/gstreamer-validate/src/auto/element_monitor.rs index ab4d4d558..c66647242 100644 --- a/gstreamer-validate/src/auto/element_monitor.rs +++ b/gstreamer-validate/src/auto/element_monitor.rs @@ -25,14 +25,14 @@ impl ElementMonitor { pub fn new( element: &impl IsA, runner: &impl IsA, - parent: &impl IsA, + parent: Option<&impl IsA>, ) -> ElementMonitor { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::gst_validate_element_monitor_new( + from_glib_full(ffi::gst_validate_element_monitor_new( element.as_ref().to_glib_none().0, runner.as_ref().to_glib_none().0, - parent.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, )) } } diff --git a/gstreamer-validate/src/auto/monitor.rs b/gstreamer-validate/src/auto/monitor.rs index a5040c1ff..ce0299ca8 100644 --- a/gstreamer-validate/src/auto/monitor.rs +++ b/gstreamer-validate/src/auto/monitor.rs @@ -31,14 +31,14 @@ impl Monitor { pub fn factory_create( target: &impl IsA, runner: &impl IsA, - parent: &impl IsA, + parent: Option<&impl IsA>, ) -> Option { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::gst_validate_monitor_factory_create( + from_glib_full(ffi::gst_validate_monitor_factory_create( target.as_ref().to_glib_none().0, runner.as_ref().to_glib_none().0, - parent.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, )) } } @@ -117,7 +117,7 @@ impl> MonitorExt for O { fn pipeline(&self) -> Option { unsafe { - from_glib_none(ffi::gst_validate_monitor_get_pipeline( + from_glib_full(ffi::gst_validate_monitor_get_pipeline( self.as_ref().to_glib_none().0, )) } @@ -125,7 +125,7 @@ impl> MonitorExt for O { fn target(&self) -> Option { unsafe { - from_glib_none(ffi::gst_validate_monitor_get_target( + from_glib_full(ffi::gst_validate_monitor_get_target( self.as_ref().to_glib_none().0, )) } diff --git a/gstreamer-validate/src/auto/pad_monitor.rs b/gstreamer-validate/src/auto/pad_monitor.rs index 3a9d40799..a29706c9a 100644 --- a/gstreamer-validate/src/auto/pad_monitor.rs +++ b/gstreamer-validate/src/auto/pad_monitor.rs @@ -26,14 +26,14 @@ impl PadMonitor { pub fn new( pad: &impl IsA, runner: &impl IsA, - parent: &impl IsA, + parent: Option<&impl IsA>, ) -> PadMonitor { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::gst_validate_pad_monitor_new( + from_glib_full(ffi::gst_validate_pad_monitor_new( pad.as_ref().to_glib_none().0, runner.as_ref().to_glib_none().0, - parent.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, )) } } diff --git a/gstreamer-validate/src/auto/pipeline_monitor.rs b/gstreamer-validate/src/auto/pipeline_monitor.rs index d22fcb8f4..23b167ee8 100644 --- a/gstreamer-validate/src/auto/pipeline_monitor.rs +++ b/gstreamer-validate/src/auto/pipeline_monitor.rs @@ -27,14 +27,14 @@ impl PipelineMonitor { pub fn new( pipeline: &impl IsA, runner: &impl IsA, - parent: &impl IsA, + parent: Option<&impl IsA>, ) -> PipelineMonitor { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::gst_validate_pipeline_monitor_new( + from_glib_full(ffi::gst_validate_pipeline_monitor_new( pipeline.as_ref().to_glib_none().0, runner.as_ref().to_glib_none().0, - parent.as_ref().to_glib_none().0, + parent.map(|p| p.as_ref()).to_glib_none().0, )) } } diff --git a/gstreamer-validate/src/auto/report.rs b/gstreamer-validate/src/auto/report.rs index 7aecc3fd8..d1a8ed402 100644 --- a/gstreamer-validate/src/auto/report.rs +++ b/gstreamer-validate/src/auto/report.rs @@ -93,7 +93,7 @@ impl Report { #[doc(alias = "gst_validate_report_get_reporter")] #[doc(alias = "get_reporter")] pub fn reporter(&self) -> Option { - unsafe { from_glib_none(ffi::gst_validate_report_get_reporter(self.to_glib_none().0)) } + unsafe { from_glib_full(ffi::gst_validate_report_get_reporter(self.to_glib_none().0)) } } #[doc(alias = "gst_validate_report_get_reporter_name")] diff --git a/gstreamer-validate/src/auto/reporter.rs b/gstreamer-validate/src/auto/reporter.rs index 42067b8ce..3e6aa0c56 100644 --- a/gstreamer-validate/src/auto/reporter.rs +++ b/gstreamer-validate/src/auto/reporter.rs @@ -3,6 +3,7 @@ // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT +use crate::Report; use crate::ReportingDetails; use crate::Runner; use glib::object::IsA; @@ -42,9 +43,9 @@ pub trait ReporterExt: 'static { #[doc(alias = "get_reporting_level")] fn reporting_level(&self) -> ReportingDetails; - //#[doc(alias = "gst_validate_reporter_get_reports")] - //#[doc(alias = "get_reports")] - //fn reports(&self) -> /*Unimplemented*/Vec; + #[doc(alias = "gst_validate_reporter_get_reports")] + #[doc(alias = "get_reports")] + fn reports(&self) -> Vec; #[doc(alias = "gst_validate_reporter_get_reports_count")] #[doc(alias = "get_reports_count")] @@ -87,7 +88,7 @@ impl> ReporterExt for O { fn pipeline(&self) -> Option { unsafe { - from_glib_none(ffi::gst_validate_reporter_get_pipeline( + from_glib_full(ffi::gst_validate_reporter_get_pipeline( self.as_ref().to_glib_none().0, )) } @@ -105,9 +106,13 @@ impl> ReporterExt for O { } } - //fn reports(&self) -> /*Unimplemented*/Vec { - // unsafe { TODO: call ffi:gst_validate_reporter_get_reports() } - //} + fn reports(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::gst_validate_reporter_get_reports( + self.as_ref().to_glib_none().0, + )) + } + } fn reports_count(&self) -> i32 { unsafe { ffi::gst_validate_reporter_get_reports_count(self.as_ref().to_glib_none().0) } @@ -115,7 +120,7 @@ impl> ReporterExt for O { fn runner(&self) -> Option { unsafe { - from_glib_none(ffi::gst_validate_reporter_get_runner( + from_glib_full(ffi::gst_validate_reporter_get_runner( self.as_ref().to_glib_none().0, )) } @@ -147,7 +152,7 @@ impl> ReporterExt for O { unsafe { ffi::gst_validate_reporter_set_name( self.as_ref().to_glib_none().0, - name.to_glib_none().0, + name.to_glib_full(), ); } } diff --git a/gstreamer-validate/src/auto/scenario.rs b/gstreamer-validate/src/auto/scenario.rs index 0945a7111..c8b590088 100644 --- a/gstreamer-validate/src/auto/scenario.rs +++ b/gstreamer-validate/src/auto/scenario.rs @@ -44,7 +44,7 @@ impl Scenario { ) -> Option { skip_assert_initialized!(); unsafe { - from_glib_none(ffi::gst_validate_scenario_factory_create( + from_glib_full(ffi::gst_validate_scenario_factory_create( runner.as_ref().to_glib_none().0, pipeline.as_ref().to_glib_none().0, scenario_name.to_glib_none().0, @@ -57,9 +57,9 @@ pub trait ScenarioExt: 'static { //#[doc(alias = "gst_validate_scenario_execute_seek")] //fn execute_seek(&self, action: &Action, rate: f64, format: gst::Format, flags: gst::SeekFlags, start_type: gst::SeekType, start: /*Ignored*/gst::ClockTime, stop_type: gst::SeekType, stop: /*Ignored*/gst::ClockTime) -> i32; - //#[doc(alias = "gst_validate_scenario_get_actions")] - //#[doc(alias = "get_actions")] - //fn actions(&self) -> /*Unimplemented*/Vec; + #[doc(alias = "gst_validate_scenario_get_actions")] + #[doc(alias = "get_actions")] + fn actions(&self) -> Vec; #[doc(alias = "gst_validate_scenario_get_pipeline")] #[doc(alias = "get_pipeline")] @@ -96,13 +96,17 @@ impl> ScenarioExt for O { // unsafe { TODO: call ffi:gst_validate_scenario_execute_seek() } //} - //fn actions(&self) -> /*Unimplemented*/Vec { - // unsafe { TODO: call ffi:gst_validate_scenario_get_actions() } - //} + fn actions(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::gst_validate_scenario_get_actions( + self.as_ref().to_glib_none().0, + )) + } + } fn pipeline(&self) -> Option { unsafe { - from_glib_none(ffi::gst_validate_scenario_get_pipeline( + from_glib_full(ffi::gst_validate_scenario_get_pipeline( self.as_ref().to_glib_none().0, )) } @@ -134,13 +138,13 @@ impl> ScenarioExt for O { F: Fn(&P, &Action) + 'static, >( this: *mut ffi::GstValidateScenario, - object: *mut ffi::GstValidateAction, + action: *mut ffi::GstValidateAction, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Scenario::from_glib_borrow(this).unsafe_cast_ref(), - &from_glib_borrow(object), + &from_glib_borrow(action), ) } unsafe { diff --git a/gstreamer-validate/src/auto/versions.txt b/gstreamer-validate/src/auto/versions.txt index 5cd49fbdf..446e74b1b 100644 --- a/gstreamer-validate/src/auto/versions.txt +++ b/gstreamer-validate/src/auto/versions.txt @@ -1,3 +1,3 @@ Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) -from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 180ef1b6c0bb) +from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 4903e817c5dd) diff --git a/gstreamer-validate/sys/build.rs b/gstreamer-validate/sys/build.rs index 84f8d9749..a4a5d1054 100644 --- a/gstreamer-validate/sys/build.rs +++ b/gstreamer-validate/sys/build.rs @@ -1,6 +1,6 @@ // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) -// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 180ef1b6c0bb) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 4903e817c5dd) // DO NOT EDIT #[cfg(not(feature = "dox"))] diff --git a/gstreamer-validate/sys/src/lib.rs b/gstreamer-validate/sys/src/lib.rs index a4c0788f3..263f1ae68 100644 --- a/gstreamer-validate/sys/src/lib.rs +++ b/gstreamer-validate/sys/src/lib.rs @@ -1,6 +1,6 @@ // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) -// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 180ef1b6c0bb) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 4903e817c5dd) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] diff --git a/gstreamer-validate/sys/tests/abi.rs b/gstreamer-validate/sys/tests/abi.rs index f3cdb5254..e732d9a8f 100644 --- a/gstreamer-validate/sys/tests/abi.rs +++ b/gstreamer-validate/sys/tests/abi.rs @@ -1,6 +1,6 @@ // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) -// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 180ef1b6c0bb) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 4903e817c5dd) // DO NOT EDIT use gstreamer_validate_sys::*; diff --git a/gstreamer-validate/sys/tests/constant.c b/gstreamer-validate/sys/tests/constant.c index 3f6403808..072eacfcb 100644 --- a/gstreamer-validate/sys/tests/constant.c +++ b/gstreamer-validate/sys/tests/constant.c @@ -1,6 +1,6 @@ // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) -// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 180ef1b6c0bb) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 4903e817c5dd) // DO NOT EDIT #include "manual.h" diff --git a/gstreamer-validate/sys/tests/layout.c b/gstreamer-validate/sys/tests/layout.c index cfe793d49..9572fa2da 100644 --- a/gstreamer-validate/sys/tests/layout.c +++ b/gstreamer-validate/sys/tests/layout.c @@ -1,6 +1,6 @@ // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) -// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 180ef1b6c0bb) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 4903e817c5dd) // DO NOT EDIT #include "manual.h"