validate: Update from fixed gir

This commit is contained in:
Thibault Saunier 2022-08-31 14:29:08 -04:00
parent 8ca9692924
commit 5227af5935
16 changed files with 57 additions and 48 deletions

@ -1 +1 @@
Subproject commit 180ef1b6c0bb1172a76209ba25a3b745ebb7af90 Subproject commit b73d2b6fbeadfbb58e242d88a82535a4e56dc25d

View file

@ -19,14 +19,14 @@ glib::wrapper! {
impl Action { impl Action {
//#[doc(alias = "gst_validate_action_new")] //#[doc(alias = "gst_validate_action_new")]
//pub fn new(scenario: &impl IsA<Scenario>, action_type: /*Ignored*/&mut ActionType, structure: &mut gst::Structure, add_to_lists: bool) -> Action { //pub fn new(scenario: Option<&impl IsA<Scenario>>, action_type: /*Ignored*/&mut ActionType, structure: &mut gst::Structure, add_to_lists: bool) -> Action {
// unsafe { TODO: call ffi:gst_validate_action_new() } // unsafe { TODO: call ffi:gst_validate_action_new() }
//} //}
#[doc(alias = "gst_validate_action_get_scenario")] #[doc(alias = "gst_validate_action_get_scenario")]
#[doc(alias = "get_scenario")] #[doc(alias = "get_scenario")]
pub fn scenario(&self) -> Option<Scenario> { pub fn scenario(&self) -> Option<Scenario> {
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")] #[doc(alias = "gst_validate_action_set_done")]
@ -38,7 +38,7 @@ impl Action {
//#[doc(alias = "gst_validate_action_get_clocktime")] //#[doc(alias = "gst_validate_action_get_clocktime")]
//#[doc(alias = "get_clocktime")] //#[doc(alias = "get_clocktime")]
//pub fn is_clocktime(scenario: &impl IsA<Scenario>, action: &Action, name: &str, retval: /*Ignored*/gst::ClockTime) -> bool { //pub fn clocktime(scenario: &impl IsA<Scenario>, action: &Action, name: &str) -> Option</*Ignored*/gst::ClockTime> {
// unsafe { TODO: call ffi:gst_validate_action_get_clocktime() } // unsafe { TODO: call ffi:gst_validate_action_get_clocktime() }
//} //}
} }

View file

@ -33,14 +33,14 @@ impl BinMonitor {
pub fn new( pub fn new(
bin: &impl IsA<gst::Bin>, bin: &impl IsA<gst::Bin>,
runner: &impl IsA<Runner>, runner: &impl IsA<Runner>,
parent: &impl IsA<Monitor>, parent: Option<&impl IsA<Monitor>>,
) -> BinMonitor { ) -> BinMonitor {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { 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, bin.as_ref().to_glib_none().0,
runner.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<O: IsA<BinMonitor>> BinMonitorExt for O { impl<O: IsA<BinMonitor>> BinMonitorExt for O {
fn scenario(&self) -> Option<Scenario> { fn scenario(&self) -> Option<Scenario> {
unsafe { 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, self.as_ref().to_glib_none().0,
)) ))
} }

View file

@ -25,14 +25,14 @@ impl ElementMonitor {
pub fn new( pub fn new(
element: &impl IsA<gst::Element>, element: &impl IsA<gst::Element>,
runner: &impl IsA<Runner>, runner: &impl IsA<Runner>,
parent: &impl IsA<Monitor>, parent: Option<&impl IsA<Monitor>>,
) -> ElementMonitor { ) -> ElementMonitor {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { 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, element.as_ref().to_glib_none().0,
runner.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,
)) ))
} }
} }

View file

@ -31,14 +31,14 @@ impl Monitor {
pub fn factory_create( pub fn factory_create(
target: &impl IsA<gst::Object>, target: &impl IsA<gst::Object>,
runner: &impl IsA<Runner>, runner: &impl IsA<Runner>,
parent: &impl IsA<Monitor>, parent: Option<&impl IsA<Monitor>>,
) -> Option<Monitor> { ) -> Option<Monitor> {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { 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, target.as_ref().to_glib_none().0,
runner.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<O: IsA<Monitor>> MonitorExt for O {
fn pipeline(&self) -> Option<gst::Pipeline> { fn pipeline(&self) -> Option<gst::Pipeline> {
unsafe { 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, self.as_ref().to_glib_none().0,
)) ))
} }
@ -125,7 +125,7 @@ impl<O: IsA<Monitor>> MonitorExt for O {
fn target(&self) -> Option<gst::Object> { fn target(&self) -> Option<gst::Object> {
unsafe { 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, self.as_ref().to_glib_none().0,
)) ))
} }

View file

@ -26,14 +26,14 @@ impl PadMonitor {
pub fn new( pub fn new(
pad: &impl IsA<gst::Pad>, pad: &impl IsA<gst::Pad>,
runner: &impl IsA<Runner>, runner: &impl IsA<Runner>,
parent: &impl IsA<ElementMonitor>, parent: Option<&impl IsA<ElementMonitor>>,
) -> PadMonitor { ) -> PadMonitor {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { 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, pad.as_ref().to_glib_none().0,
runner.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,
)) ))
} }
} }

