validate: New crate for GstValidate bindings

Co-authored-by: Thibault Saunier <tsaunier@igalia.com>
This commit is contained in:
Philippe Normand 2022-02-28 11:03:21 +00:00 committed by Thibault Saunier
parent f65d410fc5
commit 70d95dca4c
37 changed files with 4661 additions and 3 deletions

View file

@ -234,6 +234,9 @@ plugins-update-nightly:
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
echo "--features=ser_de,v1_22"
;;
gstreamer-validate)
echo ""
;;
*)
echo "--features=v1_22"
;;
@ -322,7 +325,15 @@ test nightly all-features:
- |
get_features() {
module=${1%%/sys}
echo "--features=v1_22"
case "$module" in
gstreamer-validate)
echo ""
;;
*)
echo "--features=v1_22"
;;
esac
}
# First build and test all the crates with their relevant features
# Keep features in sync with below
@ -419,6 +430,9 @@ clippy:
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
echo "--features=ser_de,v1_22"
;;
gstreamer-validate)
echo ""
;;
*)
echo "--features=v1_22"
;;

View file

@ -35,6 +35,7 @@ default-members = [
"gstreamer-rtsp",
"gstreamer-rtsp-server",
"gstreamer-sdp",
"gstreamer-validate",
"gstreamer-video",
"gstreamer-webrtc",
"examples",
@ -85,6 +86,7 @@ members = [
"gstreamer-rtsp",
"gstreamer-rtsp-server",
"gstreamer-sdp",
"gstreamer-validate",
"gstreamer-video",
"gstreamer-webrtc",
"gstreamer-allocators",

View file

@ -1,4 +1,4 @@
variables:
GST_RS_IMG_TAG: '2022-08-19.0'
GST_RS_IMG_TAG: '2022-08-22.0'
GST_RS_STABLE: '1.63.0'
GST_RS_MSRV: '1.60.0'

View file

@ -11,7 +11,7 @@ cd gstreamer
# plugins required by tests
PLUGINS="-D gst-plugins-base:ogg=enabled -D gst-plugins-base:vorbis=enabled -D gst-plugins-base:theora=enabled -D gst-plugins-good:matroska=enabled -D gst-plugins-good:vpx=enabled -D gst-plugins-bad:opus=enabled"
meson build -D prefix=/usr/local -D devtools=disabled -D examples=disabled -D gtk_doc=disabled -D introspection=disabled -D libav=disabled -D libnice=disabled -D python=disabled -D ugly=disabled -D vaapi=disabled $PLUGINS
meson build -D prefix=/usr/local -D examples=disabled -D gtk_doc=disabled -D introspection=disabled -D libav=disabled -D libnice=disabled -D python=disabled -D ugly=disabled -D vaapi=disabled $PLUGINS
ninja -C build
ninja -C build install

View file

@ -0,0 +1 @@
../gstreamer/CHANGELOG.md

View file

@ -0,0 +1 @@
../COPYRIGHT

View file

@ -0,0 +1,31 @@
[package]
name = "gstreamer-validate"
version = "0.19.0"
authors = ["Philippe Normand <philn@igalia.com>"]
categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer WebRTC library"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
license = "MIT/Apache-2.0"
readme = "README.md"
homepage = "https://gstreamer.freedesktop.org"
documentation = "https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer_validate/"
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
edition = "2021"
rust-version = "1.60"
[dependencies]
libc = "0.2"
ffi = { package = "gstreamer-validate-sys", path = "sys" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
gst = { package = "gstreamer", path = "../gstreamer", features = ["v1_22"] }
bitflags = "1.0"
[dev-dependencies]
gir-format-check = "0.1"
[features]
default = []
dox = ["ffi/dox", "glib/dox", "gst/dox"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -0,0 +1,55 @@
[options]
girs_directories = ["../gir-files", "../gst-gir-files"]
library = "GstValidate"
version = "1.0"
min_cfg_version = "1.22"
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true
single_version_file = true
generate_display_trait = false
external_libraries = [
"GLib",
"GObject",
"Gst",
]
generate = [
"GstValidate.Action",
"GstValidate.Reporter",
"GstValidate.BinMonitor",
"GstValidate.Monitor",
"GstValidate.ElementMonitor",
"GstValidate.PadMonitor",
"GstValidate.PipelineMonitor",
"GstValidate.Report",
"GstValidate.Runner",
"GstValidate.Issue",
"GstValidate.ReportingDetails",
"GstValidate.ReportLevel",
"GstValidate.IssueFlags",
"GstValidate.IssueId",
]
manual = [
"GLib.Bytes",
"GLib.Error",
"GObject.Object",
"Gst.Caps",
"Gst.Structure",
"Gst.Object",
"Gst.Bin",
"Gst.Element",
"Gst.Pipeline",
"Gst.State",
"Gst.Pad",
"Gst.Format",
"Gst.SeekFlags",
"Gst.SeekType",
]
[[object]]
name = "GstValidate.Scenario"
status = "generate"
concurrency = "none"

View file

@ -0,0 +1 @@
../LICENSE-APACHE

View file

@ -0,0 +1 @@
../LICENSE-MIT

View file

@ -0,0 +1,202 @@
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-validate.svg)](https://crates.io/crates/gstreamer-validate) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/main/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/main)
[GStreamer](https://gstreamer.freedesktop.org/) (Validate library) bindings for Rust.
Documentation can be found [here](https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer_validate/).
These bindings are providing a safe API that can be used to interface with
GStreamer, e.g. for writing GStreamer-based applications and GStreamer plugins.
The bindings are mostly autogenerated with [gir](https://github.com/gtk-rs/gir/)
based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/)
API metadata provided by the GStreamer project.
## Table of Contents
1. [Installation](#installation)
1. [Linux/BSDs](#installation-linux)
1. [macOS](#installation-macos)
1. [Windows](#installation-windows)
1. [Getting Started](#getting-started)
1. [License](#license)
1. [Contribution](#contribution)
<a name="installation"/>
## Installation
To build the GStreamer bindings or anything depending on them, you need to
have at least GStreamer 1.8 and gst-plugins-base 1.8 installed. In addition,
some of the examples/tutorials require various GStreamer plugins to be
available, which can be found in gst-plugins-base, gst-plugins-good,
gst-plugins-bad, gst-plugins-ugly and/or gst-libav.
<a name="installation-linux"/>
### Linux/BSDs
You need to install the above mentioned packages with your distributions
package manager, or build them from source.
On Debian/Ubuntu they can be installed with
```console
$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav libgstrtspserver-1.0-dev libges-1.0-dev
```
The minimum required version of the above libraries is >= 1.8. If you
build the gstreamer-player sub-crate, or any of the examples that
depend on gstreamer-player, you must ensure that in addition to the
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
that the version is >= 1.12. See the `Cargo.toml` files for the full
details,
```console
$ # Only if you wish to install gstreamer-player, make sure the version
$ # of this package is >= 1.12.
$ apt-get install libgstreamer-plugins-bad1.0-dev
```
Package names on other distributions should be similar.
Please submit a pull request with instructions for yours.
<a name="installation-macos"/>
### macOS
You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
provided by the GStreamer project.
#### Homebrew
Homebrew only installs various plugins if explicitly enabled, so some extra
`--with-*` flags may be required.
```console
$ brew install gstreamer gst-plugins-base gst-plugins-good \
gst-plugins-bad gst-plugins-ugly gst-libav gst-rtsp-server \
gst-editing-services --with-orc --with-libogg --with-opus \
--with-pango --with-theora --with-libvorbis --with-libvpx \
--enable-gtk3
```
If you wish to install the gstreamer-player sub-crate, make sure the
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
sufficient.
#### GStreamer Binaries
You need to download the *two* `.pkg` files from the GStreamer website and
install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and
`gstreamer-1.0-devel-1.12.3-x86_64.pkg`.
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
and set the `PKG_CONFIG_PATH` environment variable
```console
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
```
<a name="installation-windows"/>
### Windows
You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/)
with `pacman` or by installing the
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
the GStreamer project.
#### MSYS2 / pacman
```console
$ pacman -S glib2-devel pkg-config \
mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \
mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \
mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav \
mingw-w64-x86_64-gst-rtsp-server
```
If you wish to install the gstreamer-player sub-crate, make sure the
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
sufficient.
Note that the version of `pkg-config` included in `MSYS2` is
[known to have problems](https://github.com/rust-lang/pkg-config-rs/issues/51#issuecomment-346300858)
compiling GStreamer, so you may need to install another version. One option
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
#### GStreamer Binaries
You need to download the *two* `.msi` files for your platform from the
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.12.3.msi` and
`gstreamer-1.0-devel-x86_64-1.12.3.msi`.
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
from [here](https://sourceforge.net/projects/pkgconfiglite/))
and set the `PKG_CONFIG_PATH` environment variable
```console
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
```
<a name="getting-started"/>
## Getting Started
The API reference can be found
[here](https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer/), however it is
only the Rust API reference and does not explain any of the concepts.
For getting started with GStreamer development, the best would be to follow
the [documentation](https://gstreamer.freedesktop.org/documentation/) on the
GStreamer website, especially the [Application Development
Manual](https://gstreamer.freedesktop.org/documentation/application-development/).
While being C-centric, it explains all the fundamental concepts of GStreamer
and the code examples should be relatively easily translatable to Rust. The
API is basically the same, function/struct names are the same and everything
is only more convenient (hopefully) and safer.
In addition there are
[tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the
GStreamer website. Many of them were ported to Rust already and the code can
be found in the
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/main/tutorials)
directory.
Some further examples for various aspects of GStreamer and how to use it from
Rust can be found in the
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/main/examples)
directory.
Various GStreamer plugins written in Rust can be found in the
[gst-plugins-rs](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs)
repository.
<a name="license"/>
## LICENSE
gstreamer-rs and all crates contained in here are licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT)
at your option.
GStreamer itself is licensed under the Lesser General Public License version
2.1 or (at your option) any later version:
https://www.gnu.org/licenses/lgpl-2.1.html
<a name="contribution"/>
## Contribution
Any kinds of contributions are welcome as a pull request.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.

View file

@ -0,0 +1,47 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::Scenario;
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Action(Shared<ffi::GstValidateAction>);
match fn {
ref => |ptr| ffi::gst_validate_action_ref(ptr),
unref => |ptr| ffi::gst_validate_action_unref(ptr),
type_ => || ffi::gst_validate_action_get_type(),
}
}
impl Action {
//#[doc(alias = "gst_validate_action_new")]
//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() }
//}
#[doc(alias = "gst_validate_action_get_scenario")]
#[doc(alias = "get_scenario")]
pub fn scenario(&self) -> Option<Scenario> {
unsafe { from_glib_full(ffi::gst_validate_action_get_scenario(self.to_glib_none().0)) }
}
#[doc(alias = "gst_validate_action_set_done")]
pub fn set_done(&self) {
unsafe {
ffi::gst_validate_action_set_done(self.to_glib_none().0);
}
}
//#[doc(alias = "gst_validate_action_get_clocktime")]
//#[doc(alias = "get_clocktime")]
//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 impl Send for Action {}
unsafe impl Sync for Action {}

View file

@ -0,0 +1,9 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
#[allow(unused_imports)]
use crate::auto::*;
pub type IssueId = glib::Quark;

View file

@ -0,0 +1,107 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::ElementMonitor;
use crate::Monitor;
use crate::Reporter;
use crate::Runner;
use crate::Scenario;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "GstValidateBinMonitor")]
pub struct BinMonitor(Object<ffi::GstValidateBinMonitor, ffi::GstValidateBinMonitorClass>) @extends ElementMonitor, Monitor, gst::Object, @implements Reporter;
match fn {
type_ => || ffi::gst_validate_bin_monitor_get_type(),
}
}
impl BinMonitor {
pub const NONE: Option<&'static BinMonitor> = None;
#[doc(alias = "gst_validate_bin_monitor_new")]
pub fn new(
bin: &impl IsA<gst::Bin>,
runner: &impl IsA<Runner>,
parent: Option<&impl IsA<Monitor>>,
) -> BinMonitor {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_bin_monitor_new(
bin.as_ref().to_glib_none().0,
runner.as_ref().to_glib_none().0,
parent.map(|p| p.as_ref()).to_glib_none().0,
))
}
}
}
unsafe impl Send for BinMonitor {}
unsafe impl Sync for BinMonitor {}
pub trait BinMonitorExt: 'static {
#[doc(alias = "gst_validate_bin_monitor_get_scenario")]
#[doc(alias = "get_scenario")]
fn scenario(&self) -> Option<Scenario>;
#[doc(alias = "handles-states")]
fn is_handles_states(&self) -> bool;
#[doc(alias = "handles-states")]
fn connect_handles_states_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<BinMonitor>> BinMonitorExt for O {
fn scenario(&self) -> Option<Scenario> {
unsafe {
from_glib_full(ffi::gst_validate_bin_monitor_get_scenario(
self.as_ref().to_glib_none().0,
))
}
}
fn is_handles_states(&self) -> bool {
glib::ObjectExt::property(self.as_ref(), "handles-states")
}
fn connect_handles_states_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_handles_states_trampoline<
P: IsA<BinMonitor>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstValidateBinMonitor,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(BinMonitor::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::handles-states\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_handles_states_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -0,0 +1,42 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::Monitor;
use crate::Reporter;
use crate::Runner;
use glib::object::IsA;
use glib::translate::*;
glib::wrapper! {
#[doc(alias = "GstValidateElementMonitor")]
pub struct ElementMonitor(Object<ffi::GstValidateElementMonitor, ffi::GstValidateElementMonitorClass>) @extends Monitor, gst::Object, @implements Reporter;
match fn {
type_ => || ffi::gst_validate_element_monitor_get_type(),
}
}
impl ElementMonitor {
pub const NONE: Option<&'static ElementMonitor> = None;
#[doc(alias = "gst_validate_element_monitor_new")]
pub fn new(
element: &impl IsA<gst::Element>,
runner: &impl IsA<Runner>,
parent: Option<&impl IsA<Monitor>>,
) -> ElementMonitor {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_element_monitor_new(
element.as_ref().to_glib_none().0,
runner.as_ref().to_glib_none().0,
parent.map(|p| p.as_ref()).to_glib_none().0,
))
}
}
}
unsafe impl Send for ElementMonitor {}
unsafe impl Sync for ElementMonitor {}

View file

@ -0,0 +1,213 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstValidateReportLevel")]
pub enum ReportLevel {
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_CRITICAL")]
Critical,
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_WARNING")]
Warning,
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_ISSUE")]
Issue,
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_IGNORE")]
Ignore,
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_UNKNOWN")]
Unknown,
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_EXPECTED")]
Expected,
#[doc(alias = "GST_VALIDATE_REPORT_LEVEL_NUM_ENTRIES")]
NumEntries,
#[doc(hidden)]
__Unknown(i32),
}
impl ReportLevel {
#[doc(alias = "gst_validate_report_level_from_name")]
pub fn from_name(level_name: &str) -> ReportLevel {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_validate_report_level_from_name(
level_name.to_glib_none().0,
))
}
}
#[doc(alias = "gst_validate_report_level_get_name")]
#[doc(alias = "get_name")]
pub fn name(self) -> Option<glib::GString> {
assert_initialized_main_thread!();
unsafe { from_glib_none(ffi::gst_validate_report_level_get_name(self.into_glib())) }
}
}
#[doc(hidden)]
impl IntoGlib for ReportLevel {
type GlibType = ffi::GstValidateReportLevel;
fn into_glib(self) -> ffi::GstValidateReportLevel {
match self {
Self::Critical => ffi::GST_VALIDATE_REPORT_LEVEL_CRITICAL,
Self::Warning => ffi::GST_VALIDATE_REPORT_LEVEL_WARNING,
Self::Issue => ffi::GST_VALIDATE_REPORT_LEVEL_ISSUE,
Self::Ignore => ffi::GST_VALIDATE_REPORT_LEVEL_IGNORE,
Self::Unknown => ffi::GST_VALIDATE_REPORT_LEVEL_UNKNOWN,
Self::Expected => ffi::GST_VALIDATE_REPORT_LEVEL_EXPECTED,
Self::NumEntries => ffi::GST_VALIDATE_REPORT_LEVEL_NUM_ENTRIES,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstValidateReportLevel> for ReportLevel {
unsafe fn from_glib(value: ffi::GstValidateReportLevel) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_VALIDATE_REPORT_LEVEL_CRITICAL => Self::Critical,
ffi::GST_VALIDATE_REPORT_LEVEL_WARNING => Self::Warning,
ffi::GST_VALIDATE_REPORT_LEVEL_ISSUE => Self::Issue,
ffi::GST_VALIDATE_REPORT_LEVEL_IGNORE => Self::Ignore,
ffi::GST_VALIDATE_REPORT_LEVEL_UNKNOWN => Self::Unknown,
ffi::GST_VALIDATE_REPORT_LEVEL_EXPECTED => Self::Expected,
ffi::GST_VALIDATE_REPORT_LEVEL_NUM_ENTRIES => Self::NumEntries,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ReportLevel {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_validate_report_level_get_type()) }
}
}
impl glib::value::ValueType for ReportLevel {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ReportLevel {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ReportLevel {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstValidateReportingDetails")]
pub enum ReportingDetails {
#[doc(alias = "GST_VALIDATE_SHOW_UNKNOWN")]
Unknown,
#[doc(alias = "GST_VALIDATE_SHOW_NONE")]
None,
#[doc(alias = "GST_VALIDATE_SHOW_SYNTHETIC")]
Synthetic,
#[doc(alias = "GST_VALIDATE_SHOW_SUBCHAIN")]
Subchain,
#[doc(alias = "GST_VALIDATE_SHOW_MONITOR")]
Monitor,
#[doc(alias = "GST_VALIDATE_SHOW_ALL")]
All,
#[doc(alias = "GST_VALIDATE_SHOW_SMART")]
Smart,
#[doc(alias = "GST_VALIDATE_SHOW_COUNT")]
Count,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for ReportingDetails {
type GlibType = ffi::GstValidateReportingDetails;
fn into_glib(self) -> ffi::GstValidateReportingDetails {
match self {
Self::Unknown => ffi::GST_VALIDATE_SHOW_UNKNOWN,
Self::None => ffi::GST_VALIDATE_SHOW_NONE,
Self::Synthetic => ffi::GST_VALIDATE_SHOW_SYNTHETIC,
Self::Subchain => ffi::GST_VALIDATE_SHOW_SUBCHAIN,
Self::Monitor => ffi::GST_VALIDATE_SHOW_MONITOR,
Self::All => ffi::GST_VALIDATE_SHOW_ALL,
Self::Smart => ffi::GST_VALIDATE_SHOW_SMART,
Self::Count => ffi::GST_VALIDATE_SHOW_COUNT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstValidateReportingDetails> for ReportingDetails {
unsafe fn from_glib(value: ffi::GstValidateReportingDetails) -> Self {
skip_assert_initialized!();
match value {
ffi::GST_VALIDATE_SHOW_UNKNOWN => Self::Unknown,
ffi::GST_VALIDATE_SHOW_NONE => Self::None,
ffi::GST_VALIDATE_SHOW_SYNTHETIC => Self::Synthetic,
ffi::GST_VALIDATE_SHOW_SUBCHAIN => Self::Subchain,
ffi::GST_VALIDATE_SHOW_MONITOR => Self::Monitor,
ffi::GST_VALIDATE_SHOW_ALL => Self::All,
ffi::GST_VALIDATE_SHOW_SMART => Self::Smart,
ffi::GST_VALIDATE_SHOW_COUNT => Self::Count,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ReportingDetails {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_validate_reporting_details_get_type()) }
}
}
impl glib::value::ValueType for ReportingDetails {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ReportingDetails {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ReportingDetails {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}

View file

@ -0,0 +1,75 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
bitflags! {
#[doc(alias = "GstValidateIssueFlags")]
pub struct IssueFlags: u32 {
#[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_NONE")]
const NONE = ffi::GST_VALIDATE_ISSUE_FLAGS_NONE as u32;
#[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS")]
const FULL_DETAILS = ffi::GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS as u32;
#[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE")]
const NO_BACKTRACE = ffi::GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE as u32;
#[doc(alias = "GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE")]
const FORCE_BACKTRACE = ffi::GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE as u32;
}
}
#[doc(hidden)]
impl IntoGlib for IssueFlags {
type GlibType = ffi::GstValidateIssueFlags;
fn into_glib(self) -> ffi::GstValidateIssueFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstValidateIssueFlags> for IssueFlags {
unsafe fn from_glib(value: ffi::GstValidateIssueFlags) -> Self {
skip_assert_initialized!();
Self::from_bits_truncate(value)
}
}
impl StaticType for IssueFlags {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_validate_issue_flags_get_type()) }
}
}
impl glib::value::ValueType for IssueFlags {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for IssueFlags {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl ToValue for IssueFlags {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}

View file

@ -0,0 +1,61 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::ReportLevel;
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Issue(Boxed<ffi::GstValidateIssue>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_validate_issue_get_type(), ptr as *mut _) as *mut ffi::GstValidateIssue,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_validate_issue_get_type(), ptr as *mut _),
type_ => || ffi::gst_validate_issue_get_type(),
}
}
impl Issue {
//#[doc(alias = "gst_validate_issue_new")]
//pub fn new(issue_id: /*Ignored*/IssueId, summary: &str, description: &str, default_level: ReportLevel) -> Issue {
// unsafe { TODO: call ffi:gst_validate_issue_new() }
//}
//#[doc(alias = "gst_validate_issue_new_full")]
//pub fn new_full(issue_id: /*Ignored*/IssueId, summary: &str, description: &str, default_level: ReportLevel, flags: IssueFlags) -> Issue {
// unsafe { TODO: call ffi:gst_validate_issue_new_full() }
//}
#[doc(alias = "gst_validate_issue_get_id")]
#[doc(alias = "get_id")]
pub fn id(&mut self) -> u32 {
unsafe { ffi::gst_validate_issue_get_id(self.to_glib_none_mut().0) }
}
#[doc(alias = "gst_validate_issue_register")]
pub fn register(&mut self) {
unsafe {
ffi::gst_validate_issue_register(self.to_glib_none_mut().0);
}
}
#[doc(alias = "gst_validate_issue_set_default_level")]
pub fn set_default_level(&mut self, default_level: ReportLevel) {
unsafe {
ffi::gst_validate_issue_set_default_level(
self.to_glib_none_mut().0,
default_level.into_glib(),
);
}
}
//#[doc(alias = "gst_validate_issue_from_id")]
//pub fn from_id(issue_id: /*Ignored*/IssueId) -> Option<Issue> {
// unsafe { TODO: call ffi:gst_validate_issue_from_id() }
//}
}
unsafe impl Send for Issue {}
unsafe impl Sync for Issue {}

View file

@ -0,0 +1,56 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
mod bin_monitor;
pub use self::bin_monitor::BinMonitor;
mod element_monitor;
pub use self::element_monitor::ElementMonitor;
mod monitor;
pub use self::monitor::Monitor;
mod pad_monitor;
pub use self::pad_monitor::PadMonitor;
mod pipeline_monitor;
pub use self::pipeline_monitor::PipelineMonitor;
mod reporter;
pub use self::reporter::Reporter;
mod runner;
pub use self::runner::Runner;
mod scenario;
pub use self::scenario::Scenario;
mod action;
pub use self::action::Action;
mod issue;
pub use self::issue::Issue;
mod report;
pub use self::report::Report;
mod enums;
pub use self::enums::ReportLevel;
pub use self::enums::ReportingDetails;
mod flags;
pub use self::flags::IssueFlags;
mod alias;
pub use self::alias::IssueId;
#[doc(hidden)]
pub mod traits {
pub use super::bin_monitor::BinMonitorExt;
pub use super::monitor::MonitorExt;
pub use super::reporter::ReporterExt;
pub use super::runner::RunnerExt;
pub use super::scenario::ScenarioExt;
}

View file

@ -0,0 +1,208 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::Reporter;
use crate::Runner;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "GstValidateMonitor")]
pub struct Monitor(Object<ffi::GstValidateMonitor, ffi::GstValidateMonitorClass>) @extends gst::Object, @implements Reporter;
match fn {
type_ => || ffi::gst_validate_monitor_get_type(),
}
}
impl Monitor {
pub const NONE: Option<&'static Monitor> = None;
#[doc(alias = "gst_validate_monitor_factory_create")]
pub fn factory_create(
target: &impl IsA<gst::Object>,
runner: &impl IsA<Runner>,
parent: Option<&impl IsA<Monitor>>,
) -> Option<Monitor> {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_monitor_factory_create(
target.as_ref().to_glib_none().0,
runner.as_ref().to_glib_none().0,
parent.map(|p| p.as_ref()).to_glib_none().0,
))
}
}
}
unsafe impl Send for Monitor {}
unsafe impl Sync for Monitor {}
pub trait MonitorExt: 'static {
//#[doc(alias = "gst_validate_monitor_attach_override")]
//fn attach_override(&self, override_: /*Ignored*/&Override);
#[doc(alias = "gst_validate_monitor_get_element")]
#[doc(alias = "get_element")]
fn element(&self) -> Option<gst::Element>;
#[doc(alias = "gst_validate_monitor_get_element_name")]
#[doc(alias = "get_element_name")]
fn element_name(&self) -> Option<glib::GString>;
#[doc(alias = "gst_validate_monitor_get_target")]
#[doc(alias = "get_target")]
fn target(&self) -> Option<gst::Object>;
//#[doc(alias = "gst_validate_monitor_set_media_descriptor")]
//fn set_media_descriptor(&self, media_descriptor: /*Ignored*/&MediaDescriptor);
fn object(&self) -> Option<glib::Object>;
fn set_pipeline<P: IsA<gst::Pipeline>>(&self, pipeline: Option<&P>);
#[doc(alias = "validate-parent")]
fn validate_parent(&self) -> Option<Monitor>;
#[doc(alias = "validate-runner")]
fn validate_runner(&self) -> Option<Runner>;
//fn verbosity(&self) -> /*Ignored*/VerbosityFlags;
//fn set_verbosity(&self, verbosity: /*Ignored*/VerbosityFlags);
#[doc(alias = "pipeline")]
fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[doc(alias = "verbosity")]
fn connect_verbosity_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<Monitor>> MonitorExt for O {
//fn attach_override(&self, override_: /*Ignored*/&Override) {
// unsafe { TODO: call ffi:gst_validate_monitor_attach_override() }
//}
fn element(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ffi::gst_validate_monitor_get_element(
self.as_ref().to_glib_none().0,
))
}
}
fn element_name(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::gst_validate_monitor_get_element_name(
self.as_ref().to_glib_none().0,
))
}
}
fn target(&self) -> Option<gst::Object> {
unsafe {
from_glib_full(ffi::gst_validate_monitor_get_target(
self.as_ref().to_glib_none().0,
))
}
}
//fn set_media_descriptor(&self, media_descriptor: /*Ignored*/&MediaDescriptor) {
// unsafe { TODO: call ffi:gst_validate_monitor_set_media_descriptor() }
//}
fn object(&self) -> Option<glib::Object> {
glib::ObjectExt::property(self.as_ref(), "object")
}
fn set_pipeline<P: IsA<gst::Pipeline>>(&self, pipeline: Option<&P>) {
glib::ObjectExt::set_property(self.as_ref(), "pipeline", &pipeline)
}
fn validate_parent(&self) -> Option<Monitor> {
glib::ObjectExt::property(self.as_ref(), "validate-parent")
}
fn validate_runner(&self) -> Option<Runner> {
glib::ObjectExt::property(self.as_ref(), "validate-runner")
}
//fn verbosity(&self) -> /*Ignored*/VerbosityFlags {
// glib::ObjectExt::property(self.as_ref(), "verbosity")
//}
//fn set_verbosity(&self, verbosity: /*Ignored*/VerbosityFlags) {
// glib::ObjectExt::set_property(self.as_ref(),"verbosity", &verbosity)
//}
fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_pipeline_trampoline<
P: IsA<Monitor>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstValidateMonitor,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::pipeline\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_pipeline_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_verbosity_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_verbosity_trampoline<
P: IsA<Monitor>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstValidateMonitor,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Monitor::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::verbosity\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_verbosity_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -0,0 +1,43 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::ElementMonitor;
use crate::Monitor;
use crate::Reporter;
use crate::Runner;
use glib::object::IsA;
use glib::translate::*;
glib::wrapper! {
#[doc(alias = "GstValidatePadMonitor")]
pub struct PadMonitor(Object<ffi::GstValidatePadMonitor, ffi::GstValidatePadMonitorClass>) @extends Monitor, gst::Object, @implements Reporter;
match fn {
type_ => || ffi::gst_validate_pad_monitor_get_type(),
}
}
impl PadMonitor {
pub const NONE: Option<&'static PadMonitor> = None;
#[doc(alias = "gst_validate_pad_monitor_new")]
pub fn new(
pad: &impl IsA<gst::Pad>,
runner: &impl IsA<Runner>,
parent: Option<&impl IsA<ElementMonitor>>,
) -> PadMonitor {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_pad_monitor_new(
pad.as_ref().to_glib_none().0,
runner.as_ref().to_glib_none().0,
parent.map(|p| p.as_ref()).to_glib_none().0,
))
}
}
}
unsafe impl Send for PadMonitor {}
unsafe impl Sync for PadMonitor {}

View file

@ -0,0 +1,44 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::BinMonitor;
use crate::ElementMonitor;
use crate::Monitor;
use crate::Reporter;
use crate::Runner;
use glib::object::IsA;
use glib::translate::*;
glib::wrapper! {
#[doc(alias = "GstValidatePipelineMonitor")]
pub struct PipelineMonitor(Object<ffi::GstValidatePipelineMonitor, ffi::GstValidatePipelineMonitorClass>) @extends BinMonitor, ElementMonitor, Monitor, gst::Object, @implements Reporter;
match fn {
type_ => || ffi::gst_validate_pipeline_monitor_get_type(),
}
}
impl PipelineMonitor {
pub const NONE: Option<&'static PipelineMonitor> = None;
#[doc(alias = "gst_validate_pipeline_monitor_new")]
pub fn new(
pipeline: &impl IsA<gst::Pipeline>,
runner: &impl IsA<Runner>,
parent: Option<&impl IsA<Monitor>>,
) -> PipelineMonitor {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_pipeline_monitor_new(
pipeline.as_ref().to_glib_none().0,
runner.as_ref().to_glib_none().0,
parent.map(|p| p.as_ref()).to_glib_none().0,
))
}
}
}
unsafe impl Send for PipelineMonitor {}
unsafe impl Sync for PipelineMonitor {}

View file

@ -0,0 +1,208 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::Issue;
use crate::ReportLevel;
use crate::Reporter;
use crate::ReportingDetails;
use glib::object::IsA;
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Report(Shared<ffi::GstValidateReport>);
match fn {
ref => |ptr| ffi::gst_validate_report_ref(ptr),
unref => |ptr| ffi::gst_validate_report_unref(ptr),
type_ => || ffi::gst_validate_report_get_type(),
}
}
impl Report {
#[doc(alias = "gst_validate_report_new")]
pub fn new(issue: &mut Issue, reporter: &impl IsA<Reporter>, message: &str) -> Report {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_validate_report_new(
issue.to_glib_none_mut().0,
reporter.as_ref().to_glib_none().0,
message.to_glib_none().0,
))
}
}
#[doc(alias = "gst_validate_report_add_message")]
pub fn add_message(&self, message: &str) {
unsafe {
ffi::gst_validate_report_add_message(self.to_glib_none().0, message.to_glib_none().0);
}
}
#[doc(alias = "gst_validate_report_add_repeated_report")]
pub fn add_repeated_report(&self, repeated_report: &Report) {
unsafe {
ffi::gst_validate_report_add_repeated_report(
self.to_glib_none().0,
repeated_report.to_glib_none().0,
);
}
}
#[doc(alias = "gst_validate_report_check_abort")]
pub fn check_abort(&self) -> bool {
unsafe { from_glib(ffi::gst_validate_report_check_abort(self.to_glib_none().0)) }
}
#[doc(alias = "gst_validate_report_get_dotfile_name")]
#[doc(alias = "get_dotfile_name")]
pub fn dotfile_name(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::gst_validate_report_get_dotfile_name(
self.to_glib_none().0,
))
}
}
#[doc(alias = "gst_validate_report_get_issue")]
#[doc(alias = "get_issue")]
pub fn issue(&self) -> Option<Issue> {
unsafe { from_glib_full(ffi::gst_validate_report_get_issue(self.to_glib_none().0)) }
}
#[doc(alias = "gst_validate_report_get_issue_id")]
#[doc(alias = "get_issue_id")]
pub fn issue_id(&self) -> u32 {
unsafe { ffi::gst_validate_report_get_issue_id(self.to_glib_none().0) }
}
#[doc(alias = "gst_validate_report_get_level")]
#[doc(alias = "get_level")]
pub fn level(&self) -> ReportLevel {
unsafe { from_glib(ffi::gst_validate_report_get_level(self.to_glib_none().0)) }
}
#[doc(alias = "gst_validate_report_get_message")]
#[doc(alias = "get_message")]
pub fn message(&self) -> Option<glib::GString> {
unsafe { from_glib_full(ffi::gst_validate_report_get_message(self.to_glib_none().0)) }
}
#[doc(alias = "gst_validate_report_get_reporter")]
#[doc(alias = "get_reporter")]
pub fn reporter(&self) -> Option<Reporter> {
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 = "get_reporter_name")]
pub fn reporter_name(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::gst_validate_report_get_reporter_name(
self.to_glib_none().0,
))
}
}
#[doc(alias = "gst_validate_report_get_reporting_level")]
#[doc(alias = "get_reporting_level")]
pub fn reporting_level(&self) -> ReportingDetails {
unsafe {
from_glib(ffi::gst_validate_report_get_reporting_level(
self.to_glib_none().0,
))
}
}
//#[doc(alias = "gst_validate_report_get_timestamp")]
//#[doc(alias = "get_timestamp")]
//pub fn timestamp(&self) -> /*Ignored*/gst::ClockTime {
// unsafe { TODO: call ffi:gst_validate_report_get_timestamp() }
//}
#[doc(alias = "gst_validate_report_get_trace")]
#[doc(alias = "get_trace")]
pub fn trace(&self) -> Option<glib::GString> {
unsafe { from_glib_full(ffi::gst_validate_report_get_trace(self.to_glib_none().0)) }
}
#[doc(alias = "gst_validate_report_print_description")]
pub fn print_description(&self) {
unsafe {
ffi::gst_validate_report_print_description(self.to_glib_none().0);
}
}
#[doc(alias = "gst_validate_report_print_details")]
pub fn print_details(&self) {
unsafe {
ffi::gst_validate_report_print_details(self.to_glib_none().0);
}
}
#[doc(alias = "gst_validate_report_print_detected_on")]
pub fn print_detected_on(&self) {
unsafe {
ffi::gst_validate_report_print_detected_on(self.to_glib_none().0);
}
}
#[doc(alias = "gst_validate_report_print_level")]
pub fn print_level(&self) {
unsafe {
ffi::gst_validate_report_print_level(self.to_glib_none().0);
}
}
#[doc(alias = "gst_validate_report_printf")]
pub fn printf(&self) {
unsafe {
ffi::gst_validate_report_printf(self.to_glib_none().0);
}
}
#[doc(alias = "gst_validate_report_set_master_report")]
pub fn set_master_report(&self, master_report: &Report) -> bool {
unsafe {
from_glib(ffi::gst_validate_report_set_master_report(
self.to_glib_none().0,
master_report.to_glib_none().0,
))
}
}
#[doc(alias = "gst_validate_report_set_reporting_level")]
pub fn set_reporting_level(&self, level: ReportingDetails) {
unsafe {
ffi::gst_validate_report_set_reporting_level(self.to_glib_none().0, level.into_glib());
}
}
#[doc(alias = "gst_validate_report_should_print")]
pub fn should_print(&self) -> bool {
unsafe { from_glib(ffi::gst_validate_report_should_print(self.to_glib_none().0)) }
}
//#[doc(alias = "gst_validate_report_action")]
//pub fn action(reporter: &impl IsA<Reporter>, action: &Action, issue_id: /*Ignored*/IssueId, format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi:gst_validate_report_action() }
//}
#[doc(alias = "gst_validate_report_init")]
pub fn init() {
assert_initialized_main_thread!();
unsafe {
ffi::gst_validate_report_init();
}
}
//#[doc(alias = "gst_validate_report_valist")]
//pub fn valist(reporter: &impl IsA<Reporter>, issue_id: /*Ignored*/IssueId, format: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
// unsafe { TODO: call ffi:gst_validate_report_valist() }
//}
}
unsafe impl Send for Report {}
unsafe impl Sync for Report {}

View file

@ -0,0 +1,172 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// 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;
use glib::translate::*;
use glib::StaticType;
glib::wrapper! {
#[doc(alias = "GstValidateReporter")]
pub struct Reporter(Interface<ffi::GstValidateReporter, ffi::GstValidateReporterInterface>);
match fn {
type_ => || ffi::gst_validate_reporter_get_type(),
}
}
impl Reporter {
pub const NONE: Option<&'static Reporter> = None;
}
unsafe impl Send for Reporter {}
unsafe impl Sync for Reporter {}
pub trait ReporterExt: 'static {
#[doc(alias = "gst_validate_reporter_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> Option<glib::GString>;
#[doc(alias = "gst_validate_reporter_get_pipeline")]
#[doc(alias = "get_pipeline")]
fn pipeline(&self) -> Option<gst::Pipeline>;
//#[doc(alias = "gst_validate_reporter_get_report")]
//#[doc(alias = "get_report")]
//fn report(&self, issue_id: /*Ignored*/IssueId) -> Option<Report>;
#[doc(alias = "gst_validate_reporter_get_reporting_level")]
#[doc(alias = "get_reporting_level")]
fn reporting_level(&self) -> ReportingDetails;
#[doc(alias = "gst_validate_reporter_get_reports")]
#[doc(alias = "get_reports")]
fn reports(&self) -> Vec<Report>;
#[doc(alias = "gst_validate_reporter_get_reports_count")]
#[doc(alias = "get_reports_count")]
fn reports_count(&self) -> i32;
#[doc(alias = "gst_validate_reporter_get_runner")]
#[doc(alias = "get_runner")]
fn runner(&self) -> Option<Runner>;
#[doc(alias = "gst_validate_reporter_init")]
fn init(&self, name: &str);
#[doc(alias = "gst_validate_reporter_purge_reports")]
fn purge_reports(&self);
//#[doc(alias = "gst_validate_reporter_report_simple")]
//fn report_simple(&self, issue_id: /*Ignored*/IssueId, message: &str);
#[doc(alias = "gst_validate_reporter_set_handle_g_logs")]
fn set_handle_g_logs(&self);
#[doc(alias = "gst_validate_reporter_set_name")]
fn set_name(&self, name: &str);
#[doc(alias = "gst_validate_reporter_set_runner")]
fn set_runner(&self, runner: &impl IsA<Runner>);
#[doc(alias = "validate-runner")]
fn validate_runner(&self) -> Option<Runner>;
}
impl<O: IsA<Reporter>> ReporterExt for O {
fn name(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::gst_validate_reporter_get_name(
self.as_ref().to_glib_none().0,
))
}
}
fn pipeline(&self) -> Option<gst::Pipeline> {
unsafe {
from_glib_full(ffi::gst_validate_reporter_get_pipeline(
self.as_ref().to_glib_none().0,
))
}
}
//fn report(&self, issue_id: /*Ignored*/IssueId) -> Option<Report> {
// unsafe { TODO: call ffi:gst_validate_reporter_get_report() }
//}
fn reporting_level(&self) -> ReportingDetails {
unsafe {
from_glib(ffi::gst_validate_reporter_get_reporting_level(
self.as_ref().to_glib_none().0,
))
}
}
fn reports(&self) -> Vec<Report> {
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) }
}
fn runner(&self) -> Option<Runner> {
unsafe {
from_glib_full(ffi::gst_validate_reporter_get_runner(
self.as_ref().to_glib_none().0,
))
}
}
fn init(&self, name: &str) {
unsafe {
ffi::gst_validate_reporter_init(self.as_ref().to_glib_none().0, name.to_glib_none().0);
}
}
fn purge_reports(&self) {
unsafe {
ffi::gst_validate_reporter_purge_reports(self.as_ref().to_glib_none().0);
}
}
//fn report_simple(&self, issue_id: /*Ignored*/IssueId, message: &str) {
// unsafe { TODO: call ffi:gst_validate_reporter_report_simple() }
//}
fn set_handle_g_logs(&self) {
unsafe {
ffi::gst_validate_reporter_set_handle_g_logs(self.as_ref().to_glib_none().0);
}
}
fn set_name(&self, name: &str) {
unsafe {
ffi::gst_validate_reporter_set_name(
self.as_ref().to_glib_none().0,
name.to_glib_full(),
);
}
}
fn set_runner(&self, runner: &impl IsA<Runner>) {
unsafe {
ffi::gst_validate_reporter_set_runner(
self.as_ref().to_glib_none().0,
runner.as_ref().to_glib_none().0,
);
}
}
fn validate_runner(&self) -> Option<Runner> {
glib::ObjectExt::property(self.as_ref(), "validate-runner")
}
}

View file

@ -0,0 +1,225 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::Report;
use crate::ReportingDetails;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "GstValidateRunner")]
pub struct Runner(Object<ffi::GstValidateRunner, ffi::GstValidateRunnerClass>) @extends gst::Object;
match fn {
type_ => || ffi::gst_validate_runner_get_type(),
}
}
impl Runner {
pub const NONE: Option<&'static Runner> = None;
#[doc(alias = "gst_validate_runner_new")]
pub fn new() -> Runner {
assert_initialized_main_thread!();
unsafe { from_glib_none(ffi::gst_validate_runner_new()) }
}
}
impl Default for Runner {
fn default() -> Self {
Self::new()
}
}
unsafe impl Send for Runner {}
unsafe impl Sync for Runner {}
pub trait RunnerExt: 'static {
#[doc(alias = "gst_validate_runner_add_report")]
fn add_report(&self, report: &Report);
#[doc(alias = "gst_validate_runner_exit")]
fn exit(&self, print_result: bool) -> i32;
#[doc(alias = "gst_validate_runner_get_default_reporting_level")]
#[doc(alias = "get_default_reporting_level")]
fn default_reporting_level(&self) -> ReportingDetails;
#[doc(alias = "gst_validate_runner_get_reporting_level_for_name")]
#[doc(alias = "get_reporting_level_for_name")]
fn reporting_level_for_name(&self, name: &str) -> ReportingDetails;
#[doc(alias = "gst_validate_runner_get_reports")]
#[doc(alias = "get_reports")]
fn reports(&self) -> Vec<Report>;
#[doc(alias = "gst_validate_runner_get_reports_count")]
#[doc(alias = "get_reports_count")]
fn reports_count(&self) -> u32;
#[doc(alias = "gst_validate_runner_printf")]
fn printf(&self) -> i32;
fn params(&self) -> Option<glib::GString>;
fn set_params(&self, params: Option<&str>);
#[doc(alias = "report-added")]
fn connect_report_added<F: Fn(&Self, &Report) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[doc(alias = "stopping")]
fn connect_stopping<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "params")]
fn connect_params_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<Runner>> RunnerExt for O {
fn add_report(&self, report: &Report) {
unsafe {
ffi::gst_validate_runner_add_report(
self.as_ref().to_glib_none().0,
report.to_glib_none().0,
);
}
}
fn exit(&self, print_result: bool) -> i32 {
unsafe {
ffi::gst_validate_runner_exit(self.as_ref().to_glib_none().0, print_result.into_glib())
}
}
fn default_reporting_level(&self) -> ReportingDetails {
unsafe {
from_glib(ffi::gst_validate_runner_get_default_reporting_level(
self.as_ref().to_glib_none().0,
))
}
}
fn reporting_level_for_name(&self, name: &str) -> ReportingDetails {
unsafe {
from_glib(ffi::gst_validate_runner_get_reporting_level_for_name(
self.as_ref().to_glib_none().0,
name.to_glib_none().0,
))
}
}
fn reports(&self) -> Vec<Report> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_validate_runner_get_reports(
self.as_ref().to_glib_none().0,
))
}
}
fn reports_count(&self) -> u32 {
unsafe { ffi::gst_validate_runner_get_reports_count(self.as_ref().to_glib_none().0) }
}
fn printf(&self) -> i32 {
unsafe { ffi::gst_validate_runner_printf(self.as_ref().to_glib_none().0) }
}
fn params(&self) -> Option<glib::GString> {
glib::ObjectExt::property(self.as_ref(), "params")
}
fn set_params(&self, params: Option<&str>) {
glib::ObjectExt::set_property(self.as_ref(), "params", &params)
}
fn connect_report_added<F: Fn(&Self, &Report) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn report_added_trampoline<
P: IsA<Runner>,
F: Fn(&P, &Report) + Send + Sync + 'static,
>(
this: *mut ffi::GstValidateRunner,
object: *mut ffi::GstValidateReport,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(
Runner::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(object),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"report-added\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
report_added_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_stopping<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn stopping_trampoline<
P: IsA<Runner>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstValidateRunner,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Runner::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"stopping\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
stopping_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_params_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_params_trampoline<
P: IsA<Runner>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstValidateRunner,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Runner::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::params\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_params_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -0,0 +1,240 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::Action;
use crate::Reporter;
use crate::Runner;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "GstValidateScenario")]
pub struct Scenario(Object<ffi::GstValidateScenario, ffi::GstValidateScenarioClass>) @extends gst::Object, @implements Reporter;
match fn {
type_ => || ffi::gst_validate_scenario_get_type(),
}
}
impl Scenario {
pub const NONE: Option<&'static Scenario> = None;
#[doc(alias = "gst_validate_scenario_deinit")]
pub fn deinit() {
assert_initialized_main_thread!();
unsafe {
ffi::gst_validate_scenario_deinit();
}
}
#[doc(alias = "gst_validate_scenario_factory_create")]
pub fn factory_create(
runner: &impl IsA<Runner>,
pipeline: &impl IsA<gst::Element>,
scenario_name: &str,
) -> Option<Scenario> {
skip_assert_initialized!();
unsafe {
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,
))
}
}
}
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) -> Vec<Action>;
#[doc(alias = "gst_validate_scenario_get_pipeline")]
#[doc(alias = "get_pipeline")]
fn pipeline(&self) -> Option<gst::Element>;
#[doc(alias = "gst_validate_scenario_get_target_state")]
#[doc(alias = "get_target_state")]
fn target_state(&self) -> gst::State;
#[doc(alias = "execute-on-idle")]
fn is_execute_on_idle(&self) -> bool;
#[doc(alias = "execute-on-idle")]
fn set_execute_on_idle(&self, execute_on_idle: bool);
#[doc(alias = "handles-states")]
fn is_handles_states(&self) -> bool;
#[doc(alias = "validate-runner")]
fn validate_runner(&self) -> Option<Runner>;
#[doc(alias = "action-done")]
fn connect_action_done<F: Fn(&Self, &Action) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "done")]
fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "execute-on-idle")]
fn connect_execute_on_idle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "handles-states")]
fn connect_handles_states_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<Scenario>> ScenarioExt for O {
//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 {
// unsafe { TODO: call ffi:gst_validate_scenario_execute_seek() }
//}
fn actions(&self) -> Vec<Action> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_validate_scenario_get_actions(
self.as_ref().to_glib_none().0,
))
}
}
fn pipeline(&self) -> Option<gst::Element> {
unsafe {
from_glib_full(ffi::gst_validate_scenario_get_pipeline(
self.as_ref().to_glib_none().0,
))
}
}
fn target_state(&self) -> gst::State {
unsafe {
from_glib(ffi::gst_validate_scenario_get_target_state(
self.as_ref().to_glib_none().0,
))
}
}
fn is_execute_on_idle(&self) -> bool {
glib::ObjectExt::property(self.as_ref(), "execute-on-idle")
}
fn set_execute_on_idle(&self, execute_on_idle: bool) {
glib::ObjectExt::set_property(self.as_ref(), "execute-on-idle", &execute_on_idle)
}
fn is_handles_states(&self) -> bool {
glib::ObjectExt::property(self.as_ref(), "handles-states")
}
fn validate_runner(&self) -> Option<Runner> {
glib::ObjectExt::property(self.as_ref(), "validate-runner")
}
fn connect_action_done<F: Fn(&Self, &Action) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn action_done_trampoline<
P: IsA<Scenario>,
F: Fn(&P, &Action) + 'static,
>(
this: *mut ffi::GstValidateScenario,
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(action),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"action-done\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
action_done_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn done_trampoline<P: IsA<Scenario>, F: Fn(&P) + 'static>(
this: *mut ffi::GstValidateScenario,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Scenario::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"done\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
done_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_execute_on_idle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_execute_on_idle_trampoline<
P: IsA<Scenario>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::GstValidateScenario,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Scenario::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::execute-on-idle\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_execute_on_idle_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_handles_states_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_handles_states_trampoline<
P: IsA<Scenario>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::GstValidateScenario,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(Scenario::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::handles-states\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_handles_states_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -0,0 +1,3 @@
Generated by gir (https://github.com/gtk-rs/gir @ 9aa16ead87e1)
from gir-files (https://github.com/gtk-rs/gir-files @ b8b90867ab35)
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ def5d67e738d)

View file

@ -0,0 +1,30 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*;
#[doc(alias = "gst_validate_init")]
pub fn init() {
assert_initialized_main_thread!();
unsafe {
ffi::gst_validate_init();
}
}
#[doc(alias = "gst_validate_init_debug")]
pub fn init_debug() {
assert_initialized_main_thread!();
unsafe {
ffi::gst_validate_init_debug();
}
}
#[doc(alias = "gst_validate_setup_test_file")]
pub fn setup_test_file(test_file: &str, use_fakesinks: bool) -> gst::Structure {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_validate_setup_test_file(
test_file.to_glib_none().0,
use_fakesinks as i32,
))
}
}

View file

@ -0,0 +1,58 @@
// Take a look at the license at the top of the repository in the LICENSE file.
#![cfg_attr(feature = "dox", feature(doc_cfg))]
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::non_send_fields_in_send_ty)]
#![doc = include_str!("../README.md")]
#[doc(hidden)]
pub static INITIALIZED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
macro_rules! assert_initialized_main_thread {
() => {
if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
#[allow(unused_unsafe)]
if unsafe { gst::ffi::gst_is_initialized() } != glib::ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
} else {
gst::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
}
}
if !crate::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
if unsafe { ffi::gst_validate_is_initialized() } != glib::ffi::GTRUE {
panic!(
"GStreamer Validate has not been initialized. Call `gst_validate::init` first."
);
} else {
crate::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
}
}
};
}
macro_rules! skip_assert_initialized {
() => {};
}
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[allow(non_snake_case)]
#[allow(clippy::use_self)]
#[allow(unused_imports)]
mod auto;
pub use crate::auto::*;
#[allow(dead_code)]
mod functions;
pub use functions::*;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst_validate::prelude::*" without getting conflicts
pub mod prelude {
#[doc(hidden)]
pub use gst::prelude::*;
pub use crate::auto::traits::*;
}

View file

@ -0,0 +1,51 @@
[package]
authors = ["Philippe Normand <philn@igalia.com>"]
build = "build.rs"
description = "FFI bindings to libgstvalidate-1.0"
documentation = "https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer_validate_sys/"
homepage = "https://gstreamer.freedesktop.org"
keywords = ["ffi", "gstreamer", "gnome", "multimedia"]
license = "MIT"
name = "gstreamer-validate-sys"
readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.19.0"
edition = "2021"
rust-version = "1.57"
[package.metadata.docs.rs]
features = ["dox"]
[package.metadata.system-deps.gstreamer_validate_1_0]
name = "gstreamer-validate-1.0"
version = "1.21"
[lib]
name = "gstreamer_validate_sys"
[build-dependencies]
system-deps = "6"
[dependencies]
libc = "0.2"
[dependencies.glib]
package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core"
[dependencies.gobject]
package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core"
[dependencies.gio]
package = "gio-sys"
git = "https://github.com/gtk-rs/gtk-rs-core"
[dependencies.gst]
package = "gstreamer-sys"
path = "../../gstreamer/sys"
[dev-dependencies]
shell-words = "1.0.0"
tempfile = "3"
[features]
dox = []

View file

@ -0,0 +1,13 @@
[options]
girs_directories = ["../../gir-files", "../../gst-gir-files"]
library = "GstValidate"
version = "1.0"
min_cfg_version = "1.22"
work_mode = "sys"
external_libraries = [
"GLib",
"Gio",
"GObject",
"GStreamer",
]

View file

@ -0,0 +1,18 @@
// Generated by gir (https://github.com/gtk-rs/gir @ 9aa16ead87e1)
// from gir-files (https://github.com/gtk-rs/gir-files @ b8b90867ab35)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ def5d67e738d)
// DO NOT EDIT
#[cfg(not(feature = "dox"))]
use std::process;
#[cfg(feature = "dox")]
fn main() {} // prevent linking libraries to avoid documentation failure
#[cfg(not(feature = "dox"))]
fn main() {
if let Err(s) = system_deps::Config::new().probe() {
println!("cargo:warning={}", s);
process::exit(1);
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,601 @@
// Generated by gir (https://github.com/gtk-rs/gir @ 9aa16ead87e1)
// from gir-files (https://github.com/gtk-rs/gir-files @ b8b90867ab35)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ def5d67e738d)
// DO NOT EDIT
use gstreamer_validate_sys::*;
use std::env;
use std::error::Error;
use std::ffi::OsString;
use std::mem::{align_of, size_of};
use std::path::Path;
use std::process::Command;
use std::str;
use tempfile::Builder;
static PACKAGES: &[&str] = &["gstreamer-validate-1.0"];
#[derive(Clone, Debug)]
struct Compiler {
pub args: Vec<String>,
}
impl Compiler {
pub fn new() -> Result<Self, Box<dyn Error>> {
let mut args = get_var("CC", "cc")?;
args.push("-Wno-deprecated-declarations".to_owned());
// For _Generic
args.push("-std=c11".to_owned());
// For %z support in printf when using MinGW.
args.push("-D__USE_MINGW_ANSI_STDIO".to_owned());
args.extend(get_var("CFLAGS", "")?);
args.extend(get_var("CPPFLAGS", "")?);
args.extend(pkg_config_cflags(PACKAGES)?);
Ok(Self { args })
}
pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box<dyn Error>> {
let mut cmd = self.to_command();
cmd.arg(src);
cmd.arg("-o");
cmd.arg(out);
let status = cmd.spawn()?.wait()?;
if !status.success() {
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
}
Ok(())
}
fn to_command(&self) -> Command {
let mut cmd = Command::new(&self.args[0]);
cmd.args(&self.args[1..]);
cmd
}
}
fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
match env::var(name) {
Ok(value) => Ok(shell_words::split(&value)?),
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
Err(err) => Err(format!("{} {}", name, err).into()),
}
}
fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
if packages.is_empty() {
return Ok(Vec::new());
}
let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config"));
let mut cmd = Command::new(pkg_config);
cmd.arg("--cflags");
cmd.args(packages);
let out = cmd.output()?;
if !out.status.success() {
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
}
let stdout = str::from_utf8(&out.stdout)?;
Ok(shell_words::split(stdout.trim())?)
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
struct Layout {
size: usize,
alignment: usize,
}
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
struct Results {
/// Number of successfully completed tests.
passed: usize,
/// Total number of failed tests (including those that failed to compile).
failed: usize,
}
impl Results {
fn record_passed(&mut self) {
self.passed += 1;
}
fn record_failed(&mut self) {
self.failed += 1;
}
fn summary(&self) -> String {
format!("{} passed; {} failed", self.passed, self.failed)
}
fn expect_total_success(&self) {
if self.failed == 0 {
println!("OK: {}", self.summary());
} else {
panic!("FAILED: {}", self.summary());
};
}
}
#[test]
#[cfg(target_os = "linux")]
fn cross_validate_constants_with_c() {
let mut c_constants: Vec<(String, String)> = Vec::new();
for l in get_c_output("constant").unwrap().lines() {
let mut words = l.trim().split(';');
let name = words.next().expect("Failed to parse name").to_owned();
let value = words
.next()
.and_then(|s| s.parse().ok())
.expect("Failed to parse value");
c_constants.push((name, value));
}
let mut results = Results::default();
for ((rust_name, rust_value), (c_name, c_value)) in
RUST_CONSTANTS.iter().zip(c_constants.iter())
{
if rust_name != c_name {
results.record_failed();
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
continue;
}
if rust_value != c_value {
results.record_failed();
eprintln!(
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
rust_name, rust_value, &c_value
);
continue;
}
results.record_passed();
}
results.expect_total_success();
}
#[test]
#[cfg(target_os = "linux")]
fn cross_validate_layout_with_c() {
let mut c_layouts = Vec::new();
for l in get_c_output("layout").unwrap().lines() {
let mut words = l.trim().split(';');
let name = words.next().expect("Failed to parse name").to_owned();
let size = words
.next()
.and_then(|s| s.parse().ok())
.expect("Failed to parse size");
let alignment = words
.next()
.and_then(|s| s.parse().ok())
.expect("Failed to parse alignment");
c_layouts.push((name, Layout { size, alignment }));
}
let mut results = Results::default();
for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter())
{
if rust_name != c_name {
results.record_failed();
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
continue;
}
if rust_layout != c_layout {
results.record_failed();
eprintln!(
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
rust_name, rust_layout, &c_layout
);
continue;
}
results.record_passed();
}
results.expect_total_success();
}
fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
let tmpdir = Builder::new().prefix("abi").tempdir()?;
let exe = tmpdir.path().join(name);
let c_file = Path::new("tests").join(name).with_extension("c");
let cc = Compiler::new().expect("configured compiler");
cc.compile(&c_file, &exe)?;
let mut abi_cmd = Command::new(exe);
let output = abi_cmd.output()?;
if !output.status.success() {
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
}
Ok(String::from_utf8(output.stdout)?)
}
const RUST_LAYOUTS: &[(&str, Layout)] = &[
(
"GstValidateAction",
Layout {
size: size_of::<GstValidateAction>(),
alignment: align_of::<GstValidateAction>(),
},
),
(
"GstValidateActionParameter",
Layout {
size: size_of::<GstValidateActionParameter>(),
alignment: align_of::<GstValidateActionParameter>(),
},
),
(
"GstValidateActionReturn",
Layout {
size: size_of::<GstValidateActionReturn>(),
alignment: align_of::<GstValidateActionReturn>(),
},
),
(
"GstValidateActionType",
Layout {
size: size_of::<GstValidateActionType>(),
alignment: align_of::<GstValidateActionType>(),
},
),
(
"GstValidateActionTypeFlags",
Layout {
size: size_of::<GstValidateActionTypeFlags>(),
alignment: align_of::<GstValidateActionTypeFlags>(),
},
),
(
"GstValidateBinMonitor",
Layout {
size: size_of::<GstValidateBinMonitor>(),
alignment: align_of::<GstValidateBinMonitor>(),
},
),
(
"GstValidateBinMonitorClass",
Layout {
size: size_of::<GstValidateBinMonitorClass>(),
alignment: align_of::<GstValidateBinMonitorClass>(),
},
),
(
"GstValidateDebugFlags",
Layout {
size: size_of::<GstValidateDebugFlags>(),
alignment: align_of::<GstValidateDebugFlags>(),
},
),
(
"GstValidateElementMonitor",
Layout {
size: size_of::<GstValidateElementMonitor>(),
alignment: align_of::<GstValidateElementMonitor>(),
},
),
(
"GstValidateElementMonitorClass",
Layout {
size: size_of::<GstValidateElementMonitorClass>(),
alignment: align_of::<GstValidateElementMonitorClass>(),
},
),
(
"GstValidateInterceptionReturn",
Layout {
size: size_of::<GstValidateInterceptionReturn>(),
alignment: align_of::<GstValidateInterceptionReturn>(),
},
),
(
"GstValidateIssue",
Layout {
size: size_of::<GstValidateIssue>(),
alignment: align_of::<GstValidateIssue>(),
},
),
(
"GstValidateIssueFlags",
Layout {
size: size_of::<GstValidateIssueFlags>(),
alignment: align_of::<GstValidateIssueFlags>(),
},
),
(
"GstValidateIssueId",
Layout {
size: size_of::<GstValidateIssueId>(),
alignment: align_of::<GstValidateIssueId>(),
},
),
(
"GstValidateMediaDescriptor",
Layout {
size: size_of::<GstValidateMediaDescriptor>(),
alignment: align_of::<GstValidateMediaDescriptor>(),
},
),
(
"GstValidateMediaDescriptorClass",
Layout {
size: size_of::<GstValidateMediaDescriptorClass>(),
alignment: align_of::<GstValidateMediaDescriptorClass>(),
},
),
(
"GstValidateMediaDescriptorParser",
Layout {
size: size_of::<GstValidateMediaDescriptorParser>(),
alignment: align_of::<GstValidateMediaDescriptorParser>(),
},
),
(
"GstValidateMediaDescriptorParserClass",
Layout {
size: size_of::<GstValidateMediaDescriptorParserClass>(),
alignment: align_of::<GstValidateMediaDescriptorParserClass>(),
},
),
(
"GstValidateMediaDescriptorWriter",
Layout {
size: size_of::<GstValidateMediaDescriptorWriter>(),
alignment: align_of::<GstValidateMediaDescriptorWriter>(),
},
),
(
"GstValidateMediaDescriptorWriterClass",
Layout {
size: size_of::<GstValidateMediaDescriptorWriterClass>(),
alignment: align_of::<GstValidateMediaDescriptorWriterClass>(),
},
),
(
"GstValidateMediaDescriptorWriterFlags",
Layout {
size: size_of::<GstValidateMediaDescriptorWriterFlags>(),
alignment: align_of::<GstValidateMediaDescriptorWriterFlags>(),
},
),
(
"GstValidateMediaInfo",
Layout {
size: size_of::<GstValidateMediaInfo>(),
alignment: align_of::<GstValidateMediaInfo>(),
},
),
(
"GstValidateMonitor",
Layout {
size: size_of::<GstValidateMonitor>(),
alignment: align_of::<GstValidateMonitor>(),
},
),
(
"GstValidateMonitorClass",
Layout {
size: size_of::<GstValidateMonitorClass>(),
alignment: align_of::<GstValidateMonitorClass>(),
},
),
(
"GstValidateOverride",
Layout {
size: size_of::<GstValidateOverride>(),
alignment: align_of::<GstValidateOverride>(),
},
),
(
"GstValidateOverrideClass",
Layout {
size: size_of::<GstValidateOverrideClass>(),
alignment: align_of::<GstValidateOverrideClass>(),
},
),
(
"GstValidateOverrideRegistry",
Layout {
size: size_of::<GstValidateOverrideRegistry>(),
alignment: align_of::<GstValidateOverrideRegistry>(),
},
),
(
"GstValidatePadMonitor",
Layout {
size: size_of::<GstValidatePadMonitor>(),
alignment: align_of::<GstValidatePadMonitor>(),
},
),
(
"GstValidatePadMonitorClass",
Layout {
size: size_of::<GstValidatePadMonitorClass>(),
alignment: align_of::<GstValidatePadMonitorClass>(),
},
),
(
"GstValidatePipelineMonitor",
Layout {
size: size_of::<GstValidatePipelineMonitor>(),
alignment: align_of::<GstValidatePipelineMonitor>(),
},
),
(
"GstValidatePipelineMonitorClass",
Layout {
size: size_of::<GstValidatePipelineMonitorClass>(),
alignment: align_of::<GstValidatePipelineMonitorClass>(),
},
),
(
"GstValidateReport",
Layout {
size: size_of::<GstValidateReport>(),
alignment: align_of::<GstValidateReport>(),
},
),
(
"GstValidateReportLevel",
Layout {
size: size_of::<GstValidateReportLevel>(),
alignment: align_of::<GstValidateReportLevel>(),
},
),
(
"GstValidateReporterInterface",
Layout {
size: size_of::<GstValidateReporterInterface>(),
alignment: align_of::<GstValidateReporterInterface>(),
},
),
(
"GstValidateReportingDetails",
Layout {
size: size_of::<GstValidateReportingDetails>(),
alignment: align_of::<GstValidateReportingDetails>(),
},
),
(
"GstValidateRunner",
Layout {
size: size_of::<GstValidateRunner>(),
alignment: align_of::<GstValidateRunner>(),
},
),
(
"GstValidateRunnerClass",
Layout {
size: size_of::<GstValidateRunnerClass>(),
alignment: align_of::<GstValidateRunnerClass>(),
},
),
(
"GstValidateScenario",
Layout {
size: size_of::<GstValidateScenario>(),
alignment: align_of::<GstValidateScenario>(),
},
),
(
"GstValidateScenarioClass",
Layout {
size: size_of::<GstValidateScenarioClass>(),
alignment: align_of::<GstValidateScenarioClass>(),
},
),
(
"GstValidateStructureResolveVariablesFlags",
Layout {
size: size_of::<GstValidateStructureResolveVariablesFlags>(),
alignment: align_of::<GstValidateStructureResolveVariablesFlags>(),
},
),
(
"GstValidateVerbosityFlags",
Layout {
size: size_of::<GstValidateVerbosityFlags>(),
alignment: align_of::<GstValidateVerbosityFlags>(),
},
),
];
const RUST_CONSTANTS: &[(&str, &str)] = &[
("(guint) GST_VALIDATE_ACTION_TYPE_ASYNC", "4"),
("(guint) GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL", "128"),
(
"(guint) GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION",
"16",
),
("(guint) GST_VALIDATE_ACTION_TYPE_CONFIG", "2"),
(
"(guint) GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE",
"256",
),
("(guint) GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG", "512"),
("(guint) GST_VALIDATE_ACTION_TYPE_INTERLACED", "8"),
("(guint) GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK", "32"),
("(guint) GST_VALIDATE_ACTION_TYPE_NONE", "0"),
("(guint) GST_VALIDATE_ACTION_TYPE_NON_BLOCKING", "8"),
(
"(guint) GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL",
"64",
),
("(gint) GST_VALIDATE_EXECUTE_ACTION_ASYNC", "2"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_DONE", "7"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_ERROR", "0"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED", "4"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_INTERLACED", "3"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS", "5"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_NONE", "6"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING", "3"),
("(gint) GST_VALIDATE_EXECUTE_ACTION_OK", "1"),
("(guint) GST_VALIDATE_FATAL_CRITICALS", "4"),
("(guint) GST_VALIDATE_FATAL_DEFAULT", "0"),
("(guint) GST_VALIDATE_FATAL_ISSUES", "1"),
("(guint) GST_VALIDATE_FATAL_WARNINGS", "2"),
("(guint) GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE", "4"),
("(guint) GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS", "1"),
("(guint) GST_VALIDATE_ISSUE_FLAGS_NONE", "0"),
("(guint) GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE", "2"),
(
"(guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_FULL",
"4",
),
(
"(guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_HANDLE_GLOGS",
"8",
),
(
"(guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_NONE",
"1",
),
(
"(guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_NO_PARSER",
"2",
),
("(guint) GST_VALIDATE_PRINT_CRITICALS", "32"),
("(guint) GST_VALIDATE_PRINT_ISSUES", "8"),
("(guint) GST_VALIDATE_PRINT_WARNINGS", "16"),
("(gint) GST_VALIDATE_REPORTER_DROP", "0"),
("(gint) GST_VALIDATE_REPORTER_KEEP", "1"),
("(gint) GST_VALIDATE_REPORTER_REPORT", "2"),
("(gint) GST_VALIDATE_REPORT_LEVEL_CRITICAL", "0"),
("(gint) GST_VALIDATE_REPORT_LEVEL_EXPECTED", "5"),
("(gint) GST_VALIDATE_REPORT_LEVEL_IGNORE", "3"),
("(gint) GST_VALIDATE_REPORT_LEVEL_ISSUE", "2"),
("(gint) GST_VALIDATE_REPORT_LEVEL_NUM_ENTRIES", "6"),
("(gint) GST_VALIDATE_REPORT_LEVEL_UNKNOWN", "4"),
("(gint) GST_VALIDATE_REPORT_LEVEL_WARNING", "1"),
("(gint) GST_VALIDATE_SHOW_ALL", "5"),
("(gint) GST_VALIDATE_SHOW_COUNT", "7"),
("(gint) GST_VALIDATE_SHOW_MONITOR", "4"),
("(gint) GST_VALIDATE_SHOW_NONE", "1"),
("(gint) GST_VALIDATE_SHOW_SMART", "6"),
("(gint) GST_VALIDATE_SHOW_SUBCHAIN", "3"),
("(gint) GST_VALIDATE_SHOW_SYNTHETIC", "2"),
("(gint) GST_VALIDATE_SHOW_UNKNOWN", "0"),
("(guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_ALL", "0"),
(
"(guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_LOCAL_ONLY",
"1",
),
(
"(guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_EXPRESSION",
"2",
),
(
"(guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_FAILURE",
"2",
),
("GST_VALIDATE_UNKNOWN_BOOL", "-1"),
("GST_VALIDATE_UNKNOWN_UINT64", "-1"),
("(guint) GST_VALIDATE_VERBOSITY_ALL", "30"),
("(guint) GST_VALIDATE_VERBOSITY_MESSAGES", "4"),
("(guint) GST_VALIDATE_VERBOSITY_NEW_ELEMENTS", "16"),
("(guint) GST_VALIDATE_VERBOSITY_NONE", "0"),
("(guint) GST_VALIDATE_VERBOSITY_POSITION", "2"),
("(guint) GST_VALIDATE_VERBOSITY_PROPS_CHANGES", "8"),
];

View file

@ -0,0 +1,98 @@
// Generated by gir (https://github.com/gtk-rs/gir @ 9aa16ead87e1)
// from gir-files (https://github.com/gtk-rs/gir-files @ b8b90867ab35)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ def5d67e738d)
// DO NOT EDIT
#include "manual.h"
#include <stdio.h>
#define PRINT_CONSTANT(CONSTANT_NAME) \
printf("%s;", #CONSTANT_NAME); \
printf(_Generic((CONSTANT_NAME), \
char *: "%s", \
const char *: "%s", \
char: "%c", \
signed char: "%hhd", \
unsigned char: "%hhu", \
short int: "%hd", \
unsigned short int: "%hu", \
int: "%d", \
unsigned int: "%u", \
long: "%ld", \
unsigned long: "%lu", \
long long: "%lld", \
unsigned long long: "%llu", \
float: "%f", \
double: "%f", \
long double: "%ld"), \
CONSTANT_NAME); \
printf("\n");
int main() {
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_ASYNC);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_CONFIG);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_INTERLACED);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_NONE);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_NON_BLOCKING);
PRINT_CONSTANT((guint) GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_ASYNC);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_DONE);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_ERROR);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_INTERLACED);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_NONE);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING);
PRINT_CONSTANT((gint) GST_VALIDATE_EXECUTE_ACTION_OK);
PRINT_CONSTANT((guint) GST_VALIDATE_FATAL_CRITICALS);
PRINT_CONSTANT((guint) GST_VALIDATE_FATAL_DEFAULT);
PRINT_CONSTANT((guint) GST_VALIDATE_FATAL_ISSUES);
PRINT_CONSTANT((guint) GST_VALIDATE_FATAL_WARNINGS);
PRINT_CONSTANT((guint) GST_VALIDATE_ISSUE_FLAGS_FORCE_BACKTRACE);
PRINT_CONSTANT((guint) GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS);
PRINT_CONSTANT((guint) GST_VALIDATE_ISSUE_FLAGS_NONE);
PRINT_CONSTANT((guint) GST_VALIDATE_ISSUE_FLAGS_NO_BACKTRACE);
PRINT_CONSTANT((guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_FULL);
PRINT_CONSTANT((guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_HANDLE_GLOGS);
PRINT_CONSTANT((guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_NONE);
PRINT_CONSTANT((guint) GST_VALIDATE_MEDIA_DESCRIPTOR_WRITER_FLAGS_NO_PARSER);
PRINT_CONSTANT((guint) GST_VALIDATE_PRINT_CRITICALS);
PRINT_CONSTANT((guint) GST_VALIDATE_PRINT_ISSUES);
PRINT_CONSTANT((guint) GST_VALIDATE_PRINT_WARNINGS);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORTER_DROP);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORTER_KEEP);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORTER_REPORT);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_CRITICAL);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_EXPECTED);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_IGNORE);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_ISSUE);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_NUM_ENTRIES);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_UNKNOWN);
PRINT_CONSTANT((gint) GST_VALIDATE_REPORT_LEVEL_WARNING);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_ALL);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_COUNT);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_MONITOR);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_NONE);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_SMART);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_SUBCHAIN);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_SYNTHETIC);
PRINT_CONSTANT((gint) GST_VALIDATE_SHOW_UNKNOWN);
PRINT_CONSTANT((guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_ALL);
PRINT_CONSTANT((guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_LOCAL_ONLY);
PRINT_CONSTANT((guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_EXPRESSION);
PRINT_CONSTANT((guint) GST_VALIDATE_STRUCTURE_RESOLVE_VARIABLES_NO_FAILURE);
PRINT_CONSTANT(GST_VALIDATE_UNKNOWN_BOOL);
PRINT_CONSTANT(GST_VALIDATE_UNKNOWN_UINT64);
PRINT_CONSTANT((guint) GST_VALIDATE_VERBOSITY_ALL);
PRINT_CONSTANT((guint) GST_VALIDATE_VERBOSITY_MESSAGES);
PRINT_CONSTANT((guint) GST_VALIDATE_VERBOSITY_NEW_ELEMENTS);
PRINT_CONSTANT((guint) GST_VALIDATE_VERBOSITY_NONE);
PRINT_CONSTANT((guint) GST_VALIDATE_VERBOSITY_POSITION);
PRINT_CONSTANT((guint) GST_VALIDATE_VERBOSITY_PROPS_CHANGES);
return 0;
}

View file

@ -0,0 +1,53 @@
// Generated by gir (https://github.com/gtk-rs/gir @ 9aa16ead87e1)
// from gir-files (https://github.com/gtk-rs/gir-files @ b8b90867ab35)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ def5d67e738d)
// DO NOT EDIT
#include "manual.h"
#include <stdalign.h>
#include <stdio.h>
int main() {
printf("%s;%zu;%zu\n", "GstValidateAction", sizeof(GstValidateAction), alignof(GstValidateAction));
printf("%s;%zu;%zu\n", "GstValidateActionParameter", sizeof(GstValidateActionParameter), alignof(GstValidateActionParameter));
printf("%s;%zu;%zu\n", "GstValidateActionReturn", sizeof(GstValidateActionReturn), alignof(GstValidateActionReturn));
printf("%s;%zu;%zu\n", "GstValidateActionType", sizeof(GstValidateActionType), alignof(GstValidateActionType));
printf("%s;%zu;%zu\n", "GstValidateActionTypeFlags", sizeof(GstValidateActionTypeFlags), alignof(GstValidateActionTypeFlags));
printf("%s;%zu;%zu\n", "GstValidateBinMonitor", sizeof(GstValidateBinMonitor), alignof(GstValidateBinMonitor));
printf("%s;%zu;%zu\n", "GstValidateBinMonitorClass", sizeof(GstValidateBinMonitorClass), alignof(GstValidateBinMonitorClass));
printf("%s;%zu;%zu\n", "GstValidateDebugFlags", sizeof(GstValidateDebugFlags), alignof(GstValidateDebugFlags));
printf("%s;%zu;%zu\n", "GstValidateElementMonitor", sizeof(GstValidateElementMonitor), alignof(GstValidateElementMonitor));
printf("%s;%zu;%zu\n", "GstValidateElementMonitorClass", sizeof(GstValidateElementMonitorClass), alignof(GstValidateElementMonitorClass));
printf("%s;%zu;%zu\n", "GstValidateInterceptionReturn", sizeof(GstValidateInterceptionReturn), alignof(GstValidateInterceptionReturn));
printf("%s;%zu;%zu\n", "GstValidateIssue", sizeof(GstValidateIssue), alignof(GstValidateIssue));
printf("%s;%zu;%zu\n", "GstValidateIssueFlags", sizeof(GstValidateIssueFlags), alignof(GstValidateIssueFlags));
printf("%s;%zu;%zu\n", "GstValidateIssueId", sizeof(GstValidateIssueId), alignof(GstValidateIssueId));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptor", sizeof(GstValidateMediaDescriptor), alignof(GstValidateMediaDescriptor));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptorClass", sizeof(GstValidateMediaDescriptorClass), alignof(GstValidateMediaDescriptorClass));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptorParser", sizeof(GstValidateMediaDescriptorParser), alignof(GstValidateMediaDescriptorParser));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptorParserClass", sizeof(GstValidateMediaDescriptorParserClass), alignof(GstValidateMediaDescriptorParserClass));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptorWriter", sizeof(GstValidateMediaDescriptorWriter), alignof(GstValidateMediaDescriptorWriter));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptorWriterClass", sizeof(GstValidateMediaDescriptorWriterClass), alignof(GstValidateMediaDescriptorWriterClass));
printf("%s;%zu;%zu\n", "GstValidateMediaDescriptorWriterFlags", sizeof(GstValidateMediaDescriptorWriterFlags), alignof(GstValidateMediaDescriptorWriterFlags));
printf("%s;%zu;%zu\n", "GstValidateMediaInfo", sizeof(GstValidateMediaInfo), alignof(GstValidateMediaInfo));
printf("%s;%zu;%zu\n", "GstValidateMonitor", sizeof(GstValidateMonitor), alignof(GstValidateMonitor));
printf("%s;%zu;%zu\n", "GstValidateMonitorClass", sizeof(GstValidateMonitorClass), alignof(GstValidateMonitorClass));
printf("%s;%zu;%zu\n", "GstValidateOverride", sizeof(GstValidateOverride), alignof(GstValidateOverride));
printf("%s;%zu;%zu\n", "GstValidateOverrideClass", sizeof(GstValidateOverrideClass), alignof(GstValidateOverrideClass));
printf("%s;%zu;%zu\n", "GstValidateOverrideRegistry", sizeof(GstValidateOverrideRegistry), alignof(GstValidateOverrideRegistry));
printf("%s;%zu;%zu\n", "GstValidatePadMonitor", sizeof(GstValidatePadMonitor), alignof(GstValidatePadMonitor));
printf("%s;%zu;%zu\n", "GstValidatePadMonitorClass", sizeof(GstValidatePadMonitorClass), alignof(GstValidatePadMonitorClass));
printf("%s;%zu;%zu\n", "GstValidatePipelineMonitor", sizeof(GstValidatePipelineMonitor), alignof(GstValidatePipelineMonitor));
printf("%s;%zu;%zu\n", "GstValidatePipelineMonitorClass", sizeof(GstValidatePipelineMonitorClass), alignof(GstValidatePipelineMonitorClass));
printf("%s;%zu;%zu\n", "GstValidateReport", sizeof(GstValidateReport), alignof(GstValidateReport));
printf("%s;%zu;%zu\n", "GstValidateReportLevel", sizeof(GstValidateReportLevel), alignof(GstValidateReportLevel));
printf("%s;%zu;%zu\n", "GstValidateReporterInterface", sizeof(GstValidateReporterInterface), alignof(GstValidateReporterInterface));
printf("%s;%zu;%zu\n", "GstValidateReportingDetails", sizeof(GstValidateReportingDetails), alignof(GstValidateReportingDetails));
printf("%s;%zu;%zu\n", "GstValidateRunner", sizeof(GstValidateRunner), alignof(GstValidateRunner));
printf("%s;%zu;%zu\n", "GstValidateRunnerClass", sizeof(GstValidateRunnerClass), alignof(GstValidateRunnerClass));
printf("%s;%zu;%zu\n", "GstValidateScenario", sizeof(GstValidateScenario), alignof(GstValidateScenario));
printf("%s;%zu;%zu\n", "GstValidateScenarioClass", sizeof(GstValidateScenarioClass), alignof(GstValidateScenarioClass));
printf("%s;%zu;%zu\n", "GstValidateStructureResolveVariablesFlags", sizeof(GstValidateStructureResolveVariablesFlags), alignof(GstValidateStructureResolveVariablesFlags));
printf("%s;%zu;%zu\n", "GstValidateVerbosityFlags", sizeof(GstValidateVerbosityFlags), alignof(GstValidateVerbosityFlags));
return 0;
}

View file

@ -0,0 +1,3 @@
// Feel free to edit this file, it won't be regenerated by gir generator unless removed.
#include <gst/validate/validate.h>