View file

@ -27,14 +27,14 @@ impl PipelineMonitor {
pub fn new( pub fn new(
pipeline: &impl IsA<gst::Pipeline>, pipeline: &impl IsA<gst::Pipeline>,
runner: &impl IsA<Runner>, runner: &impl IsA<Runner>,
parent: &impl IsA<Monitor>, parent: Option<&impl IsA<Monitor>>,
) -> PipelineMonitor { ) -> PipelineMonitor {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { 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, pipeline.as_ref().to_glib_none().0,
runner.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,
)) ))
} }
} }

View file

@ -93,7 +93,7 @@ impl Report {
#[doc(alias = "gst_validate_report_get_reporter")] #[doc(alias = "gst_validate_report_get_reporter")]
#[doc(alias = "get_reporter")] #[doc(alias = "get_reporter")]
pub fn reporter(&self) -> Option<Reporter> { pub fn reporter(&self) -> Option<Reporter> {
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")] #[doc(alias = "gst_validate_report_get_reporter_name")]

View file

@ -3,6 +3,7 @@
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT // DO NOT EDIT
use crate::Report;
use crate::ReportingDetails; use crate::ReportingDetails;
use crate::Runner; use crate::Runner;
use glib::object::IsA; use glib::object::IsA;
@ -42,9 +43,9 @@ pub trait ReporterExt: 'static {
#[doc(alias = "get_reporting_level")] #[doc(alias = "get_reporting_level")]
fn reporting_level(&self) -> ReportingDetails; fn reporting_level(&self) -> ReportingDetails;
//#[doc(alias = "gst_validate_reporter_get_reports")] #[doc(alias = "gst_validate_reporter_get_reports")]
//#[doc(alias = "get_reports")] #[doc(alias = "get_reports")]
//fn reports(&self) -> /*Unimplemented*/Vec<Basic: Pointer>; fn reports(&self) -> Vec<Report>;
#[doc(alias = "gst_validate_reporter_get_reports_count")] #[doc(alias = "gst_validate_reporter_get_reports_count")]
#[doc(alias = "get_reports_count")] #[doc(alias = "get_reports_count")]
@ -87,7 +88,7 @@ impl<O: IsA<Reporter>> ReporterExt for O {
fn pipeline(&self) -> Option<gst::Pipeline> { fn pipeline(&self) -> Option<gst::Pipeline> {
unsafe { 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, self.as_ref().to_glib_none().0,
)) ))
} }
@ -105,9 +106,13 @@ impl<O: IsA<Reporter>> ReporterExt for O {
} }
} }
//fn reports(&self) -> /*Unimplemented*/Vec<Basic: Pointer> { fn reports(&self) -> Vec<Report> {
// unsafe { TODO: call ffi:gst_validate_reporter_get_reports() } unsafe {
//} FromGlibPtrContainer::from_glib_full(ffi::gst_validate_reporter_get_reports(
self.as_ref().to_glib_none().0,
))
}
}
fn reports_count(&self) -> i32 { fn reports_count(&self) -> i32 {
unsafe { ffi::gst_validate_reporter_get_reports_count(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_validate_reporter_get_reports_count(self.as_ref().to_glib_none().0) }
@ -115,7 +120,7 @@ impl<O: IsA<Reporter>> ReporterExt for O {
fn runner(&self) -> Option<Runner> { fn runner(&self) -> Option<Runner> {
unsafe { 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, self.as_ref().to_glib_none().0,
)) ))
} }
@ -147,7 +152,7 @@ impl<O: IsA<Reporter>> ReporterExt for O {
unsafe { unsafe {
ffi::gst_validate_reporter_set_name( ffi::gst_validate_reporter_set_name(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
name.to_glib_none().0, name.to_glib_full(),
); );
} }
} }

View file

@ -44,7 +44,7 @@ impl Scenario {
) -> Option<Scenario> { ) -> Option<Scenario> {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { 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, runner.as_ref().to_glib_none().0,
pipeline.as_ref().to_glib_none().0, pipeline.as_ref().to_glib_none().0,
scenario_name.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")] //#[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; //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 = "gst_validate_scenario_get_actions")]
//#[doc(alias = "get_actions")] #[doc(alias = "get_actions")]
//fn actions(&self) -> /*Unimplemented*/Vec<Basic: Pointer>; fn actions(&self) -> Vec<Action>;
#[doc(alias = "gst_validate_scenario_get_pipeline")] #[doc(alias = "gst_validate_scenario_get_pipeline")]
#[doc(alias = "get_pipeline")] #[doc(alias = "get_pipeline")]
@ -96,13 +96,17 @@ impl<O: IsA<Scenario>> ScenarioExt for O {
// unsafe { TODO: call ffi:gst_validate_scenario_execute_seek() } // unsafe { TODO: call ffi:gst_validate_scenario_execute_seek() }
//} //}
//fn actions(&self) -> /*Unimplemented*/Vec<Basic: Pointer> { fn actions(&self) -> Vec<Action> {
// unsafe { TODO: call ffi:gst_validate_scenario_get_actions() } unsafe {
//} FromGlibPtrContainer::from_glib_full(ffi::gst_validate_scenario_get_actions(
self.as_ref().to_glib_none().0,
))
}
}
fn pipeline(&self) -> Option<gst::Element> { fn pipeline(&self) -> Option<gst::Element> {
unsafe { 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, self.as_ref().to_glib_none().0,
)) ))
} }
@ -134,13 +138,13 @@ impl<O: IsA<Scenario>> ScenarioExt for O {
F: Fn(&P, &Action) + 'static, F: Fn(&P, &Action) + 'static,
>( >(
this: *mut ffi::GstValidateScenario, this: *mut ffi::GstValidateScenario,
object: *mut ffi::GstValidateAction, action: *mut ffi::GstValidateAction,
f: glib::ffi::gpointer, f: glib::ffi::gpointer,
) { ) {
let f: &F = &*(f as *const F); let f: &F = &*(f as *const F);
f( f(
Scenario::from_glib_borrow(this).unsafe_cast_ref(), Scenario::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(object), &from_glib_borrow(action),
) )
} }
unsafe { unsafe {

View file

@ -1,3 +1,3 @@
Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0)
from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) 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)

View file

@ -1,6 +1,6 @@
// Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0)
// from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) // 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 // DO NOT EDIT
#[cfg(not(feature = "dox"))] #[cfg(not(feature = "dox"))]

View file

@ -1,6 +1,6 @@
// Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0)
// from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) // 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 // DO NOT EDIT
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]

View file

@ -1,6 +1,6 @@
// Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0)
// from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) // 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 // DO NOT EDIT
use gstreamer_validate_sys::*; use gstreamer_validate_sys::*;

View file

@ -1,6 +1,6 @@
// Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0)
// from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) // 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 // DO NOT EDIT
#include "manual.h" #include "manual.h"

View file

@ -1,6 +1,6 @@
// Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0) // Generated by gir (https://github.com/gtk-rs/gir @ b5e4e17d87b0)
// from gir-files (https://github.com/gtk-rs/gir-files @ 05ae6b134dda) // 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 // DO NOT EDIT
#include "manual.h" #include "manual.h"