mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 11:31:06 +00:00
Run everything through rustfmt
This commit is contained in:
parent
77a9f4b459
commit
be0f64ce93
52 changed files with 21392 additions and 6858 deletions
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_base_sys as gst_base;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -53,8 +58,10 @@ pub struct GstAppSinkClass {
|
|||
pub new_sample: Option<unsafe extern "C" fn(*mut GstAppSink) -> gst::GstFlowReturn>,
|
||||
pub pull_preroll: Option<unsafe extern "C" fn(*mut GstAppSink) -> *mut gst::GstSample>,
|
||||
pub pull_sample: Option<unsafe extern "C" fn(*mut GstAppSink) -> *mut gst::GstSample>,
|
||||
pub try_pull_preroll: Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
|
||||
pub try_pull_sample: Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
|
||||
pub try_pull_preroll:
|
||||
Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
|
||||
pub try_pull_sample:
|
||||
Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
|
||||
pub _gst_reserved: [gpointer; 2],
|
||||
}
|
||||
|
||||
|
@ -104,10 +111,13 @@ pub struct GstAppSrcClass {
|
|||
pub need_data: Option<unsafe extern "C" fn(*mut GstAppSrc, c_uint)>,
|
||||
pub enough_data: Option<unsafe extern "C" fn(*mut GstAppSrc)>,
|
||||
pub seek_data: Option<unsafe extern "C" fn(*mut GstAppSrc, u64) -> gboolean>,
|
||||
pub push_buffer: Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBuffer) -> gst::GstFlowReturn>,
|
||||
pub push_buffer:
|
||||
Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBuffer) -> gst::GstFlowReturn>,
|
||||
pub end_of_stream: Option<unsafe extern "C" fn(*mut GstAppSrc) -> gst::GstFlowReturn>,
|
||||
pub push_sample: Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstSample) -> gst::GstFlowReturn>,
|
||||
pub push_buffer_list: Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBufferList) -> gst::GstFlowReturn>,
|
||||
pub push_sample:
|
||||
Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstSample) -> gst::GstFlowReturn>,
|
||||
pub push_buffer_list:
|
||||
Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBufferList) -> gst::GstFlowReturn>,
|
||||
pub _gst_reserved: [gpointer; 2],
|
||||
}
|
||||
|
||||
|
@ -187,16 +197,27 @@ extern "C" {
|
|||
pub fn gst_app_sink_pull_sample(appsink: *mut GstAppSink) -> *mut gst::GstSample;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
pub fn gst_app_sink_set_buffer_list_support(appsink: *mut GstAppSink, enable_lists: gboolean);
|
||||
pub fn gst_app_sink_set_callbacks(appsink: *mut GstAppSink, callbacks: *mut GstAppSinkCallbacks, user_data: gpointer, notify: glib::GDestroyNotify);
|
||||
pub fn gst_app_sink_set_callbacks(
|
||||
appsink: *mut GstAppSink,
|
||||
callbacks: *mut GstAppSinkCallbacks,
|
||||
user_data: gpointer,
|
||||
notify: glib::GDestroyNotify,
|
||||
);
|
||||
pub fn gst_app_sink_set_caps(appsink: *mut GstAppSink, caps: *const gst::GstCaps);
|
||||
pub fn gst_app_sink_set_drop(appsink: *mut GstAppSink, drop: gboolean);
|
||||
pub fn gst_app_sink_set_emit_signals(appsink: *mut GstAppSink, emit: gboolean);
|
||||
pub fn gst_app_sink_set_max_buffers(appsink: *mut GstAppSink, max: c_uint);
|
||||
pub fn gst_app_sink_set_wait_on_eos(appsink: *mut GstAppSink, wait: gboolean);
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
pub fn gst_app_sink_try_pull_preroll(appsink: *mut GstAppSink, timeout: gst::GstClockTime) -> *mut gst::GstSample;
|
||||
pub fn gst_app_sink_try_pull_preroll(
|
||||
appsink: *mut GstAppSink,
|
||||
timeout: gst::GstClockTime,
|
||||
) -> *mut gst::GstSample;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
pub fn gst_app_sink_try_pull_sample(appsink: *mut GstAppSink, timeout: gst::GstClockTime) -> *mut gst::GstSample;
|
||||
pub fn gst_app_sink_try_pull_sample(
|
||||
appsink: *mut GstAppSink,
|
||||
timeout: gst::GstClockTime,
|
||||
) -> *mut gst::GstSample;
|
||||
|
||||
//=========================================================================
|
||||
// GstAppSrc
|
||||
|
@ -213,12 +234,26 @@ extern "C" {
|
|||
pub fn gst_app_src_get_max_bytes(appsrc: *mut GstAppSrc) -> u64;
|
||||
pub fn gst_app_src_get_size(appsrc: *mut GstAppSrc) -> i64;
|
||||
pub fn gst_app_src_get_stream_type(appsrc: *mut GstAppSrc) -> GstAppStreamType;
|
||||
pub fn gst_app_src_push_buffer(appsrc: *mut GstAppSrc, buffer: *mut gst::GstBuffer) -> gst::GstFlowReturn;
|
||||
pub fn gst_app_src_push_buffer(
|
||||
appsrc: *mut GstAppSrc,
|
||||
buffer: *mut gst::GstBuffer,
|
||||
) -> gst::GstFlowReturn;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn gst_app_src_push_buffer_list(appsrc: *mut GstAppSrc, buffer_list: *mut gst::GstBufferList) -> gst::GstFlowReturn;
|
||||
pub fn gst_app_src_push_buffer_list(
|
||||
appsrc: *mut GstAppSrc,
|
||||
buffer_list: *mut gst::GstBufferList,
|
||||
) -> gst::GstFlowReturn;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_app_src_push_sample(appsrc: *mut GstAppSrc, sample: *mut gst::GstSample) -> gst::GstFlowReturn;
|
||||
pub fn gst_app_src_set_callbacks(appsrc: *mut GstAppSrc, callbacks: *mut GstAppSrcCallbacks, user_data: gpointer, notify: glib::GDestroyNotify);
|
||||
pub fn gst_app_src_push_sample(
|
||||
appsrc: *mut GstAppSrc,
|
||||
sample: *mut gst::GstSample,
|
||||
) -> gst::GstFlowReturn;
|
||||
pub fn gst_app_src_set_callbacks(
|
||||
appsrc: *mut GstAppSrc,
|
||||
callbacks: *mut GstAppSrcCallbacks,
|
||||
user_data: gpointer,
|
||||
notify: glib::GDestroyNotify,
|
||||
);
|
||||
pub fn gst_app_src_set_caps(appsrc: *mut GstAppSrc, caps: *const gst::GstCaps);
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
pub fn gst_app_src_set_duration(appsrc: *mut GstAppSrc, duration: gst::GstClockTime);
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_app_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_app_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_app_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-app-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,28 +229,71 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstAppSink", Layout {size: size_of::<GstAppSink>(), alignment: align_of::<GstAppSink>()}),
|
||||
("GstAppSinkCallbacks", Layout {size: size_of::<GstAppSinkCallbacks>(), alignment: align_of::<GstAppSinkCallbacks>()}),
|
||||
("GstAppSinkClass", Layout {size: size_of::<GstAppSinkClass>(), alignment: align_of::<GstAppSinkClass>()}),
|
||||
("GstAppSrc", Layout {size: size_of::<GstAppSrc>(), alignment: align_of::<GstAppSrc>()}),
|
||||
("GstAppSrcCallbacks", Layout {size: size_of::<GstAppSrcCallbacks>(), alignment: align_of::<GstAppSrcCallbacks>()}),
|
||||
("GstAppSrcClass", Layout {size: size_of::<GstAppSrcClass>(), alignment: align_of::<GstAppSrcClass>()}),
|
||||
("GstAppStreamType", Layout {size: size_of::<GstAppStreamType>(), alignment: align_of::<GstAppStreamType>()}),
|
||||
(
|
||||
"GstAppSink",
|
||||
Layout {
|
||||
size: size_of::<GstAppSink>(),
|
||||
alignment: align_of::<GstAppSink>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAppSinkCallbacks",
|
||||
Layout {
|
||||
size: size_of::<GstAppSinkCallbacks>(),
|
||||
alignment: align_of::<GstAppSinkCallbacks>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAppSinkClass",
|
||||
Layout {
|
||||
size: size_of::<GstAppSinkClass>(),
|
||||
alignment: align_of::<GstAppSinkClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAppSrc",
|
||||
Layout {
|
||||
size: size_of::<GstAppSrc>(),
|
||||
alignment: align_of::<GstAppSrc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAppSrcCallbacks",
|
||||
Layout {
|
||||
size: size_of::<GstAppSrcCallbacks>(),
|
||||
alignment: align_of::<GstAppSrcCallbacks>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAppSrcClass",
|
||||
Layout {
|
||||
size: size_of::<GstAppSrcClass>(),
|
||||
alignment: align_of::<GstAppSrcClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAppStreamType",
|
||||
Layout {
|
||||
size: size_of::<GstAppStreamType>(),
|
||||
alignment: align_of::<GstAppStreamType>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -252,5 +301,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_APP_STREAM_TYPE_SEEKABLE", "1"),
|
||||
("(gint) GST_APP_STREAM_TYPE_STREAM", "0"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_audio_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_audio_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_audio_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-audio-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,78 +229,421 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstAudioAggregator", Layout {size: size_of::<GstAudioAggregator>(), alignment: align_of::<GstAudioAggregator>()}),
|
||||
("GstAudioAggregatorClass", Layout {size: size_of::<GstAudioAggregatorClass>(), alignment: align_of::<GstAudioAggregatorClass>()}),
|
||||
("GstAudioAggregatorConvertPad", Layout {size: size_of::<GstAudioAggregatorConvertPad>(), alignment: align_of::<GstAudioAggregatorConvertPad>()}),
|
||||
("GstAudioAggregatorConvertPadClass", Layout {size: size_of::<GstAudioAggregatorConvertPadClass>(), alignment: align_of::<GstAudioAggregatorConvertPadClass>()}),
|
||||
("GstAudioAggregatorPad", Layout {size: size_of::<GstAudioAggregatorPad>(), alignment: align_of::<GstAudioAggregatorPad>()}),
|
||||
("GstAudioAggregatorPadClass", Layout {size: size_of::<GstAudioAggregatorPadClass>(), alignment: align_of::<GstAudioAggregatorPadClass>()}),
|
||||
("GstAudioBaseSink", Layout {size: size_of::<GstAudioBaseSink>(), alignment: align_of::<GstAudioBaseSink>()}),
|
||||
("GstAudioBaseSinkClass", Layout {size: size_of::<GstAudioBaseSinkClass>(), alignment: align_of::<GstAudioBaseSinkClass>()}),
|
||||
("GstAudioBaseSinkDiscontReason", Layout {size: size_of::<GstAudioBaseSinkDiscontReason>(), alignment: align_of::<GstAudioBaseSinkDiscontReason>()}),
|
||||
("GstAudioBaseSinkSlaveMethod", Layout {size: size_of::<GstAudioBaseSinkSlaveMethod>(), alignment: align_of::<GstAudioBaseSinkSlaveMethod>()}),
|
||||
("GstAudioBaseSrc", Layout {size: size_of::<GstAudioBaseSrc>(), alignment: align_of::<GstAudioBaseSrc>()}),
|
||||
("GstAudioBaseSrcClass", Layout {size: size_of::<GstAudioBaseSrcClass>(), alignment: align_of::<GstAudioBaseSrcClass>()}),
|
||||
("GstAudioBaseSrcSlaveMethod", Layout {size: size_of::<GstAudioBaseSrcSlaveMethod>(), alignment: align_of::<GstAudioBaseSrcSlaveMethod>()}),
|
||||
("GstAudioBuffer", Layout {size: size_of::<GstAudioBuffer>(), alignment: align_of::<GstAudioBuffer>()}),
|
||||
("GstAudioCdSrc", Layout {size: size_of::<GstAudioCdSrc>(), alignment: align_of::<GstAudioCdSrc>()}),
|
||||
("GstAudioCdSrcClass", Layout {size: size_of::<GstAudioCdSrcClass>(), alignment: align_of::<GstAudioCdSrcClass>()}),
|
||||
("GstAudioCdSrcMode", Layout {size: size_of::<GstAudioCdSrcMode>(), alignment: align_of::<GstAudioCdSrcMode>()}),
|
||||
("GstAudioCdSrcTrack", Layout {size: size_of::<GstAudioCdSrcTrack>(), alignment: align_of::<GstAudioCdSrcTrack>()}),
|
||||
("GstAudioChannelMixerFlags", Layout {size: size_of::<GstAudioChannelMixerFlags>(), alignment: align_of::<GstAudioChannelMixerFlags>()}),
|
||||
("GstAudioChannelPosition", Layout {size: size_of::<GstAudioChannelPosition>(), alignment: align_of::<GstAudioChannelPosition>()}),
|
||||
("GstAudioClippingMeta", Layout {size: size_of::<GstAudioClippingMeta>(), alignment: align_of::<GstAudioClippingMeta>()}),
|
||||
("GstAudioClock", Layout {size: size_of::<GstAudioClock>(), alignment: align_of::<GstAudioClock>()}),
|
||||
("GstAudioClockClass", Layout {size: size_of::<GstAudioClockClass>(), alignment: align_of::<GstAudioClockClass>()}),
|
||||
("GstAudioConverterFlags", Layout {size: size_of::<GstAudioConverterFlags>(), alignment: align_of::<GstAudioConverterFlags>()}),
|
||||
("GstAudioDecoder", Layout {size: size_of::<GstAudioDecoder>(), alignment: align_of::<GstAudioDecoder>()}),
|
||||
("GstAudioDecoderClass", Layout {size: size_of::<GstAudioDecoderClass>(), alignment: align_of::<GstAudioDecoderClass>()}),
|
||||
("GstAudioDitherMethod", Layout {size: size_of::<GstAudioDitherMethod>(), alignment: align_of::<GstAudioDitherMethod>()}),
|
||||
("GstAudioDownmixMeta", Layout {size: size_of::<GstAudioDownmixMeta>(), alignment: align_of::<GstAudioDownmixMeta>()}),
|
||||
("GstAudioEncoder", Layout {size: size_of::<GstAudioEncoder>(), alignment: align_of::<GstAudioEncoder>()}),
|
||||
("GstAudioEncoderClass", Layout {size: size_of::<GstAudioEncoderClass>(), alignment: align_of::<GstAudioEncoderClass>()}),
|
||||
("GstAudioFilter", Layout {size: size_of::<GstAudioFilter>(), alignment: align_of::<GstAudioFilter>()}),
|
||||
("GstAudioFilterClass", Layout {size: size_of::<GstAudioFilterClass>(), alignment: align_of::<GstAudioFilterClass>()}),
|
||||
("GstAudioFlags", Layout {size: size_of::<GstAudioFlags>(), alignment: align_of::<GstAudioFlags>()}),
|
||||
("GstAudioFormat", Layout {size: size_of::<GstAudioFormat>(), alignment: align_of::<GstAudioFormat>()}),
|
||||
("GstAudioFormatFlags", Layout {size: size_of::<GstAudioFormatFlags>(), alignment: align_of::<GstAudioFormatFlags>()}),
|
||||
("GstAudioFormatInfo", Layout {size: size_of::<GstAudioFormatInfo>(), alignment: align_of::<GstAudioFormatInfo>()}),
|
||||
("GstAudioInfo", Layout {size: size_of::<GstAudioInfo>(), alignment: align_of::<GstAudioInfo>()}),
|
||||
("GstAudioLayout", Layout {size: size_of::<GstAudioLayout>(), alignment: align_of::<GstAudioLayout>()}),
|
||||
("GstAudioMeta", Layout {size: size_of::<GstAudioMeta>(), alignment: align_of::<GstAudioMeta>()}),
|
||||
("GstAudioNoiseShapingMethod", Layout {size: size_of::<GstAudioNoiseShapingMethod>(), alignment: align_of::<GstAudioNoiseShapingMethod>()}),
|
||||
("GstAudioPackFlags", Layout {size: size_of::<GstAudioPackFlags>(), alignment: align_of::<GstAudioPackFlags>()}),
|
||||
("GstAudioQuantizeFlags", Layout {size: size_of::<GstAudioQuantizeFlags>(), alignment: align_of::<GstAudioQuantizeFlags>()}),
|
||||
("GstAudioResamplerFilterInterpolation", Layout {size: size_of::<GstAudioResamplerFilterInterpolation>(), alignment: align_of::<GstAudioResamplerFilterInterpolation>()}),
|
||||
("GstAudioResamplerFilterMode", Layout {size: size_of::<GstAudioResamplerFilterMode>(), alignment: align_of::<GstAudioResamplerFilterMode>()}),
|
||||
("GstAudioResamplerFlags", Layout {size: size_of::<GstAudioResamplerFlags>(), alignment: align_of::<GstAudioResamplerFlags>()}),
|
||||
("GstAudioResamplerMethod", Layout {size: size_of::<GstAudioResamplerMethod>(), alignment: align_of::<GstAudioResamplerMethod>()}),
|
||||
("GstAudioRingBuffer", Layout {size: size_of::<GstAudioRingBuffer>(), alignment: align_of::<GstAudioRingBuffer>()}),
|
||||
("GstAudioRingBufferClass", Layout {size: size_of::<GstAudioRingBufferClass>(), alignment: align_of::<GstAudioRingBufferClass>()}),
|
||||
("GstAudioRingBufferFormatType", Layout {size: size_of::<GstAudioRingBufferFormatType>(), alignment: align_of::<GstAudioRingBufferFormatType>()}),
|
||||
("GstAudioRingBufferSpec", Layout {size: size_of::<GstAudioRingBufferSpec>(), alignment: align_of::<GstAudioRingBufferSpec>()}),
|
||||
("GstAudioRingBufferState", Layout {size: size_of::<GstAudioRingBufferState>(), alignment: align_of::<GstAudioRingBufferState>()}),
|
||||
("GstAudioSink", Layout {size: size_of::<GstAudioSink>(), alignment: align_of::<GstAudioSink>()}),
|
||||
("GstAudioSinkClass", Layout {size: size_of::<GstAudioSinkClass>(), alignment: align_of::<GstAudioSinkClass>()}),
|
||||
("GstAudioSrc", Layout {size: size_of::<GstAudioSrc>(), alignment: align_of::<GstAudioSrc>()}),
|
||||
("GstAudioSrcClass", Layout {size: size_of::<GstAudioSrcClass>(), alignment: align_of::<GstAudioSrcClass>()}),
|
||||
("GstStreamVolumeFormat", Layout {size: size_of::<GstStreamVolumeFormat>(), alignment: align_of::<GstStreamVolumeFormat>()}),
|
||||
("GstStreamVolumeInterface", Layout {size: size_of::<GstStreamVolumeInterface>(), alignment: align_of::<GstStreamVolumeInterface>()}),
|
||||
(
|
||||
"GstAudioAggregator",
|
||||
Layout {
|
||||
size: size_of::<GstAudioAggregator>(),
|
||||
alignment: align_of::<GstAudioAggregator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioAggregatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioAggregatorClass>(),
|
||||
alignment: align_of::<GstAudioAggregatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioAggregatorConvertPad",
|
||||
Layout {
|
||||
size: size_of::<GstAudioAggregatorConvertPad>(),
|
||||
alignment: align_of::<GstAudioAggregatorConvertPad>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioAggregatorConvertPadClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioAggregatorConvertPadClass>(),
|
||||
alignment: align_of::<GstAudioAggregatorConvertPadClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioAggregatorPad",
|
||||
Layout {
|
||||
size: size_of::<GstAudioAggregatorPad>(),
|
||||
alignment: align_of::<GstAudioAggregatorPad>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioAggregatorPadClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioAggregatorPadClass>(),
|
||||
alignment: align_of::<GstAudioAggregatorPadClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSink",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSink>(),
|
||||
alignment: align_of::<GstAudioBaseSink>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSinkClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSinkClass>(),
|
||||
alignment: align_of::<GstAudioBaseSinkClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSinkDiscontReason",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSinkDiscontReason>(),
|
||||
alignment: align_of::<GstAudioBaseSinkDiscontReason>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSinkSlaveMethod",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSinkSlaveMethod>(),
|
||||
alignment: align_of::<GstAudioBaseSinkSlaveMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSrc",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSrc>(),
|
||||
alignment: align_of::<GstAudioBaseSrc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSrcClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSrcClass>(),
|
||||
alignment: align_of::<GstAudioBaseSrcClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBaseSrcSlaveMethod",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBaseSrcSlaveMethod>(),
|
||||
alignment: align_of::<GstAudioBaseSrcSlaveMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioBuffer",
|
||||
Layout {
|
||||
size: size_of::<GstAudioBuffer>(),
|
||||
alignment: align_of::<GstAudioBuffer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioCdSrc",
|
||||
Layout {
|
||||
size: size_of::<GstAudioCdSrc>(),
|
||||
alignment: align_of::<GstAudioCdSrc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioCdSrcClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioCdSrcClass>(),
|
||||
alignment: align_of::<GstAudioCdSrcClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioCdSrcMode",
|
||||
Layout {
|
||||
size: size_of::<GstAudioCdSrcMode>(),
|
||||
alignment: align_of::<GstAudioCdSrcMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioCdSrcTrack",
|
||||
Layout {
|
||||
size: size_of::<GstAudioCdSrcTrack>(),
|
||||
alignment: align_of::<GstAudioCdSrcTrack>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioChannelMixerFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioChannelMixerFlags>(),
|
||||
alignment: align_of::<GstAudioChannelMixerFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioChannelPosition",
|
||||
Layout {
|
||||
size: size_of::<GstAudioChannelPosition>(),
|
||||
alignment: align_of::<GstAudioChannelPosition>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioClippingMeta",
|
||||
Layout {
|
||||
size: size_of::<GstAudioClippingMeta>(),
|
||||
alignment: align_of::<GstAudioClippingMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioClock",
|
||||
Layout {
|
||||
size: size_of::<GstAudioClock>(),
|
||||
alignment: align_of::<GstAudioClock>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioClockClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioClockClass>(),
|
||||
alignment: align_of::<GstAudioClockClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioConverterFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioConverterFlags>(),
|
||||
alignment: align_of::<GstAudioConverterFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioDecoder",
|
||||
Layout {
|
||||
size: size_of::<GstAudioDecoder>(),
|
||||
alignment: align_of::<GstAudioDecoder>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioDecoderClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioDecoderClass>(),
|
||||
alignment: align_of::<GstAudioDecoderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioDitherMethod",
|
||||
Layout {
|
||||
size: size_of::<GstAudioDitherMethod>(),
|
||||
alignment: align_of::<GstAudioDitherMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioDownmixMeta",
|
||||
Layout {
|
||||
size: size_of::<GstAudioDownmixMeta>(),
|
||||
alignment: align_of::<GstAudioDownmixMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioEncoder",
|
||||
Layout {
|
||||
size: size_of::<GstAudioEncoder>(),
|
||||
alignment: align_of::<GstAudioEncoder>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioEncoderClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioEncoderClass>(),
|
||||
alignment: align_of::<GstAudioEncoderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioFilter",
|
||||
Layout {
|
||||
size: size_of::<GstAudioFilter>(),
|
||||
alignment: align_of::<GstAudioFilter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioFilterClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioFilterClass>(),
|
||||
alignment: align_of::<GstAudioFilterClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioFlags>(),
|
||||
alignment: align_of::<GstAudioFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioFormat",
|
||||
Layout {
|
||||
size: size_of::<GstAudioFormat>(),
|
||||
alignment: align_of::<GstAudioFormat>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioFormatFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioFormatFlags>(),
|
||||
alignment: align_of::<GstAudioFormatFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioFormatInfo",
|
||||
Layout {
|
||||
size: size_of::<GstAudioFormatInfo>(),
|
||||
alignment: align_of::<GstAudioFormatInfo>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioInfo",
|
||||
Layout {
|
||||
size: size_of::<GstAudioInfo>(),
|
||||
alignment: align_of::<GstAudioInfo>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioLayout",
|
||||
Layout {
|
||||
size: size_of::<GstAudioLayout>(),
|
||||
alignment: align_of::<GstAudioLayout>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioMeta",
|
||||
Layout {
|
||||
size: size_of::<GstAudioMeta>(),
|
||||
alignment: align_of::<GstAudioMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioNoiseShapingMethod",
|
||||
Layout {
|
||||
size: size_of::<GstAudioNoiseShapingMethod>(),
|
||||
alignment: align_of::<GstAudioNoiseShapingMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioPackFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioPackFlags>(),
|
||||
alignment: align_of::<GstAudioPackFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioQuantizeFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioQuantizeFlags>(),
|
||||
alignment: align_of::<GstAudioQuantizeFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioResamplerFilterInterpolation",
|
||||
Layout {
|
||||
size: size_of::<GstAudioResamplerFilterInterpolation>(),
|
||||
alignment: align_of::<GstAudioResamplerFilterInterpolation>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioResamplerFilterMode",
|
||||
Layout {
|
||||
size: size_of::<GstAudioResamplerFilterMode>(),
|
||||
alignment: align_of::<GstAudioResamplerFilterMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioResamplerFlags",
|
||||
Layout {
|
||||
size: size_of::<GstAudioResamplerFlags>(),
|
||||
alignment: align_of::<GstAudioResamplerFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioResamplerMethod",
|
||||
Layout {
|
||||
size: size_of::<GstAudioResamplerMethod>(),
|
||||
alignment: align_of::<GstAudioResamplerMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioRingBuffer",
|
||||
Layout {
|
||||
size: size_of::<GstAudioRingBuffer>(),
|
||||
alignment: align_of::<GstAudioRingBuffer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioRingBufferClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioRingBufferClass>(),
|
||||
alignment: align_of::<GstAudioRingBufferClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioRingBufferFormatType",
|
||||
Layout {
|
||||
size: size_of::<GstAudioRingBufferFormatType>(),
|
||||
alignment: align_of::<GstAudioRingBufferFormatType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioRingBufferSpec",
|
||||
Layout {
|
||||
size: size_of::<GstAudioRingBufferSpec>(),
|
||||
alignment: align_of::<GstAudioRingBufferSpec>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioRingBufferState",
|
||||
Layout {
|
||||
size: size_of::<GstAudioRingBufferState>(),
|
||||
alignment: align_of::<GstAudioRingBufferState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioSink",
|
||||
Layout {
|
||||
size: size_of::<GstAudioSink>(),
|
||||
alignment: align_of::<GstAudioSink>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioSinkClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioSinkClass>(),
|
||||
alignment: align_of::<GstAudioSinkClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioSrc",
|
||||
Layout {
|
||||
size: size_of::<GstAudioSrc>(),
|
||||
alignment: align_of::<GstAudioSrc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioSrcClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioSrcClass>(),
|
||||
alignment: align_of::<GstAudioSrcClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstStreamVolumeFormat",
|
||||
Layout {
|
||||
size: size_of::<GstStreamVolumeFormat>(),
|
||||
alignment: align_of::<GstStreamVolumeFormat>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstStreamVolumeInterface",
|
||||
Layout {
|
||||
size: size_of::<GstStreamVolumeInterface>(),
|
||||
alignment: align_of::<GstStreamVolumeInterface>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -492,5 +841,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_STREAM_VOLUME_FORMAT_DB", "2"),
|
||||
("(gint) GST_STREAM_VOLUME_FORMAT_LINEAR", "0"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -56,7 +56,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -78,8 +78,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -93,4 +95,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_base_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_base_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_base_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-base-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,50 +229,225 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstAggregator", Layout {size: size_of::<GstAggregator>(), alignment: align_of::<GstAggregator>()}),
|
||||
("GstAggregatorClass", Layout {size: size_of::<GstAggregatorClass>(), alignment: align_of::<GstAggregatorClass>()}),
|
||||
("GstAggregatorPad", Layout {size: size_of::<GstAggregatorPad>(), alignment: align_of::<GstAggregatorPad>()}),
|
||||
("GstAggregatorPadClass", Layout {size: size_of::<GstAggregatorPadClass>(), alignment: align_of::<GstAggregatorPadClass>()}),
|
||||
("GstBaseParse", Layout {size: size_of::<GstBaseParse>(), alignment: align_of::<GstBaseParse>()}),
|
||||
("GstBaseParseClass", Layout {size: size_of::<GstBaseParseClass>(), alignment: align_of::<GstBaseParseClass>()}),
|
||||
("GstBaseParseFrame", Layout {size: size_of::<GstBaseParseFrame>(), alignment: align_of::<GstBaseParseFrame>()}),
|
||||
("GstBaseParseFrameFlags", Layout {size: size_of::<GstBaseParseFrameFlags>(), alignment: align_of::<GstBaseParseFrameFlags>()}),
|
||||
("GstBaseSink", Layout {size: size_of::<GstBaseSink>(), alignment: align_of::<GstBaseSink>()}),
|
||||
("GstBaseSinkClass", Layout {size: size_of::<GstBaseSinkClass>(), alignment: align_of::<GstBaseSinkClass>()}),
|
||||
("GstBaseSrc", Layout {size: size_of::<GstBaseSrc>(), alignment: align_of::<GstBaseSrc>()}),
|
||||
("GstBaseSrcClass", Layout {size: size_of::<GstBaseSrcClass>(), alignment: align_of::<GstBaseSrcClass>()}),
|
||||
("GstBaseSrcFlags", Layout {size: size_of::<GstBaseSrcFlags>(), alignment: align_of::<GstBaseSrcFlags>()}),
|
||||
("GstBaseTransform", Layout {size: size_of::<GstBaseTransform>(), alignment: align_of::<GstBaseTransform>()}),
|
||||
("GstBaseTransformClass", Layout {size: size_of::<GstBaseTransformClass>(), alignment: align_of::<GstBaseTransformClass>()}),
|
||||
("GstBitReader", Layout {size: size_of::<GstBitReader>(), alignment: align_of::<GstBitReader>()}),
|
||||
("GstBitWriter", Layout {size: size_of::<GstBitWriter>(), alignment: align_of::<GstBitWriter>()}),
|
||||
("GstByteReader", Layout {size: size_of::<GstByteReader>(), alignment: align_of::<GstByteReader>()}),
|
||||
("GstByteWriter", Layout {size: size_of::<GstByteWriter>(), alignment: align_of::<GstByteWriter>()}),
|
||||
("GstCollectData", Layout {size: size_of::<GstCollectData>(), alignment: align_of::<GstCollectData>()}),
|
||||
("GstCollectPads", Layout {size: size_of::<GstCollectPads>(), alignment: align_of::<GstCollectPads>()}),
|
||||
("GstCollectPadsClass", Layout {size: size_of::<GstCollectPadsClass>(), alignment: align_of::<GstCollectPadsClass>()}),
|
||||
("GstCollectPadsStateFlags", Layout {size: size_of::<GstCollectPadsStateFlags>(), alignment: align_of::<GstCollectPadsStateFlags>()}),
|
||||
("GstDataQueue", Layout {size: size_of::<GstDataQueue>(), alignment: align_of::<GstDataQueue>()}),
|
||||
("GstDataQueueClass", Layout {size: size_of::<GstDataQueueClass>(), alignment: align_of::<GstDataQueueClass>()}),
|
||||
("GstDataQueueItem", Layout {size: size_of::<GstDataQueueItem>(), alignment: align_of::<GstDataQueueItem>()}),
|
||||
("GstDataQueueSize", Layout {size: size_of::<GstDataQueueSize>(), alignment: align_of::<GstDataQueueSize>()}),
|
||||
("GstPushSrc", Layout {size: size_of::<GstPushSrc>(), alignment: align_of::<GstPushSrc>()}),
|
||||
("GstPushSrcClass", Layout {size: size_of::<GstPushSrcClass>(), alignment: align_of::<GstPushSrcClass>()}),
|
||||
(
|
||||
"GstAggregator",
|
||||
Layout {
|
||||
size: size_of::<GstAggregator>(),
|
||||
alignment: align_of::<GstAggregator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAggregatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstAggregatorClass>(),
|
||||
alignment: align_of::<GstAggregatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAggregatorPad",
|
||||
Layout {
|
||||
size: size_of::<GstAggregatorPad>(),
|
||||
alignment: align_of::<GstAggregatorPad>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAggregatorPadClass",
|
||||
Layout {
|
||||
size: size_of::<GstAggregatorPadClass>(),
|
||||
alignment: align_of::<GstAggregatorPadClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseParse",
|
||||
Layout {
|
||||
size: size_of::<GstBaseParse>(),
|
||||
alignment: align_of::<GstBaseParse>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseParseClass",
|
||||
Layout {
|
||||
size: size_of::<GstBaseParseClass>(),
|
||||
alignment: align_of::<GstBaseParseClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseParseFrame",
|
||||
Layout {
|
||||
size: size_of::<GstBaseParseFrame>(),
|
||||
alignment: align_of::<GstBaseParseFrame>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseParseFrameFlags",
|
||||
Layout {
|
||||
size: size_of::<GstBaseParseFrameFlags>(),
|
||||
alignment: align_of::<GstBaseParseFrameFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseSink",
|
||||
Layout {
|
||||
size: size_of::<GstBaseSink>(),
|
||||
alignment: align_of::<GstBaseSink>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseSinkClass",
|
||||
Layout {
|
||||
size: size_of::<GstBaseSinkClass>(),
|
||||
alignment: align_of::<GstBaseSinkClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseSrc",
|
||||
Layout {
|
||||
size: size_of::<GstBaseSrc>(),
|
||||
alignment: align_of::<GstBaseSrc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseSrcClass",
|
||||
Layout {
|
||||
size: size_of::<GstBaseSrcClass>(),
|
||||
alignment: align_of::<GstBaseSrcClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseSrcFlags",
|
||||
Layout {
|
||||
size: size_of::<GstBaseSrcFlags>(),
|
||||
alignment: align_of::<GstBaseSrcFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseTransform",
|
||||
Layout {
|
||||
size: size_of::<GstBaseTransform>(),
|
||||
alignment: align_of::<GstBaseTransform>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBaseTransformClass",
|
||||
Layout {
|
||||
size: size_of::<GstBaseTransformClass>(),
|
||||
alignment: align_of::<GstBaseTransformClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBitReader",
|
||||
Layout {
|
||||
size: size_of::<GstBitReader>(),
|
||||
alignment: align_of::<GstBitReader>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstBitWriter",
|
||||
Layout {
|
||||
size: size_of::<GstBitWriter>(),
|
||||
alignment: align_of::<GstBitWriter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstByteReader",
|
||||
Layout {
|
||||
size: size_of::<GstByteReader>(),
|
||||
alignment: align_of::<GstByteReader>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstByteWriter",
|
||||
Layout {
|
||||
size: size_of::<GstByteWriter>(),
|
||||
alignment: align_of::<GstByteWriter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstCollectData",
|
||||
Layout {
|
||||
size: size_of::<GstCollectData>(),
|
||||
alignment: align_of::<GstCollectData>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstCollectPads",
|
||||
Layout {
|
||||
size: size_of::<GstCollectPads>(),
|
||||
alignment: align_of::<GstCollectPads>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstCollectPadsClass",
|
||||
Layout {
|
||||
size: size_of::<GstCollectPadsClass>(),
|
||||
alignment: align_of::<GstCollectPadsClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstCollectPadsStateFlags",
|
||||
Layout {
|
||||
size: size_of::<GstCollectPadsStateFlags>(),
|
||||
alignment: align_of::<GstCollectPadsStateFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDataQueue",
|
||||
Layout {
|
||||
size: size_of::<GstDataQueue>(),
|
||||
alignment: align_of::<GstDataQueue>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDataQueueClass",
|
||||
Layout {
|
||||
size: size_of::<GstDataQueueClass>(),
|
||||
alignment: align_of::<GstDataQueueClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDataQueueItem",
|
||||
Layout {
|
||||
size: size_of::<GstDataQueueItem>(),
|
||||
alignment: align_of::<GstDataQueueItem>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDataQueueSize",
|
||||
Layout {
|
||||
size: size_of::<GstDataQueueSize>(),
|
||||
alignment: align_of::<GstDataQueueSize>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPushSrc",
|
||||
Layout {
|
||||
size: size_of::<GstPushSrc>(),
|
||||
alignment: align_of::<GstPushSrc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPushSrcClass",
|
||||
Layout {
|
||||
size: size_of::<GstPushSrcClass>(),
|
||||
alignment: align_of::<GstPushSrcClass>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -289,5 +470,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(guint) GST_COLLECT_PADS_STATE_NEW_SEGMENT", "4"),
|
||||
("(guint) GST_COLLECT_PADS_STATE_WAITING", "8"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,24 +3,31 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
||||
// Callbacks
|
||||
pub type GstHarnessPrepareBufferFunc = Option<unsafe extern "C" fn(*mut GstHarness, gpointer) -> *mut gst::GstBuffer>;
|
||||
pub type GstHarnessPrepareEventFunc = Option<unsafe extern "C" fn(*mut GstHarness, gpointer) -> *mut gst::GstEvent>;
|
||||
pub type GstHarnessPrepareBufferFunc =
|
||||
Option<unsafe extern "C" fn(*mut GstHarness, gpointer) -> *mut gst::GstBuffer>;
|
||||
pub type GstHarnessPrepareEventFunc =
|
||||
Option<unsafe extern "C" fn(*mut GstHarness, gpointer) -> *mut gst::GstEvent>;
|
||||
|
||||
// Records
|
||||
#[repr(C)]
|
||||
|
@ -102,7 +109,14 @@ extern "C" {
|
|||
// GstHarness
|
||||
//=========================================================================
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_element_full(h: *mut GstHarness, element: *mut gst::GstElement, hsrc: *mut gst::GstStaticPadTemplate, element_sinkpad_name: *const c_char, hsink: *mut gst::GstStaticPadTemplate, element_srcpad_name: *const c_char);
|
||||
pub fn gst_harness_add_element_full(
|
||||
h: *mut GstHarness,
|
||||
element: *mut gst::GstElement,
|
||||
hsrc: *mut gst::GstStaticPadTemplate,
|
||||
element_sinkpad_name: *const c_char,
|
||||
hsink: *mut gst::GstStaticPadTemplate,
|
||||
element_srcpad_name: *const c_char,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_element_sink_pad(h: *mut GstHarness, sinkpad: *mut gst::GstPad);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -110,9 +124,21 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_parse(h: *mut GstHarness, launchline: *const c_char);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_probe(h: *mut GstHarness, element_name: *const c_char, pad_name: *const c_char, mask: gst::GstPadProbeType, callback: gst::GstPadProbeCallback, user_data: gpointer, destroy_data: glib::GDestroyNotify);
|
||||
pub fn gst_harness_add_probe(
|
||||
h: *mut GstHarness,
|
||||
element_name: *const c_char,
|
||||
pad_name: *const c_char,
|
||||
mask: gst::GstPadProbeType,
|
||||
callback: gst::GstPadProbeCallback,
|
||||
user_data: gpointer,
|
||||
destroy_data: glib::GDestroyNotify,
|
||||
);
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_harness_add_propose_allocation_meta(h: *mut GstHarness, api: GType, params: *const gst::GstStructure);
|
||||
pub fn gst_harness_add_propose_allocation_meta(
|
||||
h: *mut GstHarness,
|
||||
api: GType,
|
||||
params: *const gst::GstStructure,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_sink(h: *mut GstHarness, sink_element_name: *const c_char);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -120,11 +146,23 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_sink_parse(h: *mut GstHarness, launchline: *const c_char);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_src(h: *mut GstHarness, src_element_name: *const c_char, has_clock_wait: gboolean);
|
||||
pub fn gst_harness_add_src(
|
||||
h: *mut GstHarness,
|
||||
src_element_name: *const c_char,
|
||||
has_clock_wait: gboolean,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_src_harness(h: *mut GstHarness, src_harness: *mut GstHarness, has_clock_wait: gboolean);
|
||||
pub fn gst_harness_add_src_harness(
|
||||
h: *mut GstHarness,
|
||||
src_harness: *mut GstHarness,
|
||||
has_clock_wait: gboolean,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_add_src_parse(h: *mut GstHarness, launchline: *const c_char, has_clock_wait: gboolean);
|
||||
pub fn gst_harness_add_src_parse(
|
||||
h: *mut GstHarness,
|
||||
launchline: *const c_char,
|
||||
has_clock_wait: gboolean,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_buffers_in_queue(h: *mut GstHarness) -> c_uint;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -142,11 +180,23 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_events_received(h: *mut GstHarness) -> c_uint;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_find_element(h: *mut GstHarness, element_name: *const c_char) -> *mut gst::GstElement;
|
||||
pub fn gst_harness_find_element(
|
||||
h: *mut GstHarness,
|
||||
element_name: *const c_char,
|
||||
) -> *mut gst::GstElement;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_get(h: *mut GstHarness, element_name: *const c_char, first_property_name: *const c_char, ...);
|
||||
pub fn gst_harness_get(
|
||||
h: *mut GstHarness,
|
||||
element_name: *const c_char,
|
||||
first_property_name: *const c_char,
|
||||
...
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_get_allocator(h: *mut GstHarness, allocator: *mut *mut gst::GstAllocator, params: *mut gst::GstAllocationParams);
|
||||
pub fn gst_harness_get_allocator(
|
||||
h: *mut GstHarness,
|
||||
allocator: *mut *mut gst::GstAllocator,
|
||||
params: *mut gst::GstAllocationParams,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_get_last_pushed_timestamp(h: *mut GstHarness) -> gst::GstClockTime;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -162,7 +212,10 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_push(h: *mut GstHarness, buffer: *mut gst::GstBuffer) -> gst::GstFlowReturn;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_push_and_pull(h: *mut GstHarness, buffer: *mut gst::GstBuffer) -> *mut gst::GstBuffer;
|
||||
pub fn gst_harness_push_and_pull(
|
||||
h: *mut GstHarness,
|
||||
buffer: *mut gst::GstBuffer,
|
||||
) -> *mut gst::GstBuffer;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_push_event(h: *mut GstHarness, event: *mut gst::GstEvent) -> gboolean;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -170,11 +223,19 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_push_to_sink(h: *mut GstHarness) -> gst::GstFlowReturn;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_push_upstream_event(h: *mut GstHarness, event: *mut gst::GstEvent) -> gboolean;
|
||||
pub fn gst_harness_push_upstream_event(
|
||||
h: *mut GstHarness,
|
||||
event: *mut gst::GstEvent,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_query_latency(h: *mut GstHarness) -> gst::GstClockTime;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_set(h: *mut GstHarness, element_name: *const c_char, first_property_name: *const c_char, ...);
|
||||
pub fn gst_harness_set(
|
||||
h: *mut GstHarness,
|
||||
element_name: *const c_char,
|
||||
first_property_name: *const c_char,
|
||||
...
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_set_blocking_push_mode(h: *mut GstHarness);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -186,7 +247,11 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_set_forwarding(h: *mut GstHarness, forwarding: gboolean);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_set_propose_allocator(h: *mut GstHarness, allocator: *mut gst::GstAllocator, params: *const gst::GstAllocationParams);
|
||||
pub fn gst_harness_set_propose_allocator(
|
||||
h: *mut GstHarness,
|
||||
allocator: *mut gst::GstAllocator,
|
||||
params: *const gst::GstAllocationParams,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_set_sink_caps(h: *mut GstHarness, caps: *mut gst::GstCaps);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
|
@ -202,29 +267,88 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_sink_push_many(h: *mut GstHarness, pushes: c_int) -> gst::GstFlowReturn;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_src_crank_and_push_many(h: *mut GstHarness, cranks: c_int, pushes: c_int) -> gst::GstFlowReturn;
|
||||
pub fn gst_harness_src_crank_and_push_many(
|
||||
h: *mut GstHarness,
|
||||
cranks: c_int,
|
||||
pushes: c_int,
|
||||
) -> gst::GstFlowReturn;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_src_push_event(h: *mut GstHarness) -> gboolean;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_custom_start(h: *mut GstHarness, init: glib::GFunc, callback: glib::GFunc, data: gpointer, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_custom_start(
|
||||
h: *mut GstHarness,
|
||||
init: glib::GFunc,
|
||||
callback: glib::GFunc,
|
||||
data: gpointer,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_property_start_full(h: *mut GstHarness, name: *const c_char, value: *const gobject::GValue, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_property_start_full(
|
||||
h: *mut GstHarness,
|
||||
name: *const c_char,
|
||||
value: *const gobject::GValue,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_push_buffer_start_full(h: *mut GstHarness, caps: *mut gst::GstCaps, segment: *const gst::GstSegment, buf: *mut gst::GstBuffer, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_push_buffer_start_full(
|
||||
h: *mut GstHarness,
|
||||
caps: *mut gst::GstCaps,
|
||||
segment: *const gst::GstSegment,
|
||||
buf: *mut gst::GstBuffer,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_push_buffer_with_cb_start_full(h: *mut GstHarness, caps: *mut gst::GstCaps, segment: *const gst::GstSegment, func: GstHarnessPrepareBufferFunc, data: gpointer, notify: glib::GDestroyNotify, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_push_buffer_with_cb_start_full(
|
||||
h: *mut GstHarness,
|
||||
caps: *mut gst::GstCaps,
|
||||
segment: *const gst::GstSegment,
|
||||
func: GstHarnessPrepareBufferFunc,
|
||||
data: gpointer,
|
||||
notify: glib::GDestroyNotify,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_push_event_start_full(h: *mut GstHarness, event: *mut gst::GstEvent, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_push_event_start_full(
|
||||
h: *mut GstHarness,
|
||||
event: *mut gst::GstEvent,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_harness_stress_push_event_with_cb_start_full(h: *mut GstHarness, func: GstHarnessPrepareEventFunc, data: gpointer, notify: glib::GDestroyNotify, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_push_event_with_cb_start_full(
|
||||
h: *mut GstHarness,
|
||||
func: GstHarnessPrepareEventFunc,
|
||||
data: gpointer,
|
||||
notify: glib::GDestroyNotify,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_push_upstream_event_start_full(h: *mut GstHarness, event: *mut gst::GstEvent, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_push_upstream_event_start_full(
|
||||
h: *mut GstHarness,
|
||||
event: *mut gst::GstEvent,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_harness_stress_push_upstream_event_with_cb_start_full(h: *mut GstHarness, func: GstHarnessPrepareEventFunc, data: gpointer, notify: glib::GDestroyNotify, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_push_upstream_event_with_cb_start_full(
|
||||
h: *mut GstHarness,
|
||||
func: GstHarnessPrepareEventFunc,
|
||||
data: gpointer,
|
||||
notify: glib::GDestroyNotify,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_requestpad_start_full(h: *mut GstHarness, templ: *mut gst::GstPadTemplate, name: *const c_char, caps: *mut gst::GstCaps, release: gboolean, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_requestpad_start_full(
|
||||
h: *mut GstHarness,
|
||||
templ: *mut gst::GstPadTemplate,
|
||||
name: *const c_char,
|
||||
caps: *mut gst::GstCaps,
|
||||
release: gboolean,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_statechange_start_full(h: *mut GstHarness, sleep: c_ulong) -> *mut GstHarnessThread;
|
||||
pub fn gst_harness_stress_statechange_start_full(
|
||||
h: *mut GstHarness,
|
||||
sleep: c_ulong,
|
||||
) -> *mut GstHarnessThread;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn gst_harness_take_all_data(h: *mut GstHarness, size: *mut size_t) -> *mut u8;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
|
@ -248,21 +372,43 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_use_testclock(h: *mut GstHarness);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_wait_for_clock_id_waits(h: *mut GstHarness, waits: c_uint, timeout: c_uint) -> gboolean;
|
||||
pub fn gst_harness_wait_for_clock_id_waits(
|
||||
h: *mut GstHarness,
|
||||
waits: c_uint,
|
||||
timeout: c_uint,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_new(element_name: *const c_char) -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_harness_new_empty() -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_new_full(element: *mut gst::GstElement, hsrc: *mut gst::GstStaticPadTemplate, element_sinkpad_name: *const c_char, hsink: *mut gst::GstStaticPadTemplate, element_srcpad_name: *const c_char) -> *mut GstHarness;
|
||||
pub fn gst_harness_new_full(
|
||||
element: *mut gst::GstElement,
|
||||
hsrc: *mut gst::GstStaticPadTemplate,
|
||||
element_sinkpad_name: *const c_char,
|
||||
hsink: *mut gst::GstStaticPadTemplate,
|
||||
element_srcpad_name: *const c_char,
|
||||
) -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_new_parse(launchline: *const c_char) -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_new_with_element(element: *mut gst::GstElement, element_sinkpad_name: *const c_char, element_srcpad_name: *const c_char) -> *mut GstHarness;
|
||||
pub fn gst_harness_new_with_element(
|
||||
element: *mut gst::GstElement,
|
||||
element_sinkpad_name: *const c_char,
|
||||
element_srcpad_name: *const c_char,
|
||||
) -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_new_with_padnames(element_name: *const c_char, element_sinkpad_name: *const c_char, element_srcpad_name: *const c_char) -> *mut GstHarness;
|
||||
pub fn gst_harness_new_with_padnames(
|
||||
element_name: *const c_char,
|
||||
element_sinkpad_name: *const c_char,
|
||||
element_srcpad_name: *const c_char,
|
||||
) -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_new_with_templates(element_name: *const c_char, hsrc: *mut gst::GstStaticPadTemplate, hsink: *mut gst::GstStaticPadTemplate) -> *mut GstHarness;
|
||||
pub fn gst_harness_new_with_templates(
|
||||
element_name: *const c_char,
|
||||
hsrc: *mut gst::GstStaticPadTemplate,
|
||||
hsink: *mut gst::GstStaticPadTemplate,
|
||||
) -> *mut GstHarness;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_harness_stress_thread_stop(t: *mut GstHarnessThread) -> c_uint;
|
||||
|
||||
|
@ -275,7 +421,9 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_new_with_start_time(start_time: gst::GstClockTime) -> *mut gst::GstClock;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_test_clock_id_list_get_latest_time(pending_list: *const glib::GList) -> gst::GstClockTime;
|
||||
pub fn gst_test_clock_id_list_get_latest_time(
|
||||
pending_list: *const glib::GList,
|
||||
) -> gst::GstClockTime;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_advance_time(test_clock: *mut GstTestClock, delta: gst::GstClockTimeDiff);
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
|
@ -287,26 +435,47 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_peek_id_count(test_clock: *mut GstTestClock) -> c_uint;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_peek_next_pending_id(test_clock: *mut GstTestClock, pending_id: *mut gst::GstClockID) -> gboolean;
|
||||
pub fn gst_test_clock_peek_next_pending_id(
|
||||
test_clock: *mut GstTestClock,
|
||||
pending_id: *mut gst::GstClockID,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_test_clock_process_id_list(test_clock: *mut GstTestClock, pending_list: *const glib::GList) -> c_uint;
|
||||
pub fn gst_test_clock_process_id_list(
|
||||
test_clock: *mut GstTestClock,
|
||||
pending_list: *const glib::GList,
|
||||
) -> c_uint;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_process_next_clock_id(test_clock: *mut GstTestClock) -> gst::GstClockID;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_set_time(test_clock: *mut GstTestClock, new_time: gst::GstClockTime);
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_test_clock_timed_wait_for_multiple_pending_ids(test_clock: *mut GstTestClock, count: c_uint, timeout_ms: c_uint, pending_list: *mut *mut glib::GList) -> gboolean;
|
||||
pub fn gst_test_clock_timed_wait_for_multiple_pending_ids(
|
||||
test_clock: *mut GstTestClock,
|
||||
count: c_uint,
|
||||
timeout_ms: c_uint,
|
||||
pending_list: *mut *mut glib::GList,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_test_clock_wait_for_multiple_pending_ids(test_clock: *mut GstTestClock, count: c_uint, pending_list: *mut *mut glib::GList);
|
||||
pub fn gst_test_clock_wait_for_multiple_pending_ids(
|
||||
test_clock: *mut GstTestClock,
|
||||
count: c_uint,
|
||||
pending_list: *mut *mut glib::GList,
|
||||
);
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_wait_for_next_pending_id(test_clock: *mut GstTestClock, pending_id: *mut gst::GstClockID);
|
||||
pub fn gst_test_clock_wait_for_next_pending_id(
|
||||
test_clock: *mut GstTestClock,
|
||||
pending_id: *mut gst::GstClockID,
|
||||
);
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_test_clock_wait_for_pending_id_count(test_clock: *mut GstTestClock, count: c_uint);
|
||||
|
||||
//=========================================================================
|
||||
// Other functions
|
||||
//=========================================================================
|
||||
pub fn gst_consistency_checker_add_pad(consist: *mut GstStreamConsistency, pad: *mut gst::GstPad) -> gboolean;
|
||||
pub fn gst_consistency_checker_add_pad(
|
||||
consist: *mut GstStreamConsistency,
|
||||
pad: *mut gst::GstPad,
|
||||
) -> gboolean;
|
||||
pub fn gst_consistency_checker_free(consist: *mut GstStreamConsistency);
|
||||
pub fn gst_consistency_checker_new(pad: *mut gst::GstPad) -> *mut GstStreamConsistency;
|
||||
pub fn gst_consistency_checker_reset(consist: *mut GstStreamConsistency);
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_check_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_check_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_check_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-check-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,27 +229,43 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstHarness", Layout {size: size_of::<GstHarness>(), alignment: align_of::<GstHarness>()}),
|
||||
("GstTestClock", Layout {size: size_of::<GstTestClock>(), alignment: align_of::<GstTestClock>()}),
|
||||
("GstTestClockClass", Layout {size: size_of::<GstTestClockClass>(), alignment: align_of::<GstTestClockClass>()}),
|
||||
(
|
||||
"GstHarness",
|
||||
Layout {
|
||||
size: size_of::<GstHarness>(),
|
||||
alignment: align_of::<GstHarness>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTestClock",
|
||||
Layout {
|
||||
size: size_of::<GstTestClock>(),
|
||||
alignment: align_of::<GstTestClock>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTestClockClass",
|
||||
Layout {
|
||||
size: size_of::<GstTestClockClass>(),
|
||||
alignment: align_of::<GstTestClockClass>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
];
|
||||
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[];
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -44,7 +44,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -66,8 +66,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -81,4 +83,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -34,7 +34,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -56,8 +56,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -71,4 +73,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,8 @@ use libc::c_char;
|
|||
|
||||
// See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/497
|
||||
#[cfg(any(feature = "egl", feature = "dox"))]
|
||||
pub const GST_GL_DISPLAY_EGL_NAME: *const c_char = b"gst.gl.display.egl\0" as *const u8 as *const c_char;
|
||||
pub const GST_GL_DISPLAY_EGL_NAME: *const c_char =
|
||||
b"gst.gl.display.egl\0" as *const u8 as *const c_char;
|
||||
|
||||
// See https://gitlab.gnome.org/GNOME/gobject-introspection/issues/238
|
||||
pub const GST_GL_COLOR_CONVERT_VIDEO_CAPS: *const c_char = b"video/x-raw(memory:GLMemory), format = (string) { RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, xBGR, ARGB, ABGR, Y444, I420, YV12, Y42B, Y41B, NV12, NV21, YUY2, UYVY, AYUV, GRAY8, GRAY16_LE, GRAY16_BE, RGB16, BGR16 }, width = (int) [ 1, max ], height = (int) [ 1, max ], framerate = (fraction) [ 0, max ], texture-target = (string) { 2D, rectangle, external-oes } ; video/x-raw(memory:GLMemory,meta:GstVideoOverlayComposition), format = (string) { RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, xBGR, ARGB, ABGR, Y444, I420, YV12, Y42B, Y41B, NV12, NV21, YUY2, UYVY, AYUV, GRAY8, GRAY16_LE, GRAY16_BE, RGB16, BGR16 }, width = (int) [ 1, max ], height = (int) [ 1, max ], framerate = (fraction) [ 0, max ], texture-target = (string) { 2D, rectangle, external-oes }\0" as *const u8 as *const c_char;
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_gl_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_gl_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_gl_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-gl-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,96 +229,511 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstGLAPI", Layout {size: size_of::<GstGLAPI>(), alignment: align_of::<GstGLAPI>()}),
|
||||
("GstGLAllocationParams", Layout {size: size_of::<GstGLAllocationParams>(), alignment: align_of::<GstGLAllocationParams>()}),
|
||||
("GstGLAsyncDebug", Layout {size: size_of::<GstGLAsyncDebug>(), alignment: align_of::<GstGLAsyncDebug>()}),
|
||||
("GstGLBaseFilter", Layout {size: size_of::<GstGLBaseFilter>(), alignment: align_of::<GstGLBaseFilter>()}),
|
||||
("GstGLBaseFilterClass", Layout {size: size_of::<GstGLBaseFilterClass>(), alignment: align_of::<GstGLBaseFilterClass>()}),
|
||||
("GstGLBaseMemory", Layout {size: size_of::<GstGLBaseMemory>(), alignment: align_of::<GstGLBaseMemory>()}),
|
||||
("GstGLBaseMemoryAllocator", Layout {size: size_of::<GstGLBaseMemoryAllocator>(), alignment: align_of::<GstGLBaseMemoryAllocator>()}),
|
||||
("GstGLBaseMemoryAllocatorClass", Layout {size: size_of::<GstGLBaseMemoryAllocatorClass>(), alignment: align_of::<GstGLBaseMemoryAllocatorClass>()}),
|
||||
("GstGLBaseMemoryError", Layout {size: size_of::<GstGLBaseMemoryError>(), alignment: align_of::<GstGLBaseMemoryError>()}),
|
||||
("GstGLBaseMemoryTransfer", Layout {size: size_of::<GstGLBaseMemoryTransfer>(), alignment: align_of::<GstGLBaseMemoryTransfer>()}),
|
||||
("GstGLBuffer", Layout {size: size_of::<GstGLBuffer>(), alignment: align_of::<GstGLBuffer>()}),
|
||||
("GstGLBufferAllocationParams", Layout {size: size_of::<GstGLBufferAllocationParams>(), alignment: align_of::<GstGLBufferAllocationParams>()}),
|
||||
("GstGLBufferAllocator", Layout {size: size_of::<GstGLBufferAllocator>(), alignment: align_of::<GstGLBufferAllocator>()}),
|
||||
("GstGLBufferAllocatorClass", Layout {size: size_of::<GstGLBufferAllocatorClass>(), alignment: align_of::<GstGLBufferAllocatorClass>()}),
|
||||
("GstGLBufferPool", Layout {size: size_of::<GstGLBufferPool>(), alignment: align_of::<GstGLBufferPool>()}),
|
||||
("GstGLBufferPoolClass", Layout {size: size_of::<GstGLBufferPoolClass>(), alignment: align_of::<GstGLBufferPoolClass>()}),
|
||||
("GstGLColorConvert", Layout {size: size_of::<GstGLColorConvert>(), alignment: align_of::<GstGLColorConvert>()}),
|
||||
("GstGLColorConvertClass", Layout {size: size_of::<GstGLColorConvertClass>(), alignment: align_of::<GstGLColorConvertClass>()}),
|
||||
("GstGLContext", Layout {size: size_of::<GstGLContext>(), alignment: align_of::<GstGLContext>()}),
|
||||
("GstGLContextClass", Layout {size: size_of::<GstGLContextClass>(), alignment: align_of::<GstGLContextClass>()}),
|
||||
("GstGLContextError", Layout {size: size_of::<GstGLContextError>(), alignment: align_of::<GstGLContextError>()}),
|
||||
("GstGLDisplay", Layout {size: size_of::<GstGLDisplay>(), alignment: align_of::<GstGLDisplay>()}),
|
||||
("GstGLDisplayClass", Layout {size: size_of::<GstGLDisplayClass>(), alignment: align_of::<GstGLDisplayClass>()}),
|
||||
(
|
||||
"GstGLAPI",
|
||||
Layout {
|
||||
size: size_of::<GstGLAPI>(),
|
||||
alignment: align_of::<GstGLAPI>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLAllocationParams",
|
||||
Layout {
|
||||
size: size_of::<GstGLAllocationParams>(),
|
||||
alignment: align_of::<GstGLAllocationParams>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLAsyncDebug",
|
||||
Layout {
|
||||
size: size_of::<GstGLAsyncDebug>(),
|
||||
alignment: align_of::<GstGLAsyncDebug>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseFilter",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseFilter>(),
|
||||
alignment: align_of::<GstGLBaseFilter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseFilterClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseFilterClass>(),
|
||||
alignment: align_of::<GstGLBaseFilterClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseMemory",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseMemory>(),
|
||||
alignment: align_of::<GstGLBaseMemory>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseMemoryAllocator",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseMemoryAllocator>(),
|
||||
alignment: align_of::<GstGLBaseMemoryAllocator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseMemoryAllocatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseMemoryAllocatorClass>(),
|
||||
alignment: align_of::<GstGLBaseMemoryAllocatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseMemoryError",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseMemoryError>(),
|
||||
alignment: align_of::<GstGLBaseMemoryError>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBaseMemoryTransfer",
|
||||
Layout {
|
||||
size: size_of::<GstGLBaseMemoryTransfer>(),
|
||||
alignment: align_of::<GstGLBaseMemoryTransfer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBuffer",
|
||||
Layout {
|
||||
size: size_of::<GstGLBuffer>(),
|
||||
alignment: align_of::<GstGLBuffer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBufferAllocationParams",
|
||||
Layout {
|
||||
size: size_of::<GstGLBufferAllocationParams>(),
|
||||
alignment: align_of::<GstGLBufferAllocationParams>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBufferAllocator",
|
||||
Layout {
|
||||
size: size_of::<GstGLBufferAllocator>(),
|
||||
alignment: align_of::<GstGLBufferAllocator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBufferAllocatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLBufferAllocatorClass>(),
|
||||
alignment: align_of::<GstGLBufferAllocatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBufferPool",
|
||||
Layout {
|
||||
size: size_of::<GstGLBufferPool>(),
|
||||
alignment: align_of::<GstGLBufferPool>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLBufferPoolClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLBufferPoolClass>(),
|
||||
alignment: align_of::<GstGLBufferPoolClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLColorConvert",
|
||||
Layout {
|
||||
size: size_of::<GstGLColorConvert>(),
|
||||
alignment: align_of::<GstGLColorConvert>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLColorConvertClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLColorConvertClass>(),
|
||||
alignment: align_of::<GstGLColorConvertClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLContext",
|
||||
Layout {
|
||||
size: size_of::<GstGLContext>(),
|
||||
alignment: align_of::<GstGLContext>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLContextClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLContextClass>(),
|
||||
alignment: align_of::<GstGLContextClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLContextError",
|
||||
Layout {
|
||||
size: size_of::<GstGLContextError>(),
|
||||
alignment: align_of::<GstGLContextError>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLDisplay",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplay>(),
|
||||
alignment: align_of::<GstGLDisplay>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLDisplayClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayClass>(),
|
||||
alignment: align_of::<GstGLDisplayClass>(),
|
||||
},
|
||||
),
|
||||
#[cfg(any(feature = "egl", feature = "dox"))]
|
||||
("GstGLDisplayEGL", Layout {size: size_of::<GstGLDisplayEGL>(), alignment: align_of::<GstGLDisplayEGL>()}),
|
||||
(
|
||||
"GstGLDisplayEGL",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayEGL>(),
|
||||
alignment: align_of::<GstGLDisplayEGL>(),
|
||||
},
|
||||
),
|
||||
#[cfg(any(feature = "egl", feature = "dox"))]
|
||||
("GstGLDisplayEGLClass", Layout {size: size_of::<GstGLDisplayEGLClass>(), alignment: align_of::<GstGLDisplayEGLClass>()}),
|
||||
("GstGLDisplayType", Layout {size: size_of::<GstGLDisplayType>(), alignment: align_of::<GstGLDisplayType>()}),
|
||||
(
|
||||
"GstGLDisplayEGLClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayEGLClass>(),
|
||||
alignment: align_of::<GstGLDisplayEGLClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLDisplayType",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayType>(),
|
||||
alignment: align_of::<GstGLDisplayType>(),
|
||||
},
|
||||
),
|
||||
#[cfg(any(feature = "wayland", feature = "dox"))]
|
||||
("GstGLDisplayWayland", Layout {size: size_of::<GstGLDisplayWayland>(), alignment: align_of::<GstGLDisplayWayland>()}),
|
||||
(
|
||||
"GstGLDisplayWayland",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayWayland>(),
|
||||
alignment: align_of::<GstGLDisplayWayland>(),
|
||||
},
|
||||
),
|
||||
#[cfg(any(feature = "wayland", feature = "dox"))]
|
||||
("GstGLDisplayWaylandClass", Layout {size: size_of::<GstGLDisplayWaylandClass>(), alignment: align_of::<GstGLDisplayWaylandClass>()}),
|
||||
(
|
||||
"GstGLDisplayWaylandClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayWaylandClass>(),
|
||||
alignment: align_of::<GstGLDisplayWaylandClass>(),
|
||||
},
|
||||
),
|
||||
#[cfg(any(feature = "x11", feature = "dox"))]
|
||||
("GstGLDisplayX11", Layout {size: size_of::<GstGLDisplayX11>(), alignment: align_of::<GstGLDisplayX11>()}),
|
||||
(
|
||||
"GstGLDisplayX11",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayX11>(),
|
||||
alignment: align_of::<GstGLDisplayX11>(),
|
||||
},
|
||||
),
|
||||
#[cfg(any(feature = "x11", feature = "dox"))]
|
||||
("GstGLDisplayX11Class", Layout {size: size_of::<GstGLDisplayX11Class>(), alignment: align_of::<GstGLDisplayX11Class>()}),
|
||||
("GstGLFilter", Layout {size: size_of::<GstGLFilter>(), alignment: align_of::<GstGLFilter>()}),
|
||||
("GstGLFilterClass", Layout {size: size_of::<GstGLFilterClass>(), alignment: align_of::<GstGLFilterClass>()}),
|
||||
("GstGLFormat", Layout {size: size_of::<GstGLFormat>(), alignment: align_of::<GstGLFormat>()}),
|
||||
("GstGLFramebuffer", Layout {size: size_of::<GstGLFramebuffer>(), alignment: align_of::<GstGLFramebuffer>()}),
|
||||
("GstGLFramebufferClass", Layout {size: size_of::<GstGLFramebufferClass>(), alignment: align_of::<GstGLFramebufferClass>()}),
|
||||
("GstGLMemory", Layout {size: size_of::<GstGLMemory>(), alignment: align_of::<GstGLMemory>()}),
|
||||
("GstGLMemoryAllocator", Layout {size: size_of::<GstGLMemoryAllocator>(), alignment: align_of::<GstGLMemoryAllocator>()}),
|
||||
("GstGLMemoryAllocatorClass", Layout {size: size_of::<GstGLMemoryAllocatorClass>(), alignment: align_of::<GstGLMemoryAllocatorClass>()}),
|
||||
("GstGLMemoryPBO", Layout {size: size_of::<GstGLMemoryPBO>(), alignment: align_of::<GstGLMemoryPBO>()}),
|
||||
("GstGLMemoryPBOAllocator", Layout {size: size_of::<GstGLMemoryPBOAllocator>(), alignment: align_of::<GstGLMemoryPBOAllocator>()}),
|
||||
("GstGLMemoryPBOAllocatorClass", Layout {size: size_of::<GstGLMemoryPBOAllocatorClass>(), alignment: align_of::<GstGLMemoryPBOAllocatorClass>()}),
|
||||
("GstGLOverlayCompositor", Layout {size: size_of::<GstGLOverlayCompositor>(), alignment: align_of::<GstGLOverlayCompositor>()}),
|
||||
("GstGLOverlayCompositorClass", Layout {size: size_of::<GstGLOverlayCompositorClass>(), alignment: align_of::<GstGLOverlayCompositorClass>()}),
|
||||
("GstGLPlatform", Layout {size: size_of::<GstGLPlatform>(), alignment: align_of::<GstGLPlatform>()}),
|
||||
("GstGLQuery", Layout {size: size_of::<GstGLQuery>(), alignment: align_of::<GstGLQuery>()}),
|
||||
("GstGLQueryType", Layout {size: size_of::<GstGLQueryType>(), alignment: align_of::<GstGLQueryType>()}),
|
||||
("GstGLRenderbuffer", Layout {size: size_of::<GstGLRenderbuffer>(), alignment: align_of::<GstGLRenderbuffer>()}),
|
||||
("GstGLRenderbufferAllocationParams", Layout {size: size_of::<GstGLRenderbufferAllocationParams>(), alignment: align_of::<GstGLRenderbufferAllocationParams>()}),
|
||||
("GstGLRenderbufferAllocator", Layout {size: size_of::<GstGLRenderbufferAllocator>(), alignment: align_of::<GstGLRenderbufferAllocator>()}),
|
||||
("GstGLRenderbufferAllocatorClass", Layout {size: size_of::<GstGLRenderbufferAllocatorClass>(), alignment: align_of::<GstGLRenderbufferAllocatorClass>()}),
|
||||
("GstGLSLError", Layout {size: size_of::<GstGLSLError>(), alignment: align_of::<GstGLSLError>()}),
|
||||
("GstGLSLProfile", Layout {size: size_of::<GstGLSLProfile>(), alignment: align_of::<GstGLSLProfile>()}),
|
||||
("GstGLSLStage", Layout {size: size_of::<GstGLSLStage>(), alignment: align_of::<GstGLSLStage>()}),
|
||||
("GstGLSLStageClass", Layout {size: size_of::<GstGLSLStageClass>(), alignment: align_of::<GstGLSLStageClass>()}),
|
||||
("GstGLSLVersion", Layout {size: size_of::<GstGLSLVersion>(), alignment: align_of::<GstGLSLVersion>()}),
|
||||
("GstGLShader", Layout {size: size_of::<GstGLShader>(), alignment: align_of::<GstGLShader>()}),
|
||||
("GstGLShaderClass", Layout {size: size_of::<GstGLShaderClass>(), alignment: align_of::<GstGLShaderClass>()}),
|
||||
("GstGLStereoDownmix", Layout {size: size_of::<GstGLStereoDownmix>(), alignment: align_of::<GstGLStereoDownmix>()}),
|
||||
("GstGLSyncMeta", Layout {size: size_of::<GstGLSyncMeta>(), alignment: align_of::<GstGLSyncMeta>()}),
|
||||
("GstGLTextureTarget", Layout {size: size_of::<GstGLTextureTarget>(), alignment: align_of::<GstGLTextureTarget>()}),
|
||||
("GstGLUpload", Layout {size: size_of::<GstGLUpload>(), alignment: align_of::<GstGLUpload>()}),
|
||||
("GstGLUploadClass", Layout {size: size_of::<GstGLUploadClass>(), alignment: align_of::<GstGLUploadClass>()}),
|
||||
("GstGLUploadReturn", Layout {size: size_of::<GstGLUploadReturn>(), alignment: align_of::<GstGLUploadReturn>()}),
|
||||
("GstGLVideoAllocationParams", Layout {size: size_of::<GstGLVideoAllocationParams>(), alignment: align_of::<GstGLVideoAllocationParams>()}),
|
||||
("GstGLViewConvert", Layout {size: size_of::<GstGLViewConvert>(), alignment: align_of::<GstGLViewConvert>()}),
|
||||
("GstGLViewConvertClass", Layout {size: size_of::<GstGLViewConvertClass>(), alignment: align_of::<GstGLViewConvertClass>()}),
|
||||
("GstGLWindow", Layout {size: size_of::<GstGLWindow>(), alignment: align_of::<GstGLWindow>()}),
|
||||
("GstGLWindowClass", Layout {size: size_of::<GstGLWindowClass>(), alignment: align_of::<GstGLWindowClass>()}),
|
||||
("GstGLWindowError", Layout {size: size_of::<GstGLWindowError>(), alignment: align_of::<GstGLWindowError>()}),
|
||||
(
|
||||
"GstGLDisplayX11Class",
|
||||
Layout {
|
||||
size: size_of::<GstGLDisplayX11Class>(),
|
||||
alignment: align_of::<GstGLDisplayX11Class>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLFilter",
|
||||
Layout {
|
||||
size: size_of::<GstGLFilter>(),
|
||||
alignment: align_of::<GstGLFilter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLFilterClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLFilterClass>(),
|
||||
alignment: align_of::<GstGLFilterClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLFormat",
|
||||
Layout {
|
||||
size: size_of::<GstGLFormat>(),
|
||||
alignment: align_of::<GstGLFormat>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLFramebuffer",
|
||||
Layout {
|
||||
size: size_of::<GstGLFramebuffer>(),
|
||||
alignment: align_of::<GstGLFramebuffer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLFramebufferClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLFramebufferClass>(),
|
||||
alignment: align_of::<GstGLFramebufferClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLMemory",
|
||||
Layout {
|
||||
size: size_of::<GstGLMemory>(),
|
||||
alignment: align_of::<GstGLMemory>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLMemoryAllocator",
|
||||
Layout {
|
||||
size: size_of::<GstGLMemoryAllocator>(),
|
||||
alignment: align_of::<GstGLMemoryAllocator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLMemoryAllocatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLMemoryAllocatorClass>(),
|
||||
alignment: align_of::<GstGLMemoryAllocatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLMemoryPBO",
|
||||
Layout {
|
||||
size: size_of::<GstGLMemoryPBO>(),
|
||||
alignment: align_of::<GstGLMemoryPBO>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLMemoryPBOAllocator",
|
||||
Layout {
|
||||
size: size_of::<GstGLMemoryPBOAllocator>(),
|
||||
alignment: align_of::<GstGLMemoryPBOAllocator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLMemoryPBOAllocatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLMemoryPBOAllocatorClass>(),
|
||||
alignment: align_of::<GstGLMemoryPBOAllocatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLOverlayCompositor",
|
||||
Layout {
|
||||
size: size_of::<GstGLOverlayCompositor>(),
|
||||
alignment: align_of::<GstGLOverlayCompositor>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLOverlayCompositorClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLOverlayCompositorClass>(),
|
||||
alignment: align_of::<GstGLOverlayCompositorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLPlatform",
|
||||
Layout {
|
||||
size: size_of::<GstGLPlatform>(),
|
||||
alignment: align_of::<GstGLPlatform>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLQuery",
|
||||
Layout {
|
||||
size: size_of::<GstGLQuery>(),
|
||||
alignment: align_of::<GstGLQuery>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLQueryType",
|
||||
Layout {
|
||||
size: size_of::<GstGLQueryType>(),
|
||||
alignment: align_of::<GstGLQueryType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLRenderbuffer",
|
||||
Layout {
|
||||
size: size_of::<GstGLRenderbuffer>(),
|
||||
alignment: align_of::<GstGLRenderbuffer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLRenderbufferAllocationParams",
|
||||
Layout {
|
||||
size: size_of::<GstGLRenderbufferAllocationParams>(),
|
||||
alignment: align_of::<GstGLRenderbufferAllocationParams>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLRenderbufferAllocator",
|
||||
Layout {
|
||||
size: size_of::<GstGLRenderbufferAllocator>(),
|
||||
alignment: align_of::<GstGLRenderbufferAllocator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLRenderbufferAllocatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLRenderbufferAllocatorClass>(),
|
||||
alignment: align_of::<GstGLRenderbufferAllocatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLSLError",
|
||||
Layout {
|
||||
size: size_of::<GstGLSLError>(),
|
||||
alignment: align_of::<GstGLSLError>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLSLProfile",
|
||||
Layout {
|
||||
size: size_of::<GstGLSLProfile>(),
|
||||
alignment: align_of::<GstGLSLProfile>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLSLStage",
|
||||
Layout {
|
||||
size: size_of::<GstGLSLStage>(),
|
||||
alignment: align_of::<GstGLSLStage>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLSLStageClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLSLStageClass>(),
|
||||
alignment: align_of::<GstGLSLStageClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLSLVersion",
|
||||
Layout {
|
||||
size: size_of::<GstGLSLVersion>(),
|
||||
alignment: align_of::<GstGLSLVersion>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLShader",
|
||||
Layout {
|
||||
size: size_of::<GstGLShader>(),
|
||||
alignment: align_of::<GstGLShader>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLShaderClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLShaderClass>(),
|
||||
alignment: align_of::<GstGLShaderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLStereoDownmix",
|
||||
Layout {
|
||||
size: size_of::<GstGLStereoDownmix>(),
|
||||
alignment: align_of::<GstGLStereoDownmix>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLSyncMeta",
|
||||
Layout {
|
||||
size: size_of::<GstGLSyncMeta>(),
|
||||
alignment: align_of::<GstGLSyncMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLTextureTarget",
|
||||
Layout {
|
||||
size: size_of::<GstGLTextureTarget>(),
|
||||
alignment: align_of::<GstGLTextureTarget>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLUpload",
|
||||
Layout {
|
||||
size: size_of::<GstGLUpload>(),
|
||||
alignment: align_of::<GstGLUpload>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLUploadClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLUploadClass>(),
|
||||
alignment: align_of::<GstGLUploadClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLUploadReturn",
|
||||
Layout {
|
||||
size: size_of::<GstGLUploadReturn>(),
|
||||
alignment: align_of::<GstGLUploadReturn>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLVideoAllocationParams",
|
||||
Layout {
|
||||
size: size_of::<GstGLVideoAllocationParams>(),
|
||||
alignment: align_of::<GstGLVideoAllocationParams>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLViewConvert",
|
||||
Layout {
|
||||
size: size_of::<GstGLViewConvert>(),
|
||||
alignment: align_of::<GstGLViewConvert>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLViewConvertClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLViewConvertClass>(),
|
||||
alignment: align_of::<GstGLViewConvertClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLWindow",
|
||||
Layout {
|
||||
size: size_of::<GstGLWindow>(),
|
||||
alignment: align_of::<GstGLWindow>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLWindowClass",
|
||||
Layout {
|
||||
size: size_of::<GstGLWindowClass>(),
|
||||
alignment: align_of::<GstGLWindowClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstGLWindowError",
|
||||
Layout {
|
||||
size: size_of::<GstGLWindowError>(),
|
||||
alignment: align_of::<GstGLWindowError>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -443,5 +864,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE", "2"),
|
||||
("GST_MAP_GL", "131072"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -410,7 +415,8 @@ pub const GST_MTS_TABLE_ID_ATSC_DATA_SERVICE: GstMpegtsSectionATSCTableID = 207;
|
|||
pub const GST_MTS_TABLE_ID_ATSC_NETWORK_RESOURCE: GstMpegtsSectionATSCTableID = 209;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_LONG_TERM_SERVICE: GstMpegtsSectionATSCTableID = 210;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_DIRECTED_CHANNEL_CHANGE: GstMpegtsSectionATSCTableID = 211;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_DIRECTED_CHANNEL_CHANGE_SECTION_CODE: GstMpegtsSectionATSCTableID = 212;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_DIRECTED_CHANNEL_CHANGE_SECTION_CODE: GstMpegtsSectionATSCTableID =
|
||||
212;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_AGGREGATE_EVENT_INFORMATION: GstMpegtsSectionATSCTableID = 214;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_AGGREGATE_EXTENDED_TEXT: GstMpegtsSectionATSCTableID = 215;
|
||||
pub const GST_MTS_TABLE_ID_ATSC_AGGREGATE_DATA_EVENT: GstMpegtsSectionATSCTableID = 217;
|
||||
|
@ -736,7 +742,10 @@ pub struct GstMpegtsAtscStringSegment {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsAtscStringSegment {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsAtscStringSegment @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsAtscStringSegment @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("compression_type", &self.compression_type)
|
||||
.field("mode", &self.mode)
|
||||
.field("compressed_data_size", &self.compressed_data_size)
|
||||
|
@ -856,7 +865,10 @@ pub struct GstMpegtsCableDeliverySystemDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsCableDeliverySystemDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsCableDeliverySystemDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsCableDeliverySystemDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("frequency", &self.frequency)
|
||||
.field("outer_fec", &self.outer_fec)
|
||||
.field("modulation", &self.modulation)
|
||||
|
@ -878,7 +890,10 @@ pub struct GstMpegtsComponentDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsComponentDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsComponentDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsComponentDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("stream_content", &self.stream_content)
|
||||
.field("component_type", &self.component_type)
|
||||
.field("component_tag", &self.component_tag)
|
||||
|
@ -920,7 +935,10 @@ pub struct GstMpegtsDVBLinkageDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDVBLinkageDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDVBLinkageDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDVBLinkageDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("transport_stream_id", &self.transport_stream_id)
|
||||
.field("original_network_id", &self.original_network_id)
|
||||
.field("service_id", &self.service_id)
|
||||
|
@ -941,7 +959,10 @@ pub struct GstMpegtsDVBLinkageEvent {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDVBLinkageEvent {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDVBLinkageEvent @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDVBLinkageEvent @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("target_event_id", &self.target_event_id)
|
||||
.field("target_listed", &self.target_listed)
|
||||
.field("event_simulcast", &self.event_simulcast)
|
||||
|
@ -967,7 +988,10 @@ pub struct GstMpegtsDVBLinkageExtendedEvent {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDVBLinkageExtendedEvent {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDVBLinkageExtendedEvent @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDVBLinkageExtendedEvent @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("target_event_id", &self.target_event_id)
|
||||
.field("target_listed", &self.target_listed)
|
||||
.field("event_simulcast", &self.event_simulcast)
|
||||
|
@ -976,8 +1000,14 @@ impl ::std::fmt::Debug for GstMpegtsDVBLinkageExtendedEvent {
|
|||
.field("original_network_id_flag", &self.original_network_id_flag)
|
||||
.field("service_id_flag", &self.service_id_flag)
|
||||
.field("user_defined_id", &self.user_defined_id)
|
||||
.field("target_transport_stream_id", &self.target_transport_stream_id)
|
||||
.field("target_original_network_id", &self.target_original_network_id)
|
||||
.field(
|
||||
"target_transport_stream_id",
|
||||
&self.target_transport_stream_id,
|
||||
)
|
||||
.field(
|
||||
"target_original_network_id",
|
||||
&self.target_original_network_id,
|
||||
)
|
||||
.field("target_service_id", &self.target_service_id)
|
||||
.finish()
|
||||
}
|
||||
|
@ -994,7 +1024,10 @@ pub struct GstMpegtsDVBLinkageMobileHandOver {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDVBLinkageMobileHandOver {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDVBLinkageMobileHandOver @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDVBLinkageMobileHandOver @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("hand_over_type", &self.hand_over_type)
|
||||
.field("origin_type", &self.origin_type)
|
||||
.field("network_id", &self.network_id)
|
||||
|
@ -1012,7 +1045,10 @@ pub struct GstMpegtsDVBParentalRatingItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDVBParentalRatingItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDVBParentalRatingItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDVBParentalRatingItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("country_code", &self.country_code)
|
||||
.field("rating", &self.rating)
|
||||
.finish()
|
||||
|
@ -1028,7 +1064,10 @@ pub struct GstMpegtsDVBServiceListItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDVBServiceListItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDVBServiceListItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDVBServiceListItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("service_id", &self.service_id)
|
||||
.field("type_", &self.type_)
|
||||
.finish()
|
||||
|
@ -1048,7 +1087,10 @@ pub struct GstMpegtsDataBroadcastDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDataBroadcastDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDataBroadcastDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDataBroadcastDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("data_broadcast_id", &self.data_broadcast_id)
|
||||
.field("component_tag", &self.component_tag)
|
||||
.field("length", &self.length)
|
||||
|
@ -1089,7 +1131,10 @@ pub struct GstMpegtsDvbMultilingualBouquetNameItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDvbMultilingualBouquetNameItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDvbMultilingualBouquetNameItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDvbMultilingualBouquetNameItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("language_code", &self.language_code)
|
||||
.field("bouquet_name", &self.bouquet_name)
|
||||
.finish()
|
||||
|
@ -1105,7 +1150,10 @@ pub struct GstMpegtsDvbMultilingualComponentItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDvbMultilingualComponentItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDvbMultilingualComponentItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDvbMultilingualComponentItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("language_code", &self.language_code)
|
||||
.field("description", &self.description)
|
||||
.finish()
|
||||
|
@ -1121,7 +1169,10 @@ pub struct GstMpegtsDvbMultilingualNetworkNameItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDvbMultilingualNetworkNameItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDvbMultilingualNetworkNameItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDvbMultilingualNetworkNameItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("language_code", &self.language_code)
|
||||
.field("network_name", &self.network_name)
|
||||
.finish()
|
||||
|
@ -1138,7 +1189,10 @@ pub struct GstMpegtsDvbMultilingualServiceNameItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsDvbMultilingualServiceNameItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsDvbMultilingualServiceNameItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsDvbMultilingualServiceNameItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("language_code", &self.language_code)
|
||||
.field("provider_name", &self.provider_name)
|
||||
.field("service_name", &self.service_name)
|
||||
|
@ -1163,7 +1217,10 @@ impl ::std::fmt::Debug for GstMpegtsEIT {
|
|||
f.debug_struct(&format!("GstMpegtsEIT @ {:?}", self as *const _))
|
||||
.field("transport_stream_id", &self.transport_stream_id)
|
||||
.field("original_network_id", &self.original_network_id)
|
||||
.field("segment_last_section_number", &self.segment_last_section_number)
|
||||
.field(
|
||||
"segment_last_section_number",
|
||||
&self.segment_last_section_number,
|
||||
)
|
||||
.field("last_table_id", &self.last_table_id)
|
||||
.field("actual_stream", &self.actual_stream)
|
||||
.field("present_following", &self.present_following)
|
||||
|
@ -1208,7 +1265,10 @@ pub struct GstMpegtsExtendedEventDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsExtendedEventDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsExtendedEventDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsExtendedEventDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("descriptor_number", &self.descriptor_number)
|
||||
.field("last_descriptor_number", &self.last_descriptor_number)
|
||||
.field("language_code", &self.language_code)
|
||||
|
@ -1227,7 +1287,10 @@ pub struct GstMpegtsExtendedEventItem {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsExtendedEventItem {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsExtendedEventItem @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsExtendedEventItem @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("item_description", &self.item_description)
|
||||
.field("item", &self.item)
|
||||
.finish()
|
||||
|
@ -1244,7 +1307,10 @@ pub struct GstMpegtsISO639LanguageDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsISO639LanguageDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsISO639LanguageDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsISO639LanguageDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("nb_language", &self.nb_language)
|
||||
.finish()
|
||||
}
|
||||
|
@ -1277,7 +1343,10 @@ pub struct GstMpegtsLogicalChannelDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsLogicalChannelDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsLogicalChannelDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsLogicalChannelDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("nb_channels", &self.nb_channels)
|
||||
.finish()
|
||||
}
|
||||
|
@ -1370,7 +1439,10 @@ impl ::std::fmt::Debug for GstMpegtsPatProgram {
|
|||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsPatProgram @ {:?}", self as *const _))
|
||||
.field("program_number", &self.program_number)
|
||||
.field("network_or_program_map_PID", &self.network_or_program_map_PID)
|
||||
.field(
|
||||
"network_or_program_map_PID",
|
||||
&self.network_or_program_map_PID,
|
||||
)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -1411,7 +1483,10 @@ impl ::std::fmt::Debug for GstMpegtsSDTService {
|
|||
f.debug_struct(&format!("GstMpegtsSDTService @ {:?}", self as *const _))
|
||||
.field("service_id", &self.service_id)
|
||||
.field("EIT_schedule_flag", &self.EIT_schedule_flag)
|
||||
.field("EIT_present_following_flag", &self.EIT_present_following_flag)
|
||||
.field(
|
||||
"EIT_present_following_flag",
|
||||
&self.EIT_present_following_flag,
|
||||
)
|
||||
.field("running_status", &self.running_status)
|
||||
.field("free_CA_mode", &self.free_CA_mode)
|
||||
.field("descriptors", &self.descriptors)
|
||||
|
@ -1435,7 +1510,10 @@ pub struct GstMpegtsSatelliteDeliverySystemDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsSatelliteDeliverySystemDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsSatelliteDeliverySystemDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsSatelliteDeliverySystemDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("frequency", &self.frequency)
|
||||
.field("orbital_position", &self.orbital_position)
|
||||
.field("west_east", &self.west_east)
|
||||
|
@ -1498,7 +1576,10 @@ pub struct GstMpegtsT2DeliverySystemCell {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsT2DeliverySystemCell {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsT2DeliverySystemCell @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsT2DeliverySystemCell @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("cell_id", &self.cell_id)
|
||||
.field("centre_frequencies", &self.centre_frequencies)
|
||||
.field("sub_cells", &self.sub_cells)
|
||||
|
@ -1515,7 +1596,10 @@ pub struct GstMpegtsT2DeliverySystemCellExtension {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsT2DeliverySystemCellExtension {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsT2DeliverySystemCellExtension @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsT2DeliverySystemCellExtension @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("cell_id_extension", &self.cell_id_extension)
|
||||
.field("transposer_frequency", &self.transposer_frequency)
|
||||
.finish()
|
||||
|
@ -1538,7 +1622,10 @@ pub struct GstMpegtsT2DeliverySystemDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsT2DeliverySystemDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsT2DeliverySystemDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsT2DeliverySystemDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("plp_id", &self.plp_id)
|
||||
.field("t2_system_id", &self.t2_system_id)
|
||||
.field("siso_miso", &self.siso_miso)
|
||||
|
@ -1587,7 +1674,10 @@ pub struct GstMpegtsTerrestrialDeliverySystemDescriptor {
|
|||
|
||||
impl ::std::fmt::Debug for GstMpegtsTerrestrialDeliverySystemDescriptor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstMpegtsTerrestrialDeliverySystemDescriptor @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstMpegtsTerrestrialDeliverySystemDescriptor @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("frequency", &self.frequency)
|
||||
.field("bandwidth", &self.bandwidth)
|
||||
.field("priority", &self.priority)
|
||||
|
@ -1640,13 +1730,17 @@ extern "C" {
|
|||
// GstMpegtsAtscSTT
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_atsc_stt_get_type() -> GType;
|
||||
pub fn gst_mpegts_atsc_stt_get_datetime_utc(stt: *mut GstMpegtsAtscSTT) -> *mut gst::GstDateTime;
|
||||
pub fn gst_mpegts_atsc_stt_get_datetime_utc(
|
||||
stt: *mut GstMpegtsAtscSTT,
|
||||
) -> *mut gst::GstDateTime;
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsAtscStringSegment
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_atsc_string_segment_get_type() -> GType;
|
||||
pub fn gst_mpegts_atsc_string_segment_get_string(seg: *mut GstMpegtsAtscStringSegment) -> *const c_char;
|
||||
pub fn gst_mpegts_atsc_string_segment_get_string(
|
||||
seg: *mut GstMpegtsAtscStringSegment,
|
||||
) -> *const c_char;
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsAtscVCT
|
||||
|
@ -1672,7 +1766,9 @@ extern "C" {
|
|||
// GstMpegtsCableDeliverySystemDescriptor
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_dvb_cable_delivery_system_descriptor_get_type() -> GType;
|
||||
pub fn gst_mpegts_dvb_cable_delivery_system_descriptor_free(source: *mut GstMpegtsCableDeliverySystemDescriptor);
|
||||
pub fn gst_mpegts_dvb_cable_delivery_system_descriptor_free(
|
||||
source: *mut GstMpegtsCableDeliverySystemDescriptor,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsComponentDescriptor
|
||||
|
@ -1689,9 +1785,15 @@ extern "C" {
|
|||
//=========================================================================
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_type() -> GType;
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_free(source: *mut GstMpegtsDVBLinkageDescriptor);
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_event(desc: *const GstMpegtsDVBLinkageDescriptor) -> *const GstMpegtsDVBLinkageEvent;
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_extended_event(desc: *const GstMpegtsDVBLinkageDescriptor) -> *const glib::GPtrArray;
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over(desc: *const GstMpegtsDVBLinkageDescriptor) -> *const GstMpegtsDVBLinkageMobileHandOver;
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_event(
|
||||
desc: *const GstMpegtsDVBLinkageDescriptor,
|
||||
) -> *const GstMpegtsDVBLinkageEvent;
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_extended_event(
|
||||
desc: *const GstMpegtsDVBLinkageDescriptor,
|
||||
) -> *const glib::GPtrArray;
|
||||
pub fn gst_mpegts_dvb_linkage_descriptor_get_mobile_hand_over(
|
||||
desc: *const GstMpegtsDVBLinkageDescriptor,
|
||||
) -> *const GstMpegtsDVBLinkageMobileHandOver;
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsDVBLinkageEvent
|
||||
|
@ -1722,55 +1824,208 @@ extern "C" {
|
|||
// GstMpegtsDataBroadcastDescriptor
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_dvb_data_broadcast_descriptor_get_type() -> GType;
|
||||
pub fn gst_mpegts_dvb_data_broadcast_descriptor_free(source: *mut GstMpegtsDataBroadcastDescriptor);
|
||||
pub fn gst_mpegts_dvb_data_broadcast_descriptor_free(
|
||||
source: *mut GstMpegtsDataBroadcastDescriptor,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsDescriptor
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_descriptor_get_type() -> GType;
|
||||
pub fn gst_mpegts_descriptor_free(desc: *mut GstMpegtsDescriptor);
|
||||
pub fn gst_mpegts_descriptor_parse_ca(descriptor: *mut GstMpegtsDescriptor, ca_system_id: *mut u16, ca_pid: *mut u16, private_data: *mut *const u8, private_data_size: *mut size_t) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_cable_delivery_system(descriptor: *const GstMpegtsDescriptor, res: *mut GstMpegtsCableDeliverySystemDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_bouquet_name(descriptor: *const GstMpegtsDescriptor, bouquet_name: *mut *mut c_char) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_ca_identifier(descriptor: *const GstMpegtsDescriptor, list: *mut *mut glib::GArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_component(descriptor: *const GstMpegtsDescriptor, res: *mut *mut GstMpegtsComponentDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_content(descriptor: *const GstMpegtsDescriptor, content: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_data_broadcast(descriptor: *const GstMpegtsDescriptor, res: *mut *mut GstMpegtsDataBroadcastDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_data_broadcast_id(descriptor: *const GstMpegtsDescriptor, data_broadcast_id: *mut u16, id_selector_bytes: *mut *mut u8, len: *mut u8) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_extended_event(descriptor: *const GstMpegtsDescriptor, res: *mut *mut GstMpegtsExtendedEventDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_frequency_list(descriptor: *const GstMpegtsDescriptor, offset: *mut gboolean, list: *mut *mut glib::GArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_linkage(descriptor: *const GstMpegtsDescriptor, res: *mut *mut GstMpegtsDVBLinkageDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name(descriptor: *const GstMpegtsDescriptor, bouquet_name_items: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_component(descriptor: *const GstMpegtsDescriptor, component_tag: *mut u8, component_description_items: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_network_name(descriptor: *const GstMpegtsDescriptor, network_name_items: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_service_name(descriptor: *const GstMpegtsDescriptor, service_name_items: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_network_name(descriptor: *const GstMpegtsDescriptor, name: *mut *mut c_char) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_parental_rating(descriptor: *const GstMpegtsDescriptor, rating: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_private_data_specifier(descriptor: *const GstMpegtsDescriptor, private_data_specifier: *mut u32, private_data: *mut *mut u8, length: *mut u8) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_scrambling(descriptor: *const GstMpegtsDescriptor, scrambling_mode: *mut GstMpegtsDVBScramblingModeType) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_service(descriptor: *const GstMpegtsDescriptor, service_type: *mut GstMpegtsDVBServiceType, service_name: *mut *mut c_char, provider_name: *mut *mut c_char) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_service_list(descriptor: *const GstMpegtsDescriptor, list: *mut *mut glib::GPtrArray) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_short_event(descriptor: *const GstMpegtsDescriptor, language_code: *mut *mut c_char, event_name: *mut *mut c_char, text: *mut *mut c_char) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_stream_identifier(descriptor: *const GstMpegtsDescriptor, component_tag: *mut u8) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_stuffing(descriptor: *const GstMpegtsDescriptor, stuffing_bytes: *mut *mut u8) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_subtitling_idx(descriptor: *const GstMpegtsDescriptor, idx: c_uint, lang: *mut *mut c_char, type_: *mut u8, composition_page_id: *mut u16, ancillary_page_id: *mut u16) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_subtitling_nb(descriptor: *const GstMpegtsDescriptor) -> c_uint;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_t2_delivery_system(descriptor: *const GstMpegtsDescriptor, res: *mut *mut GstMpegtsT2DeliverySystemDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_teletext_idx(descriptor: *const GstMpegtsDescriptor, idx: c_uint, language_code: *mut *mut c_char, teletext_type: *mut GstMpegtsDVBTeletextType, magazine_number: *mut u8, page_number: *mut u8) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_teletext_nb(descriptor: *const GstMpegtsDescriptor) -> c_uint;
|
||||
pub fn gst_mpegts_descriptor_parse_iso_639_language(descriptor: *const GstMpegtsDescriptor, res: *mut *mut GstMpegtsISO639LanguageDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_iso_639_language_idx(descriptor: *const GstMpegtsDescriptor, idx: c_uint, lang: *mut *mut c_char, audio_type: *mut GstMpegtsIso639AudioType) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_iso_639_language_nb(descriptor: *const GstMpegtsDescriptor) -> c_uint;
|
||||
pub fn gst_mpegts_descriptor_parse_logical_channel(descriptor: *const GstMpegtsDescriptor, res: *mut GstMpegtsLogicalChannelDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_satellite_delivery_system(descriptor: *const GstMpegtsDescriptor, res: *mut GstMpegtsSatelliteDeliverySystemDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_terrestrial_delivery_system(descriptor: *const GstMpegtsDescriptor, res: *mut GstMpegtsTerrestrialDeliverySystemDescriptor) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_from_custom(tag: u8, data: *const u8, length: size_t) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_custom_with_extension(tag: u8, tag_extension: u8, data: *const u8, length: size_t) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_dvb_network_name(name: *const c_char) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_dvb_service(service_type: GstMpegtsDVBServiceType, service_name: *const c_char, service_provider: *const c_char) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_dvb_subtitling(lang: *const c_char, type_: u8, composition: u16, ancillary: u16) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_iso_639_language(language: *const c_char) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_registration(format_identifier: *const c_char, additional_info: *mut u8, additional_info_length: size_t) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_parse_ca(
|
||||
descriptor: *mut GstMpegtsDescriptor,
|
||||
ca_system_id: *mut u16,
|
||||
ca_pid: *mut u16,
|
||||
private_data: *mut *const u8,
|
||||
private_data_size: *mut size_t,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_cable_delivery_system(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut GstMpegtsCableDeliverySystemDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_bouquet_name(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
bouquet_name: *mut *mut c_char,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_ca_identifier(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
list: *mut *mut glib::GArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_component(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut *mut GstMpegtsComponentDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_content(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
content: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_data_broadcast(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut *mut GstMpegtsDataBroadcastDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_data_broadcast_id(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
data_broadcast_id: *mut u16,
|
||||
id_selector_bytes: *mut *mut u8,
|
||||
len: *mut u8,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_extended_event(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut *mut GstMpegtsExtendedEventDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_frequency_list(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
offset: *mut gboolean,
|
||||
list: *mut *mut glib::GArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_linkage(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut *mut GstMpegtsDVBLinkageDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
bouquet_name_items: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_component(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
component_tag: *mut u8,
|
||||
component_description_items: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_network_name(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
network_name_items: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_multilingual_service_name(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
service_name_items: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_network_name(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
name: *mut *mut c_char,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_parental_rating(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
rating: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_private_data_specifier(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
private_data_specifier: *mut u32,
|
||||
private_data: *mut *mut u8,
|
||||
length: *mut u8,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_scrambling(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
scrambling_mode: *mut GstMpegtsDVBScramblingModeType,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_service(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
service_type: *mut GstMpegtsDVBServiceType,
|
||||
service_name: *mut *mut c_char,
|
||||
provider_name: *mut *mut c_char,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_service_list(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
list: *mut *mut glib::GPtrArray,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_short_event(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
language_code: *mut *mut c_char,
|
||||
event_name: *mut *mut c_char,
|
||||
text: *mut *mut c_char,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_stream_identifier(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
component_tag: *mut u8,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_stuffing(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
stuffing_bytes: *mut *mut u8,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_subtitling_idx(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
idx: c_uint,
|
||||
lang: *mut *mut c_char,
|
||||
type_: *mut u8,
|
||||
composition_page_id: *mut u16,
|
||||
ancillary_page_id: *mut u16,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_subtitling_nb(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
) -> c_uint;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_t2_delivery_system(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut *mut GstMpegtsT2DeliverySystemDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_teletext_idx(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
idx: c_uint,
|
||||
language_code: *mut *mut c_char,
|
||||
teletext_type: *mut GstMpegtsDVBTeletextType,
|
||||
magazine_number: *mut u8,
|
||||
page_number: *mut u8,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_dvb_teletext_nb(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
) -> c_uint;
|
||||
pub fn gst_mpegts_descriptor_parse_iso_639_language(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut *mut GstMpegtsISO639LanguageDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_iso_639_language_idx(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
idx: c_uint,
|
||||
lang: *mut *mut c_char,
|
||||
audio_type: *mut GstMpegtsIso639AudioType,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_iso_639_language_nb(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
) -> c_uint;
|
||||
pub fn gst_mpegts_descriptor_parse_logical_channel(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut GstMpegtsLogicalChannelDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_satellite_delivery_system(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut GstMpegtsSatelliteDeliverySystemDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_parse_terrestrial_delivery_system(
|
||||
descriptor: *const GstMpegtsDescriptor,
|
||||
res: *mut GstMpegtsTerrestrialDeliverySystemDescriptor,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_descriptor_from_custom(
|
||||
tag: u8,
|
||||
data: *const u8,
|
||||
length: size_t,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_custom_with_extension(
|
||||
tag: u8,
|
||||
tag_extension: u8,
|
||||
data: *const u8,
|
||||
length: size_t,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_dvb_network_name(
|
||||
name: *const c_char,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_dvb_service(
|
||||
service_type: GstMpegtsDVBServiceType,
|
||||
service_name: *const c_char,
|
||||
service_provider: *const c_char,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_dvb_subtitling(
|
||||
lang: *const c_char,
|
||||
type_: u8,
|
||||
composition: u16,
|
||||
ancillary: u16,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_iso_639_language(
|
||||
language: *const c_char,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_descriptor_from_registration(
|
||||
format_identifier: *const c_char,
|
||||
additional_info: *mut u8,
|
||||
additional_info_length: size_t,
|
||||
) -> *mut GstMpegtsDescriptor;
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsDvbMultilingualBouquetNameItem
|
||||
|
@ -1817,7 +2072,9 @@ extern "C" {
|
|||
// GstMpegtsISO639LanguageDescriptor
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_iso_639_language_get_type() -> GType;
|
||||
pub fn gst_mpegts_iso_639_language_descriptor_free(desc: *mut GstMpegtsISO639LanguageDescriptor);
|
||||
pub fn gst_mpegts_iso_639_language_descriptor_free(
|
||||
desc: *mut GstMpegtsISO639LanguageDescriptor,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsLogicalChannel
|
||||
|
@ -1880,13 +2137,29 @@ extern "C" {
|
|||
// GstMpegtsSection
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_section_get_type() -> GType;
|
||||
pub fn gst_mpegts_section_new(pid: u16, data: *mut u8, data_size: size_t) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_section_get_atsc_cvct(section: *mut GstMpegtsSection) -> *const GstMpegtsAtscVCT;
|
||||
pub fn gst_mpegts_section_get_atsc_eit(section: *mut GstMpegtsSection) -> *const GstMpegtsAtscEIT;
|
||||
pub fn gst_mpegts_section_get_atsc_ett(section: *mut GstMpegtsSection) -> *const GstMpegtsAtscETT;
|
||||
pub fn gst_mpegts_section_get_atsc_mgt(section: *mut GstMpegtsSection) -> *const GstMpegtsAtscMGT;
|
||||
pub fn gst_mpegts_section_get_atsc_stt(section: *mut GstMpegtsSection) -> *const GstMpegtsAtscSTT;
|
||||
pub fn gst_mpegts_section_get_atsc_tvct(section: *mut GstMpegtsSection) -> *const GstMpegtsAtscVCT;
|
||||
pub fn gst_mpegts_section_new(
|
||||
pid: u16,
|
||||
data: *mut u8,
|
||||
data_size: size_t,
|
||||
) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_section_get_atsc_cvct(
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *const GstMpegtsAtscVCT;
|
||||
pub fn gst_mpegts_section_get_atsc_eit(
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *const GstMpegtsAtscEIT;
|
||||
pub fn gst_mpegts_section_get_atsc_ett(
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *const GstMpegtsAtscETT;
|
||||
pub fn gst_mpegts_section_get_atsc_mgt(
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *const GstMpegtsAtscMGT;
|
||||
pub fn gst_mpegts_section_get_atsc_stt(
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *const GstMpegtsAtscSTT;
|
||||
pub fn gst_mpegts_section_get_atsc_tvct(
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *const GstMpegtsAtscVCT;
|
||||
pub fn gst_mpegts_section_get_bat(section: *mut GstMpegtsSection) -> *const GstMpegtsBAT;
|
||||
pub fn gst_mpegts_section_get_cat(section: *mut GstMpegtsSection) -> *mut glib::GPtrArray;
|
||||
pub fn gst_mpegts_section_get_data(section: *mut GstMpegtsSection) -> *mut glib::GBytes;
|
||||
|
@ -1898,10 +2171,19 @@ extern "C" {
|
|||
pub fn gst_mpegts_section_get_tdt(section: *mut GstMpegtsSection) -> *mut gst::GstDateTime;
|
||||
pub fn gst_mpegts_section_get_tot(section: *mut GstMpegtsSection) -> *const GstMpegtsTOT;
|
||||
pub fn gst_mpegts_section_get_tsdt(section: *mut GstMpegtsSection) -> *mut glib::GPtrArray;
|
||||
pub fn gst_mpegts_section_packetize(section: *mut GstMpegtsSection, output_size: *mut size_t) -> *mut u8;
|
||||
pub fn gst_mpegts_section_send_event(section: *mut GstMpegtsSection, element: *mut gst::GstElement) -> gboolean;
|
||||
pub fn gst_mpegts_section_packetize(
|
||||
section: *mut GstMpegtsSection,
|
||||
output_size: *mut size_t,
|
||||
) -> *mut u8;
|
||||
pub fn gst_mpegts_section_send_event(
|
||||
section: *mut GstMpegtsSection,
|
||||
element: *mut gst::GstElement,
|
||||
) -> gboolean;
|
||||
pub fn gst_mpegts_section_from_nit(nit: *mut GstMpegtsNIT) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_section_from_pat(programs: *mut glib::GPtrArray, ts_id: u16) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_section_from_pat(
|
||||
programs: *mut glib::GPtrArray,
|
||||
ts_id: u16,
|
||||
) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_section_from_pmt(pmt: *mut GstMpegtsPMT, pid: u16) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_section_from_sdt(sdt: *mut GstMpegtsSDT) -> *mut GstMpegtsSection;
|
||||
|
||||
|
@ -1919,7 +2201,9 @@ extern "C" {
|
|||
// GstMpegtsT2DeliverySystemDescriptor
|
||||
//=========================================================================
|
||||
pub fn gst_mpegts_t2_delivery_system_descriptor_get_type() -> GType;
|
||||
pub fn gst_mpegts_t2_delivery_system_descriptor_free(source: *mut GstMpegtsT2DeliverySystemDescriptor);
|
||||
pub fn gst_mpegts_t2_delivery_system_descriptor_free(
|
||||
source: *mut GstMpegtsT2DeliverySystemDescriptor,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstMpegtsTOT
|
||||
|
@ -1936,10 +2220,17 @@ extern "C" {
|
|||
//=========================================================================
|
||||
pub fn gst_mpegts_dvb_component_descriptor_free(source: *mut GstMpegtsComponentDescriptor);
|
||||
pub fn gst_event_parse_mpegts_section(event: *mut gst::GstEvent) -> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_find_descriptor(descriptors: *mut glib::GPtrArray, tag: u8) -> *const GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_find_descriptor(
|
||||
descriptors: *mut glib::GPtrArray,
|
||||
tag: u8,
|
||||
) -> *const GstMpegtsDescriptor;
|
||||
pub fn gst_mpegts_initialize();
|
||||
pub fn gst_message_new_mpegts_section(parent: *mut gst::GstObject, section: *mut GstMpegtsSection) -> *mut gst::GstMessage;
|
||||
pub fn gst_message_parse_mpegts_section(message: *mut gst::GstMessage) -> *mut GstMpegtsSection;
|
||||
pub fn gst_message_new_mpegts_section(
|
||||
parent: *mut gst::GstObject,
|
||||
section: *mut GstMpegtsSection,
|
||||
) -> *mut gst::GstMessage;
|
||||
pub fn gst_message_parse_mpegts_section(message: *mut gst::GstMessage)
|
||||
-> *mut GstMpegtsSection;
|
||||
pub fn gst_mpegts_parse_descriptors(buffer: *mut u8, buf_len: size_t) -> *mut glib::GPtrArray;
|
||||
pub fn gst_mpegts_pat_new() -> *mut glib::GPtrArray;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,18 +3,23 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate gio_sys as gio;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gio_sys as gio;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -22,13 +27,18 @@ use glib::{gboolean, gconstpointer, gpointer, GType};
|
|||
// Constants
|
||||
pub const GST_NET_TIME_PACKET_SIZE: c_int = 16;
|
||||
pub const GST_PTP_CLOCK_ID_NONE: u64 = 18446744073709551615;
|
||||
pub const GST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED: *const c_char = b"GstPtpStatisticsBestMasterClockSelected\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_NEW_DOMAIN_FOUND: *const c_char = b"GstPtpStatisticsNewDomainFound\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_PATH_DELAY_MEASURED: *const c_char = b"GstPtpStatisticsPathDelayMeasured\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_TIME_UPDATED: *const c_char = b"GstPtpStatisticsTimeUpdated\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED: *const c_char =
|
||||
b"GstPtpStatisticsBestMasterClockSelected\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_NEW_DOMAIN_FOUND: *const c_char =
|
||||
b"GstPtpStatisticsNewDomainFound\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_PATH_DELAY_MEASURED: *const c_char =
|
||||
b"GstPtpStatisticsPathDelayMeasured\0" as *const u8 as *const c_char;
|
||||
pub const GST_PTP_STATISTICS_TIME_UPDATED: *const c_char =
|
||||
b"GstPtpStatisticsTimeUpdated\0" as *const u8 as *const c_char;
|
||||
|
||||
// Callbacks
|
||||
pub type GstPtpStatisticsCallback = Option<unsafe extern "C" fn(u8, *const gst::GstStructure, gpointer) -> gboolean>;
|
||||
pub type GstPtpStatisticsCallback =
|
||||
Option<unsafe extern "C" fn(u8, *const gst::GstStructure, gpointer) -> gboolean>;
|
||||
|
||||
// Records
|
||||
#[repr(C)]
|
||||
|
@ -76,7 +86,10 @@ pub struct GstNetControlMessageMeta {
|
|||
|
||||
impl ::std::fmt::Debug for GstNetControlMessageMeta {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstNetControlMessageMeta @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstNetControlMessageMeta @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("meta", &self.meta)
|
||||
.field("message", &self.message)
|
||||
.finish()
|
||||
|
@ -239,28 +252,51 @@ extern "C" {
|
|||
pub fn gst_net_time_packet_new(buffer: *const u8) -> *mut GstNetTimePacket;
|
||||
pub fn gst_net_time_packet_copy(packet: *const GstNetTimePacket) -> *mut GstNetTimePacket;
|
||||
pub fn gst_net_time_packet_free(packet: *mut GstNetTimePacket);
|
||||
pub fn gst_net_time_packet_send(packet: *const GstNetTimePacket, socket: *mut gio::GSocket, dest_address: *mut gio::GSocketAddress, error: *mut *mut glib::GError) -> gboolean;
|
||||
pub fn gst_net_time_packet_send(
|
||||
packet: *const GstNetTimePacket,
|
||||
socket: *mut gio::GSocket,
|
||||
dest_address: *mut gio::GSocketAddress,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> gboolean;
|
||||
pub fn gst_net_time_packet_serialize(packet: *const GstNetTimePacket) -> *mut u8;
|
||||
pub fn gst_net_time_packet_receive(socket: *mut gio::GSocket, src_address: *mut *mut gio::GSocketAddress, error: *mut *mut glib::GError) -> *mut GstNetTimePacket;
|
||||
pub fn gst_net_time_packet_receive(
|
||||
socket: *mut gio::GSocket,
|
||||
src_address: *mut *mut gio::GSocketAddress,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstNetTimePacket;
|
||||
|
||||
//=========================================================================
|
||||
// GstNetClientClock
|
||||
//=========================================================================
|
||||
pub fn gst_net_client_clock_get_type() -> GType;
|
||||
pub fn gst_net_client_clock_new(name: *const c_char, remote_address: *const c_char, remote_port: c_int, base_time: gst::GstClockTime) -> *mut gst::GstClock;
|
||||
pub fn gst_net_client_clock_new(
|
||||
name: *const c_char,
|
||||
remote_address: *const c_char,
|
||||
remote_port: c_int,
|
||||
base_time: gst::GstClockTime,
|
||||
) -> *mut gst::GstClock;
|
||||
|
||||
//=========================================================================
|
||||
// GstNetTimeProvider
|
||||
//=========================================================================
|
||||
pub fn gst_net_time_provider_get_type() -> GType;
|
||||
pub fn gst_net_time_provider_new(clock: *mut gst::GstClock, address: *const c_char, port: c_int) -> *mut GstNetTimeProvider;
|
||||
pub fn gst_net_time_provider_new(
|
||||
clock: *mut gst::GstClock,
|
||||
address: *const c_char,
|
||||
port: c_int,
|
||||
) -> *mut GstNetTimeProvider;
|
||||
|
||||
//=========================================================================
|
||||
// GstNtpClock
|
||||
//=========================================================================
|
||||
pub fn gst_ntp_clock_get_type() -> GType;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_ntp_clock_new(name: *const c_char, remote_address: *const c_char, remote_port: c_int, base_time: gst::GstClockTime) -> *mut gst::GstClock;
|
||||
pub fn gst_ntp_clock_new(
|
||||
name: *const c_char,
|
||||
remote_address: *const c_char,
|
||||
remote_port: c_int,
|
||||
base_time: gst::GstClockTime,
|
||||
) -> *mut gst::GstClock;
|
||||
|
||||
//=========================================================================
|
||||
// GstPtpClock
|
||||
|
@ -272,8 +308,14 @@ extern "C" {
|
|||
//=========================================================================
|
||||
// Other functions
|
||||
//=========================================================================
|
||||
pub fn gst_buffer_add_net_address_meta(buffer: *mut gst::GstBuffer, addr: *mut gio::GSocketAddress) -> *mut GstNetAddressMeta;
|
||||
pub fn gst_buffer_add_net_control_message_meta(buffer: *mut gst::GstBuffer, message: *mut gio::GSocketControlMessage) -> *mut GstNetControlMessageMeta;
|
||||
pub fn gst_buffer_add_net_address_meta(
|
||||
buffer: *mut gst::GstBuffer,
|
||||
addr: *mut gio::GSocketAddress,
|
||||
) -> *mut GstNetAddressMeta;
|
||||
pub fn gst_buffer_add_net_control_message_meta(
|
||||
buffer: *mut gst::GstBuffer,
|
||||
message: *mut gio::GSocketControlMessage,
|
||||
) -> *mut GstNetControlMessageMeta;
|
||||
pub fn gst_buffer_get_net_address_meta(buffer: *mut gst::GstBuffer) -> *mut GstNetAddressMeta;
|
||||
pub fn gst_net_address_meta_api_get_type() -> GType;
|
||||
pub fn gst_net_control_message_meta_api_get_type() -> GType;
|
||||
|
@ -286,7 +328,11 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_ptp_is_supported() -> gboolean;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_ptp_statistics_callback_add(callback: GstPtpStatisticsCallback, user_data: gpointer, destroy_data: glib::GDestroyNotify) -> c_ulong;
|
||||
pub fn gst_ptp_statistics_callback_add(
|
||||
callback: GstPtpStatisticsCallback,
|
||||
user_data: gpointer,
|
||||
destroy_data: glib::GDestroyNotify,
|
||||
) -> c_ulong;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_ptp_statistics_callback_remove(id: c_ulong);
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_net_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_net_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_net_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-net-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,41 +229,118 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstNetAddressMeta", Layout {size: size_of::<GstNetAddressMeta>(), alignment: align_of::<GstNetAddressMeta>()}),
|
||||
("GstNetClientClock", Layout {size: size_of::<GstNetClientClock>(), alignment: align_of::<GstNetClientClock>()}),
|
||||
("GstNetClientClockClass", Layout {size: size_of::<GstNetClientClockClass>(), alignment: align_of::<GstNetClientClockClass>()}),
|
||||
("GstNetControlMessageMeta", Layout {size: size_of::<GstNetControlMessageMeta>(), alignment: align_of::<GstNetControlMessageMeta>()}),
|
||||
("GstNetTimePacket", Layout {size: size_of::<GstNetTimePacket>(), alignment: align_of::<GstNetTimePacket>()}),
|
||||
("GstNetTimeProvider", Layout {size: size_of::<GstNetTimeProvider>(), alignment: align_of::<GstNetTimeProvider>()}),
|
||||
("GstNetTimeProviderClass", Layout {size: size_of::<GstNetTimeProviderClass>(), alignment: align_of::<GstNetTimeProviderClass>()}),
|
||||
("GstNtpClock", Layout {size: size_of::<GstNtpClock>(), alignment: align_of::<GstNtpClock>()}),
|
||||
("GstNtpClockClass", Layout {size: size_of::<GstNtpClockClass>(), alignment: align_of::<GstNtpClockClass>()}),
|
||||
("GstPtpClock", Layout {size: size_of::<GstPtpClock>(), alignment: align_of::<GstPtpClock>()}),
|
||||
("GstPtpClockClass", Layout {size: size_of::<GstPtpClockClass>(), alignment: align_of::<GstPtpClockClass>()}),
|
||||
(
|
||||
"GstNetAddressMeta",
|
||||
Layout {
|
||||
size: size_of::<GstNetAddressMeta>(),
|
||||
alignment: align_of::<GstNetAddressMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNetClientClock",
|
||||
Layout {
|
||||
size: size_of::<GstNetClientClock>(),
|
||||
alignment: align_of::<GstNetClientClock>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNetClientClockClass",
|
||||
Layout {
|
||||
size: size_of::<GstNetClientClockClass>(),
|
||||
alignment: align_of::<GstNetClientClockClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNetControlMessageMeta",
|
||||
Layout {
|
||||
size: size_of::<GstNetControlMessageMeta>(),
|
||||
alignment: align_of::<GstNetControlMessageMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNetTimePacket",
|
||||
Layout {
|
||||
size: size_of::<GstNetTimePacket>(),
|
||||
alignment: align_of::<GstNetTimePacket>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNetTimeProvider",
|
||||
Layout {
|
||||
size: size_of::<GstNetTimeProvider>(),
|
||||
alignment: align_of::<GstNetTimeProvider>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNetTimeProviderClass",
|
||||
Layout {
|
||||
size: size_of::<GstNetTimeProviderClass>(),
|
||||
alignment: align_of::<GstNetTimeProviderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNtpClock",
|
||||
Layout {
|
||||
size: size_of::<GstNtpClock>(),
|
||||
alignment: align_of::<GstNtpClock>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNtpClockClass",
|
||||
Layout {
|
||||
size: size_of::<GstNtpClockClass>(),
|
||||
alignment: align_of::<GstNtpClockClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPtpClock",
|
||||
Layout {
|
||||
size: size_of::<GstPtpClock>(),
|
||||
alignment: align_of::<GstPtpClock>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPtpClockClass",
|
||||
Layout {
|
||||
size: size_of::<GstPtpClockClass>(),
|
||||
alignment: align_of::<GstPtpClockClass>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("GST_NET_TIME_PACKET_SIZE", "16"),
|
||||
("GST_PTP_CLOCK_ID_NONE", "18446744073709551615"),
|
||||
("GST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED", "GstPtpStatisticsBestMasterClockSelected"),
|
||||
("GST_PTP_STATISTICS_NEW_DOMAIN_FOUND", "GstPtpStatisticsNewDomainFound"),
|
||||
("GST_PTP_STATISTICS_PATH_DELAY_MEASURED", "GstPtpStatisticsPathDelayMeasured"),
|
||||
("GST_PTP_STATISTICS_TIME_UPDATED", "GstPtpStatisticsTimeUpdated"),
|
||||
(
|
||||
"GST_PTP_STATISTICS_BEST_MASTER_CLOCK_SELECTED",
|
||||
"GstPtpStatisticsBestMasterClockSelected",
|
||||
),
|
||||
(
|
||||
"GST_PTP_STATISTICS_NEW_DOMAIN_FOUND",
|
||||
"GstPtpStatisticsNewDomainFound",
|
||||
),
|
||||
(
|
||||
"GST_PTP_STATISTICS_PATH_DELAY_MEASURED",
|
||||
"GstPtpStatisticsPathDelayMeasured",
|
||||
),
|
||||
(
|
||||
"GST_PTP_STATISTICS_TIME_UPDATED",
|
||||
"GstPtpStatisticsTimeUpdated",
|
||||
),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -46,7 +46,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -68,8 +68,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -83,4 +85,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,19 +3,24 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_audio_sys as gst_audio;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_video_sys as gst_video;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -66,9 +71,12 @@ pub const GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS: GstInstallPluginsReturn = 203
|
|||
// Constants
|
||||
pub const GST_ENCODING_CATEGORY_CAPTURE: *const c_char = b"capture\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_DEVICE: *const c_char = b"device\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_FILE_EXTENSION: *const c_char = b"file-extension\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_ONLINE_SERVICE: *const c_char = b"online-service\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_STORAGE_EDITING: *const c_char = b"storage-editing\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_FILE_EXTENSION: *const c_char =
|
||||
b"file-extension\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_ONLINE_SERVICE: *const c_char =
|
||||
b"online-service\0" as *const u8 as *const c_char;
|
||||
pub const GST_ENCODING_CATEGORY_STORAGE_EDITING: *const c_char =
|
||||
b"storage-editing\0" as *const u8 as *const c_char;
|
||||
|
||||
// Flags
|
||||
pub type GstDiscovererSerializeFlags = c_uint;
|
||||
|
@ -79,8 +87,15 @@ pub const GST_DISCOVERER_SERIALIZE_MISC: GstDiscovererSerializeFlags = 4;
|
|||
pub const GST_DISCOVERER_SERIALIZE_ALL: GstDiscovererSerializeFlags = 7;
|
||||
|
||||
// Callbacks
|
||||
pub type GstAudioVisualizerShaderFunc = Option<unsafe extern "C" fn(*mut GstAudioVisualizer, *const gst_video::GstVideoFrame, *mut gst_video::GstVideoFrame)>;
|
||||
pub type GstInstallPluginsResultFunc = Option<unsafe extern "C" fn(GstInstallPluginsReturn, gpointer)>;
|
||||
pub type GstAudioVisualizerShaderFunc = Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstAudioVisualizer,
|
||||
*const gst_video::GstVideoFrame,
|
||||
*mut gst_video::GstVideoFrame,
|
||||
),
|
||||
>;
|
||||
pub type GstInstallPluginsResultFunc =
|
||||
Option<unsafe extern "C" fn(GstInstallPluginsReturn, gpointer)>;
|
||||
|
||||
// Records
|
||||
#[repr(C)]
|
||||
|
@ -88,8 +103,15 @@ pub type GstInstallPluginsResultFunc = Option<unsafe extern "C" fn(GstInstallPlu
|
|||
pub struct GstAudioVisualizerClass {
|
||||
pub parent_class: gst::GstElementClass,
|
||||
pub setup: Option<unsafe extern "C" fn(*mut GstAudioVisualizer) -> gboolean>,
|
||||
pub render: Option<unsafe extern "C" fn(*mut GstAudioVisualizer, *mut gst::GstBuffer, *mut gst_video::GstVideoFrame) -> gboolean>,
|
||||
pub decide_allocation: Option<unsafe extern "C" fn(*mut GstAudioVisualizer, *mut gst::GstQuery) -> gboolean>,
|
||||
pub render: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstAudioVisualizer,
|
||||
*mut gst::GstBuffer,
|
||||
*mut gst_video::GstVideoFrame,
|
||||
) -> gboolean,
|
||||
>,
|
||||
pub decide_allocation:
|
||||
Option<unsafe extern "C" fn(*mut GstAudioVisualizer, *mut gst::GstQuery) -> gboolean>,
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for GstAudioVisualizerClass {
|
||||
|
@ -113,7 +135,9 @@ pub struct GstDiscovererClass {
|
|||
pub parentclass: gobject::GObjectClass,
|
||||
pub finished: Option<unsafe extern "C" fn(*mut GstDiscoverer)>,
|
||||
pub starting: Option<unsafe extern "C" fn(*mut GstDiscoverer)>,
|
||||
pub discovered: Option<unsafe extern "C" fn(*mut GstDiscoverer, *mut GstDiscovererInfo, *const glib::GError)>,
|
||||
pub discovered: Option<
|
||||
unsafe extern "C" fn(*mut GstDiscoverer, *mut GstDiscovererInfo, *const glib::GError),
|
||||
>,
|
||||
pub source_setup: Option<unsafe extern "C" fn(*mut GstDiscoverer, *mut gst::GstElement)>,
|
||||
pub _reserved: [gpointer; 4],
|
||||
}
|
||||
|
@ -161,7 +185,10 @@ pub struct GstInstallPluginsContext(c_void);
|
|||
|
||||
impl ::std::fmt::Debug for GstInstallPluginsContext {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstInstallPluginsContext @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstInstallPluginsContext @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +246,10 @@ pub struct GstDiscovererContainerInfo(c_void);
|
|||
|
||||
impl ::std::fmt::Debug for GstDiscovererContainerInfo {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstDiscovererContainerInfo @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstDiscovererContainerInfo @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -249,7 +279,10 @@ pub struct GstDiscovererSubtitleInfo(c_void);
|
|||
|
||||
impl ::std::fmt::Debug for GstDiscovererSubtitleInfo {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstDiscovererSubtitleInfo @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstDiscovererSubtitleInfo @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +312,10 @@ pub struct GstEncodingContainerProfile(c_void);
|
|||
|
||||
impl ::std::fmt::Debug for GstEncodingContainerProfile {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstEncodingContainerProfile @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstEncodingContainerProfile @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -342,14 +378,25 @@ extern "C" {
|
|||
//=========================================================================
|
||||
pub fn gst_install_plugins_context_get_type() -> GType;
|
||||
pub fn gst_install_plugins_context_new() -> *mut GstInstallPluginsContext;
|
||||
pub fn gst_install_plugins_context_copy(ctx: *mut GstInstallPluginsContext) -> *mut GstInstallPluginsContext;
|
||||
pub fn gst_install_plugins_context_copy(
|
||||
ctx: *mut GstInstallPluginsContext,
|
||||
) -> *mut GstInstallPluginsContext;
|
||||
pub fn gst_install_plugins_context_free(ctx: *mut GstInstallPluginsContext);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_install_plugins_context_set_confirm_search(ctx: *mut GstInstallPluginsContext, confirm_search: gboolean);
|
||||
pub fn gst_install_plugins_context_set_confirm_search(
|
||||
ctx: *mut GstInstallPluginsContext,
|
||||
confirm_search: gboolean,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_install_plugins_context_set_desktop_id(ctx: *mut GstInstallPluginsContext, desktop_id: *const c_char);
|
||||
pub fn gst_install_plugins_context_set_desktop_id(
|
||||
ctx: *mut GstInstallPluginsContext,
|
||||
desktop_id: *const c_char,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_install_plugins_context_set_startup_notification_id(ctx: *mut GstInstallPluginsContext, startup_id: *const c_char);
|
||||
pub fn gst_install_plugins_context_set_startup_notification_id(
|
||||
ctx: *mut GstInstallPluginsContext,
|
||||
startup_id: *const c_char,
|
||||
);
|
||||
pub fn gst_install_plugins_context_set_xid(ctx: *mut GstInstallPluginsContext, xid: c_uint);
|
||||
|
||||
//=========================================================================
|
||||
|
@ -361,9 +408,19 @@ extern "C" {
|
|||
// GstDiscoverer
|
||||
//=========================================================================
|
||||
pub fn gst_discoverer_get_type() -> GType;
|
||||
pub fn gst_discoverer_new(timeout: gst::GstClockTime, error: *mut *mut glib::GError) -> *mut GstDiscoverer;
|
||||
pub fn gst_discoverer_discover_uri(discoverer: *mut GstDiscoverer, uri: *const c_char, error: *mut *mut glib::GError) -> *mut GstDiscovererInfo;
|
||||
pub fn gst_discoverer_discover_uri_async(discoverer: *mut GstDiscoverer, uri: *const c_char) -> gboolean;
|
||||
pub fn gst_discoverer_new(
|
||||
timeout: gst::GstClockTime,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstDiscoverer;
|
||||
pub fn gst_discoverer_discover_uri(
|
||||
discoverer: *mut GstDiscoverer,
|
||||
uri: *const c_char,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstDiscovererInfo;
|
||||
pub fn gst_discoverer_discover_uri_async(
|
||||
discoverer: *mut GstDiscoverer,
|
||||
uri: *const c_char,
|
||||
) -> gboolean;
|
||||
pub fn gst_discoverer_start(discoverer: *mut GstDiscoverer);
|
||||
pub fn gst_discoverer_stop(discoverer: *mut GstDiscoverer);
|
||||
|
||||
|
@ -376,63 +433,103 @@ extern "C" {
|
|||
pub fn gst_discoverer_audio_info_get_channel_mask(info: *const GstDiscovererAudioInfo) -> u64;
|
||||
pub fn gst_discoverer_audio_info_get_channels(info: *const GstDiscovererAudioInfo) -> c_uint;
|
||||
pub fn gst_discoverer_audio_info_get_depth(info: *const GstDiscovererAudioInfo) -> c_uint;
|
||||
pub fn gst_discoverer_audio_info_get_language(info: *const GstDiscovererAudioInfo) -> *const c_char;
|
||||
pub fn gst_discoverer_audio_info_get_max_bitrate(info: *const GstDiscovererAudioInfo) -> c_uint;
|
||||
pub fn gst_discoverer_audio_info_get_sample_rate(info: *const GstDiscovererAudioInfo) -> c_uint;
|
||||
pub fn gst_discoverer_audio_info_get_language(
|
||||
info: *const GstDiscovererAudioInfo,
|
||||
) -> *const c_char;
|
||||
pub fn gst_discoverer_audio_info_get_max_bitrate(info: *const GstDiscovererAudioInfo)
|
||||
-> c_uint;
|
||||
pub fn gst_discoverer_audio_info_get_sample_rate(info: *const GstDiscovererAudioInfo)
|
||||
-> c_uint;
|
||||
|
||||
//=========================================================================
|
||||
// GstDiscovererContainerInfo
|
||||
//=========================================================================
|
||||
pub fn gst_discoverer_container_info_get_type() -> GType;
|
||||
pub fn gst_discoverer_container_info_get_streams(info: *mut GstDiscovererContainerInfo) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_container_info_get_streams(
|
||||
info: *mut GstDiscovererContainerInfo,
|
||||
) -> *mut glib::GList;
|
||||
|
||||
//=========================================================================
|
||||
// GstDiscovererInfo
|
||||
//=========================================================================
|
||||
pub fn gst_discoverer_info_get_type() -> GType;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_discoverer_info_from_variant(variant: *mut glib::GVariant) -> *mut GstDiscovererInfo;
|
||||
pub fn gst_discoverer_info_from_variant(variant: *mut glib::GVariant)
|
||||
-> *mut GstDiscovererInfo;
|
||||
pub fn gst_discoverer_info_copy(ptr: *mut GstDiscovererInfo) -> *mut GstDiscovererInfo;
|
||||
pub fn gst_discoverer_info_get_audio_streams(info: *mut GstDiscovererInfo) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_container_streams(info: *mut GstDiscovererInfo) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_container_streams(
|
||||
info: *mut GstDiscovererInfo,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_duration(info: *const GstDiscovererInfo) -> gst::GstClockTime;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn gst_discoverer_info_get_live(info: *const GstDiscovererInfo) -> gboolean;
|
||||
pub fn gst_discoverer_info_get_misc(info: *const GstDiscovererInfo) -> *const gst::GstStructure;
|
||||
pub fn gst_discoverer_info_get_misc(info: *const GstDiscovererInfo)
|
||||
-> *const gst::GstStructure;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_discoverer_info_get_missing_elements_installer_details(info: *const GstDiscovererInfo) -> *mut *const c_char;
|
||||
pub fn gst_discoverer_info_get_missing_elements_installer_details(
|
||||
info: *const GstDiscovererInfo,
|
||||
) -> *mut *const c_char;
|
||||
pub fn gst_discoverer_info_get_result(info: *const GstDiscovererInfo) -> GstDiscovererResult;
|
||||
pub fn gst_discoverer_info_get_seekable(info: *const GstDiscovererInfo) -> gboolean;
|
||||
pub fn gst_discoverer_info_get_stream_info(info: *mut GstDiscovererInfo) -> *mut GstDiscovererStreamInfo;
|
||||
pub fn gst_discoverer_info_get_stream_info(
|
||||
info: *mut GstDiscovererInfo,
|
||||
) -> *mut GstDiscovererStreamInfo;
|
||||
pub fn gst_discoverer_info_get_stream_list(info: *mut GstDiscovererInfo) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_streams(info: *mut GstDiscovererInfo, streamtype: GType) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_subtitle_streams(info: *mut GstDiscovererInfo) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_streams(
|
||||
info: *mut GstDiscovererInfo,
|
||||
streamtype: GType,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_subtitle_streams(
|
||||
info: *mut GstDiscovererInfo,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_discoverer_info_get_tags(info: *const GstDiscovererInfo) -> *const gst::GstTagList;
|
||||
pub fn gst_discoverer_info_get_toc(info: *const GstDiscovererInfo) -> *const gst::GstToc;
|
||||
pub fn gst_discoverer_info_get_uri(info: *const GstDiscovererInfo) -> *const c_char;
|
||||
pub fn gst_discoverer_info_get_video_streams(info: *mut GstDiscovererInfo) -> *mut glib::GList;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_discoverer_info_to_variant(info: *mut GstDiscovererInfo, flags: GstDiscovererSerializeFlags) -> *mut glib::GVariant;
|
||||
pub fn gst_discoverer_info_to_variant(
|
||||
info: *mut GstDiscovererInfo,
|
||||
flags: GstDiscovererSerializeFlags,
|
||||
) -> *mut glib::GVariant;
|
||||
|
||||
//=========================================================================
|
||||
// GstDiscovererStreamInfo
|
||||
//=========================================================================
|
||||
pub fn gst_discoverer_stream_info_get_type() -> GType;
|
||||
pub fn gst_discoverer_stream_info_list_free(infos: *mut glib::GList);
|
||||
pub fn gst_discoverer_stream_info_get_caps(info: *mut GstDiscovererStreamInfo) -> *mut gst::GstCaps;
|
||||
pub fn gst_discoverer_stream_info_get_misc(info: *mut GstDiscovererStreamInfo) -> *const gst::GstStructure;
|
||||
pub fn gst_discoverer_stream_info_get_next(info: *mut GstDiscovererStreamInfo) -> *mut GstDiscovererStreamInfo;
|
||||
pub fn gst_discoverer_stream_info_get_previous(info: *mut GstDiscovererStreamInfo) -> *mut GstDiscovererStreamInfo;
|
||||
pub fn gst_discoverer_stream_info_get_stream_id(info: *mut GstDiscovererStreamInfo) -> *const c_char;
|
||||
pub fn gst_discoverer_stream_info_get_stream_type_nick(info: *mut GstDiscovererStreamInfo) -> *const c_char;
|
||||
pub fn gst_discoverer_stream_info_get_tags(info: *mut GstDiscovererStreamInfo) -> *const gst::GstTagList;
|
||||
pub fn gst_discoverer_stream_info_get_toc(info: *mut GstDiscovererStreamInfo) -> *const gst::GstToc;
|
||||
pub fn gst_discoverer_stream_info_get_caps(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *mut gst::GstCaps;
|
||||
pub fn gst_discoverer_stream_info_get_misc(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *const gst::GstStructure;
|
||||
pub fn gst_discoverer_stream_info_get_next(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *mut GstDiscovererStreamInfo;
|
||||
pub fn gst_discoverer_stream_info_get_previous(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *mut GstDiscovererStreamInfo;
|
||||
pub fn gst_discoverer_stream_info_get_stream_id(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *const c_char;
|
||||
pub fn gst_discoverer_stream_info_get_stream_type_nick(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *const c_char;
|
||||
pub fn gst_discoverer_stream_info_get_tags(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *const gst::GstTagList;
|
||||
pub fn gst_discoverer_stream_info_get_toc(
|
||||
info: *mut GstDiscovererStreamInfo,
|
||||
) -> *const gst::GstToc;
|
||||
|
||||
//=========================================================================
|
||||
// GstDiscovererSubtitleInfo
|
||||
//=========================================================================
|
||||
pub fn gst_discoverer_subtitle_info_get_type() -> GType;
|
||||
pub fn gst_discoverer_subtitle_info_get_language(info: *const GstDiscovererSubtitleInfo) -> *const c_char;
|
||||
pub fn gst_discoverer_subtitle_info_get_language(
|
||||
info: *const GstDiscovererSubtitleInfo,
|
||||
) -> *const c_char;
|
||||
|
||||
//=========================================================================
|
||||
// GstDiscovererVideoInfo
|
||||
|
@ -440,93 +537,188 @@ extern "C" {
|
|||
pub fn gst_discoverer_video_info_get_type() -> GType;
|
||||
pub fn gst_discoverer_video_info_get_bitrate(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_depth(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_framerate_denom(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_framerate_num(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_framerate_denom(
|
||||
info: *const GstDiscovererVideoInfo,
|
||||
) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_framerate_num(
|
||||
info: *const GstDiscovererVideoInfo,
|
||||
) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_height(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_max_bitrate(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_max_bitrate(info: *const GstDiscovererVideoInfo)
|
||||
-> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_par_denom(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_par_num(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_get_width(info: *const GstDiscovererVideoInfo) -> c_uint;
|
||||
pub fn gst_discoverer_video_info_is_image(info: *const GstDiscovererVideoInfo) -> gboolean;
|
||||
pub fn gst_discoverer_video_info_is_interlaced(info: *const GstDiscovererVideoInfo) -> gboolean;
|
||||
pub fn gst_discoverer_video_info_is_interlaced(info: *const GstDiscovererVideoInfo)
|
||||
-> gboolean;
|
||||
|
||||
//=========================================================================
|
||||
// GstEncodingAudioProfile
|
||||
//=========================================================================
|
||||
pub fn gst_encoding_audio_profile_get_type() -> GType;
|
||||
pub fn gst_encoding_audio_profile_new(format: *mut gst::GstCaps, preset: *const c_char, restriction: *mut gst::GstCaps, presence: c_uint) -> *mut GstEncodingAudioProfile;
|
||||
pub fn gst_encoding_audio_profile_new(
|
||||
format: *mut gst::GstCaps,
|
||||
preset: *const c_char,
|
||||
restriction: *mut gst::GstCaps,
|
||||
presence: c_uint,
|
||||
) -> *mut GstEncodingAudioProfile;
|
||||
|
||||
//=========================================================================
|
||||
// GstEncodingContainerProfile
|
||||
//=========================================================================
|
||||
pub fn gst_encoding_container_profile_get_type() -> GType;
|
||||
pub fn gst_encoding_container_profile_new(name: *const c_char, description: *const c_char, format: *mut gst::GstCaps, preset: *const c_char) -> *mut GstEncodingContainerProfile;
|
||||
pub fn gst_encoding_container_profile_add_profile(container: *mut GstEncodingContainerProfile, profile: *mut GstEncodingProfile) -> gboolean;
|
||||
pub fn gst_encoding_container_profile_contains_profile(container: *mut GstEncodingContainerProfile, profile: *mut GstEncodingProfile) -> gboolean;
|
||||
pub fn gst_encoding_container_profile_get_profiles(profile: *mut GstEncodingContainerProfile) -> *const glib::GList;
|
||||
pub fn gst_encoding_container_profile_new(
|
||||
name: *const c_char,
|
||||
description: *const c_char,
|
||||
format: *mut gst::GstCaps,
|
||||
preset: *const c_char,
|
||||
) -> *mut GstEncodingContainerProfile;
|
||||
pub fn gst_encoding_container_profile_add_profile(
|
||||
container: *mut GstEncodingContainerProfile,
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_container_profile_contains_profile(
|
||||
container: *mut GstEncodingContainerProfile,
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_container_profile_get_profiles(
|
||||
profile: *mut GstEncodingContainerProfile,
|
||||
) -> *const glib::GList;
|
||||
|
||||
//=========================================================================
|
||||
// GstEncodingProfile
|
||||
//=========================================================================
|
||||
pub fn gst_encoding_profile_get_type() -> GType;
|
||||
pub fn gst_encoding_profile_find(targetname: *const c_char, profilename: *const c_char, category: *const c_char) -> *mut GstEncodingProfile;
|
||||
pub fn gst_encoding_profile_from_discoverer(info: *mut GstDiscovererInfo) -> *mut GstEncodingProfile;
|
||||
pub fn gst_encoding_profile_find(
|
||||
targetname: *const c_char,
|
||||
profilename: *const c_char,
|
||||
category: *const c_char,
|
||||
) -> *mut GstEncodingProfile;
|
||||
pub fn gst_encoding_profile_from_discoverer(
|
||||
info: *mut GstDiscovererInfo,
|
||||
) -> *mut GstEncodingProfile;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
pub fn gst_encoding_profile_copy(self_: *mut GstEncodingProfile) -> *mut GstEncodingProfile;
|
||||
pub fn gst_encoding_profile_get_allow_dynamic_output(profile: *mut GstEncodingProfile) -> gboolean;
|
||||
pub fn gst_encoding_profile_get_allow_dynamic_output(
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_profile_get_description(profile: *mut GstEncodingProfile) -> *const c_char;
|
||||
pub fn gst_encoding_profile_get_file_extension(profile: *mut GstEncodingProfile) -> *const c_char;
|
||||
pub fn gst_encoding_profile_get_file_extension(
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> *const c_char;
|
||||
pub fn gst_encoding_profile_get_format(profile: *mut GstEncodingProfile) -> *mut gst::GstCaps;
|
||||
pub fn gst_encoding_profile_get_input_caps(profile: *mut GstEncodingProfile) -> *mut gst::GstCaps;
|
||||
pub fn gst_encoding_profile_get_input_caps(
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> *mut gst::GstCaps;
|
||||
pub fn gst_encoding_profile_get_name(profile: *mut GstEncodingProfile) -> *const c_char;
|
||||
pub fn gst_encoding_profile_get_presence(profile: *mut GstEncodingProfile) -> c_uint;
|
||||
pub fn gst_encoding_profile_get_preset(profile: *mut GstEncodingProfile) -> *const c_char;
|
||||
pub fn gst_encoding_profile_get_preset_name(profile: *mut GstEncodingProfile) -> *const c_char;
|
||||
pub fn gst_encoding_profile_get_restriction(profile: *mut GstEncodingProfile) -> *mut gst::GstCaps;
|
||||
pub fn gst_encoding_profile_get_restriction(
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> *mut gst::GstCaps;
|
||||
pub fn gst_encoding_profile_get_type_nick(profile: *mut GstEncodingProfile) -> *const c_char;
|
||||
pub fn gst_encoding_profile_is_enabled(profile: *mut GstEncodingProfile) -> gboolean;
|
||||
pub fn gst_encoding_profile_is_equal(a: *mut GstEncodingProfile, b: *mut GstEncodingProfile) -> gboolean;
|
||||
pub fn gst_encoding_profile_set_allow_dynamic_output(profile: *mut GstEncodingProfile, allow_dynamic_output: gboolean);
|
||||
pub fn gst_encoding_profile_set_description(profile: *mut GstEncodingProfile, description: *const c_char);
|
||||
pub fn gst_encoding_profile_is_equal(
|
||||
a: *mut GstEncodingProfile,
|
||||
b: *mut GstEncodingProfile,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_profile_set_allow_dynamic_output(
|
||||
profile: *mut GstEncodingProfile,
|
||||
allow_dynamic_output: gboolean,
|
||||
);
|
||||
pub fn gst_encoding_profile_set_description(
|
||||
profile: *mut GstEncodingProfile,
|
||||
description: *const c_char,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_encoding_profile_set_enabled(profile: *mut GstEncodingProfile, enabled: gboolean);
|
||||
pub fn gst_encoding_profile_set_format(profile: *mut GstEncodingProfile, format: *mut gst::GstCaps);
|
||||
pub fn gst_encoding_profile_set_format(
|
||||
profile: *mut GstEncodingProfile,
|
||||
format: *mut gst::GstCaps,
|
||||
);
|
||||
pub fn gst_encoding_profile_set_name(profile: *mut GstEncodingProfile, name: *const c_char);
|
||||
pub fn gst_encoding_profile_set_presence(profile: *mut GstEncodingProfile, presence: c_uint);
|
||||
pub fn gst_encoding_profile_set_preset(profile: *mut GstEncodingProfile, preset: *const c_char);
|
||||
pub fn gst_encoding_profile_set_preset_name(profile: *mut GstEncodingProfile, preset_name: *const c_char);
|
||||
pub fn gst_encoding_profile_set_restriction(profile: *mut GstEncodingProfile, restriction: *mut gst::GstCaps);
|
||||
pub fn gst_encoding_profile_set_preset_name(
|
||||
profile: *mut GstEncodingProfile,
|
||||
preset_name: *const c_char,
|
||||
);
|
||||
pub fn gst_encoding_profile_set_restriction(
|
||||
profile: *mut GstEncodingProfile,
|
||||
restriction: *mut gst::GstCaps,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstEncodingTarget
|
||||
//=========================================================================
|
||||
pub fn gst_encoding_target_get_type() -> GType;
|
||||
pub fn gst_encoding_target_new(name: *const c_char, category: *const c_char, description: *const c_char, profiles: *const glib::GList) -> *mut GstEncodingTarget;
|
||||
pub fn gst_encoding_target_load(name: *const c_char, category: *const c_char, error: *mut *mut glib::GError) -> *mut GstEncodingTarget;
|
||||
pub fn gst_encoding_target_load_from_file(filepath: *const c_char, error: *mut *mut glib::GError) -> *mut GstEncodingTarget;
|
||||
pub fn gst_encoding_target_add_profile(target: *mut GstEncodingTarget, profile: *mut GstEncodingProfile) -> gboolean;
|
||||
pub fn gst_encoding_target_new(
|
||||
name: *const c_char,
|
||||
category: *const c_char,
|
||||
description: *const c_char,
|
||||
profiles: *const glib::GList,
|
||||
) -> *mut GstEncodingTarget;
|
||||
pub fn gst_encoding_target_load(
|
||||
name: *const c_char,
|
||||
category: *const c_char,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstEncodingTarget;
|
||||
pub fn gst_encoding_target_load_from_file(
|
||||
filepath: *const c_char,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstEncodingTarget;
|
||||
pub fn gst_encoding_target_add_profile(
|
||||
target: *mut GstEncodingTarget,
|
||||
profile: *mut GstEncodingProfile,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_target_get_category(target: *mut GstEncodingTarget) -> *const c_char;
|
||||
pub fn gst_encoding_target_get_description(target: *mut GstEncodingTarget) -> *const c_char;
|
||||
pub fn gst_encoding_target_get_name(target: *mut GstEncodingTarget) -> *const c_char;
|
||||
pub fn gst_encoding_target_get_profile(target: *mut GstEncodingTarget, name: *const c_char) -> *mut GstEncodingProfile;
|
||||
pub fn gst_encoding_target_get_profile(
|
||||
target: *mut GstEncodingTarget,
|
||||
name: *const c_char,
|
||||
) -> *mut GstEncodingProfile;
|
||||
pub fn gst_encoding_target_get_profiles(target: *mut GstEncodingTarget) -> *const glib::GList;
|
||||
pub fn gst_encoding_target_save(target: *mut GstEncodingTarget, error: *mut *mut glib::GError) -> gboolean;
|
||||
pub fn gst_encoding_target_save_to_file(target: *mut GstEncodingTarget, filepath: *const c_char, error: *mut *mut glib::GError) -> gboolean;
|
||||
pub fn gst_encoding_target_save(
|
||||
target: *mut GstEncodingTarget,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_target_save_to_file(
|
||||
target: *mut GstEncodingTarget,
|
||||
filepath: *const c_char,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> gboolean;
|
||||
|
||||
//=========================================================================
|
||||
// GstEncodingVideoProfile
|
||||
//=========================================================================
|
||||
pub fn gst_encoding_video_profile_get_type() -> GType;
|
||||
pub fn gst_encoding_video_profile_new(format: *mut gst::GstCaps, preset: *const c_char, restriction: *mut gst::GstCaps, presence: c_uint) -> *mut GstEncodingVideoProfile;
|
||||
pub fn gst_encoding_video_profile_new(
|
||||
format: *mut gst::GstCaps,
|
||||
preset: *const c_char,
|
||||
restriction: *mut gst::GstCaps,
|
||||
presence: c_uint,
|
||||
) -> *mut GstEncodingVideoProfile;
|
||||
pub fn gst_encoding_video_profile_get_pass(prof: *mut GstEncodingVideoProfile) -> c_uint;
|
||||
pub fn gst_encoding_video_profile_get_variableframerate(prof: *mut GstEncodingVideoProfile) -> gboolean;
|
||||
pub fn gst_encoding_video_profile_get_variableframerate(
|
||||
prof: *mut GstEncodingVideoProfile,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_video_profile_set_pass(prof: *mut GstEncodingVideoProfile, pass: c_uint);
|
||||
pub fn gst_encoding_video_profile_set_variableframerate(prof: *mut GstEncodingVideoProfile, variableframerate: gboolean);
|
||||
pub fn gst_encoding_video_profile_set_variableframerate(
|
||||
prof: *mut GstEncodingVideoProfile,
|
||||
variableframerate: gboolean,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// Other functions
|
||||
//=========================================================================
|
||||
pub fn gst_codec_utils_aac_caps_set_level_and_profile(caps: *mut gst::GstCaps, audio_config: *const u8, len: c_uint) -> gboolean;
|
||||
pub fn gst_codec_utils_aac_caps_set_level_and_profile(
|
||||
caps: *mut gst::GstCaps,
|
||||
audio_config: *const u8,
|
||||
len: c_uint,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
pub fn gst_codec_utils_aac_get_channels(audio_config: *const u8, len: c_uint) -> c_uint;
|
||||
pub fn gst_codec_utils_aac_get_index_from_sample_rate(rate: c_uint) -> c_int;
|
||||
|
@ -535,53 +727,150 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
pub fn gst_codec_utils_aac_get_sample_rate(audio_config: *const u8, len: c_uint) -> c_uint;
|
||||
pub fn gst_codec_utils_aac_get_sample_rate_from_index(sr_idx: c_uint) -> c_uint;
|
||||
pub fn gst_codec_utils_h264_caps_set_level_and_profile(caps: *mut gst::GstCaps, sps: *const u8, len: c_uint) -> gboolean;
|
||||
pub fn gst_codec_utils_h264_caps_set_level_and_profile(
|
||||
caps: *mut gst::GstCaps,
|
||||
sps: *const u8,
|
||||
len: c_uint,
|
||||
) -> gboolean;
|
||||
pub fn gst_codec_utils_h264_get_level(sps: *const u8, len: c_uint) -> *const c_char;
|
||||
pub fn gst_codec_utils_h264_get_level_idc(level: *const c_char) -> u8;
|
||||
pub fn gst_codec_utils_h264_get_profile(sps: *const u8, len: c_uint) -> *const c_char;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_codec_utils_h265_caps_set_level_tier_and_profile(caps: *mut gst::GstCaps, profile_tier_level: *const u8, len: c_uint) -> gboolean;
|
||||
pub fn gst_codec_utils_h265_caps_set_level_tier_and_profile(
|
||||
caps: *mut gst::GstCaps,
|
||||
profile_tier_level: *const u8,
|
||||
len: c_uint,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_codec_utils_h265_get_level(profile_tier_level: *const u8, len: c_uint) -> *const c_char;
|
||||
pub fn gst_codec_utils_h265_get_level(
|
||||
profile_tier_level: *const u8,
|
||||
len: c_uint,
|
||||
) -> *const c_char;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_codec_utils_h265_get_level_idc(level: *const c_char) -> u8;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_codec_utils_h265_get_profile(profile_tier_level: *const u8, len: c_uint) -> *const c_char;
|
||||
pub fn gst_codec_utils_h265_get_profile(
|
||||
profile_tier_level: *const u8,
|
||||
len: c_uint,
|
||||
) -> *const c_char;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_codec_utils_h265_get_tier(profile_tier_level: *const u8, len: c_uint) -> *const c_char;
|
||||
pub fn gst_codec_utils_mpeg4video_caps_set_level_and_profile(caps: *mut gst::GstCaps, vis_obj_seq: *const u8, len: c_uint) -> gboolean;
|
||||
pub fn gst_codec_utils_mpeg4video_get_level(vis_obj_seq: *const u8, len: c_uint) -> *const c_char;
|
||||
pub fn gst_codec_utils_mpeg4video_get_profile(vis_obj_seq: *const u8, len: c_uint) -> *const c_char;
|
||||
pub fn gst_codec_utils_h265_get_tier(
|
||||
profile_tier_level: *const u8,
|
||||
len: c_uint,
|
||||
) -> *const c_char;
|
||||
pub fn gst_codec_utils_mpeg4video_caps_set_level_and_profile(
|
||||
caps: *mut gst::GstCaps,
|
||||
vis_obj_seq: *const u8,
|
||||
len: c_uint,
|
||||
) -> gboolean;
|
||||
pub fn gst_codec_utils_mpeg4video_get_level(
|
||||
vis_obj_seq: *const u8,
|
||||
len: c_uint,
|
||||
) -> *const c_char;
|
||||
pub fn gst_codec_utils_mpeg4video_get_profile(
|
||||
vis_obj_seq: *const u8,
|
||||
len: c_uint,
|
||||
) -> *const c_char;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_codec_utils_opus_create_caps(rate: u32, channels: u8, channel_mapping_family: u8, stream_count: u8, coupled_count: u8, channel_mapping: *const u8) -> *mut gst::GstCaps;
|
||||
pub fn gst_codec_utils_opus_create_caps(
|
||||
rate: u32,
|
||||
channels: u8,
|
||||
channel_mapping_family: u8,
|
||||
stream_count: u8,
|
||||
coupled_count: u8,
|
||||
channel_mapping: *const u8,
|
||||
) -> *mut gst::GstCaps;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_codec_utils_opus_create_caps_from_header(header: *mut gst::GstBuffer, comments: *mut gst::GstBuffer) -> *mut gst::GstCaps;
|
||||
pub fn gst_codec_utils_opus_create_caps_from_header(
|
||||
header: *mut gst::GstBuffer,
|
||||
comments: *mut gst::GstBuffer,
|
||||
) -> *mut gst::GstCaps;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_codec_utils_opus_create_header(rate: u32, channels: u8, channel_mapping_family: u8, stream_count: u8, coupled_count: u8, channel_mapping: *const u8, pre_skip: u16, output_gain: i16) -> *mut gst::GstBuffer;
|
||||
pub fn gst_codec_utils_opus_create_header(
|
||||
rate: u32,
|
||||
channels: u8,
|
||||
channel_mapping_family: u8,
|
||||
stream_count: u8,
|
||||
coupled_count: u8,
|
||||
channel_mapping: *const u8,
|
||||
pre_skip: u16,
|
||||
output_gain: i16,
|
||||
) -> *mut gst::GstBuffer;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_codec_utils_opus_parse_caps(caps: *mut gst::GstCaps, rate: *mut u32, channels: *mut u8, channel_mapping_family: *mut u8, stream_count: *mut u8, coupled_count: *mut u8, channel_mapping: *mut [u8; 256]) -> gboolean;
|
||||
pub fn gst_codec_utils_opus_parse_caps(
|
||||
caps: *mut gst::GstCaps,
|
||||
rate: *mut u32,
|
||||
channels: *mut u8,
|
||||
channel_mapping_family: *mut u8,
|
||||
stream_count: *mut u8,
|
||||
coupled_count: *mut u8,
|
||||
channel_mapping: *mut [u8; 256],
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_codec_utils_opus_parse_header(header: *mut gst::GstBuffer, rate: *mut u32, channels: *mut u8, channel_mapping_family: *mut u8, stream_count: *mut u8, coupled_count: *mut u8, channel_mapping: *mut [u8; 256], pre_skip: *mut u16, output_gain: *mut i16) -> gboolean;
|
||||
pub fn gst_codec_utils_opus_parse_header(
|
||||
header: *mut gst::GstBuffer,
|
||||
rate: *mut u32,
|
||||
channels: *mut u8,
|
||||
channel_mapping_family: *mut u8,
|
||||
stream_count: *mut u8,
|
||||
coupled_count: *mut u8,
|
||||
channel_mapping: *mut [u8; 256],
|
||||
pre_skip: *mut u16,
|
||||
output_gain: *mut i16,
|
||||
) -> gboolean;
|
||||
pub fn gst_encoding_list_all_targets(categoryname: *const c_char) -> *mut glib::GList;
|
||||
pub fn gst_encoding_list_available_categories() -> *mut glib::GList;
|
||||
pub fn gst_install_plugins_async(details: *const *const c_char, ctx: *mut GstInstallPluginsContext, func: GstInstallPluginsResultFunc, user_data: gpointer) -> GstInstallPluginsReturn;
|
||||
pub fn gst_install_plugins_async(
|
||||
details: *const *const c_char,
|
||||
ctx: *mut GstInstallPluginsContext,
|
||||
func: GstInstallPluginsResultFunc,
|
||||
user_data: gpointer,
|
||||
) -> GstInstallPluginsReturn;
|
||||
pub fn gst_install_plugins_installation_in_progress() -> gboolean;
|
||||
pub fn gst_install_plugins_supported() -> gboolean;
|
||||
pub fn gst_install_plugins_sync(details: *const *const c_char, ctx: *mut GstInstallPluginsContext) -> GstInstallPluginsReturn;
|
||||
pub fn gst_install_plugins_sync(
|
||||
details: *const *const c_char,
|
||||
ctx: *mut GstInstallPluginsContext,
|
||||
) -> GstInstallPluginsReturn;
|
||||
pub fn gst_is_missing_plugin_message(msg: *mut gst::GstMessage) -> gboolean;
|
||||
pub fn gst_missing_decoder_installer_detail_new(decode_caps: *const gst::GstCaps) -> *mut c_char;
|
||||
pub fn gst_missing_decoder_message_new(element: *mut gst::GstElement, decode_caps: *const gst::GstCaps) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_decoder_installer_detail_new(
|
||||
decode_caps: *const gst::GstCaps,
|
||||
) -> *mut c_char;
|
||||
pub fn gst_missing_decoder_message_new(
|
||||
element: *mut gst::GstElement,
|
||||
decode_caps: *const gst::GstCaps,
|
||||
) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_element_installer_detail_new(factory_name: *const c_char) -> *mut c_char;
|
||||
pub fn gst_missing_element_message_new(element: *mut gst::GstElement, factory_name: *const c_char) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_encoder_installer_detail_new(encode_caps: *const gst::GstCaps) -> *mut c_char;
|
||||
pub fn gst_missing_encoder_message_new(element: *mut gst::GstElement, encode_caps: *const gst::GstCaps) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_element_message_new(
|
||||
element: *mut gst::GstElement,
|
||||
factory_name: *const c_char,
|
||||
) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_encoder_installer_detail_new(
|
||||
encode_caps: *const gst::GstCaps,
|
||||
) -> *mut c_char;
|
||||
pub fn gst_missing_encoder_message_new(
|
||||
element: *mut gst::GstElement,
|
||||
encode_caps: *const gst::GstCaps,
|
||||
) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_plugin_message_get_description(msg: *mut gst::GstMessage) -> *mut c_char;
|
||||
pub fn gst_missing_plugin_message_get_installer_detail(msg: *mut gst::GstMessage) -> *mut c_char;
|
||||
pub fn gst_missing_plugin_message_get_installer_detail(
|
||||
msg: *mut gst::GstMessage,
|
||||
) -> *mut c_char;
|
||||
pub fn gst_missing_uri_sink_installer_detail_new(protocol: *const c_char) -> *mut c_char;
|
||||
pub fn gst_missing_uri_sink_message_new(element: *mut gst::GstElement, protocol: *const c_char) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_uri_sink_message_new(
|
||||
element: *mut gst::GstElement,
|
||||
protocol: *const c_char,
|
||||
) -> *mut gst::GstMessage;
|
||||
pub fn gst_missing_uri_source_installer_detail_new(protocol: *const c_char) -> *mut c_char;
|
||||
pub fn gst_missing_uri_source_message_new(element: *mut gst::GstElement, protocol: *const c_char) -> *mut gst::GstMessage;
|
||||
pub fn gst_pb_utils_add_codec_description_to_tag_list(taglist: *mut gst::GstTagList, codec_tag: *const c_char, caps: *const gst::GstCaps) -> gboolean;
|
||||
pub fn gst_missing_uri_source_message_new(
|
||||
element: *mut gst::GstElement,
|
||||
protocol: *const c_char,
|
||||
) -> *mut gst::GstMessage;
|
||||
pub fn gst_pb_utils_add_codec_description_to_tag_list(
|
||||
taglist: *mut gst::GstTagList,
|
||||
codec_tag: *const c_char,
|
||||
caps: *const gst::GstCaps,
|
||||
) -> gboolean;
|
||||
pub fn gst_pb_utils_get_codec_description(caps: *const gst::GstCaps) -> *mut c_char;
|
||||
pub fn gst_pb_utils_get_decoder_description(caps: *const gst::GstCaps) -> *mut c_char;
|
||||
pub fn gst_pb_utils_get_element_description(factory_name: *const c_char) -> *mut c_char;
|
||||
|
@ -589,7 +878,12 @@ extern "C" {
|
|||
pub fn gst_pb_utils_get_sink_description(protocol: *const c_char) -> *mut c_char;
|
||||
pub fn gst_pb_utils_get_source_description(protocol: *const c_char) -> *mut c_char;
|
||||
pub fn gst_pb_utils_init();
|
||||
pub fn gst_plugins_base_version(major: *mut c_uint, minor: *mut c_uint, micro: *mut c_uint, nano: *mut c_uint);
|
||||
pub fn gst_plugins_base_version(
|
||||
major: *mut c_uint,
|
||||
minor: *mut c_uint,
|
||||
micro: *mut c_uint,
|
||||
nano: *mut c_uint,
|
||||
);
|
||||
pub fn gst_plugins_base_version_string() -> *mut c_char;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_pbutils_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_pbutils_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_pbutils_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-pbutils-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,48 +229,154 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstAudioVisualizer", Layout {size: size_of::<GstAudioVisualizer>(), alignment: align_of::<GstAudioVisualizer>()}),
|
||||
("GstAudioVisualizerClass", Layout {size: size_of::<GstAudioVisualizerClass>(), alignment: align_of::<GstAudioVisualizerClass>()}),
|
||||
("GstAudioVisualizerShader", Layout {size: size_of::<GstAudioVisualizerShader>(), alignment: align_of::<GstAudioVisualizerShader>()}),
|
||||
("GstDiscoverer", Layout {size: size_of::<GstDiscoverer>(), alignment: align_of::<GstDiscoverer>()}),
|
||||
("GstDiscovererAudioInfoClass", Layout {size: size_of::<GstDiscovererAudioInfoClass>(), alignment: align_of::<GstDiscovererAudioInfoClass>()}),
|
||||
("GstDiscovererClass", Layout {size: size_of::<GstDiscovererClass>(), alignment: align_of::<GstDiscovererClass>()}),
|
||||
("GstDiscovererContainerInfoClass", Layout {size: size_of::<GstDiscovererContainerInfoClass>(), alignment: align_of::<GstDiscovererContainerInfoClass>()}),
|
||||
("GstDiscovererInfoClass", Layout {size: size_of::<GstDiscovererInfoClass>(), alignment: align_of::<GstDiscovererInfoClass>()}),
|
||||
("GstDiscovererResult", Layout {size: size_of::<GstDiscovererResult>(), alignment: align_of::<GstDiscovererResult>()}),
|
||||
("GstDiscovererSerializeFlags", Layout {size: size_of::<GstDiscovererSerializeFlags>(), alignment: align_of::<GstDiscovererSerializeFlags>()}),
|
||||
("GstDiscovererStreamInfoClass", Layout {size: size_of::<GstDiscovererStreamInfoClass>(), alignment: align_of::<GstDiscovererStreamInfoClass>()}),
|
||||
("GstDiscovererSubtitleInfoClass", Layout {size: size_of::<GstDiscovererSubtitleInfoClass>(), alignment: align_of::<GstDiscovererSubtitleInfoClass>()}),
|
||||
("GstDiscovererVideoInfoClass", Layout {size: size_of::<GstDiscovererVideoInfoClass>(), alignment: align_of::<GstDiscovererVideoInfoClass>()}),
|
||||
("GstEncodingTargetClass", Layout {size: size_of::<GstEncodingTargetClass>(), alignment: align_of::<GstEncodingTargetClass>()}),
|
||||
("GstInstallPluginsReturn", Layout {size: size_of::<GstInstallPluginsReturn>(), alignment: align_of::<GstInstallPluginsReturn>()}),
|
||||
(
|
||||
"GstAudioVisualizer",
|
||||
Layout {
|
||||
size: size_of::<GstAudioVisualizer>(),
|
||||
alignment: align_of::<GstAudioVisualizer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioVisualizerClass",
|
||||
Layout {
|
||||
size: size_of::<GstAudioVisualizerClass>(),
|
||||
alignment: align_of::<GstAudioVisualizerClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstAudioVisualizerShader",
|
||||
Layout {
|
||||
size: size_of::<GstAudioVisualizerShader>(),
|
||||
alignment: align_of::<GstAudioVisualizerShader>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscoverer",
|
||||
Layout {
|
||||
size: size_of::<GstDiscoverer>(),
|
||||
alignment: align_of::<GstDiscoverer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererAudioInfoClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererAudioInfoClass>(),
|
||||
alignment: align_of::<GstDiscovererAudioInfoClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererClass>(),
|
||||
alignment: align_of::<GstDiscovererClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererContainerInfoClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererContainerInfoClass>(),
|
||||
alignment: align_of::<GstDiscovererContainerInfoClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererInfoClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererInfoClass>(),
|
||||
alignment: align_of::<GstDiscovererInfoClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererResult",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererResult>(),
|
||||
alignment: align_of::<GstDiscovererResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererSerializeFlags",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererSerializeFlags>(),
|
||||
alignment: align_of::<GstDiscovererSerializeFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererStreamInfoClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererStreamInfoClass>(),
|
||||
alignment: align_of::<GstDiscovererStreamInfoClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererSubtitleInfoClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererSubtitleInfoClass>(),
|
||||
alignment: align_of::<GstDiscovererSubtitleInfoClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstDiscovererVideoInfoClass",
|
||||
Layout {
|
||||
size: size_of::<GstDiscovererVideoInfoClass>(),
|
||||
alignment: align_of::<GstDiscovererVideoInfoClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstEncodingTargetClass",
|
||||
Layout {
|
||||
size: size_of::<GstEncodingTargetClass>(),
|
||||
alignment: align_of::<GstEncodingTargetClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstInstallPluginsReturn",
|
||||
Layout {
|
||||
size: size_of::<GstInstallPluginsReturn>(),
|
||||
alignment: align_of::<GstInstallPluginsReturn>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE", "1"),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_DOWN", "3"),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN", "7"),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT", "6"),
|
||||
(
|
||||
"(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN",
|
||||
"7",
|
||||
),
|
||||
(
|
||||
"(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT",
|
||||
"6",
|
||||
),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_LEFT", "4"),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT", "5"),
|
||||
(
|
||||
"(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT",
|
||||
"5",
|
||||
),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_UP", "2"),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN", "9"),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT", "8"),
|
||||
(
|
||||
"(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN",
|
||||
"9",
|
||||
),
|
||||
(
|
||||
"(gint) GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT",
|
||||
"8",
|
||||
),
|
||||
("(gint) GST_AUDIO_VISUALIZER_SHADER_NONE", "0"),
|
||||
("(gint) GST_DISCOVERER_BUSY", "4"),
|
||||
("(gint) GST_DISCOVERER_ERROR", "2"),
|
||||
|
@ -294,5 +406,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_INSTALL_PLUGINS_SUCCESS", "0"),
|
||||
("(gint) GST_INSTALL_PLUGINS_USER_ABORT", "4"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -36,7 +36,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -58,8 +58,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -73,4 +75,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,18 +3,23 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_video_sys as gst_video;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -59,7 +64,8 @@ pub type GstPlayerClass = *mut _GstPlayerClass;
|
|||
#[repr(C)]
|
||||
pub struct _GstPlayerGMainContextSignalDispatcherClass(c_void);
|
||||
|
||||
pub type GstPlayerGMainContextSignalDispatcherClass = *mut _GstPlayerGMainContextSignalDispatcherClass;
|
||||
pub type GstPlayerGMainContextSignalDispatcherClass =
|
||||
*mut _GstPlayerGMainContextSignalDispatcherClass;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct _GstPlayerMediaInfoClass(c_void);
|
||||
|
@ -70,12 +76,23 @@ pub type GstPlayerMediaInfoClass = *mut _GstPlayerMediaInfoClass;
|
|||
#[derive(Copy, Clone)]
|
||||
pub struct GstPlayerSignalDispatcherInterface {
|
||||
pub parent_iface: gobject::GTypeInterface,
|
||||
pub dispatch: Option<unsafe extern "C" fn(*mut GstPlayerSignalDispatcher, *mut GstPlayer, GstPlayerSignalDispatcherFunc, gpointer, glib::GDestroyNotify)>,
|
||||
pub dispatch: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstPlayerSignalDispatcher,
|
||||
*mut GstPlayer,
|
||||
GstPlayerSignalDispatcherFunc,
|
||||
gpointer,
|
||||
glib::GDestroyNotify,
|
||||
),
|
||||
>,
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for GstPlayerSignalDispatcherInterface {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstPlayerSignalDispatcherInterface @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstPlayerSignalDispatcherInterface @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent_iface", &self.parent_iface)
|
||||
.field("dispatch", &self.dispatch)
|
||||
.finish()
|
||||
|
@ -106,12 +123,17 @@ pub type GstPlayerVideoOverlayVideoRendererClass = *mut _GstPlayerVideoOverlayVi
|
|||
#[derive(Copy, Clone)]
|
||||
pub struct GstPlayerVideoRendererInterface {
|
||||
pub parent_iface: gobject::GTypeInterface,
|
||||
pub create_video_sink: Option<unsafe extern "C" fn(*mut GstPlayerVideoRenderer, *mut GstPlayer) -> *mut gst::GstElement>,
|
||||
pub create_video_sink: Option<
|
||||
unsafe extern "C" fn(*mut GstPlayerVideoRenderer, *mut GstPlayer) -> *mut gst::GstElement,
|
||||
>,
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for GstPlayerVideoRendererInterface {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstPlayerVideoRendererInterface @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstPlayerVideoRendererInterface @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent_iface", &self.parent_iface)
|
||||
.field("create_video_sink", &self.create_video_sink)
|
||||
.finish()
|
||||
|
@ -160,7 +182,10 @@ pub struct GstPlayerGMainContextSignalDispatcher(c_void);
|
|||
|
||||
impl ::std::fmt::Debug for GstPlayerGMainContextSignalDispatcher {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstPlayerGMainContextSignalDispatcher @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstPlayerGMainContextSignalDispatcher @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +235,10 @@ pub struct GstPlayerVideoOverlayVideoRenderer(c_void);
|
|||
|
||||
impl ::std::fmt::Debug for GstPlayerVideoOverlayVideoRenderer {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstPlayerVideoOverlayVideoRenderer @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstPlayerVideoOverlayVideoRenderer @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
@ -234,14 +262,15 @@ impl ::std::fmt::Debug for GstPlayerVideoRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerColorBalanceType
|
||||
//=========================================================================
|
||||
pub fn gst_player_color_balance_type_get_type() -> GType;
|
||||
pub fn gst_player_color_balance_type_get_name(type_: GstPlayerColorBalanceType) -> *const c_char;
|
||||
pub fn gst_player_color_balance_type_get_name(
|
||||
type_: GstPlayerColorBalanceType,
|
||||
) -> *const c_char;
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerError
|
||||
|
@ -260,18 +289,28 @@ extern "C" {
|
|||
// GstPlayerVisualization
|
||||
//=========================================================================
|
||||
pub fn gst_player_visualization_get_type() -> GType;
|
||||
pub fn gst_player_visualization_copy(vis: *const GstPlayerVisualization) -> *mut GstPlayerVisualization;
|
||||
pub fn gst_player_visualization_copy(
|
||||
vis: *const GstPlayerVisualization,
|
||||
) -> *mut GstPlayerVisualization;
|
||||
pub fn gst_player_visualization_free(vis: *mut GstPlayerVisualization);
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayer
|
||||
//=========================================================================
|
||||
pub fn gst_player_get_type() -> GType;
|
||||
pub fn gst_player_new(video_renderer: *mut GstPlayerVideoRenderer, signal_dispatcher: *mut GstPlayerSignalDispatcher) -> *mut GstPlayer;
|
||||
pub fn gst_player_config_get_position_update_interval(config: *const gst::GstStructure) -> c_uint;
|
||||
pub fn gst_player_new(
|
||||
video_renderer: *mut GstPlayerVideoRenderer,
|
||||
signal_dispatcher: *mut GstPlayerSignalDispatcher,
|
||||
) -> *mut GstPlayer;
|
||||
pub fn gst_player_config_get_position_update_interval(
|
||||
config: *const gst::GstStructure,
|
||||
) -> c_uint;
|
||||
pub fn gst_player_config_get_seek_accurate(config: *const gst::GstStructure) -> gboolean;
|
||||
pub fn gst_player_config_get_user_agent(config: *const gst::GstStructure) -> *mut c_char;
|
||||
pub fn gst_player_config_set_position_update_interval(config: *mut gst::GstStructure, interval: c_uint);
|
||||
pub fn gst_player_config_set_position_update_interval(
|
||||
config: *mut gst::GstStructure,
|
||||
interval: c_uint,
|
||||
);
|
||||
pub fn gst_player_config_set_seek_accurate(config: *mut gst::GstStructure, accurate: gboolean);
|
||||
pub fn gst_player_config_set_user_agent(config: *mut gst::GstStructure, agent: *const c_char);
|
||||
pub fn gst_player_get_audio_streams(info: *const GstPlayerMediaInfo) -> *mut glib::GList;
|
||||
|
@ -280,16 +319,25 @@ extern "C" {
|
|||
pub fn gst_player_visualizations_free(viss: *mut *mut GstPlayerVisualization);
|
||||
pub fn gst_player_visualizations_get() -> *mut *mut GstPlayerVisualization;
|
||||
pub fn gst_player_get_audio_video_offset(player: *mut GstPlayer) -> i64;
|
||||
pub fn gst_player_get_color_balance(player: *mut GstPlayer, type_: GstPlayerColorBalanceType) -> c_double;
|
||||
pub fn gst_player_get_color_balance(
|
||||
player: *mut GstPlayer,
|
||||
type_: GstPlayerColorBalanceType,
|
||||
) -> c_double;
|
||||
pub fn gst_player_get_config(player: *mut GstPlayer) -> *mut gst::GstStructure;
|
||||
pub fn gst_player_get_current_audio_track(player: *mut GstPlayer) -> *mut GstPlayerAudioInfo;
|
||||
pub fn gst_player_get_current_subtitle_track(player: *mut GstPlayer) -> *mut GstPlayerSubtitleInfo;
|
||||
pub fn gst_player_get_current_subtitle_track(
|
||||
player: *mut GstPlayer,
|
||||
) -> *mut GstPlayerSubtitleInfo;
|
||||
pub fn gst_player_get_current_video_track(player: *mut GstPlayer) -> *mut GstPlayerVideoInfo;
|
||||
pub fn gst_player_get_current_visualization(player: *mut GstPlayer) -> *mut c_char;
|
||||
pub fn gst_player_get_duration(player: *mut GstPlayer) -> gst::GstClockTime;
|
||||
pub fn gst_player_get_media_info(player: *mut GstPlayer) -> *mut GstPlayerMediaInfo;
|
||||
pub fn gst_player_get_multiview_flags(player: *mut GstPlayer) -> gst_video::GstVideoMultiviewFlags;
|
||||
pub fn gst_player_get_multiview_mode(player: *mut GstPlayer) -> gst_video::GstVideoMultiviewFramePacking;
|
||||
pub fn gst_player_get_multiview_flags(
|
||||
player: *mut GstPlayer,
|
||||
) -> gst_video::GstVideoMultiviewFlags;
|
||||
pub fn gst_player_get_multiview_mode(
|
||||
player: *mut GstPlayer,
|
||||
) -> gst_video::GstVideoMultiviewFramePacking;
|
||||
pub fn gst_player_get_mute(player: *mut GstPlayer) -> gboolean;
|
||||
pub fn gst_player_get_pipeline(player: *mut GstPlayer) -> *mut gst::GstElement;
|
||||
pub fn gst_player_get_position(player: *mut GstPlayer) -> gst::GstClockTime;
|
||||
|
@ -298,7 +346,11 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_player_get_subtitle_video_offset(player: *mut GstPlayer) -> i64;
|
||||
pub fn gst_player_get_uri(player: *mut GstPlayer) -> *mut c_char;
|
||||
pub fn gst_player_get_video_snapshot(player: *mut GstPlayer, format: GstPlayerSnapshotFormat, config: *const gst::GstStructure) -> *mut gst::GstSample;
|
||||
pub fn gst_player_get_video_snapshot(
|
||||
player: *mut GstPlayer,
|
||||
format: GstPlayerSnapshotFormat,
|
||||
config: *const gst::GstStructure,
|
||||
) -> *mut gst::GstSample;
|
||||
pub fn gst_player_get_volume(player: *mut GstPlayer) -> c_double;
|
||||
pub fn gst_player_has_color_balance(player: *mut GstPlayer) -> gboolean;
|
||||
pub fn gst_player_pause(player: *mut GstPlayer);
|
||||
|
@ -307,10 +359,23 @@ extern "C" {
|
|||
pub fn gst_player_set_audio_track(player: *mut GstPlayer, stream_index: c_int) -> gboolean;
|
||||
pub fn gst_player_set_audio_track_enabled(player: *mut GstPlayer, enabled: gboolean);
|
||||
pub fn gst_player_set_audio_video_offset(player: *mut GstPlayer, offset: i64);
|
||||
pub fn gst_player_set_color_balance(player: *mut GstPlayer, type_: GstPlayerColorBalanceType, value: c_double);
|
||||
pub fn gst_player_set_config(player: *mut GstPlayer, config: *mut gst::GstStructure) -> gboolean;
|
||||
pub fn gst_player_set_multiview_flags(player: *mut GstPlayer, flags: gst_video::GstVideoMultiviewFlags);
|
||||
pub fn gst_player_set_multiview_mode(player: *mut GstPlayer, mode: gst_video::GstVideoMultiviewFramePacking);
|
||||
pub fn gst_player_set_color_balance(
|
||||
player: *mut GstPlayer,
|
||||
type_: GstPlayerColorBalanceType,
|
||||
value: c_double,
|
||||
);
|
||||
pub fn gst_player_set_config(
|
||||
player: *mut GstPlayer,
|
||||
config: *mut gst::GstStructure,
|
||||
) -> gboolean;
|
||||
pub fn gst_player_set_multiview_flags(
|
||||
player: *mut GstPlayer,
|
||||
flags: gst_video::GstVideoMultiviewFlags,
|
||||
);
|
||||
pub fn gst_player_set_multiview_mode(
|
||||
player: *mut GstPlayer,
|
||||
mode: gst_video::GstVideoMultiviewFramePacking,
|
||||
);
|
||||
pub fn gst_player_set_mute(player: *mut GstPlayer, val: gboolean);
|
||||
pub fn gst_player_set_rate(player: *mut GstPlayer, rate: c_double);
|
||||
pub fn gst_player_set_subtitle_track(player: *mut GstPlayer, stream_index: c_int) -> gboolean;
|
||||
|
@ -340,26 +405,47 @@ extern "C" {
|
|||
// GstPlayerGMainContextSignalDispatcher
|
||||
//=========================================================================
|
||||
pub fn gst_player_g_main_context_signal_dispatcher_get_type() -> GType;
|
||||
pub fn gst_player_g_main_context_signal_dispatcher_new(application_context: *mut glib::GMainContext) -> *mut GstPlayerSignalDispatcher;
|
||||
pub fn gst_player_g_main_context_signal_dispatcher_new(
|
||||
application_context: *mut glib::GMainContext,
|
||||
) -> *mut GstPlayerSignalDispatcher;
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerMediaInfo
|
||||
//=========================================================================
|
||||
pub fn gst_player_media_info_get_type() -> GType;
|
||||
pub fn gst_player_media_info_get_audio_streams(info: *const GstPlayerMediaInfo) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_container_format(info: *const GstPlayerMediaInfo) -> *const c_char;
|
||||
pub fn gst_player_media_info_get_duration(info: *const GstPlayerMediaInfo) -> gst::GstClockTime;
|
||||
pub fn gst_player_media_info_get_image_sample(info: *const GstPlayerMediaInfo) -> *mut gst::GstSample;
|
||||
pub fn gst_player_media_info_get_number_of_audio_streams(info: *const GstPlayerMediaInfo) -> c_uint;
|
||||
pub fn gst_player_media_info_get_audio_streams(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_container_format(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> *const c_char;
|
||||
pub fn gst_player_media_info_get_duration(info: *const GstPlayerMediaInfo)
|
||||
-> gst::GstClockTime;
|
||||
pub fn gst_player_media_info_get_image_sample(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> *mut gst::GstSample;
|
||||
pub fn gst_player_media_info_get_number_of_audio_streams(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> c_uint;
|
||||
pub fn gst_player_media_info_get_number_of_streams(info: *const GstPlayerMediaInfo) -> c_uint;
|
||||
pub fn gst_player_media_info_get_number_of_subtitle_streams(info: *const GstPlayerMediaInfo) -> c_uint;
|
||||
pub fn gst_player_media_info_get_number_of_video_streams(info: *const GstPlayerMediaInfo) -> c_uint;
|
||||
pub fn gst_player_media_info_get_stream_list(info: *const GstPlayerMediaInfo) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_subtitle_streams(info: *const GstPlayerMediaInfo) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_number_of_subtitle_streams(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> c_uint;
|
||||
pub fn gst_player_media_info_get_number_of_video_streams(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> c_uint;
|
||||
pub fn gst_player_media_info_get_stream_list(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_subtitle_streams(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_tags(info: *const GstPlayerMediaInfo) -> *mut gst::GstTagList;
|
||||
pub fn gst_player_media_info_get_title(info: *const GstPlayerMediaInfo) -> *const c_char;
|
||||
pub fn gst_player_media_info_get_uri(info: *const GstPlayerMediaInfo) -> *const c_char;
|
||||
pub fn gst_player_media_info_get_video_streams(info: *const GstPlayerMediaInfo) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_get_video_streams(
|
||||
info: *const GstPlayerMediaInfo,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_player_media_info_is_live(info: *const GstPlayerMediaInfo) -> gboolean;
|
||||
pub fn gst_player_media_info_is_seekable(info: *const GstPlayerMediaInfo) -> gboolean;
|
||||
|
||||
|
@ -370,37 +456,75 @@ extern "C" {
|
|||
pub fn gst_player_stream_info_get_caps(info: *const GstPlayerStreamInfo) -> *mut gst::GstCaps;
|
||||
pub fn gst_player_stream_info_get_codec(info: *const GstPlayerStreamInfo) -> *const c_char;
|
||||
pub fn gst_player_stream_info_get_index(info: *const GstPlayerStreamInfo) -> c_int;
|
||||
pub fn gst_player_stream_info_get_stream_type(info: *const GstPlayerStreamInfo) -> *const c_char;
|
||||
pub fn gst_player_stream_info_get_tags(info: *const GstPlayerStreamInfo) -> *mut gst::GstTagList;
|
||||
pub fn gst_player_stream_info_get_stream_type(
|
||||
info: *const GstPlayerStreamInfo,
|
||||
) -> *const c_char;
|
||||
pub fn gst_player_stream_info_get_tags(
|
||||
info: *const GstPlayerStreamInfo,
|
||||
) -> *mut gst::GstTagList;
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerSubtitleInfo
|
||||
//=========================================================================
|
||||
pub fn gst_player_subtitle_info_get_type() -> GType;
|
||||
pub fn gst_player_subtitle_info_get_language(info: *const GstPlayerSubtitleInfo) -> *const c_char;
|
||||
pub fn gst_player_subtitle_info_get_language(
|
||||
info: *const GstPlayerSubtitleInfo,
|
||||
) -> *const c_char;
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerVideoInfo
|
||||
//=========================================================================
|
||||
pub fn gst_player_video_info_get_type() -> GType;
|
||||
pub fn gst_player_video_info_get_bitrate(info: *const GstPlayerVideoInfo) -> c_int;
|
||||
pub fn gst_player_video_info_get_framerate(info: *const GstPlayerVideoInfo, fps_n: *mut c_int, fps_d: *mut c_int);
|
||||
pub fn gst_player_video_info_get_framerate(
|
||||
info: *const GstPlayerVideoInfo,
|
||||
fps_n: *mut c_int,
|
||||
fps_d: *mut c_int,
|
||||
);
|
||||
pub fn gst_player_video_info_get_height(info: *const GstPlayerVideoInfo) -> c_int;
|
||||
pub fn gst_player_video_info_get_max_bitrate(info: *const GstPlayerVideoInfo) -> c_int;
|
||||
pub fn gst_player_video_info_get_pixel_aspect_ratio(info: *const GstPlayerVideoInfo, par_n: *mut c_uint, par_d: *mut c_uint);
|
||||
pub fn gst_player_video_info_get_pixel_aspect_ratio(
|
||||
info: *const GstPlayerVideoInfo,
|
||||
par_n: *mut c_uint,
|
||||
par_d: *mut c_uint,
|
||||
);
|
||||
pub fn gst_player_video_info_get_width(info: *const GstPlayerVideoInfo) -> c_int;
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerVideoOverlayVideoRenderer
|
||||
//=========================================================================
|
||||
pub fn gst_player_video_overlay_video_renderer_get_type() -> GType;
|
||||
pub fn gst_player_video_overlay_video_renderer_new(window_handle: gpointer) -> *mut GstPlayerVideoRenderer;
|
||||
pub fn gst_player_video_overlay_video_renderer_new_with_sink(window_handle: gpointer, video_sink: *mut gst::GstElement) -> *mut GstPlayerVideoRenderer;
|
||||
pub fn gst_player_video_overlay_video_renderer_expose(self_: *mut GstPlayerVideoOverlayVideoRenderer);
|
||||
pub fn gst_player_video_overlay_video_renderer_get_render_rectangle(self_: *mut GstPlayerVideoOverlayVideoRenderer, x: *mut c_int, y: *mut c_int, width: *mut c_int, height: *mut c_int);
|
||||
pub fn gst_player_video_overlay_video_renderer_get_window_handle(self_: *mut GstPlayerVideoOverlayVideoRenderer) -> gpointer;
|
||||
pub fn gst_player_video_overlay_video_renderer_set_render_rectangle(self_: *mut GstPlayerVideoOverlayVideoRenderer, x: c_int, y: c_int, width: c_int, height: c_int);
|
||||
pub fn gst_player_video_overlay_video_renderer_set_window_handle(self_: *mut GstPlayerVideoOverlayVideoRenderer, window_handle: gpointer);
|
||||
pub fn gst_player_video_overlay_video_renderer_new(
|
||||
window_handle: gpointer,
|
||||
) -> *mut GstPlayerVideoRenderer;
|
||||
pub fn gst_player_video_overlay_video_renderer_new_with_sink(
|
||||
window_handle: gpointer,
|
||||
video_sink: *mut gst::GstElement,
|
||||
) -> *mut GstPlayerVideoRenderer;
|
||||
pub fn gst_player_video_overlay_video_renderer_expose(
|
||||
self_: *mut GstPlayerVideoOverlayVideoRenderer,
|
||||
);
|
||||
pub fn gst_player_video_overlay_video_renderer_get_render_rectangle(
|
||||
self_: *mut GstPlayerVideoOverlayVideoRenderer,
|
||||
x: *mut c_int,
|
||||
y: *mut c_int,
|
||||
width: *mut c_int,
|
||||
height: *mut c_int,
|
||||
);
|
||||
pub fn gst_player_video_overlay_video_renderer_get_window_handle(
|
||||
self_: *mut GstPlayerVideoOverlayVideoRenderer,
|
||||
) -> gpointer;
|
||||
pub fn gst_player_video_overlay_video_renderer_set_render_rectangle(
|
||||
self_: *mut GstPlayerVideoOverlayVideoRenderer,
|
||||
x: c_int,
|
||||
y: c_int,
|
||||
width: c_int,
|
||||
height: c_int,
|
||||
);
|
||||
pub fn gst_player_video_overlay_video_renderer_set_window_handle(
|
||||
self_: *mut GstPlayerVideoOverlayVideoRenderer,
|
||||
window_handle: gpointer,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstPlayerSignalDispatcher
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_player_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_player_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_player_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-player-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,28 +229,71 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstPlayerColorBalanceType", Layout {size: size_of::<GstPlayerColorBalanceType>(), alignment: align_of::<GstPlayerColorBalanceType>()}),
|
||||
("GstPlayerError", Layout {size: size_of::<GstPlayerError>(), alignment: align_of::<GstPlayerError>()}),
|
||||
("GstPlayerSignalDispatcherInterface", Layout {size: size_of::<GstPlayerSignalDispatcherInterface>(), alignment: align_of::<GstPlayerSignalDispatcherInterface>()}),
|
||||
("GstPlayerSnapshotFormat", Layout {size: size_of::<GstPlayerSnapshotFormat>(), alignment: align_of::<GstPlayerSnapshotFormat>()}),
|
||||
("GstPlayerState", Layout {size: size_of::<GstPlayerState>(), alignment: align_of::<GstPlayerState>()}),
|
||||
("GstPlayerVideoRendererInterface", Layout {size: size_of::<GstPlayerVideoRendererInterface>(), alignment: align_of::<GstPlayerVideoRendererInterface>()}),
|
||||
("GstPlayerVisualization", Layout {size: size_of::<GstPlayerVisualization>(), alignment: align_of::<GstPlayerVisualization>()}),
|
||||
(
|
||||
"GstPlayerColorBalanceType",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerColorBalanceType>(),
|
||||
alignment: align_of::<GstPlayerColorBalanceType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPlayerError",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerError>(),
|
||||
alignment: align_of::<GstPlayerError>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPlayerSignalDispatcherInterface",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerSignalDispatcherInterface>(),
|
||||
alignment: align_of::<GstPlayerSignalDispatcherInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPlayerSnapshotFormat",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerSnapshotFormat>(),
|
||||
alignment: align_of::<GstPlayerSnapshotFormat>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPlayerState",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerState>(),
|
||||
alignment: align_of::<GstPlayerState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPlayerVideoRendererInterface",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerVideoRendererInterface>(),
|
||||
alignment: align_of::<GstPlayerVideoRendererInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstPlayerVisualization",
|
||||
Layout {
|
||||
size: size_of::<GstPlayerVisualization>(),
|
||||
alignment: align_of::<GstPlayerVisualization>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -263,5 +312,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_PLAYER_THUMBNAIL_RAW_NATIVE", "0"),
|
||||
("(gint) GST_PLAYER_THUMBNAIL_RAW_xRGB", "1"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_rtsp_server_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_rtsp_server_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_rtsp_server_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-rtsp-server-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,71 +229,372 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstRTSPAddress", Layout {size: size_of::<GstRTSPAddress>(), alignment: align_of::<GstRTSPAddress>()}),
|
||||
("GstRTSPAddressFlags", Layout {size: size_of::<GstRTSPAddressFlags>(), alignment: align_of::<GstRTSPAddressFlags>()}),
|
||||
("GstRTSPAddressPool", Layout {size: size_of::<GstRTSPAddressPool>(), alignment: align_of::<GstRTSPAddressPool>()}),
|
||||
("GstRTSPAddressPoolClass", Layout {size: size_of::<GstRTSPAddressPoolClass>(), alignment: align_of::<GstRTSPAddressPoolClass>()}),
|
||||
("GstRTSPAddressPoolResult", Layout {size: size_of::<GstRTSPAddressPoolResult>(), alignment: align_of::<GstRTSPAddressPoolResult>()}),
|
||||
("GstRTSPAuth", Layout {size: size_of::<GstRTSPAuth>(), alignment: align_of::<GstRTSPAuth>()}),
|
||||
("GstRTSPAuthClass", Layout {size: size_of::<GstRTSPAuthClass>(), alignment: align_of::<GstRTSPAuthClass>()}),
|
||||
("GstRTSPClient", Layout {size: size_of::<GstRTSPClient>(), alignment: align_of::<GstRTSPClient>()}),
|
||||
("GstRTSPClientClass", Layout {size: size_of::<GstRTSPClientClass>(), alignment: align_of::<GstRTSPClientClass>()}),
|
||||
("GstRTSPContext", Layout {size: size_of::<GstRTSPContext>(), alignment: align_of::<GstRTSPContext>()}),
|
||||
("GstRTSPFilterResult", Layout {size: size_of::<GstRTSPFilterResult>(), alignment: align_of::<GstRTSPFilterResult>()}),
|
||||
("GstRTSPMedia", Layout {size: size_of::<GstRTSPMedia>(), alignment: align_of::<GstRTSPMedia>()}),
|
||||
("GstRTSPMediaClass", Layout {size: size_of::<GstRTSPMediaClass>(), alignment: align_of::<GstRTSPMediaClass>()}),
|
||||
("GstRTSPMediaFactory", Layout {size: size_of::<GstRTSPMediaFactory>(), alignment: align_of::<GstRTSPMediaFactory>()}),
|
||||
("GstRTSPMediaFactoryClass", Layout {size: size_of::<GstRTSPMediaFactoryClass>(), alignment: align_of::<GstRTSPMediaFactoryClass>()}),
|
||||
("GstRTSPMediaFactoryURI", Layout {size: size_of::<GstRTSPMediaFactoryURI>(), alignment: align_of::<GstRTSPMediaFactoryURI>()}),
|
||||
("GstRTSPMediaFactoryURIClass", Layout {size: size_of::<GstRTSPMediaFactoryURIClass>(), alignment: align_of::<GstRTSPMediaFactoryURIClass>()}),
|
||||
("GstRTSPMediaStatus", Layout {size: size_of::<GstRTSPMediaStatus>(), alignment: align_of::<GstRTSPMediaStatus>()}),
|
||||
("GstRTSPMountPoints", Layout {size: size_of::<GstRTSPMountPoints>(), alignment: align_of::<GstRTSPMountPoints>()}),
|
||||
("GstRTSPMountPointsClass", Layout {size: size_of::<GstRTSPMountPointsClass>(), alignment: align_of::<GstRTSPMountPointsClass>()}),
|
||||
("GstRTSPOnvifClient", Layout {size: size_of::<GstRTSPOnvifClient>(), alignment: align_of::<GstRTSPOnvifClient>()}),
|
||||
("GstRTSPOnvifClientClass", Layout {size: size_of::<GstRTSPOnvifClientClass>(), alignment: align_of::<GstRTSPOnvifClientClass>()}),
|
||||
("GstRTSPOnvifMedia", Layout {size: size_of::<GstRTSPOnvifMedia>(), alignment: align_of::<GstRTSPOnvifMedia>()}),
|
||||
("GstRTSPOnvifMediaClass", Layout {size: size_of::<GstRTSPOnvifMediaClass>(), alignment: align_of::<GstRTSPOnvifMediaClass>()}),
|
||||
("GstRTSPOnvifMediaFactory", Layout {size: size_of::<GstRTSPOnvifMediaFactory>(), alignment: align_of::<GstRTSPOnvifMediaFactory>()}),
|
||||
("GstRTSPOnvifMediaFactoryClass", Layout {size: size_of::<GstRTSPOnvifMediaFactoryClass>(), alignment: align_of::<GstRTSPOnvifMediaFactoryClass>()}),
|
||||
("GstRTSPOnvifServer", Layout {size: size_of::<GstRTSPOnvifServer>(), alignment: align_of::<GstRTSPOnvifServer>()}),
|
||||
("GstRTSPOnvifServerClass", Layout {size: size_of::<GstRTSPOnvifServerClass>(), alignment: align_of::<GstRTSPOnvifServerClass>()}),
|
||||
("GstRTSPPermissions", Layout {size: size_of::<GstRTSPPermissions>(), alignment: align_of::<GstRTSPPermissions>()}),
|
||||
("GstRTSPPublishClockMode", Layout {size: size_of::<GstRTSPPublishClockMode>(), alignment: align_of::<GstRTSPPublishClockMode>()}),
|
||||
("GstRTSPServer", Layout {size: size_of::<GstRTSPServer>(), alignment: align_of::<GstRTSPServer>()}),
|
||||
("GstRTSPServerClass", Layout {size: size_of::<GstRTSPServerClass>(), alignment: align_of::<GstRTSPServerClass>()}),
|
||||
("GstRTSPSession", Layout {size: size_of::<GstRTSPSession>(), alignment: align_of::<GstRTSPSession>()}),
|
||||
("GstRTSPSessionClass", Layout {size: size_of::<GstRTSPSessionClass>(), alignment: align_of::<GstRTSPSessionClass>()}),
|
||||
("GstRTSPSessionMedia", Layout {size: size_of::<GstRTSPSessionMedia>(), alignment: align_of::<GstRTSPSessionMedia>()}),
|
||||
("GstRTSPSessionMediaClass", Layout {size: size_of::<GstRTSPSessionMediaClass>(), alignment: align_of::<GstRTSPSessionMediaClass>()}),
|
||||
("GstRTSPSessionPool", Layout {size: size_of::<GstRTSPSessionPool>(), alignment: align_of::<GstRTSPSessionPool>()}),
|
||||
("GstRTSPSessionPoolClass", Layout {size: size_of::<GstRTSPSessionPoolClass>(), alignment: align_of::<GstRTSPSessionPoolClass>()}),
|
||||
("GstRTSPStream", Layout {size: size_of::<GstRTSPStream>(), alignment: align_of::<GstRTSPStream>()}),
|
||||
("GstRTSPStreamClass", Layout {size: size_of::<GstRTSPStreamClass>(), alignment: align_of::<GstRTSPStreamClass>()}),
|
||||
("GstRTSPStreamTransport", Layout {size: size_of::<GstRTSPStreamTransport>(), alignment: align_of::<GstRTSPStreamTransport>()}),
|
||||
("GstRTSPStreamTransportClass", Layout {size: size_of::<GstRTSPStreamTransportClass>(), alignment: align_of::<GstRTSPStreamTransportClass>()}),
|
||||
("GstRTSPSuspendMode", Layout {size: size_of::<GstRTSPSuspendMode>(), alignment: align_of::<GstRTSPSuspendMode>()}),
|
||||
("GstRTSPThread", Layout {size: size_of::<GstRTSPThread>(), alignment: align_of::<GstRTSPThread>()}),
|
||||
("GstRTSPThreadPool", Layout {size: size_of::<GstRTSPThreadPool>(), alignment: align_of::<GstRTSPThreadPool>()}),
|
||||
("GstRTSPThreadPoolClass", Layout {size: size_of::<GstRTSPThreadPoolClass>(), alignment: align_of::<GstRTSPThreadPoolClass>()}),
|
||||
("GstRTSPThreadType", Layout {size: size_of::<GstRTSPThreadType>(), alignment: align_of::<GstRTSPThreadType>()}),
|
||||
("GstRTSPToken", Layout {size: size_of::<GstRTSPToken>(), alignment: align_of::<GstRTSPToken>()}),
|
||||
("GstRTSPTransportMode", Layout {size: size_of::<GstRTSPTransportMode>(), alignment: align_of::<GstRTSPTransportMode>()}),
|
||||
("GstSDPInfo", Layout {size: size_of::<GstSDPInfo>(), alignment: align_of::<GstSDPInfo>()}),
|
||||
(
|
||||
"GstRTSPAddress",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAddress>(),
|
||||
alignment: align_of::<GstRTSPAddress>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAddressFlags",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAddressFlags>(),
|
||||
alignment: align_of::<GstRTSPAddressFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAddressPool",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAddressPool>(),
|
||||
alignment: align_of::<GstRTSPAddressPool>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAddressPoolClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAddressPoolClass>(),
|
||||
alignment: align_of::<GstRTSPAddressPoolClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAddressPoolResult",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAddressPoolResult>(),
|
||||
alignment: align_of::<GstRTSPAddressPoolResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAuth",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAuth>(),
|
||||
alignment: align_of::<GstRTSPAuth>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAuthClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAuthClass>(),
|
||||
alignment: align_of::<GstRTSPAuthClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPClient",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPClient>(),
|
||||
alignment: align_of::<GstRTSPClient>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPClientClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPClientClass>(),
|
||||
alignment: align_of::<GstRTSPClientClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPContext",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPContext>(),
|
||||
alignment: align_of::<GstRTSPContext>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPFilterResult",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPFilterResult>(),
|
||||
alignment: align_of::<GstRTSPFilterResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMedia",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMedia>(),
|
||||
alignment: align_of::<GstRTSPMedia>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMediaClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMediaClass>(),
|
||||
alignment: align_of::<GstRTSPMediaClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMediaFactory",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMediaFactory>(),
|
||||
alignment: align_of::<GstRTSPMediaFactory>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMediaFactoryClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMediaFactoryClass>(),
|
||||
alignment: align_of::<GstRTSPMediaFactoryClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMediaFactoryURI",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMediaFactoryURI>(),
|
||||
alignment: align_of::<GstRTSPMediaFactoryURI>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMediaFactoryURIClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMediaFactoryURIClass>(),
|
||||
alignment: align_of::<GstRTSPMediaFactoryURIClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMediaStatus",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMediaStatus>(),
|
||||
alignment: align_of::<GstRTSPMediaStatus>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMountPoints",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMountPoints>(),
|
||||
alignment: align_of::<GstRTSPMountPoints>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMountPointsClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMountPointsClass>(),
|
||||
alignment: align_of::<GstRTSPMountPointsClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifClient",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifClient>(),
|
||||
alignment: align_of::<GstRTSPOnvifClient>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifClientClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifClientClass>(),
|
||||
alignment: align_of::<GstRTSPOnvifClientClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifMedia",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifMedia>(),
|
||||
alignment: align_of::<GstRTSPOnvifMedia>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifMediaClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifMediaClass>(),
|
||||
alignment: align_of::<GstRTSPOnvifMediaClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifMediaFactory",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifMediaFactory>(),
|
||||
alignment: align_of::<GstRTSPOnvifMediaFactory>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifMediaFactoryClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifMediaFactoryClass>(),
|
||||
alignment: align_of::<GstRTSPOnvifMediaFactoryClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifServer",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifServer>(),
|
||||
alignment: align_of::<GstRTSPOnvifServer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPOnvifServerClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPOnvifServerClass>(),
|
||||
alignment: align_of::<GstRTSPOnvifServerClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPPermissions",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPPermissions>(),
|
||||
alignment: align_of::<GstRTSPPermissions>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPPublishClockMode",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPPublishClockMode>(),
|
||||
alignment: align_of::<GstRTSPPublishClockMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPServer",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPServer>(),
|
||||
alignment: align_of::<GstRTSPServer>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPServerClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPServerClass>(),
|
||||
alignment: align_of::<GstRTSPServerClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSession",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSession>(),
|
||||
alignment: align_of::<GstRTSPSession>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSessionClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSessionClass>(),
|
||||
alignment: align_of::<GstRTSPSessionClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSessionMedia",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSessionMedia>(),
|
||||
alignment: align_of::<GstRTSPSessionMedia>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSessionMediaClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSessionMediaClass>(),
|
||||
alignment: align_of::<GstRTSPSessionMediaClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSessionPool",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSessionPool>(),
|
||||
alignment: align_of::<GstRTSPSessionPool>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSessionPoolClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSessionPoolClass>(),
|
||||
alignment: align_of::<GstRTSPSessionPoolClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPStream",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPStream>(),
|
||||
alignment: align_of::<GstRTSPStream>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPStreamClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPStreamClass>(),
|
||||
alignment: align_of::<GstRTSPStreamClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPStreamTransport",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPStreamTransport>(),
|
||||
alignment: align_of::<GstRTSPStreamTransport>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPStreamTransportClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPStreamTransportClass>(),
|
||||
alignment: align_of::<GstRTSPStreamTransportClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPSuspendMode",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPSuspendMode>(),
|
||||
alignment: align_of::<GstRTSPSuspendMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPThread",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPThread>(),
|
||||
alignment: align_of::<GstRTSPThread>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPThreadPool",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPThreadPool>(),
|
||||
alignment: align_of::<GstRTSPThreadPool>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPThreadPoolClass",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPThreadPoolClass>(),
|
||||
alignment: align_of::<GstRTSPThreadPoolClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPThreadType",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPThreadType>(),
|
||||
alignment: align_of::<GstRTSPThreadType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPToken",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPToken>(),
|
||||
alignment: align_of::<GstRTSPToken>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTransportMode",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTransportMode>(),
|
||||
alignment: align_of::<GstRTSPTransportMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPInfo",
|
||||
Layout {
|
||||
size: size_of::<GstSDPInfo>(),
|
||||
alignment: align_of::<GstSDPInfo>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -305,9 +612,18 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_RTSP_ADDRESS_POOL_ERESERVED", "-2"),
|
||||
("(gint) GST_RTSP_ADDRESS_POOL_OK", "0"),
|
||||
("GST_RTSP_AUTH_CHECK_CONNECT", "auth.check.connect"),
|
||||
("GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS", "auth.check.media.factory.access"),
|
||||
("GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT", "auth.check.media.factory.construct"),
|
||||
("GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS", "auth.check.transport.client-settings"),
|
||||
(
|
||||
"GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS",
|
||||
"auth.check.media.factory.access",
|
||||
),
|
||||
(
|
||||
"GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT",
|
||||
"auth.check.media.factory.construct",
|
||||
),
|
||||
(
|
||||
"GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS",
|
||||
"auth.check.transport.client-settings",
|
||||
),
|
||||
("GST_RTSP_AUTH_CHECK_URL", "auth.check.url"),
|
||||
("(gint) GST_RTSP_FILTER_KEEP", "1"),
|
||||
("(gint) GST_RTSP_FILTER_REF", "2"),
|
||||
|
@ -318,9 +634,15 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_RTSP_MEDIA_STATUS_SUSPENDED", "4"),
|
||||
("(gint) GST_RTSP_MEDIA_STATUS_UNPREPARED", "0"),
|
||||
("(gint) GST_RTSP_MEDIA_STATUS_UNPREPARING", "1"),
|
||||
("GST_RTSP_ONVIF_BACKCHANNEL_REQUIREMENT", "www.onvif.org/ver20/backchannel"),
|
||||
(
|
||||
"GST_RTSP_ONVIF_BACKCHANNEL_REQUIREMENT",
|
||||
"www.onvif.org/ver20/backchannel",
|
||||
),
|
||||
("GST_RTSP_PERM_MEDIA_FACTORY_ACCESS", "media.factory.access"),
|
||||
("GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT", "media.factory.construct"),
|
||||
(
|
||||
"GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT",
|
||||
"media.factory.construct",
|
||||
),
|
||||
("(gint) GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK", "1"),
|
||||
("(gint) GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET", "2"),
|
||||
("(gint) GST_RTSP_PUBLISH_CLOCK_MODE_NONE", "0"),
|
||||
|
@ -330,9 +652,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_RTSP_THREAD_TYPE_CLIENT", "0"),
|
||||
("(gint) GST_RTSP_THREAD_TYPE_MEDIA", "1"),
|
||||
("GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE", "media.factory.role"),
|
||||
("GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS", "transport.client-settings"),
|
||||
(
|
||||
"GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS",
|
||||
"transport.client-settings",
|
||||
),
|
||||
("(guint) GST_RTSP_TRANSPORT_MODE_PLAY", "1"),
|
||||
("(guint) GST_RTSP_TRANSPORT_MODE_RECORD", "2"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -50,7 +50,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -72,8 +72,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -87,4 +89,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,19 +3,24 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate gio_sys as gio;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gio_sys as gio;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_sdp_sys as gst_sdp;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -282,7 +287,10 @@ pub union GstRTSPMessage_type_data {
|
|||
|
||||
impl ::std::fmt::Debug for GstRTSPMessage_type_data {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstRTSPMessage_type_data @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstRTSPMessage_type_data @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("request", unsafe { &self.request })
|
||||
.field("response", unsafe { &self.response })
|
||||
.field("data", unsafe { &self.data })
|
||||
|
@ -291,7 +299,14 @@ impl ::std::fmt::Debug for GstRTSPMessage_type_data {
|
|||
}
|
||||
|
||||
// Callbacks
|
||||
pub type GstRTSPConnectionAcceptCertificateFunc = Option<unsafe extern "C" fn(*mut gio::GTlsConnection, *mut gio::GTlsCertificate, gio::GTlsCertificateFlags, gpointer) -> gboolean>;
|
||||
pub type GstRTSPConnectionAcceptCertificateFunc = Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut gio::GTlsConnection,
|
||||
*mut gio::GTlsCertificate,
|
||||
gio::GTlsCertificateFlags,
|
||||
gpointer,
|
||||
) -> gboolean,
|
||||
>;
|
||||
|
||||
// Records
|
||||
#[repr(C)]
|
||||
|
@ -337,22 +352,56 @@ pub type GstRTSPConnection = *mut _GstRTSPConnection;
|
|||
#[derive(Copy, Clone)]
|
||||
pub struct GstRTSPExtensionInterface {
|
||||
pub parent: gobject::GTypeInterface,
|
||||
pub detect_server: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage) -> gboolean>,
|
||||
pub before_send: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage) -> GstRTSPResult>,
|
||||
pub after_send: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage, *mut GstRTSPMessage) -> GstRTSPResult>,
|
||||
pub parse_sdp: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut gst_sdp::GstSDPMessage, *mut gst::GstStructure) -> GstRTSPResult>,
|
||||
pub setup_media: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut gst_sdp::GstSDPMedia) -> GstRTSPResult>,
|
||||
pub configure_stream: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut gst::GstCaps) -> gboolean>,
|
||||
pub get_transports: Option<unsafe extern "C" fn(*mut GstRTSPExtension, GstRTSPLowerTrans, *mut *mut c_char) -> GstRTSPResult>,
|
||||
pub stream_select: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPUrl) -> GstRTSPResult>,
|
||||
pub send: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage, *mut GstRTSPMessage) -> GstRTSPResult>,
|
||||
pub receive_request: Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage) -> GstRTSPResult>,
|
||||
pub detect_server:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage) -> gboolean>,
|
||||
pub before_send:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage) -> GstRTSPResult>,
|
||||
pub after_send: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstRTSPExtension,
|
||||
*mut GstRTSPMessage,
|
||||
*mut GstRTSPMessage,
|
||||
) -> GstRTSPResult,
|
||||
>,
|
||||
pub parse_sdp: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstRTSPExtension,
|
||||
*mut gst_sdp::GstSDPMessage,
|
||||
*mut gst::GstStructure,
|
||||
) -> GstRTSPResult,
|
||||
>,
|
||||
pub setup_media: Option<
|
||||
unsafe extern "C" fn(*mut GstRTSPExtension, *mut gst_sdp::GstSDPMedia) -> GstRTSPResult,
|
||||
>,
|
||||
pub configure_stream:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut gst::GstCaps) -> gboolean>,
|
||||
pub get_transports: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstRTSPExtension,
|
||||
GstRTSPLowerTrans,
|
||||
*mut *mut c_char,
|
||||
) -> GstRTSPResult,
|
||||
>,
|
||||
pub stream_select:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPUrl) -> GstRTSPResult>,
|
||||
pub send: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstRTSPExtension,
|
||||
*mut GstRTSPMessage,
|
||||
*mut GstRTSPMessage,
|
||||
) -> GstRTSPResult,
|
||||
>,
|
||||
pub receive_request:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPExtension, *mut GstRTSPMessage) -> GstRTSPResult>,
|
||||
pub _gst_reserved: [gpointer; 4],
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for GstRTSPExtensionInterface {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstRTSPExtensionInterface @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstRTSPExtensionInterface @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent", &self.parent)
|
||||
.field("detect_server", &self.detect_server)
|
||||
.field("before_send", &self.before_send)
|
||||
|
@ -397,7 +446,10 @@ pub struct GstRTSPMessage_type_data_data {
|
|||
|
||||
impl ::std::fmt::Debug for GstRTSPMessage_type_data_data {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstRTSPMessage_type_data_data @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstRTSPMessage_type_data_data @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("channel", &self.channel)
|
||||
.finish()
|
||||
}
|
||||
|
@ -413,7 +465,10 @@ pub struct GstRTSPMessage_type_data_request {
|
|||
|
||||
impl ::std::fmt::Debug for GstRTSPMessage_type_data_request {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstRTSPMessage_type_data_request @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstRTSPMessage_type_data_request @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("method", &self.method)
|
||||
.field("uri", &self.uri)
|
||||
.field("version", &self.version)
|
||||
|
@ -431,7 +486,10 @@ pub struct GstRTSPMessage_type_data_response {
|
|||
|
||||
impl ::std::fmt::Debug for GstRTSPMessage_type_data_response {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstRTSPMessage_type_data_response @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstRTSPMessage_type_data_response @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("code", &self.code)
|
||||
.field("reason", &self.reason)
|
||||
.field("version", &self.version)
|
||||
|
@ -592,15 +650,35 @@ pub type GstRTSPWatch = *mut _GstRTSPWatch;
|
|||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct GstRTSPWatchFuncs {
|
||||
pub message_received: Option<unsafe extern "C" fn(*mut GstRTSPWatch, *mut GstRTSPMessage, gpointer) -> GstRTSPResult>,
|
||||
pub message_sent: Option<unsafe extern "C" fn(*mut GstRTSPWatch, c_uint, gpointer) -> GstRTSPResult>,
|
||||
pub message_received: Option<
|
||||
unsafe extern "C" fn(*mut GstRTSPWatch, *mut GstRTSPMessage, gpointer) -> GstRTSPResult,
|
||||
>,
|
||||
pub message_sent:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPWatch, c_uint, gpointer) -> GstRTSPResult>,
|
||||
pub closed: Option<unsafe extern "C" fn(*mut GstRTSPWatch, gpointer) -> GstRTSPResult>,
|
||||
pub error: Option<unsafe extern "C" fn(*mut GstRTSPWatch, GstRTSPResult, gpointer) -> GstRTSPResult>,
|
||||
pub tunnel_start: Option<unsafe extern "C" fn(*mut GstRTSPWatch, gpointer) -> GstRTSPStatusCode>,
|
||||
pub error:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPWatch, GstRTSPResult, gpointer) -> GstRTSPResult>,
|
||||
pub tunnel_start:
|
||||
Option<unsafe extern "C" fn(*mut GstRTSPWatch, gpointer) -> GstRTSPStatusCode>,
|
||||
pub tunnel_complete: Option<unsafe extern "C" fn(*mut GstRTSPWatch, gpointer) -> GstRTSPResult>,
|
||||
pub error_full: Option<unsafe extern "C" fn(*mut GstRTSPWatch, GstRTSPResult, *mut GstRTSPMessage, c_uint, gpointer) -> GstRTSPResult>,
|
||||
pub error_full: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstRTSPWatch,
|
||||
GstRTSPResult,
|
||||
*mut GstRTSPMessage,
|
||||
c_uint,
|
||||
gpointer,
|
||||
) -> GstRTSPResult,
|
||||
>,
|
||||
pub tunnel_lost: Option<unsafe extern "C" fn(*mut GstRTSPWatch, gpointer) -> GstRTSPResult>,
|
||||
pub tunnel_http_response: Option<unsafe extern "C" fn(*mut GstRTSPWatch, *mut GstRTSPMessage, *mut GstRTSPMessage, gpointer) -> GstRTSPResult>,
|
||||
pub tunnel_http_response: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstRTSPWatch,
|
||||
*mut GstRTSPMessage,
|
||||
*mut GstRTSPMessage,
|
||||
gpointer,
|
||||
) -> GstRTSPResult,
|
||||
>,
|
||||
pub _gst_reserved: [gpointer; 3],
|
||||
}
|
||||
|
||||
|
@ -630,7 +708,6 @@ impl ::std::fmt::Debug for GstRTSPExtension {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
//=========================================================================
|
||||
|
@ -727,111 +804,314 @@ extern "C" {
|
|||
//=========================================================================
|
||||
pub fn gst_rtsp_connection_clear_auth_params(conn: *mut GstRTSPConnection);
|
||||
pub fn gst_rtsp_connection_close(conn: *mut GstRTSPConnection) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_connect(conn: *mut GstRTSPConnection, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_connect(
|
||||
conn: *mut GstRTSPConnection,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_connect_with_response(conn: *mut GstRTSPConnection, timeout: *mut glib::GTimeVal, response: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_do_tunnel(conn: *mut GstRTSPConnection, conn2: *mut GstRTSPConnection) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_flush(conn: *mut GstRTSPConnection, flush: gboolean) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_connect_with_response(
|
||||
conn: *mut GstRTSPConnection,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
response: *mut GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_do_tunnel(
|
||||
conn: *mut GstRTSPConnection,
|
||||
conn2: *mut GstRTSPConnection,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_flush(
|
||||
conn: *mut GstRTSPConnection,
|
||||
flush: gboolean,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_free(conn: *mut GstRTSPConnection) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_get_ip(conn: *const GstRTSPConnection) -> *const c_char;
|
||||
pub fn gst_rtsp_connection_get_read_socket(conn: *const GstRTSPConnection) -> *mut gio::GSocket;
|
||||
pub fn gst_rtsp_connection_get_read_socket(conn: *const GstRTSPConnection)
|
||||
-> *mut gio::GSocket;
|
||||
pub fn gst_rtsp_connection_get_remember_session_id(conn: *mut GstRTSPConnection) -> gboolean;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_get_tls(conn: *mut GstRTSPConnection, error: *mut *mut glib::GError) -> *mut gio::GTlsConnection;
|
||||
pub fn gst_rtsp_connection_get_tls(
|
||||
conn: *mut GstRTSPConnection,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut gio::GTlsConnection;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_get_tls_database(conn: *mut GstRTSPConnection) -> *mut gio::GTlsDatabase;
|
||||
pub fn gst_rtsp_connection_get_tls_database(
|
||||
conn: *mut GstRTSPConnection,
|
||||
) -> *mut gio::GTlsDatabase;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_get_tls_interaction(conn: *mut GstRTSPConnection) -> *mut gio::GTlsInteraction;
|
||||
pub fn gst_rtsp_connection_get_tls_interaction(
|
||||
conn: *mut GstRTSPConnection,
|
||||
) -> *mut gio::GTlsInteraction;
|
||||
#[cfg(any(feature = "v1_2_1", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_get_tls_validation_flags(conn: *mut GstRTSPConnection) -> gio::GTlsCertificateFlags;
|
||||
pub fn gst_rtsp_connection_get_tls_validation_flags(
|
||||
conn: *mut GstRTSPConnection,
|
||||
) -> gio::GTlsCertificateFlags;
|
||||
pub fn gst_rtsp_connection_get_tunnelid(conn: *const GstRTSPConnection) -> *const c_char;
|
||||
pub fn gst_rtsp_connection_get_url(conn: *const GstRTSPConnection) -> *mut GstRTSPUrl;
|
||||
pub fn gst_rtsp_connection_get_write_socket(conn: *const GstRTSPConnection) -> *mut gio::GSocket;
|
||||
pub fn gst_rtsp_connection_get_write_socket(
|
||||
conn: *const GstRTSPConnection,
|
||||
) -> *mut gio::GSocket;
|
||||
pub fn gst_rtsp_connection_is_tunneled(conn: *const GstRTSPConnection) -> gboolean;
|
||||
pub fn gst_rtsp_connection_next_timeout(conn: *mut GstRTSPConnection, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_poll(conn: *mut GstRTSPConnection, events: GstRTSPEvent, revents: *mut GstRTSPEvent, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_read(conn: *mut GstRTSPConnection, data: *mut u8, size: c_uint, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_receive(conn: *mut GstRTSPConnection, message: *mut GstRTSPMessage, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_next_timeout(
|
||||
conn: *mut GstRTSPConnection,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_poll(
|
||||
conn: *mut GstRTSPConnection,
|
||||
events: GstRTSPEvent,
|
||||
revents: *mut GstRTSPEvent,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_read(
|
||||
conn: *mut GstRTSPConnection,
|
||||
data: *mut u8,
|
||||
size: c_uint,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_receive(
|
||||
conn: *mut GstRTSPConnection,
|
||||
message: *mut GstRTSPMessage,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_reset_timeout(conn: *mut GstRTSPConnection) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_send(conn: *mut GstRTSPConnection, message: *mut GstRTSPMessage, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_send(
|
||||
conn: *mut GstRTSPConnection,
|
||||
message: *mut GstRTSPMessage,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_send_messages(conn: *mut GstRTSPConnection, messages: *mut GstRTSPMessage, n_messages: c_uint, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_send_messages(
|
||||
conn: *mut GstRTSPConnection,
|
||||
messages: *mut GstRTSPMessage,
|
||||
n_messages: c_uint,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_set_accept_certificate_func(conn: *mut GstRTSPConnection, func: GstRTSPConnectionAcceptCertificateFunc, user_data: gpointer, destroy_notify: glib::GDestroyNotify);
|
||||
pub fn gst_rtsp_connection_set_auth(conn: *mut GstRTSPConnection, method: GstRTSPAuthMethod, user: *const c_char, pass: *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_set_auth_param(conn: *mut GstRTSPConnection, param: *const c_char, value: *const c_char);
|
||||
pub fn gst_rtsp_connection_set_accept_certificate_func(
|
||||
conn: *mut GstRTSPConnection,
|
||||
func: GstRTSPConnectionAcceptCertificateFunc,
|
||||
user_data: gpointer,
|
||||
destroy_notify: glib::GDestroyNotify,
|
||||
);
|
||||
pub fn gst_rtsp_connection_set_auth(
|
||||
conn: *mut GstRTSPConnection,
|
||||
method: GstRTSPAuthMethod,
|
||||
user: *const c_char,
|
||||
pass: *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_set_auth_param(
|
||||
conn: *mut GstRTSPConnection,
|
||||
param: *const c_char,
|
||||
value: *const c_char,
|
||||
);
|
||||
pub fn gst_rtsp_connection_set_http_mode(conn: *mut GstRTSPConnection, enable: gboolean);
|
||||
pub fn gst_rtsp_connection_set_ip(conn: *mut GstRTSPConnection, ip: *const c_char);
|
||||
pub fn gst_rtsp_connection_set_proxy(conn: *mut GstRTSPConnection, host: *const c_char, port: c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_set_qos_dscp(conn: *mut GstRTSPConnection, qos_dscp: c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_set_remember_session_id(conn: *mut GstRTSPConnection, remember: gboolean);
|
||||
pub fn gst_rtsp_connection_set_proxy(
|
||||
conn: *mut GstRTSPConnection,
|
||||
host: *const c_char,
|
||||
port: c_uint,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_set_qos_dscp(
|
||||
conn: *mut GstRTSPConnection,
|
||||
qos_dscp: c_uint,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_set_remember_session_id(
|
||||
conn: *mut GstRTSPConnection,
|
||||
remember: gboolean,
|
||||
);
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_set_tls_database(conn: *mut GstRTSPConnection, database: *mut gio::GTlsDatabase);
|
||||
pub fn gst_rtsp_connection_set_tls_database(
|
||||
conn: *mut GstRTSPConnection,
|
||||
database: *mut gio::GTlsDatabase,
|
||||
);
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_set_tls_interaction(conn: *mut GstRTSPConnection, interaction: *mut gio::GTlsInteraction);
|
||||
pub fn gst_rtsp_connection_set_tls_interaction(
|
||||
conn: *mut GstRTSPConnection,
|
||||
interaction: *mut gio::GTlsInteraction,
|
||||
);
|
||||
#[cfg(any(feature = "v1_2_1", feature = "dox"))]
|
||||
pub fn gst_rtsp_connection_set_tls_validation_flags(conn: *mut GstRTSPConnection, flags: gio::GTlsCertificateFlags) -> gboolean;
|
||||
pub fn gst_rtsp_connection_set_tls_validation_flags(
|
||||
conn: *mut GstRTSPConnection,
|
||||
flags: gio::GTlsCertificateFlags,
|
||||
) -> gboolean;
|
||||
pub fn gst_rtsp_connection_set_tunneled(conn: *mut GstRTSPConnection, tunneled: gboolean);
|
||||
pub fn gst_rtsp_connection_write(conn: *mut GstRTSPConnection, data: *const u8, size: c_uint, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_accept(socket: *mut gio::GSocket, conn: *mut *mut GstRTSPConnection, cancellable: *mut gio::GCancellable) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_create(url: *const GstRTSPUrl, conn: *mut *mut GstRTSPConnection) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_create_from_socket(socket: *mut gio::GSocket, ip: *const c_char, port: u16, initial_buffer: *const c_char, conn: *mut *mut GstRTSPConnection) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_write(
|
||||
conn: *mut GstRTSPConnection,
|
||||
data: *const u8,
|
||||
size: c_uint,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_accept(
|
||||
socket: *mut gio::GSocket,
|
||||
conn: *mut *mut GstRTSPConnection,
|
||||
cancellable: *mut gio::GCancellable,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_create(
|
||||
url: *const GstRTSPUrl,
|
||||
conn: *mut *mut GstRTSPConnection,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_connection_create_from_socket(
|
||||
socket: *mut gio::GSocket,
|
||||
ip: *const c_char,
|
||||
port: u16,
|
||||
initial_buffer: *const c_char,
|
||||
conn: *mut *mut GstRTSPConnection,
|
||||
) -> GstRTSPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstRTSPMessage
|
||||
//=========================================================================
|
||||
pub fn gst_rtsp_msg_get_type() -> GType;
|
||||
pub fn gst_rtsp_message_add_header(msg: *mut GstRTSPMessage, field: GstRTSPHeaderField, value: *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_add_header(
|
||||
msg: *mut GstRTSPMessage,
|
||||
field: GstRTSPHeaderField,
|
||||
value: *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_add_header_by_name(msg: *mut GstRTSPMessage, header: *const c_char, value: *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_append_headers(msg: *const GstRTSPMessage, str: *mut glib::GString) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_add_header_by_name(
|
||||
msg: *mut GstRTSPMessage,
|
||||
header: *const c_char,
|
||||
value: *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_append_headers(
|
||||
msg: *const GstRTSPMessage,
|
||||
str: *mut glib::GString,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_copy(msg: *const GstRTSPMessage, copy: *mut *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_copy(
|
||||
msg: *const GstRTSPMessage,
|
||||
copy: *mut *mut GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_dump(msg: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_free(msg: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_body(msg: *const GstRTSPMessage, data: *mut *mut u8, size: *mut c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_body(
|
||||
msg: *const GstRTSPMessage,
|
||||
data: *mut *mut u8,
|
||||
size: *mut c_uint,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_get_body_buffer(msg: *const GstRTSPMessage, buffer: *mut *mut gst::GstBuffer) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_header(msg: *const GstRTSPMessage, field: GstRTSPHeaderField, value: *mut *mut c_char, indx: c_int) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_body_buffer(
|
||||
msg: *const GstRTSPMessage,
|
||||
buffer: *mut *mut gst::GstBuffer,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_header(
|
||||
msg: *const GstRTSPMessage,
|
||||
field: GstRTSPHeaderField,
|
||||
value: *mut *mut c_char,
|
||||
indx: c_int,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_get_header_by_name(msg: *mut GstRTSPMessage, header: *const c_char, value: *mut *mut c_char, index: c_int) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_header_by_name(
|
||||
msg: *mut GstRTSPMessage,
|
||||
header: *const c_char,
|
||||
value: *mut *mut c_char,
|
||||
index: c_int,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_get_type(msg: *mut GstRTSPMessage) -> GstRTSPMsgType;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_has_body_buffer(msg: *const GstRTSPMessage) -> gboolean;
|
||||
pub fn gst_rtsp_message_init(msg: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_init_data(msg: *mut GstRTSPMessage, channel: u8) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_init_request(msg: *mut GstRTSPMessage, method: GstRTSPMethod, uri: *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_init_response(msg: *mut GstRTSPMessage, code: GstRTSPStatusCode, reason: *const c_char, request: *const GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_init_request(
|
||||
msg: *mut GstRTSPMessage,
|
||||
method: GstRTSPMethod,
|
||||
uri: *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_init_response(
|
||||
msg: *mut GstRTSPMessage,
|
||||
code: GstRTSPStatusCode,
|
||||
reason: *const c_char,
|
||||
request: *const GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_parse_auth_credentials(msg: *mut GstRTSPMessage, field: GstRTSPHeaderField) -> *mut *mut GstRTSPAuthCredential;
|
||||
pub fn gst_rtsp_message_parse_data(msg: *mut GstRTSPMessage, channel: *mut u8) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_parse_request(msg: *mut GstRTSPMessage, method: *mut GstRTSPMethod, uri: *mut *const c_char, version: *mut GstRTSPVersion) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_parse_response(msg: *mut GstRTSPMessage, code: *mut GstRTSPStatusCode, reason: *mut *const c_char, version: *mut GstRTSPVersion) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_remove_header(msg: *mut GstRTSPMessage, field: GstRTSPHeaderField, indx: c_int) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_parse_auth_credentials(
|
||||
msg: *mut GstRTSPMessage,
|
||||
field: GstRTSPHeaderField,
|
||||
) -> *mut *mut GstRTSPAuthCredential;
|
||||
pub fn gst_rtsp_message_parse_data(msg: *mut GstRTSPMessage, channel: *mut u8)
|
||||
-> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_parse_request(
|
||||
msg: *mut GstRTSPMessage,
|
||||
method: *mut GstRTSPMethod,
|
||||
uri: *mut *const c_char,
|
||||
version: *mut GstRTSPVersion,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_parse_response(
|
||||
msg: *mut GstRTSPMessage,
|
||||
code: *mut GstRTSPStatusCode,
|
||||
reason: *mut *const c_char,
|
||||
version: *mut GstRTSPVersion,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_remove_header(
|
||||
msg: *mut GstRTSPMessage,
|
||||
field: GstRTSPHeaderField,
|
||||
indx: c_int,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_remove_header_by_name(msg: *mut GstRTSPMessage, header: *const c_char, index: c_int) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_set_body(msg: *mut GstRTSPMessage, data: *const u8, size: c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_remove_header_by_name(
|
||||
msg: *mut GstRTSPMessage,
|
||||
header: *const c_char,
|
||||
index: c_int,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_set_body(
|
||||
msg: *mut GstRTSPMessage,
|
||||
data: *const u8,
|
||||
size: c_uint,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_set_body_buffer(msg: *mut GstRTSPMessage, buffer: *mut gst::GstBuffer) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_steal_body(msg: *mut GstRTSPMessage, data: *mut *mut u8, size: *mut c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_set_body_buffer(
|
||||
msg: *mut GstRTSPMessage,
|
||||
buffer: *mut gst::GstBuffer,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_steal_body(
|
||||
msg: *mut GstRTSPMessage,
|
||||
data: *mut *mut u8,
|
||||
size: *mut c_uint,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_steal_body_buffer(msg: *mut GstRTSPMessage, buffer: *mut *mut gst::GstBuffer) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_take_body(msg: *mut GstRTSPMessage, data: *mut u8, size: c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_steal_body_buffer(
|
||||
msg: *mut GstRTSPMessage,
|
||||
buffer: *mut *mut gst::GstBuffer,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_take_body(
|
||||
msg: *mut GstRTSPMessage,
|
||||
data: *mut u8,
|
||||
size: c_uint,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_take_body_buffer(msg: *mut GstRTSPMessage, buffer: *mut gst::GstBuffer) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_take_header(msg: *mut GstRTSPMessage, field: GstRTSPHeaderField, value: *mut c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_take_body_buffer(
|
||||
msg: *mut GstRTSPMessage,
|
||||
buffer: *mut gst::GstBuffer,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_take_header(
|
||||
msg: *mut GstRTSPMessage,
|
||||
field: GstRTSPHeaderField,
|
||||
value: *mut c_char,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_6", feature = "dox"))]
|
||||
pub fn gst_rtsp_message_take_header_by_name(msg: *mut GstRTSPMessage, header: *const c_char, value: *mut c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_take_header_by_name(
|
||||
msg: *mut GstRTSPMessage,
|
||||
header: *const c_char,
|
||||
value: *mut c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_unset(msg: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstRTSPRange
|
||||
//=========================================================================
|
||||
pub fn gst_rtsp_range_convert_units(range: *mut GstRTSPTimeRange, unit: GstRTSPRangeUnit) -> gboolean;
|
||||
pub fn gst_rtsp_range_convert_units(
|
||||
range: *mut GstRTSPTimeRange,
|
||||
unit: GstRTSPRangeUnit,
|
||||
) -> gboolean;
|
||||
pub fn gst_rtsp_range_free(range: *mut GstRTSPTimeRange);
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_rtsp_range_get_times(range: *const GstRTSPTimeRange, min: *mut gst::GstClockTime, max: *mut gst::GstClockTime) -> gboolean;
|
||||
pub fn gst_rtsp_range_parse(rangestr: *const c_char, range: *mut *mut GstRTSPTimeRange) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_range_get_times(
|
||||
range: *const GstRTSPTimeRange,
|
||||
min: *mut gst::GstClockTime,
|
||||
max: *mut gst::GstClockTime,
|
||||
) -> gboolean;
|
||||
pub fn gst_rtsp_range_parse(
|
||||
rangestr: *const c_char,
|
||||
range: *mut *mut GstRTSPTimeRange,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_range_to_string(range: *const GstRTSPTimeRange) -> *mut c_char;
|
||||
|
||||
//=========================================================================
|
||||
|
@ -840,12 +1120,25 @@ extern "C" {
|
|||
pub fn gst_rtsp_transport_as_text(transport: *mut GstRTSPTransport) -> *mut c_char;
|
||||
pub fn gst_rtsp_transport_free(transport: *mut GstRTSPTransport) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_rtsp_transport_get_media_type(transport: *mut GstRTSPTransport, media_type: *mut *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_get_media_type(
|
||||
transport: *mut GstRTSPTransport,
|
||||
media_type: *mut *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_init(transport: *mut GstRTSPTransport) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_get_manager(trans: GstRTSPTransMode, manager: *mut *const c_char, option: c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_get_mime(trans: GstRTSPTransMode, mime: *mut *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_get_manager(
|
||||
trans: GstRTSPTransMode,
|
||||
manager: *mut *const c_char,
|
||||
option: c_uint,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_get_mime(
|
||||
trans: GstRTSPTransMode,
|
||||
mime: *mut *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_new(transport: *mut *mut GstRTSPTransport) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_parse(str: *const c_char, transport: *mut GstRTSPTransport) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_transport_parse(
|
||||
str: *const c_char,
|
||||
transport: *mut GstRTSPTransport,
|
||||
) -> GstRTSPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstRTSPUrl
|
||||
|
@ -862,37 +1155,104 @@ extern "C" {
|
|||
//=========================================================================
|
||||
// GstRTSPWatch
|
||||
//=========================================================================
|
||||
pub fn gst_rtsp_watch_attach(watch: *mut GstRTSPWatch, context: *mut glib::GMainContext) -> c_uint;
|
||||
pub fn gst_rtsp_watch_attach(
|
||||
watch: *mut GstRTSPWatch,
|
||||
context: *mut glib::GMainContext,
|
||||
) -> c_uint;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_rtsp_watch_get_send_backlog(watch: *mut GstRTSPWatch, bytes: *mut size_t, messages: *mut c_uint);
|
||||
pub fn gst_rtsp_watch_get_send_backlog(
|
||||
watch: *mut GstRTSPWatch,
|
||||
bytes: *mut size_t,
|
||||
messages: *mut c_uint,
|
||||
);
|
||||
pub fn gst_rtsp_watch_reset(watch: *mut GstRTSPWatch);
|
||||
pub fn gst_rtsp_watch_send_message(watch: *mut GstRTSPWatch, message: *mut GstRTSPMessage, id: *mut c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_watch_send_message(
|
||||
watch: *mut GstRTSPWatch,
|
||||
message: *mut GstRTSPMessage,
|
||||
id: *mut c_uint,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_watch_send_messages(watch: *mut GstRTSPWatch, messages: *mut GstRTSPMessage, n_messages: c_uint, id: *mut c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_watch_send_messages(
|
||||
watch: *mut GstRTSPWatch,
|
||||
messages: *mut GstRTSPMessage,
|
||||
n_messages: c_uint,
|
||||
id: *mut c_uint,
|
||||
) -> GstRTSPResult;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_rtsp_watch_set_flushing(watch: *mut GstRTSPWatch, flushing: gboolean);
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_rtsp_watch_set_send_backlog(watch: *mut GstRTSPWatch, bytes: size_t, messages: c_uint);
|
||||
pub fn gst_rtsp_watch_set_send_backlog(
|
||||
watch: *mut GstRTSPWatch,
|
||||
bytes: size_t,
|
||||
messages: c_uint,
|
||||
);
|
||||
pub fn gst_rtsp_watch_unref(watch: *mut GstRTSPWatch);
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_rtsp_watch_wait_backlog(watch: *mut GstRTSPWatch, timeout: *mut glib::GTimeVal) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_watch_write_data(watch: *mut GstRTSPWatch, data: *const u8, size: c_uint, id: *mut c_uint) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_watch_new(conn: *mut GstRTSPConnection, funcs: *mut GstRTSPWatchFuncs, user_data: gpointer, notify: glib::GDestroyNotify) -> *mut GstRTSPWatch;
|
||||
pub fn gst_rtsp_watch_wait_backlog(
|
||||
watch: *mut GstRTSPWatch,
|
||||
timeout: *mut glib::GTimeVal,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_watch_write_data(
|
||||
watch: *mut GstRTSPWatch,
|
||||
data: *const u8,
|
||||
size: c_uint,
|
||||
id: *mut c_uint,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_watch_new(
|
||||
conn: *mut GstRTSPConnection,
|
||||
funcs: *mut GstRTSPWatchFuncs,
|
||||
user_data: gpointer,
|
||||
notify: glib::GDestroyNotify,
|
||||
) -> *mut GstRTSPWatch;
|
||||
|
||||
//=========================================================================
|
||||
// GstRTSPExtension
|
||||
//=========================================================================
|
||||
pub fn gst_rtsp_extension_get_type() -> GType;
|
||||
pub fn gst_rtsp_extension_after_send(ext: *mut GstRTSPExtension, req: *mut GstRTSPMessage, resp: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_before_send(ext: *mut GstRTSPExtension, req: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_configure_stream(ext: *mut GstRTSPExtension, caps: *mut gst::GstCaps) -> gboolean;
|
||||
pub fn gst_rtsp_extension_detect_server(ext: *mut GstRTSPExtension, resp: *mut GstRTSPMessage) -> gboolean;
|
||||
pub fn gst_rtsp_extension_get_transports(ext: *mut GstRTSPExtension, protocols: GstRTSPLowerTrans, transport: *mut *mut c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_parse_sdp(ext: *mut GstRTSPExtension, sdp: *mut gst_sdp::GstSDPMessage, s: *mut gst::GstStructure) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_receive_request(ext: *mut GstRTSPExtension, req: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_send(ext: *mut GstRTSPExtension, req: *mut GstRTSPMessage, resp: *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_setup_media(ext: *mut GstRTSPExtension, media: *mut gst_sdp::GstSDPMedia) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_stream_select(ext: *mut GstRTSPExtension, url: *mut GstRTSPUrl) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_after_send(
|
||||
ext: *mut GstRTSPExtension,
|
||||
req: *mut GstRTSPMessage,
|
||||
resp: *mut GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_before_send(
|
||||
ext: *mut GstRTSPExtension,
|
||||
req: *mut GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_configure_stream(
|
||||
ext: *mut GstRTSPExtension,
|
||||
caps: *mut gst::GstCaps,
|
||||
) -> gboolean;
|
||||
pub fn gst_rtsp_extension_detect_server(
|
||||
ext: *mut GstRTSPExtension,
|
||||
resp: *mut GstRTSPMessage,
|
||||
) -> gboolean;
|
||||
pub fn gst_rtsp_extension_get_transports(
|
||||
ext: *mut GstRTSPExtension,
|
||||
protocols: GstRTSPLowerTrans,
|
||||
transport: *mut *mut c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_parse_sdp(
|
||||
ext: *mut GstRTSPExtension,
|
||||
sdp: *mut gst_sdp::GstSDPMessage,
|
||||
s: *mut gst::GstStructure,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_receive_request(
|
||||
ext: *mut GstRTSPExtension,
|
||||
req: *mut GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_send(
|
||||
ext: *mut GstRTSPExtension,
|
||||
req: *mut GstRTSPMessage,
|
||||
resp: *mut GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_setup_media(
|
||||
ext: *mut GstRTSPExtension,
|
||||
media: *mut gst_sdp::GstSDPMedia,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_extension_stream_select(
|
||||
ext: *mut GstRTSPExtension,
|
||||
url: *mut GstRTSPUrl,
|
||||
) -> GstRTSPResult;
|
||||
|
||||
//=========================================================================
|
||||
// Other functions
|
||||
|
@ -902,15 +1262,38 @@ extern "C" {
|
|||
pub fn gst_rtsp_find_header_field(header: *const c_char) -> GstRTSPHeaderField;
|
||||
pub fn gst_rtsp_find_method(method: *const c_char) -> GstRTSPMethod;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
pub fn gst_rtsp_generate_digest_auth_response(algorithm: *const c_char, method: *const c_char, realm: *const c_char, username: *const c_char, password: *const c_char, uri: *const c_char, nonce: *const c_char) -> *mut c_char;
|
||||
pub fn gst_rtsp_generate_digest_auth_response(
|
||||
algorithm: *const c_char,
|
||||
method: *const c_char,
|
||||
realm: *const c_char,
|
||||
username: *const c_char,
|
||||
password: *const c_char,
|
||||
uri: *const c_char,
|
||||
nonce: *const c_char,
|
||||
) -> *mut c_char;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_rtsp_generate_digest_auth_response_from_md5(algorithm: *const c_char, method: *const c_char, md5: *const c_char, uri: *const c_char, nonce: *const c_char) -> *mut c_char;
|
||||
pub fn gst_rtsp_generate_digest_auth_response_from_md5(
|
||||
algorithm: *const c_char,
|
||||
method: *const c_char,
|
||||
md5: *const c_char,
|
||||
uri: *const c_char,
|
||||
nonce: *const c_char,
|
||||
) -> *mut c_char;
|
||||
pub fn gst_rtsp_header_allow_multiple(field: GstRTSPHeaderField) -> gboolean;
|
||||
pub fn gst_rtsp_header_as_text(field: GstRTSPHeaderField) -> *const c_char;
|
||||
pub fn gst_rtsp_message_new(msg: *mut *mut GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_new_data(msg: *mut *mut GstRTSPMessage, channel: u8) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_new_request(msg: *mut *mut GstRTSPMessage, method: GstRTSPMethod, uri: *const c_char) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_new_response(msg: *mut *mut GstRTSPMessage, code: GstRTSPStatusCode, reason: *const c_char, request: *const GstRTSPMessage) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_new_request(
|
||||
msg: *mut *mut GstRTSPMessage,
|
||||
method: GstRTSPMethod,
|
||||
uri: *const c_char,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_message_new_response(
|
||||
msg: *mut *mut GstRTSPMessage,
|
||||
code: GstRTSPStatusCode,
|
||||
reason: *const c_char,
|
||||
request: *const GstRTSPMessage,
|
||||
) -> GstRTSPResult;
|
||||
pub fn gst_rtsp_options_as_text(options: GstRTSPMethod) -> *mut c_char;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_rtsp_options_from_text(options: *const c_char) -> GstRTSPMethod;
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_rtsp_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_rtsp_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_rtsp_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-rtsp-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,47 +229,204 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstRTSPAuthCredential", Layout {size: size_of::<GstRTSPAuthCredential>(), alignment: align_of::<GstRTSPAuthCredential>()}),
|
||||
("GstRTSPAuthMethod", Layout {size: size_of::<GstRTSPAuthMethod>(), alignment: align_of::<GstRTSPAuthMethod>()}),
|
||||
("GstRTSPAuthParam", Layout {size: size_of::<GstRTSPAuthParam>(), alignment: align_of::<GstRTSPAuthParam>()}),
|
||||
("GstRTSPEvent", Layout {size: size_of::<GstRTSPEvent>(), alignment: align_of::<GstRTSPEvent>()}),
|
||||
("GstRTSPExtensionInterface", Layout {size: size_of::<GstRTSPExtensionInterface>(), alignment: align_of::<GstRTSPExtensionInterface>()}),
|
||||
("GstRTSPFamily", Layout {size: size_of::<GstRTSPFamily>(), alignment: align_of::<GstRTSPFamily>()}),
|
||||
("GstRTSPHeaderField", Layout {size: size_of::<GstRTSPHeaderField>(), alignment: align_of::<GstRTSPHeaderField>()}),
|
||||
("GstRTSPLowerTrans", Layout {size: size_of::<GstRTSPLowerTrans>(), alignment: align_of::<GstRTSPLowerTrans>()}),
|
||||
("GstRTSPMessage", Layout {size: size_of::<GstRTSPMessage>(), alignment: align_of::<GstRTSPMessage>()}),
|
||||
("GstRTSPMethod", Layout {size: size_of::<GstRTSPMethod>(), alignment: align_of::<GstRTSPMethod>()}),
|
||||
("GstRTSPMsgType", Layout {size: size_of::<GstRTSPMsgType>(), alignment: align_of::<GstRTSPMsgType>()}),
|
||||
("GstRTSPProfile", Layout {size: size_of::<GstRTSPProfile>(), alignment: align_of::<GstRTSPProfile>()}),
|
||||
("GstRTSPRange", Layout {size: size_of::<GstRTSPRange>(), alignment: align_of::<GstRTSPRange>()}),
|
||||
("GstRTSPRangeUnit", Layout {size: size_of::<GstRTSPRangeUnit>(), alignment: align_of::<GstRTSPRangeUnit>()}),
|
||||
("GstRTSPResult", Layout {size: size_of::<GstRTSPResult>(), alignment: align_of::<GstRTSPResult>()}),
|
||||
("GstRTSPState", Layout {size: size_of::<GstRTSPState>(), alignment: align_of::<GstRTSPState>()}),
|
||||
("GstRTSPStatusCode", Layout {size: size_of::<GstRTSPStatusCode>(), alignment: align_of::<GstRTSPStatusCode>()}),
|
||||
("GstRTSPTime", Layout {size: size_of::<GstRTSPTime>(), alignment: align_of::<GstRTSPTime>()}),
|
||||
("GstRTSPTime2", Layout {size: size_of::<GstRTSPTime2>(), alignment: align_of::<GstRTSPTime2>()}),
|
||||
("GstRTSPTimeRange", Layout {size: size_of::<GstRTSPTimeRange>(), alignment: align_of::<GstRTSPTimeRange>()}),
|
||||
("GstRTSPTimeType", Layout {size: size_of::<GstRTSPTimeType>(), alignment: align_of::<GstRTSPTimeType>()}),
|
||||
("GstRTSPTransMode", Layout {size: size_of::<GstRTSPTransMode>(), alignment: align_of::<GstRTSPTransMode>()}),
|
||||
("GstRTSPTransport", Layout {size: size_of::<GstRTSPTransport>(), alignment: align_of::<GstRTSPTransport>()}),
|
||||
("GstRTSPUrl", Layout {size: size_of::<GstRTSPUrl>(), alignment: align_of::<GstRTSPUrl>()}),
|
||||
("GstRTSPVersion", Layout {size: size_of::<GstRTSPVersion>(), alignment: align_of::<GstRTSPVersion>()}),
|
||||
("GstRTSPWatchFuncs", Layout {size: size_of::<GstRTSPWatchFuncs>(), alignment: align_of::<GstRTSPWatchFuncs>()}),
|
||||
(
|
||||
"GstRTSPAuthCredential",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAuthCredential>(),
|
||||
alignment: align_of::<GstRTSPAuthCredential>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAuthMethod",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAuthMethod>(),
|
||||
alignment: align_of::<GstRTSPAuthMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPAuthParam",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPAuthParam>(),
|
||||
alignment: align_of::<GstRTSPAuthParam>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPEvent",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPEvent>(),
|
||||
alignment: align_of::<GstRTSPEvent>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPExtensionInterface",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPExtensionInterface>(),
|
||||
alignment: align_of::<GstRTSPExtensionInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPFamily",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPFamily>(),
|
||||
alignment: align_of::<GstRTSPFamily>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPHeaderField",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPHeaderField>(),
|
||||
alignment: align_of::<GstRTSPHeaderField>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPLowerTrans",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPLowerTrans>(),
|
||||
alignment: align_of::<GstRTSPLowerTrans>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMessage",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMessage>(),
|
||||
alignment: align_of::<GstRTSPMessage>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMethod",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMethod>(),
|
||||
alignment: align_of::<GstRTSPMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPMsgType",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPMsgType>(),
|
||||
alignment: align_of::<GstRTSPMsgType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPProfile",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPProfile>(),
|
||||
alignment: align_of::<GstRTSPProfile>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPRange",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPRange>(),
|
||||
alignment: align_of::<GstRTSPRange>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPRangeUnit",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPRangeUnit>(),
|
||||
alignment: align_of::<GstRTSPRangeUnit>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPResult",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPResult>(),
|
||||
alignment: align_of::<GstRTSPResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPState",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPState>(),
|
||||
alignment: align_of::<GstRTSPState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPStatusCode",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPStatusCode>(),
|
||||
alignment: align_of::<GstRTSPStatusCode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTime",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTime>(),
|
||||
alignment: align_of::<GstRTSPTime>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTime2",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTime2>(),
|
||||
alignment: align_of::<GstRTSPTime2>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTimeRange",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTimeRange>(),
|
||||
alignment: align_of::<GstRTSPTimeRange>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTimeType",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTimeType>(),
|
||||
alignment: align_of::<GstRTSPTimeType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTransMode",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTransMode>(),
|
||||
alignment: align_of::<GstRTSPTransMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPTransport",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPTransport>(),
|
||||
alignment: align_of::<GstRTSPTransport>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPUrl",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPUrl>(),
|
||||
alignment: align_of::<GstRTSPUrl>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPVersion",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPVersion>(),
|
||||
alignment: align_of::<GstRTSPVersion>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstRTSPWatchFuncs",
|
||||
Layout {
|
||||
size: size_of::<GstRTSPWatchFuncs>(),
|
||||
alignment: align_of::<GstRTSPWatchFuncs>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -435,7 +598,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_RTSP_STS_FORBIDDEN", "403"),
|
||||
("(gint) GST_RTSP_STS_GATEWAY_TIMEOUT", "504"),
|
||||
("(gint) GST_RTSP_STS_GONE", "410"),
|
||||
("(gint) GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE", "456"),
|
||||
(
|
||||
"(gint) GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE",
|
||||
"456",
|
||||
),
|
||||
("(gint) GST_RTSP_STS_INTERNAL_SERVER_ERROR", "500"),
|
||||
("(gint) GST_RTSP_STS_INVALID", "0"),
|
||||
("(gint) GST_RTSP_STS_INVALID_RANGE", "457"),
|
||||
|
@ -453,7 +619,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_RTSP_STS_NOT_IMPLEMENTED", "501"),
|
||||
("(gint) GST_RTSP_STS_NOT_MODIFIED", "304"),
|
||||
("(gint) GST_RTSP_STS_OK", "200"),
|
||||
("(gint) GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED", "460"),
|
||||
(
|
||||
"(gint) GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED",
|
||||
"460",
|
||||
),
|
||||
("(gint) GST_RTSP_STS_OPTION_NOT_SUPPORTED", "551"),
|
||||
("(gint) GST_RTSP_STS_PARAMETER_IS_READONLY", "458"),
|
||||
("(gint) GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD", "451"),
|
||||
|
@ -485,5 +654,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_RTSP_VERSION_2_0", "32"),
|
||||
("(gint) GST_RTSP_VERSION_INVALID", "0"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -541,55 +546,126 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_new() -> *mut GstMIKEYMessage;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_new_from_bytes(bytes: *mut glib::GBytes, info: *mut GstMIKEYDecryptInfo, error: *mut *mut glib::GError) -> *mut GstMIKEYMessage;
|
||||
pub fn gst_mikey_message_new_from_bytes(
|
||||
bytes: *mut glib::GBytes,
|
||||
info: *mut GstMIKEYDecryptInfo,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstMIKEYMessage;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_mikey_message_new_from_caps(caps: *mut gst::GstCaps) -> *mut GstMIKEYMessage;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_new_from_data(data: gconstpointer, size: size_t, info: *mut GstMIKEYDecryptInfo, error: *mut *mut glib::GError) -> *mut GstMIKEYMessage;
|
||||
pub fn gst_mikey_message_new_from_data(
|
||||
data: gconstpointer,
|
||||
size: size_t,
|
||||
info: *mut GstMIKEYDecryptInfo,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut GstMIKEYMessage;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_cs_srtp(msg: *mut GstMIKEYMessage, policy: u8, ssrc: u32, roc: u32) -> gboolean;
|
||||
pub fn gst_mikey_message_add_cs_srtp(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
policy: u8,
|
||||
ssrc: u32,
|
||||
roc: u32,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_payload(msg: *mut GstMIKEYMessage, payload: *mut GstMIKEYPayload) -> gboolean;
|
||||
pub fn gst_mikey_message_add_payload(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
payload: *mut GstMIKEYPayload,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_pke(msg: *mut GstMIKEYMessage, C: GstMIKEYCacheType, data_len: u16, data: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_message_add_pke(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
C: GstMIKEYCacheType,
|
||||
data_len: u16,
|
||||
data: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_rand(msg: *mut GstMIKEYMessage, len: u8, rand: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_message_add_rand(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
len: u8,
|
||||
rand: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_rand_len(msg: *mut GstMIKEYMessage, len: u8) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_t(msg: *mut GstMIKEYMessage, type_: GstMIKEYTSType, ts_value: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_message_add_t(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
type_: GstMIKEYTSType,
|
||||
ts_value: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_add_t_now_ntp_utc(msg: *mut GstMIKEYMessage) -> gboolean;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_mikey_message_base64_encode(msg: *mut GstMIKEYMessage) -> *mut c_char;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_find_payload(msg: *const GstMIKEYMessage, type_: GstMIKEYPayloadType, nth: c_uint) -> *const GstMIKEYPayload;
|
||||
pub fn gst_mikey_message_find_payload(
|
||||
msg: *const GstMIKEYMessage,
|
||||
type_: GstMIKEYPayloadType,
|
||||
nth: c_uint,
|
||||
) -> *const GstMIKEYPayload;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_get_cs_srtp(msg: *const GstMIKEYMessage, idx: c_uint) -> *const GstMIKEYMapSRTP;
|
||||
pub fn gst_mikey_message_get_cs_srtp(
|
||||
msg: *const GstMIKEYMessage,
|
||||
idx: c_uint,
|
||||
) -> *const GstMIKEYMapSRTP;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_get_n_cs(msg: *const GstMIKEYMessage) -> c_uint;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_get_n_payloads(msg: *const GstMIKEYMessage) -> c_uint;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_get_payload(msg: *const GstMIKEYMessage, idx: c_uint) -> *const GstMIKEYPayload;
|
||||
pub fn gst_mikey_message_get_payload(
|
||||
msg: *const GstMIKEYMessage,
|
||||
idx: c_uint,
|
||||
) -> *const GstMIKEYPayload;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_insert_cs_srtp(msg: *mut GstMIKEYMessage, idx: c_int, map: *const GstMIKEYMapSRTP) -> gboolean;
|
||||
pub fn gst_mikey_message_insert_cs_srtp(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
idx: c_int,
|
||||
map: *const GstMIKEYMapSRTP,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_insert_payload(msg: *mut GstMIKEYMessage, idx: c_uint, payload: *mut GstMIKEYPayload) -> gboolean;
|
||||
pub fn gst_mikey_message_insert_payload(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
idx: c_uint,
|
||||
payload: *mut GstMIKEYPayload,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_remove_cs_srtp(msg: *mut GstMIKEYMessage, idx: c_int) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_remove_payload(msg: *mut GstMIKEYMessage, idx: c_uint) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_replace_cs_srtp(msg: *mut GstMIKEYMessage, idx: c_int, map: *const GstMIKEYMapSRTP) -> gboolean;
|
||||
pub fn gst_mikey_message_replace_cs_srtp(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
idx: c_int,
|
||||
map: *const GstMIKEYMapSRTP,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_replace_payload(msg: *mut GstMIKEYMessage, idx: c_uint, payload: *mut GstMIKEYPayload) -> gboolean;
|
||||
pub fn gst_mikey_message_replace_payload(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
idx: c_uint,
|
||||
payload: *mut GstMIKEYPayload,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_set_info(msg: *mut GstMIKEYMessage, version: u8, type_: GstMIKEYType, V: gboolean, prf_func: GstMIKEYPRFFunc, CSB_id: u32, map_type: GstMIKEYMapType) -> gboolean;
|
||||
pub fn gst_mikey_message_set_info(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
version: u8,
|
||||
type_: GstMIKEYType,
|
||||
V: gboolean,
|
||||
prf_func: GstMIKEYPRFFunc,
|
||||
CSB_id: u32,
|
||||
map_type: GstMIKEYMapType,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_message_to_bytes(msg: *mut GstMIKEYMessage, info: *mut GstMIKEYEncryptInfo, error: *mut *mut glib::GError) -> *mut glib::GBytes;
|
||||
pub fn gst_mikey_message_to_bytes(
|
||||
msg: *mut GstMIKEYMessage,
|
||||
info: *mut GstMIKEYEncryptInfo,
|
||||
error: *mut *mut glib::GError,
|
||||
) -> *mut glib::GBytes;
|
||||
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
|
||||
pub fn gst_mikey_message_to_caps(msg: *const GstMIKEYMessage, caps: *mut gst::GstCaps) -> gboolean;
|
||||
pub fn gst_mikey_message_to_caps(
|
||||
msg: *const GstMIKEYMessage,
|
||||
caps: *mut gst::GstCaps,
|
||||
) -> gboolean;
|
||||
|
||||
//=========================================================================
|
||||
// GstMIKEYPayload
|
||||
|
@ -598,39 +674,99 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_new(type_: GstMIKEYPayloadType) -> *mut GstMIKEYPayload;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_kemac_add_sub(payload: *mut GstMIKEYPayload, newpay: *mut GstMIKEYPayload) -> gboolean;
|
||||
pub fn gst_mikey_payload_kemac_add_sub(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
newpay: *mut GstMIKEYPayload,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_kemac_get_n_sub(payload: *const GstMIKEYPayload) -> c_uint;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_kemac_get_sub(payload: *const GstMIKEYPayload, idx: c_uint) -> *const GstMIKEYPayload;
|
||||
pub fn gst_mikey_payload_kemac_get_sub(
|
||||
payload: *const GstMIKEYPayload,
|
||||
idx: c_uint,
|
||||
) -> *const GstMIKEYPayload;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_kemac_remove_sub(payload: *mut GstMIKEYPayload, idx: c_uint) -> gboolean;
|
||||
pub fn gst_mikey_payload_kemac_remove_sub(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
idx: c_uint,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_kemac_set(payload: *mut GstMIKEYPayload, enc_alg: GstMIKEYEncAlg, mac_alg: GstMIKEYMacAlg) -> gboolean;
|
||||
pub fn gst_mikey_payload_kemac_set(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
enc_alg: GstMIKEYEncAlg,
|
||||
mac_alg: GstMIKEYMacAlg,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_key_data_set_interval(payload: *mut GstMIKEYPayload, vf_len: u8, vf_data: *const u8, vt_len: u8, vt_data: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_key_data_set_interval(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
vf_len: u8,
|
||||
vf_data: *const u8,
|
||||
vt_len: u8,
|
||||
vt_data: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_key_data_set_key(payload: *mut GstMIKEYPayload, key_type: GstMIKEYKeyDataType, key_len: u16, key_data: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_key_data_set_key(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
key_type: GstMIKEYKeyDataType,
|
||||
key_len: u16,
|
||||
key_data: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_key_data_set_salt(payload: *mut GstMIKEYPayload, salt_len: u16, salt_data: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_key_data_set_salt(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
salt_len: u16,
|
||||
salt_data: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_key_data_set_spi(payload: *mut GstMIKEYPayload, spi_len: u8, spi_data: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_key_data_set_spi(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
spi_len: u8,
|
||||
spi_data: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_pke_set(payload: *mut GstMIKEYPayload, C: GstMIKEYCacheType, data_len: u16, data: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_pke_set(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
C: GstMIKEYCacheType,
|
||||
data_len: u16,
|
||||
data: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_rand_set(payload: *mut GstMIKEYPayload, len: u8, rand: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_rand_set(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
len: u8,
|
||||
rand: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_sp_add_param(payload: *mut GstMIKEYPayload, type_: u8, len: u8, val: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_sp_add_param(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
type_: u8,
|
||||
len: u8,
|
||||
val: *const u8,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_sp_get_n_params(payload: *const GstMIKEYPayload) -> c_uint;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_sp_get_param(payload: *const GstMIKEYPayload, idx: c_uint) -> *const GstMIKEYPayloadSPParam;
|
||||
pub fn gst_mikey_payload_sp_get_param(
|
||||
payload: *const GstMIKEYPayload,
|
||||
idx: c_uint,
|
||||
) -> *const GstMIKEYPayloadSPParam;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_sp_remove_param(payload: *mut GstMIKEYPayload, idx: c_uint) -> gboolean;
|
||||
pub fn gst_mikey_payload_sp_remove_param(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
idx: c_uint,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_sp_set(payload: *mut GstMIKEYPayload, policy: c_uint, proto: GstMIKEYSecProto) -> gboolean;
|
||||
pub fn gst_mikey_payload_sp_set(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
policy: c_uint,
|
||||
proto: GstMIKEYSecProto,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_4", feature = "dox"))]
|
||||
pub fn gst_mikey_payload_t_set(payload: *mut GstMIKEYPayload, type_: GstMIKEYTSType, ts_value: *const u8) -> gboolean;
|
||||
pub fn gst_mikey_payload_t_set(
|
||||
payload: *mut GstMIKEYPayload,
|
||||
type_: GstMIKEYTSType,
|
||||
ts_value: *const u8,
|
||||
) -> gboolean;
|
||||
|
||||
//=========================================================================
|
||||
// GstSDPAttribute
|
||||
|
@ -638,7 +774,11 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_attribute_clear(attr: *mut GstSDPAttribute) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_attribute_set(attr: *mut GstSDPAttribute, key: *const c_char, value: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_attribute_set(
|
||||
attr: *mut GstSDPAttribute,
|
||||
key: *const c_char,
|
||||
value: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstSDPBandwidth
|
||||
|
@ -646,7 +786,11 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_bandwidth_clear(bw: *mut GstSDPBandwidth) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_bandwidth_set(bw: *mut GstSDPBandwidth, bwtype: *const c_char, bandwidth: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_bandwidth_set(
|
||||
bw: *mut GstSDPBandwidth,
|
||||
bwtype: *const c_char,
|
||||
bandwidth: c_uint,
|
||||
) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstSDPConnection
|
||||
|
@ -654,32 +798,80 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_connection_clear(conn: *mut GstSDPConnection) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_connection_set(conn: *mut GstSDPConnection, nettype: *const c_char, addrtype: *const c_char, address: *const c_char, ttl: c_uint, addr_number: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_connection_set(
|
||||
conn: *mut GstSDPConnection,
|
||||
nettype: *const c_char,
|
||||
addrtype: *const c_char,
|
||||
address: *const c_char,
|
||||
ttl: c_uint,
|
||||
addr_number: c_uint,
|
||||
) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstSDPMedia
|
||||
//=========================================================================
|
||||
pub fn gst_sdp_media_add_attribute(media: *mut GstSDPMedia, key: *const c_char, value: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_bandwidth(media: *mut GstSDPMedia, bwtype: *const c_char, bandwidth: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_connection(media: *mut GstSDPMedia, nettype: *const c_char, addrtype: *const c_char, address: *const c_char, ttl: c_uint, addr_number: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_format(media: *mut GstSDPMedia, format: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_attribute(
|
||||
media: *mut GstSDPMedia,
|
||||
key: *const c_char,
|
||||
value: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_bandwidth(
|
||||
media: *mut GstSDPMedia,
|
||||
bwtype: *const c_char,
|
||||
bandwidth: c_uint,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_connection(
|
||||
media: *mut GstSDPMedia,
|
||||
nettype: *const c_char,
|
||||
addrtype: *const c_char,
|
||||
address: *const c_char,
|
||||
ttl: c_uint,
|
||||
addr_number: c_uint,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_add_format(media: *mut GstSDPMedia, format: *const c_char)
|
||||
-> GstSDPResult;
|
||||
pub fn gst_sdp_media_as_text(media: *const GstSDPMedia) -> *mut c_char;
|
||||
pub fn gst_sdp_media_attributes_len(media: *const GstSDPMedia) -> c_uint;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_sdp_media_attributes_to_caps(media: *const GstSDPMedia, caps: *mut gst::GstCaps) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_attributes_to_caps(
|
||||
media: *const GstSDPMedia,
|
||||
caps: *mut gst::GstCaps,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_bandwidths_len(media: *const GstSDPMedia) -> c_uint;
|
||||
pub fn gst_sdp_media_connections_len(media: *const GstSDPMedia) -> c_uint;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_copy(media: *const GstSDPMedia, copy: *mut *mut GstSDPMedia) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_copy(
|
||||
media: *const GstSDPMedia,
|
||||
copy: *mut *mut GstSDPMedia,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_formats_len(media: *const GstSDPMedia) -> c_uint;
|
||||
pub fn gst_sdp_media_free(media: *mut GstSDPMedia) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_get_attribute(media: *const GstSDPMedia, idx: c_uint) -> *const GstSDPAttribute;
|
||||
pub fn gst_sdp_media_get_attribute_val(media: *const GstSDPMedia, key: *const c_char) -> *const c_char;
|
||||
pub fn gst_sdp_media_get_attribute_val_n(media: *const GstSDPMedia, key: *const c_char, nth: c_uint) -> *const c_char;
|
||||
pub fn gst_sdp_media_get_bandwidth(media: *const GstSDPMedia, idx: c_uint) -> *const GstSDPBandwidth;
|
||||
pub fn gst_sdp_media_get_attribute(
|
||||
media: *const GstSDPMedia,
|
||||
idx: c_uint,
|
||||
) -> *const GstSDPAttribute;
|
||||
pub fn gst_sdp_media_get_attribute_val(
|
||||
media: *const GstSDPMedia,
|
||||
key: *const c_char,
|
||||
) -> *const c_char;
|
||||
pub fn gst_sdp_media_get_attribute_val_n(
|
||||
media: *const GstSDPMedia,
|
||||
key: *const c_char,
|
||||
nth: c_uint,
|
||||
) -> *const c_char;
|
||||
pub fn gst_sdp_media_get_bandwidth(
|
||||
media: *const GstSDPMedia,
|
||||
idx: c_uint,
|
||||
) -> *const GstSDPBandwidth;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_sdp_media_get_caps_from_media(media: *const GstSDPMedia, pt: c_int) -> *mut gst::GstCaps;
|
||||
pub fn gst_sdp_media_get_connection(media: *const GstSDPMedia, idx: c_uint) -> *const GstSDPConnection;
|
||||
pub fn gst_sdp_media_get_caps_from_media(
|
||||
media: *const GstSDPMedia,
|
||||
pt: c_int,
|
||||
) -> *mut gst::GstCaps;
|
||||
pub fn gst_sdp_media_get_connection(
|
||||
media: *const GstSDPMedia,
|
||||
idx: c_uint,
|
||||
) -> *const GstSDPConnection;
|
||||
pub fn gst_sdp_media_get_format(media: *const GstSDPMedia, idx: c_uint) -> *const c_char;
|
||||
pub fn gst_sdp_media_get_information(media: *const GstSDPMedia) -> *const c_char;
|
||||
pub fn gst_sdp_media_get_key(media: *const GstSDPMedia) -> *const GstSDPKey;
|
||||
|
@ -689,15 +881,34 @@ extern "C" {
|
|||
pub fn gst_sdp_media_get_proto(media: *const GstSDPMedia) -> *const c_char;
|
||||
pub fn gst_sdp_media_init(media: *mut GstSDPMedia) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_insert_attribute(media: *mut GstSDPMedia, idx: c_int, attr: *mut GstSDPAttribute) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_insert_attribute(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_int,
|
||||
attr: *mut GstSDPAttribute,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_insert_bandwidth(media: *mut GstSDPMedia, idx: c_int, bw: *mut GstSDPBandwidth) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_insert_bandwidth(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_int,
|
||||
bw: *mut GstSDPBandwidth,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_insert_connection(media: *mut GstSDPMedia, idx: c_int, conn: *mut GstSDPConnection) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_insert_connection(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_int,
|
||||
conn: *mut GstSDPConnection,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_insert_format(media: *mut GstSDPMedia, idx: c_int, format: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_insert_format(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_int,
|
||||
format: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
|
||||
pub fn gst_sdp_media_parse_keymgmt(media: *const GstSDPMedia, mikey: *mut *mut GstMIKEYMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_parse_keymgmt(
|
||||
media: *const GstSDPMedia,
|
||||
mikey: *mut *mut GstMIKEYMessage,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_remove_attribute(media: *mut GstSDPMedia, idx: c_uint) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
|
@ -707,48 +918,119 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_remove_format(media: *mut GstSDPMedia, idx: c_uint) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_replace_attribute(media: *mut GstSDPMedia, idx: c_uint, attr: *mut GstSDPAttribute) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_replace_attribute(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_uint,
|
||||
attr: *mut GstSDPAttribute,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_replace_bandwidth(media: *mut GstSDPMedia, idx: c_uint, bw: *mut GstSDPBandwidth) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_replace_bandwidth(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_uint,
|
||||
bw: *mut GstSDPBandwidth,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_replace_connection(media: *mut GstSDPMedia, idx: c_uint, conn: *mut GstSDPConnection) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_replace_connection(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_uint,
|
||||
conn: *mut GstSDPConnection,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_media_replace_format(media: *mut GstSDPMedia, idx: c_uint, format: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_information(media: *mut GstSDPMedia, information: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_key(media: *mut GstSDPMedia, type_: *const c_char, data: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_replace_format(
|
||||
media: *mut GstSDPMedia,
|
||||
idx: c_uint,
|
||||
format: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_information(
|
||||
media: *mut GstSDPMedia,
|
||||
information: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_key(
|
||||
media: *mut GstSDPMedia,
|
||||
type_: *const c_char,
|
||||
data: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_media(media: *mut GstSDPMedia, med: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_port_info(media: *mut GstSDPMedia, port: c_uint, num_ports: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_port_info(
|
||||
media: *mut GstSDPMedia,
|
||||
port: c_uint,
|
||||
num_ports: c_uint,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_proto(media: *mut GstSDPMedia, proto: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_uninit(media: *mut GstSDPMedia) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_new(media: *mut *mut GstSDPMedia) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_sdp_media_set_media_from_caps(caps: *const gst::GstCaps, media: *mut GstSDPMedia) -> GstSDPResult;
|
||||
pub fn gst_sdp_media_set_media_from_caps(
|
||||
caps: *const gst::GstCaps,
|
||||
media: *mut GstSDPMedia,
|
||||
) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstSDPMessage
|
||||
//=========================================================================
|
||||
pub fn gst_sdp_message_get_type() -> GType;
|
||||
pub fn gst_sdp_message_add_attribute(msg: *mut GstSDPMessage, key: *const c_char, value: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_bandwidth(msg: *mut GstSDPMessage, bwtype: *const c_char, bandwidth: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_email(msg: *mut GstSDPMessage, email: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_media(msg: *mut GstSDPMessage, media: *mut GstSDPMedia) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_phone(msg: *mut GstSDPMessage, phone: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_time(msg: *mut GstSDPMessage, start: *const c_char, stop: *const c_char, repeat: *mut *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_zone(msg: *mut GstSDPMessage, adj_time: *const c_char, typed_time: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_attribute(
|
||||
msg: *mut GstSDPMessage,
|
||||
key: *const c_char,
|
||||
value: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_bandwidth(
|
||||
msg: *mut GstSDPMessage,
|
||||
bwtype: *const c_char,
|
||||
bandwidth: c_uint,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_email(msg: *mut GstSDPMessage, email: *const c_char)
|
||||
-> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_media(
|
||||
msg: *mut GstSDPMessage,
|
||||
media: *mut GstSDPMedia,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_phone(msg: *mut GstSDPMessage, phone: *const c_char)
|
||||
-> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_time(
|
||||
msg: *mut GstSDPMessage,
|
||||
start: *const c_char,
|
||||
stop: *const c_char,
|
||||
repeat: *mut *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_add_zone(
|
||||
msg: *mut GstSDPMessage,
|
||||
adj_time: *const c_char,
|
||||
typed_time: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_as_text(msg: *const GstSDPMessage) -> *mut c_char;
|
||||
pub fn gst_sdp_message_attributes_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_sdp_message_attributes_to_caps(msg: *const GstSDPMessage, caps: *mut gst::GstCaps) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_attributes_to_caps(
|
||||
msg: *const GstSDPMessage,
|
||||
caps: *mut gst::GstCaps,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_bandwidths_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_copy(msg: *const GstSDPMessage, copy: *mut *mut GstSDPMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_copy(
|
||||
msg: *const GstSDPMessage,
|
||||
copy: *mut *mut GstSDPMessage,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_dump(msg: *const GstSDPMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_emails_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
pub fn gst_sdp_message_free(msg: *mut GstSDPMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_get_attribute(msg: *const GstSDPMessage, idx: c_uint) -> *const GstSDPAttribute;
|
||||
pub fn gst_sdp_message_get_attribute_val(msg: *const GstSDPMessage, key: *const c_char) -> *const c_char;
|
||||
pub fn gst_sdp_message_get_attribute_val_n(msg: *const GstSDPMessage, key: *const c_char, nth: c_uint) -> *const c_char;
|
||||
pub fn gst_sdp_message_get_bandwidth(msg: *const GstSDPMessage, idx: c_uint) -> *const GstSDPBandwidth;
|
||||
pub fn gst_sdp_message_get_attribute(
|
||||
msg: *const GstSDPMessage,
|
||||
idx: c_uint,
|
||||
) -> *const GstSDPAttribute;
|
||||
pub fn gst_sdp_message_get_attribute_val(
|
||||
msg: *const GstSDPMessage,
|
||||
key: *const c_char,
|
||||
) -> *const c_char;
|
||||
pub fn gst_sdp_message_get_attribute_val_n(
|
||||
msg: *const GstSDPMessage,
|
||||
key: *const c_char,
|
||||
nth: c_uint,
|
||||
) -> *const c_char;
|
||||
pub fn gst_sdp_message_get_bandwidth(
|
||||
msg: *const GstSDPMessage,
|
||||
idx: c_uint,
|
||||
) -> *const GstSDPBandwidth;
|
||||
pub fn gst_sdp_message_get_connection(msg: *const GstSDPMessage) -> *const GstSDPConnection;
|
||||
pub fn gst_sdp_message_get_email(msg: *const GstSDPMessage, idx: c_uint) -> *const c_char;
|
||||
pub fn gst_sdp_message_get_information(msg: *const GstSDPMessage) -> *const c_char;
|
||||
|
@ -763,20 +1045,47 @@ extern "C" {
|
|||
pub fn gst_sdp_message_get_zone(msg: *const GstSDPMessage, idx: c_uint) -> *const GstSDPZone;
|
||||
pub fn gst_sdp_message_init(msg: *mut GstSDPMessage) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_insert_attribute(msg: *mut GstSDPMessage, idx: c_int, attr: *mut GstSDPAttribute) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_insert_attribute(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_int,
|
||||
attr: *mut GstSDPAttribute,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_insert_bandwidth(msg: *mut GstSDPMessage, idx: c_int, bw: *mut GstSDPBandwidth) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_insert_bandwidth(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_int,
|
||||
bw: *mut GstSDPBandwidth,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_insert_email(msg: *mut GstSDPMessage, idx: c_int, email: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_insert_email(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_int,
|
||||
email: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_insert_phone(msg: *mut GstSDPMessage, idx: c_int, phone: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_insert_phone(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_int,
|
||||
phone: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_insert_time(msg: *mut GstSDPMessage, idx: c_int, t: *mut GstSDPTime) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_insert_time(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_int,
|
||||
t: *mut GstSDPTime,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_insert_zone(msg: *mut GstSDPMessage, idx: c_int, zone: *mut GstSDPZone) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_insert_zone(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_int,
|
||||
zone: *mut GstSDPZone,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_medias_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
|
||||
pub fn gst_sdp_message_parse_keymgmt(msg: *const GstSDPMessage, mikey: *mut *mut GstMIKEYMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_parse_keymgmt(
|
||||
msg: *const GstSDPMessage,
|
||||
mikey: *mut *mut GstMIKEYMessage,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_phones_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_remove_attribute(msg: *mut GstSDPMessage, idx: c_uint) -> GstSDPResult;
|
||||
|
@ -791,32 +1100,91 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_remove_zone(msg: *mut GstSDPMessage, idx: c_uint) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_replace_attribute(msg: *mut GstSDPMessage, idx: c_uint, attr: *mut GstSDPAttribute) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_replace_attribute(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_uint,
|
||||
attr: *mut GstSDPAttribute,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_replace_bandwidth(msg: *mut GstSDPMessage, idx: c_uint, bw: *mut GstSDPBandwidth) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_replace_bandwidth(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_uint,
|
||||
bw: *mut GstSDPBandwidth,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_replace_email(msg: *mut GstSDPMessage, idx: c_uint, email: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_replace_email(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_uint,
|
||||
email: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_replace_phone(msg: *mut GstSDPMessage, idx: c_uint, phone: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_replace_phone(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_uint,
|
||||
phone: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_replace_time(msg: *mut GstSDPMessage, idx: c_uint, t: *mut GstSDPTime) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_replace_time(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_uint,
|
||||
t: *mut GstSDPTime,
|
||||
) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_message_replace_zone(msg: *mut GstSDPMessage, idx: c_uint, zone: *mut GstSDPZone) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_connection(msg: *mut GstSDPMessage, nettype: *const c_char, addrtype: *const c_char, address: *const c_char, ttl: c_uint, addr_number: c_uint) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_information(msg: *mut GstSDPMessage, information: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_key(msg: *mut GstSDPMessage, type_: *const c_char, data: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_origin(msg: *mut GstSDPMessage, username: *const c_char, sess_id: *const c_char, sess_version: *const c_char, nettype: *const c_char, addrtype: *const c_char, addr: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_session_name(msg: *mut GstSDPMessage, session_name: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_replace_zone(
|
||||
msg: *mut GstSDPMessage,
|
||||
idx: c_uint,
|
||||
zone: *mut GstSDPZone,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_connection(
|
||||
msg: *mut GstSDPMessage,
|
||||
nettype: *const c_char,
|
||||
addrtype: *const c_char,
|
||||
address: *const c_char,
|
||||
ttl: c_uint,
|
||||
addr_number: c_uint,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_information(
|
||||
msg: *mut GstSDPMessage,
|
||||
information: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_key(
|
||||
msg: *mut GstSDPMessage,
|
||||
type_: *const c_char,
|
||||
data: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_origin(
|
||||
msg: *mut GstSDPMessage,
|
||||
username: *const c_char,
|
||||
sess_id: *const c_char,
|
||||
sess_version: *const c_char,
|
||||
nettype: *const c_char,
|
||||
addrtype: *const c_char,
|
||||
addr: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_session_name(
|
||||
msg: *mut GstSDPMessage,
|
||||
session_name: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_uri(msg: *mut GstSDPMessage, uri: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_version(msg: *mut GstSDPMessage, version: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_set_version(
|
||||
msg: *mut GstSDPMessage,
|
||||
version: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_times_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
pub fn gst_sdp_message_uninit(msg: *mut GstSDPMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_zones_len(msg: *const GstSDPMessage) -> c_uint;
|
||||
pub fn gst_sdp_message_as_uri(scheme: *const c_char, msg: *const GstSDPMessage) -> *mut c_char;
|
||||
pub fn gst_sdp_message_new(msg: *mut *mut GstSDPMessage) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn gst_sdp_message_new_from_text(text: *const c_char, msg: *mut *mut GstSDPMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_parse_buffer(data: *const u8, size: c_uint, msg: *mut GstSDPMessage) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_new_from_text(
|
||||
text: *const c_char,
|
||||
msg: *mut *mut GstSDPMessage,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_parse_buffer(
|
||||
data: *const u8,
|
||||
size: c_uint,
|
||||
msg: *mut GstSDPMessage,
|
||||
) -> GstSDPResult;
|
||||
pub fn gst_sdp_message_parse_uri(uri: *const c_char, msg: *mut GstSDPMessage) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
|
@ -825,7 +1193,12 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_time_clear(t: *mut GstSDPTime) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_time_set(t: *mut GstSDPTime, start: *const c_char, stop: *const c_char, repeat: *mut *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_time_set(
|
||||
t: *mut GstSDPTime,
|
||||
start: *const c_char,
|
||||
stop: *const c_char,
|
||||
repeat: *mut *const c_char,
|
||||
) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
// GstSDPZone
|
||||
|
@ -833,12 +1206,20 @@ extern "C" {
|
|||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_zone_clear(zone: *mut GstSDPZone) -> GstSDPResult;
|
||||
#[cfg(any(feature = "v1_2", feature = "dox"))]
|
||||
pub fn gst_sdp_zone_set(zone: *mut GstSDPZone, adj_time: *const c_char, typed_time: *const c_char) -> GstSDPResult;
|
||||
pub fn gst_sdp_zone_set(
|
||||
zone: *mut GstSDPZone,
|
||||
adj_time: *const c_char,
|
||||
typed_time: *const c_char,
|
||||
) -> GstSDPResult;
|
||||
|
||||
//=========================================================================
|
||||
// Other functions
|
||||
//=========================================================================
|
||||
pub fn gst_sdp_address_is_multicast(nettype: *const c_char, addrtype: *const c_char, addr: *const c_char) -> gboolean;
|
||||
pub fn gst_sdp_address_is_multicast(
|
||||
nettype: *const c_char,
|
||||
addrtype: *const c_char,
|
||||
addr: *const c_char,
|
||||
) -> gboolean;
|
||||
#[cfg(any(feature = "v1_8", feature = "dox"))]
|
||||
pub fn gst_sdp_make_keymgmt(uri: *const c_char, base64: *const c_char) -> *mut c_char;
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_sdp_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_sdp_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_sdp_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-sdp-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,53 +229,246 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstMIKEYCacheType", Layout {size: size_of::<GstMIKEYCacheType>(), alignment: align_of::<GstMIKEYCacheType>()}),
|
||||
("GstMIKEYEncAlg", Layout {size: size_of::<GstMIKEYEncAlg>(), alignment: align_of::<GstMIKEYEncAlg>()}),
|
||||
("GstMIKEYKVType", Layout {size: size_of::<GstMIKEYKVType>(), alignment: align_of::<GstMIKEYKVType>()}),
|
||||
("GstMIKEYKeyDataType", Layout {size: size_of::<GstMIKEYKeyDataType>(), alignment: align_of::<GstMIKEYKeyDataType>()}),
|
||||
("GstMIKEYMacAlg", Layout {size: size_of::<GstMIKEYMacAlg>(), alignment: align_of::<GstMIKEYMacAlg>()}),
|
||||
("GstMIKEYMapSRTP", Layout {size: size_of::<GstMIKEYMapSRTP>(), alignment: align_of::<GstMIKEYMapSRTP>()}),
|
||||
("GstMIKEYMapType", Layout {size: size_of::<GstMIKEYMapType>(), alignment: align_of::<GstMIKEYMapType>()}),
|
||||
("GstMIKEYMessage", Layout {size: size_of::<GstMIKEYMessage>(), alignment: align_of::<GstMIKEYMessage>()}),
|
||||
("GstMIKEYPRFFunc", Layout {size: size_of::<GstMIKEYPRFFunc>(), alignment: align_of::<GstMIKEYPRFFunc>()}),
|
||||
("GstMIKEYPayload", Layout {size: size_of::<GstMIKEYPayload>(), alignment: align_of::<GstMIKEYPayload>()}),
|
||||
("GstMIKEYPayloadKEMAC", Layout {size: size_of::<GstMIKEYPayloadKEMAC>(), alignment: align_of::<GstMIKEYPayloadKEMAC>()}),
|
||||
("GstMIKEYPayloadKeyData", Layout {size: size_of::<GstMIKEYPayloadKeyData>(), alignment: align_of::<GstMIKEYPayloadKeyData>()}),
|
||||
("GstMIKEYPayloadPKE", Layout {size: size_of::<GstMIKEYPayloadPKE>(), alignment: align_of::<GstMIKEYPayloadPKE>()}),
|
||||
("GstMIKEYPayloadRAND", Layout {size: size_of::<GstMIKEYPayloadRAND>(), alignment: align_of::<GstMIKEYPayloadRAND>()}),
|
||||
("GstMIKEYPayloadSP", Layout {size: size_of::<GstMIKEYPayloadSP>(), alignment: align_of::<GstMIKEYPayloadSP>()}),
|
||||
("GstMIKEYPayloadSPParam", Layout {size: size_of::<GstMIKEYPayloadSPParam>(), alignment: align_of::<GstMIKEYPayloadSPParam>()}),
|
||||
("GstMIKEYPayloadT", Layout {size: size_of::<GstMIKEYPayloadT>(), alignment: align_of::<GstMIKEYPayloadT>()}),
|
||||
("GstMIKEYPayloadType", Layout {size: size_of::<GstMIKEYPayloadType>(), alignment: align_of::<GstMIKEYPayloadType>()}),
|
||||
("GstMIKEYSecProto", Layout {size: size_of::<GstMIKEYSecProto>(), alignment: align_of::<GstMIKEYSecProto>()}),
|
||||
("GstMIKEYSecSRTP", Layout {size: size_of::<GstMIKEYSecSRTP>(), alignment: align_of::<GstMIKEYSecSRTP>()}),
|
||||
("GstMIKEYTSType", Layout {size: size_of::<GstMIKEYTSType>(), alignment: align_of::<GstMIKEYTSType>()}),
|
||||
("GstMIKEYType", Layout {size: size_of::<GstMIKEYType>(), alignment: align_of::<GstMIKEYType>()}),
|
||||
("GstSDPAttribute", Layout {size: size_of::<GstSDPAttribute>(), alignment: align_of::<GstSDPAttribute>()}),
|
||||
("GstSDPBandwidth", Layout {size: size_of::<GstSDPBandwidth>(), alignment: align_of::<GstSDPBandwidth>()}),
|
||||
("GstSDPConnection", Layout {size: size_of::<GstSDPConnection>(), alignment: align_of::<GstSDPConnection>()}),
|
||||
("GstSDPKey", Layout {size: size_of::<GstSDPKey>(), alignment: align_of::<GstSDPKey>()}),
|
||||
("GstSDPMedia", Layout {size: size_of::<GstSDPMedia>(), alignment: align_of::<GstSDPMedia>()}),
|
||||
("GstSDPMessage", Layout {size: size_of::<GstSDPMessage>(), alignment: align_of::<GstSDPMessage>()}),
|
||||
("GstSDPOrigin", Layout {size: size_of::<GstSDPOrigin>(), alignment: align_of::<GstSDPOrigin>()}),
|
||||
("GstSDPResult", Layout {size: size_of::<GstSDPResult>(), alignment: align_of::<GstSDPResult>()}),
|
||||
("GstSDPTime", Layout {size: size_of::<GstSDPTime>(), alignment: align_of::<GstSDPTime>()}),
|
||||
("GstSDPZone", Layout {size: size_of::<GstSDPZone>(), alignment: align_of::<GstSDPZone>()}),
|
||||
(
|
||||
"GstMIKEYCacheType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYCacheType>(),
|
||||
alignment: align_of::<GstMIKEYCacheType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYEncAlg",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYEncAlg>(),
|
||||
alignment: align_of::<GstMIKEYEncAlg>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYKVType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYKVType>(),
|
||||
alignment: align_of::<GstMIKEYKVType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYKeyDataType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYKeyDataType>(),
|
||||
alignment: align_of::<GstMIKEYKeyDataType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYMacAlg",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYMacAlg>(),
|
||||
alignment: align_of::<GstMIKEYMacAlg>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYMapSRTP",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYMapSRTP>(),
|
||||
alignment: align_of::<GstMIKEYMapSRTP>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYMapType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYMapType>(),
|
||||
alignment: align_of::<GstMIKEYMapType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYMessage",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYMessage>(),
|
||||
alignment: align_of::<GstMIKEYMessage>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPRFFunc",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPRFFunc>(),
|
||||
alignment: align_of::<GstMIKEYPRFFunc>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayload",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayload>(),
|
||||
alignment: align_of::<GstMIKEYPayload>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadKEMAC",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadKEMAC>(),
|
||||
alignment: align_of::<GstMIKEYPayloadKEMAC>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadKeyData",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadKeyData>(),
|
||||
alignment: align_of::<GstMIKEYPayloadKeyData>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadPKE",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadPKE>(),
|
||||
alignment: align_of::<GstMIKEYPayloadPKE>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadRAND",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadRAND>(),
|
||||
alignment: align_of::<GstMIKEYPayloadRAND>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadSP",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadSP>(),
|
||||
alignment: align_of::<GstMIKEYPayloadSP>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadSPParam",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadSPParam>(),
|
||||
alignment: align_of::<GstMIKEYPayloadSPParam>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadT",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadT>(),
|
||||
alignment: align_of::<GstMIKEYPayloadT>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYPayloadType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYPayloadType>(),
|
||||
alignment: align_of::<GstMIKEYPayloadType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYSecProto",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYSecProto>(),
|
||||
alignment: align_of::<GstMIKEYSecProto>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYSecSRTP",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYSecSRTP>(),
|
||||
alignment: align_of::<GstMIKEYSecSRTP>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYTSType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYTSType>(),
|
||||
alignment: align_of::<GstMIKEYTSType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstMIKEYType",
|
||||
Layout {
|
||||
size: size_of::<GstMIKEYType>(),
|
||||
alignment: align_of::<GstMIKEYType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPAttribute",
|
||||
Layout {
|
||||
size: size_of::<GstSDPAttribute>(),
|
||||
alignment: align_of::<GstSDPAttribute>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPBandwidth",
|
||||
Layout {
|
||||
size: size_of::<GstSDPBandwidth>(),
|
||||
alignment: align_of::<GstSDPBandwidth>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPConnection",
|
||||
Layout {
|
||||
size: size_of::<GstSDPConnection>(),
|
||||
alignment: align_of::<GstSDPConnection>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPKey",
|
||||
Layout {
|
||||
size: size_of::<GstSDPKey>(),
|
||||
alignment: align_of::<GstSDPKey>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPMedia",
|
||||
Layout {
|
||||
size: size_of::<GstSDPMedia>(),
|
||||
alignment: align_of::<GstSDPMedia>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPMessage",
|
||||
Layout {
|
||||
size: size_of::<GstSDPMessage>(),
|
||||
alignment: align_of::<GstSDPMessage>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPOrigin",
|
||||
Layout {
|
||||
size: size_of::<GstSDPOrigin>(),
|
||||
alignment: align_of::<GstSDPOrigin>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPResult",
|
||||
Layout {
|
||||
size: size_of::<GstSDPResult>(),
|
||||
alignment: align_of::<GstSDPResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPTime",
|
||||
Layout {
|
||||
size: size_of::<GstSDPTime>(),
|
||||
alignment: align_of::<GstSDPTime>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstSDPZone",
|
||||
Layout {
|
||||
size: size_of::<GstSDPZone>(),
|
||||
alignment: align_of::<GstSDPZone>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -340,5 +539,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_SDP_EINVAL", "-1"),
|
||||
("(gint) GST_SDP_OK", "0"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -52,7 +52,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -74,8 +74,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -89,4 +91,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -48,7 +48,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -70,8 +70,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -85,4 +87,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,18 +3,23 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_base_sys as gst_base;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -48,41 +53,70 @@ pub const GST_TAG_IMAGE_TYPE_BAND_ARTIST_LOGO: GstTagImageType = 17;
|
|||
pub const GST_TAG_IMAGE_TYPE_PUBLISHER_STUDIO_LOGO: GstTagImageType = 18;
|
||||
|
||||
// Constants
|
||||
pub const GST_TAG_CAPTURING_CONTRAST: *const c_char = b"capturing-contrast\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_DIGITAL_ZOOM_RATIO: *const c_char = b"capturing-digital-zoom-ratio\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_EXPOSURE_COMPENSATION: *const c_char = b"capturing-exposure-compensation\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_EXPOSURE_MODE: *const c_char = b"capturing-exposure-mode\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_EXPOSURE_PROGRAM: *const c_char = b"capturing-exposure-program\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FLASH_FIRED: *const c_char = b"capturing-flash-fired\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FLASH_MODE: *const c_char = b"capturing-flash-mode\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FOCAL_LENGTH: *const c_char = b"capturing-focal-length\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FOCAL_LENGTH_35_MM: *const c_char = b"capturing-focal-length-35mm\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FOCAL_RATIO: *const c_char = b"capturing-focal-ratio\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_GAIN_ADJUSTMENT: *const c_char = b"capturing-gain-adjustment\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_ISO_SPEED: *const c_char = b"capturing-iso-speed\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_METERING_MODE: *const c_char = b"capturing-metering-mode\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SATURATION: *const c_char = b"capturing-saturation\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SCENE_CAPTURE_TYPE: *const c_char = b"capturing-scene-capture-type\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SHARPNESS: *const c_char = b"capturing-sharpness\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SHUTTER_SPEED: *const c_char = b"capturing-shutter-speed\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SOURCE: *const c_char = b"capturing-source\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_WHITE_BALANCE: *const c_char = b"capturing-white-balance\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_CONTRAST: *const c_char =
|
||||
b"capturing-contrast\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_DIGITAL_ZOOM_RATIO: *const c_char =
|
||||
b"capturing-digital-zoom-ratio\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_EXPOSURE_COMPENSATION: *const c_char =
|
||||
b"capturing-exposure-compensation\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_EXPOSURE_MODE: *const c_char =
|
||||
b"capturing-exposure-mode\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_EXPOSURE_PROGRAM: *const c_char =
|
||||
b"capturing-exposure-program\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FLASH_FIRED: *const c_char =
|
||||
b"capturing-flash-fired\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FLASH_MODE: *const c_char =
|
||||
b"capturing-flash-mode\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FOCAL_LENGTH: *const c_char =
|
||||
b"capturing-focal-length\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FOCAL_LENGTH_35_MM: *const c_char =
|
||||
b"capturing-focal-length-35mm\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_FOCAL_RATIO: *const c_char =
|
||||
b"capturing-focal-ratio\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_GAIN_ADJUSTMENT: *const c_char =
|
||||
b"capturing-gain-adjustment\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_ISO_SPEED: *const c_char =
|
||||
b"capturing-iso-speed\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_METERING_MODE: *const c_char =
|
||||
b"capturing-metering-mode\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SATURATION: *const c_char =
|
||||
b"capturing-saturation\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SCENE_CAPTURE_TYPE: *const c_char =
|
||||
b"capturing-scene-capture-type\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SHARPNESS: *const c_char =
|
||||
b"capturing-sharpness\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SHUTTER_SPEED: *const c_char =
|
||||
b"capturing-shutter-speed\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_SOURCE: *const c_char =
|
||||
b"capturing-source\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CAPTURING_WHITE_BALANCE: *const c_char =
|
||||
b"capturing-white-balance\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_CDDB_DISCID: *const c_char = b"discid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_CDDB_DISCID_FULL: *const c_char = b"discid-full\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_MUSICBRAINZ_DISCID: *const c_char = b"musicbrainz-discid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_MUSICBRAINZ_DISCID_FULL: *const c_char = b"musicbrainz-discid-full\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_CDDB_DISCID_FULL: *const c_char =
|
||||
b"discid-full\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_MUSICBRAINZ_DISCID: *const c_char =
|
||||
b"musicbrainz-discid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CDDA_MUSICBRAINZ_DISCID_FULL: *const c_char =
|
||||
b"musicbrainz-discid-full\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CMML_CLIP: *const c_char = b"cmml-clip\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CMML_HEAD: *const c_char = b"cmml-head\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_CMML_STREAM: *const c_char = b"cmml-stream\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_ID3V2_HEADER_SIZE: c_int = 10;
|
||||
pub const GST_TAG_IMAGE_HORIZONTAL_PPI: *const c_char = b"image-horizontal-ppi\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_IMAGE_VERTICAL_PPI: *const c_char = b"image-vertical-ppi\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_IMAGE_HORIZONTAL_PPI: *const c_char =
|
||||
b"image-horizontal-ppi\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_IMAGE_VERTICAL_PPI: *const c_char =
|
||||
b"image-vertical-ppi\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICAL_KEY: *const c_char = b"musical-key\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_ALBUMARTISTID: *const c_char = b"musicbrainz-albumartistid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_ALBUMID: *const c_char = b"musicbrainz-albumid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_ARTISTID: *const c_char = b"musicbrainz-artistid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_TRACKID: *const c_char = b"musicbrainz-trackid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_TRMID: *const c_char = b"musicbrainz-trmid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_ALBUMARTISTID: *const c_char =
|
||||
b"musicbrainz-albumartistid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_ALBUMID: *const c_char =
|
||||
b"musicbrainz-albumid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_ARTISTID: *const c_char =
|
||||
b"musicbrainz-artistid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_TRACKID: *const c_char =
|
||||
b"musicbrainz-trackid\0" as *const u8 as *const c_char;
|
||||
pub const GST_TAG_MUSICBRAINZ_TRMID: *const c_char =
|
||||
b"musicbrainz-trmid\0" as *const u8 as *const c_char;
|
||||
|
||||
// Flags
|
||||
pub type GstTagLicenseFlags = c_uint;
|
||||
|
@ -108,9 +142,30 @@ pub struct GstTagDemuxClass {
|
|||
pub parent_class: gst::GstElementClass,
|
||||
pub min_start_size: c_uint,
|
||||
pub min_end_size: c_uint,
|
||||
pub identify_tag: Option<unsafe extern "C" fn(*mut GstTagDemux, *mut gst::GstBuffer, gboolean, *mut c_uint) -> gboolean>,
|
||||
pub parse_tag: Option<unsafe extern "C" fn(*mut GstTagDemux, *mut gst::GstBuffer, gboolean, *mut c_uint, *mut *mut gst::GstTagList) -> GstTagDemuxResult>,
|
||||
pub merge_tags: Option<unsafe extern "C" fn(*mut GstTagDemux, *const gst::GstTagList, *const gst::GstTagList) -> *mut gst::GstTagList>,
|
||||
pub identify_tag: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstTagDemux,
|
||||
*mut gst::GstBuffer,
|
||||
gboolean,
|
||||
*mut c_uint,
|
||||
) -> gboolean,
|
||||
>,
|
||||
pub parse_tag: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstTagDemux,
|
||||
*mut gst::GstBuffer,
|
||||
gboolean,
|
||||
*mut c_uint,
|
||||
*mut *mut gst::GstTagList,
|
||||
) -> GstTagDemuxResult,
|
||||
>,
|
||||
pub merge_tags: Option<
|
||||
unsafe extern "C" fn(
|
||||
*mut GstTagDemux,
|
||||
*const gst::GstTagList,
|
||||
*const gst::GstTagList,
|
||||
) -> *mut gst::GstTagList,
|
||||
>,
|
||||
pub reserved: [gpointer; 4],
|
||||
}
|
||||
|
||||
|
@ -136,8 +191,10 @@ pub type GstTagDemuxPrivate = *mut _GstTagDemuxPrivate;
|
|||
#[derive(Copy, Clone)]
|
||||
pub struct GstTagMuxClass {
|
||||
pub parent_class: gst::GstElementClass,
|
||||
pub render_start_tag: Option<unsafe extern "C" fn(*mut GstTagMux, *const gst::GstTagList) -> *mut gst::GstBuffer>,
|
||||
pub render_end_tag: Option<unsafe extern "C" fn(*mut GstTagMux, *const gst::GstTagList) -> *mut gst::GstBuffer>,
|
||||
pub render_start_tag:
|
||||
Option<unsafe extern "C" fn(*mut GstTagMux, *const gst::GstTagList) -> *mut gst::GstBuffer>,
|
||||
pub render_end_tag:
|
||||
Option<unsafe extern "C" fn(*mut GstTagMux, *const gst::GstTagList) -> *mut gst::GstBuffer>,
|
||||
pub _gst_reserved: [gpointer; 4],
|
||||
}
|
||||
|
||||
|
@ -164,7 +221,10 @@ pub struct GstTagXmpWriterInterface {
|
|||
|
||||
impl ::std::fmt::Debug for GstTagXmpWriterInterface {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstTagXmpWriterInterface @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstTagXmpWriterInterface @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent", &self.parent)
|
||||
.finish()
|
||||
}
|
||||
|
@ -213,7 +273,6 @@ impl ::std::fmt::Debug for GstTagXmpWriter {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
//=========================================================================
|
||||
|
@ -247,18 +306,32 @@ extern "C" {
|
|||
pub fn gst_tag_xmp_writer_get_type() -> GType;
|
||||
pub fn gst_tag_xmp_writer_add_all_schemas(config: *mut GstTagXmpWriter);
|
||||
pub fn gst_tag_xmp_writer_add_schema(config: *mut GstTagXmpWriter, schema: *const c_char);
|
||||
pub fn gst_tag_xmp_writer_has_schema(config: *mut GstTagXmpWriter, schema: *const c_char) -> gboolean;
|
||||
pub fn gst_tag_xmp_writer_has_schema(
|
||||
config: *mut GstTagXmpWriter,
|
||||
schema: *const c_char,
|
||||
) -> gboolean;
|
||||
pub fn gst_tag_xmp_writer_remove_all_schemas(config: *mut GstTagXmpWriter);
|
||||
pub fn gst_tag_xmp_writer_remove_schema(config: *mut GstTagXmpWriter, schema: *const c_char);
|
||||
pub fn gst_tag_xmp_writer_tag_list_to_xmp_buffer(config: *mut GstTagXmpWriter, taglist: *const gst::GstTagList, read_only: gboolean) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_xmp_writer_tag_list_to_xmp_buffer(
|
||||
config: *mut GstTagXmpWriter,
|
||||
taglist: *const gst::GstTagList,
|
||||
read_only: gboolean,
|
||||
) -> *mut gst::GstBuffer;
|
||||
|
||||
//=========================================================================
|
||||
// Other functions
|
||||
//=========================================================================
|
||||
pub fn gst_tag_check_language_code(lang_code: *const c_char) -> gboolean;
|
||||
pub fn gst_tag_freeform_string_to_utf8(data: *const c_char, size: c_int, env_vars: *mut *const c_char) -> *mut c_char;
|
||||
pub fn gst_tag_freeform_string_to_utf8(
|
||||
data: *const c_char,
|
||||
size: c_int,
|
||||
env_vars: *mut *const c_char,
|
||||
) -> *mut c_char;
|
||||
pub fn gst_tag_from_id3_tag(id3_tag: *const c_char) -> *const c_char;
|
||||
pub fn gst_tag_from_id3_user_tag(type_: *const c_char, id3_user_tag: *const c_char) -> *const c_char;
|
||||
pub fn gst_tag_from_id3_user_tag(
|
||||
type_: *const c_char,
|
||||
id3_user_tag: *const c_char,
|
||||
) -> *const c_char;
|
||||
pub fn gst_tag_from_vorbis_tag(vorbis_tag: *const c_char) -> *const c_char;
|
||||
pub fn gst_tag_get_id3v2_tag_size(buffer: *mut gst::GstBuffer) -> c_uint;
|
||||
pub fn gst_tag_get_language_code_iso_639_1(lang_code: *const c_char) -> *const c_char;
|
||||
|
@ -275,23 +348,73 @@ extern "C" {
|
|||
pub fn gst_tag_get_licenses() -> *mut *mut c_char;
|
||||
pub fn gst_tag_id3_genre_count() -> c_uint;
|
||||
pub fn gst_tag_id3_genre_get(id: c_uint) -> *const c_char;
|
||||
pub fn gst_tag_image_data_to_image_sample(image_data: *const u8, image_data_len: c_uint, image_type: GstTagImageType) -> *mut gst::GstSample;
|
||||
pub fn gst_tag_list_add_id3_image(tag_list: *mut gst::GstTagList, image_data: *const u8, image_data_len: c_uint, id3_picture_type: c_uint) -> gboolean;
|
||||
pub fn gst_tag_list_from_exif_buffer(buffer: *mut gst::GstBuffer, byte_order: c_int, base_offset: u32) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_exif_buffer_with_tiff_header(buffer: *mut gst::GstBuffer) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_image_data_to_image_sample(
|
||||
image_data: *const u8,
|
||||
image_data_len: c_uint,
|
||||
image_type: GstTagImageType,
|
||||
) -> *mut gst::GstSample;
|
||||
pub fn gst_tag_list_add_id3_image(
|
||||
tag_list: *mut gst::GstTagList,
|
||||
image_data: *const u8,
|
||||
image_data_len: c_uint,
|
||||
id3_picture_type: c_uint,
|
||||
) -> gboolean;
|
||||
pub fn gst_tag_list_from_exif_buffer(
|
||||
buffer: *mut gst::GstBuffer,
|
||||
byte_order: c_int,
|
||||
base_offset: u32,
|
||||
) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_exif_buffer_with_tiff_header(
|
||||
buffer: *mut gst::GstBuffer,
|
||||
) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_id3v2_tag(buffer: *mut gst::GstBuffer) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_vorbiscomment(data: *const u8, size: size_t, id_data: *const u8, id_data_length: c_uint, vendor_string: *mut *mut c_char) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_vorbiscomment_buffer(buffer: *mut gst::GstBuffer, id_data: *const u8, id_data_length: c_uint, vendor_string: *mut *mut c_char) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_vorbiscomment(
|
||||
data: *const u8,
|
||||
size: size_t,
|
||||
id_data: *const u8,
|
||||
id_data_length: c_uint,
|
||||
vendor_string: *mut *mut c_char,
|
||||
) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_vorbiscomment_buffer(
|
||||
buffer: *mut gst::GstBuffer,
|
||||
id_data: *const u8,
|
||||
id_data_length: c_uint,
|
||||
vendor_string: *mut *mut c_char,
|
||||
) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_from_xmp_buffer(buffer: *mut gst::GstBuffer) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_new_from_id3v1(data: *const [u8; 128]) -> *mut gst::GstTagList;
|
||||
pub fn gst_tag_list_to_exif_buffer(taglist: *const gst::GstTagList, byte_order: c_int, base_offset: u32) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_list_to_exif_buffer_with_tiff_header(taglist: *const gst::GstTagList) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_list_to_vorbiscomment_buffer(list: *const gst::GstTagList, id_data: *const u8, id_data_length: c_uint, vendor_string: *const c_char) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_list_to_xmp_buffer(list: *const gst::GstTagList, read_only: gboolean, schemas: *mut *const c_char) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_parse_extended_comment(ext_comment: *const c_char, key: *mut *mut c_char, lang: *mut *mut c_char, value: *mut *mut c_char, fail_if_no_key: gboolean) -> gboolean;
|
||||
pub fn gst_tag_list_to_exif_buffer(
|
||||
taglist: *const gst::GstTagList,
|
||||
byte_order: c_int,
|
||||
base_offset: u32,
|
||||
) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_list_to_exif_buffer_with_tiff_header(
|
||||
taglist: *const gst::GstTagList,
|
||||
) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_list_to_vorbiscomment_buffer(
|
||||
list: *const gst::GstTagList,
|
||||
id_data: *const u8,
|
||||
id_data_length: c_uint,
|
||||
vendor_string: *const c_char,
|
||||
) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_list_to_xmp_buffer(
|
||||
list: *const gst::GstTagList,
|
||||
read_only: gboolean,
|
||||
schemas: *mut *const c_char,
|
||||
) -> *mut gst::GstBuffer;
|
||||
pub fn gst_tag_parse_extended_comment(
|
||||
ext_comment: *const c_char,
|
||||
key: *mut *mut c_char,
|
||||
lang: *mut *mut c_char,
|
||||
value: *mut *mut c_char,
|
||||
fail_if_no_key: gboolean,
|
||||
) -> gboolean;
|
||||
pub fn gst_tag_register_musicbrainz_tags();
|
||||
pub fn gst_tag_to_id3_tag(gst_tag: *const c_char) -> *const c_char;
|
||||
pub fn gst_tag_to_vorbis_comments(list: *const gst::GstTagList, tag: *const c_char) -> *mut glib::GList;
|
||||
pub fn gst_tag_to_vorbis_comments(
|
||||
list: *const gst::GstTagList,
|
||||
tag: *const c_char,
|
||||
) -> *mut glib::GList;
|
||||
pub fn gst_tag_to_vorbis_tag(gst_tag: *const c_char) -> *const c_char;
|
||||
pub fn gst_tag_xmp_list_schemas() -> *mut *const c_char;
|
||||
pub fn gst_vorbis_tag_add(list: *mut gst::GstTagList, tag: *const c_char, value: *const c_char);
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_tag_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_tag_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_tag_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-tag-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,47 +229,114 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstTagDemux", Layout {size: size_of::<GstTagDemux>(), alignment: align_of::<GstTagDemux>()}),
|
||||
("GstTagDemuxClass", Layout {size: size_of::<GstTagDemuxClass>(), alignment: align_of::<GstTagDemuxClass>()}),
|
||||
("GstTagDemuxResult", Layout {size: size_of::<GstTagDemuxResult>(), alignment: align_of::<GstTagDemuxResult>()}),
|
||||
("GstTagImageType", Layout {size: size_of::<GstTagImageType>(), alignment: align_of::<GstTagImageType>()}),
|
||||
("GstTagLicenseFlags", Layout {size: size_of::<GstTagLicenseFlags>(), alignment: align_of::<GstTagLicenseFlags>()}),
|
||||
("GstTagMux", Layout {size: size_of::<GstTagMux>(), alignment: align_of::<GstTagMux>()}),
|
||||
("GstTagMuxClass", Layout {size: size_of::<GstTagMuxClass>(), alignment: align_of::<GstTagMuxClass>()}),
|
||||
("GstTagXmpWriterInterface", Layout {size: size_of::<GstTagXmpWriterInterface>(), alignment: align_of::<GstTagXmpWriterInterface>()}),
|
||||
(
|
||||
"GstTagDemux",
|
||||
Layout {
|
||||
size: size_of::<GstTagDemux>(),
|
||||
alignment: align_of::<GstTagDemux>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagDemuxClass",
|
||||
Layout {
|
||||
size: size_of::<GstTagDemuxClass>(),
|
||||
alignment: align_of::<GstTagDemuxClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagDemuxResult",
|
||||
Layout {
|
||||
size: size_of::<GstTagDemuxResult>(),
|
||||
alignment: align_of::<GstTagDemuxResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagImageType",
|
||||
Layout {
|
||||
size: size_of::<GstTagImageType>(),
|
||||
alignment: align_of::<GstTagImageType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagLicenseFlags",
|
||||
Layout {
|
||||
size: size_of::<GstTagLicenseFlags>(),
|
||||
alignment: align_of::<GstTagLicenseFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagMux",
|
||||
Layout {
|
||||
size: size_of::<GstTagMux>(),
|
||||
alignment: align_of::<GstTagMux>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagMuxClass",
|
||||
Layout {
|
||||
size: size_of::<GstTagMuxClass>(),
|
||||
alignment: align_of::<GstTagMuxClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstTagXmpWriterInterface",
|
||||
Layout {
|
||||
size: size_of::<GstTagXmpWriterInterface>(),
|
||||
alignment: align_of::<GstTagXmpWriterInterface>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("GST_TAG_CAPTURING_CONTRAST", "capturing-contrast"),
|
||||
("GST_TAG_CAPTURING_DIGITAL_ZOOM_RATIO", "capturing-digital-zoom-ratio"),
|
||||
("GST_TAG_CAPTURING_EXPOSURE_COMPENSATION", "capturing-exposure-compensation"),
|
||||
(
|
||||
"GST_TAG_CAPTURING_DIGITAL_ZOOM_RATIO",
|
||||
"capturing-digital-zoom-ratio",
|
||||
),
|
||||
(
|
||||
"GST_TAG_CAPTURING_EXPOSURE_COMPENSATION",
|
||||
"capturing-exposure-compensation",
|
||||
),
|
||||
("GST_TAG_CAPTURING_EXPOSURE_MODE", "capturing-exposure-mode"),
|
||||
("GST_TAG_CAPTURING_EXPOSURE_PROGRAM", "capturing-exposure-program"),
|
||||
(
|
||||
"GST_TAG_CAPTURING_EXPOSURE_PROGRAM",
|
||||
"capturing-exposure-program",
|
||||
),
|
||||
("GST_TAG_CAPTURING_FLASH_FIRED", "capturing-flash-fired"),
|
||||
("GST_TAG_CAPTURING_FLASH_MODE", "capturing-flash-mode"),
|
||||
("GST_TAG_CAPTURING_FOCAL_LENGTH", "capturing-focal-length"),
|
||||
("GST_TAG_CAPTURING_FOCAL_LENGTH_35_MM", "capturing-focal-length-35mm"),
|
||||
(
|
||||
"GST_TAG_CAPTURING_FOCAL_LENGTH_35_MM",
|
||||
"capturing-focal-length-35mm",
|
||||
),
|
||||
("GST_TAG_CAPTURING_FOCAL_RATIO", "capturing-focal-ratio"),
|
||||
("GST_TAG_CAPTURING_GAIN_ADJUSTMENT", "capturing-gain-adjustment"),
|
||||
(
|
||||
"GST_TAG_CAPTURING_GAIN_ADJUSTMENT",
|
||||
"capturing-gain-adjustment",
|
||||
),
|
||||
("GST_TAG_CAPTURING_ISO_SPEED", "capturing-iso-speed"),
|
||||
("GST_TAG_CAPTURING_METERING_MODE", "capturing-metering-mode"),
|
||||
("GST_TAG_CAPTURING_SATURATION", "capturing-saturation"),
|
||||
("GST_TAG_CAPTURING_SCENE_CAPTURE_TYPE", "capturing-scene-capture-type"),
|
||||
(
|
||||
"GST_TAG_CAPTURING_SCENE_CAPTURE_TYPE",
|
||||
"capturing-scene-capture-type",
|
||||
),
|
||||
("GST_TAG_CAPTURING_SHARPNESS", "capturing-sharpness"),
|
||||
("GST_TAG_CAPTURING_SHUTTER_SPEED", "capturing-shutter-speed"),
|
||||
("GST_TAG_CAPTURING_SOURCE", "capturing-source"),
|
||||
|
@ -271,7 +344,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("GST_TAG_CDDA_CDDB_DISCID", "discid"),
|
||||
("GST_TAG_CDDA_CDDB_DISCID_FULL", "discid-full"),
|
||||
("GST_TAG_CDDA_MUSICBRAINZ_DISCID", "musicbrainz-discid"),
|
||||
("GST_TAG_CDDA_MUSICBRAINZ_DISCID_FULL", "musicbrainz-discid-full"),
|
||||
(
|
||||
"GST_TAG_CDDA_MUSICBRAINZ_DISCID_FULL",
|
||||
"musicbrainz-discid-full",
|
||||
),
|
||||
("GST_TAG_CMML_CLIP", "cmml-clip"),
|
||||
("GST_TAG_CMML_HEAD", "cmml-head"),
|
||||
("GST_TAG_CMML_STREAM", "cmml-stream"),
|
||||
|
@ -301,14 +377,23 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_TAG_IMAGE_TYPE_UNDEFINED", "0"),
|
||||
("(gint) GST_TAG_IMAGE_TYPE_VIDEO_CAPTURE", "14"),
|
||||
("GST_TAG_IMAGE_VERTICAL_PPI", "image-vertical-ppi"),
|
||||
("(guint) GST_TAG_LICENSE_CREATIVE_COMMONS_LICENSE", "16777216"),
|
||||
("(guint) GST_TAG_LICENSE_FREE_SOFTWARE_FOUNDATION_LICENSE", "33554432"),
|
||||
(
|
||||
"(guint) GST_TAG_LICENSE_CREATIVE_COMMONS_LICENSE",
|
||||
"16777216",
|
||||
),
|
||||
(
|
||||
"(guint) GST_TAG_LICENSE_FREE_SOFTWARE_FOUNDATION_LICENSE",
|
||||
"33554432",
|
||||
),
|
||||
("(guint) GST_TAG_LICENSE_PERMITS_DERIVATIVE_WORKS", "4"),
|
||||
("(guint) GST_TAG_LICENSE_PERMITS_DISTRIBUTION", "2"),
|
||||
("(guint) GST_TAG_LICENSE_PERMITS_REPRODUCTION", "1"),
|
||||
("(guint) GST_TAG_LICENSE_PERMITS_SHARING", "8"),
|
||||
("(guint) GST_TAG_LICENSE_PROHIBITS_COMMERCIAL_USE", "65536"),
|
||||
("(guint) GST_TAG_LICENSE_PROHIBITS_HIGH_INCOME_NATION_USE", "131072"),
|
||||
(
|
||||
"(guint) GST_TAG_LICENSE_PROHIBITS_HIGH_INCOME_NATION_USE",
|
||||
"131072",
|
||||
),
|
||||
("(guint) GST_TAG_LICENSE_REQUIRES_ATTRIBUTION", "512"),
|
||||
("(guint) GST_TAG_LICENSE_REQUIRES_COPYLEFT", "4096"),
|
||||
("(guint) GST_TAG_LICENSE_REQUIRES_LESSER_COPYLEFT", "8192"),
|
||||
|
@ -316,11 +401,12 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(guint) GST_TAG_LICENSE_REQUIRES_SHARE_ALIKE", "1024"),
|
||||
("(guint) GST_TAG_LICENSE_REQUIRES_SOURCE_CODE", "2048"),
|
||||
("GST_TAG_MUSICAL_KEY", "musical-key"),
|
||||
("GST_TAG_MUSICBRAINZ_ALBUMARTISTID", "musicbrainz-albumartistid"),
|
||||
(
|
||||
"GST_TAG_MUSICBRAINZ_ALBUMARTISTID",
|
||||
"musicbrainz-albumartistid",
|
||||
),
|
||||
("GST_TAG_MUSICBRAINZ_ALBUMID", "musicbrainz-albumid"),
|
||||
("GST_TAG_MUSICBRAINZ_ARTISTID", "musicbrainz-artistid"),
|
||||
("GST_TAG_MUSICBRAINZ_TRACKID", "musicbrainz-trackid"),
|
||||
("GST_TAG_MUSICBRAINZ_TRMID", "musicbrainz-trmid"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -52,7 +52,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -74,8 +74,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -89,4 +91,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_video_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_video_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_video_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-video-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,113 +229,666 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstColorBalanceChannel", Layout {size: size_of::<GstColorBalanceChannel>(), alignment: align_of::<GstColorBalanceChannel>()}),
|
||||
("GstColorBalanceChannelClass", Layout {size: size_of::<GstColorBalanceChannelClass>(), alignment: align_of::<GstColorBalanceChannelClass>()}),
|
||||
("GstColorBalanceInterface", Layout {size: size_of::<GstColorBalanceInterface>(), alignment: align_of::<GstColorBalanceInterface>()}),
|
||||
("GstColorBalanceType", Layout {size: size_of::<GstColorBalanceType>(), alignment: align_of::<GstColorBalanceType>()}),
|
||||
("GstNavigationCommand", Layout {size: size_of::<GstNavigationCommand>(), alignment: align_of::<GstNavigationCommand>()}),
|
||||
("GstNavigationEventType", Layout {size: size_of::<GstNavigationEventType>(), alignment: align_of::<GstNavigationEventType>()}),
|
||||
("GstNavigationInterface", Layout {size: size_of::<GstNavigationInterface>(), alignment: align_of::<GstNavigationInterface>()}),
|
||||
("GstNavigationMessageType", Layout {size: size_of::<GstNavigationMessageType>(), alignment: align_of::<GstNavigationMessageType>()}),
|
||||
("GstNavigationQueryType", Layout {size: size_of::<GstNavigationQueryType>(), alignment: align_of::<GstNavigationQueryType>()}),
|
||||
("GstVideoAffineTransformationMeta", Layout {size: size_of::<GstVideoAffineTransformationMeta>(), alignment: align_of::<GstVideoAffineTransformationMeta>()}),
|
||||
("GstVideoAggregator", Layout {size: size_of::<GstVideoAggregator>(), alignment: align_of::<GstVideoAggregator>()}),
|
||||
("GstVideoAggregatorClass", Layout {size: size_of::<GstVideoAggregatorClass>(), alignment: align_of::<GstVideoAggregatorClass>()}),
|
||||
("GstVideoAggregatorConvertPad", Layout {size: size_of::<GstVideoAggregatorConvertPad>(), alignment: align_of::<GstVideoAggregatorConvertPad>()}),
|
||||
("GstVideoAggregatorConvertPadClass", Layout {size: size_of::<GstVideoAggregatorConvertPadClass>(), alignment: align_of::<GstVideoAggregatorConvertPadClass>()}),
|
||||
("GstVideoAggregatorPad", Layout {size: size_of::<GstVideoAggregatorPad>(), alignment: align_of::<GstVideoAggregatorPad>()}),
|
||||
("GstVideoAggregatorPadClass", Layout {size: size_of::<GstVideoAggregatorPadClass>(), alignment: align_of::<GstVideoAggregatorPadClass>()}),
|
||||
("GstVideoAlignment", Layout {size: size_of::<GstVideoAlignment>(), alignment: align_of::<GstVideoAlignment>()}),
|
||||
("GstVideoAlphaMode", Layout {size: size_of::<GstVideoAlphaMode>(), alignment: align_of::<GstVideoAlphaMode>()}),
|
||||
("GstVideoAncillary", Layout {size: size_of::<GstVideoAncillary>(), alignment: align_of::<GstVideoAncillary>()}),
|
||||
("GstVideoAncillaryDID", Layout {size: size_of::<GstVideoAncillaryDID>(), alignment: align_of::<GstVideoAncillaryDID>()}),
|
||||
("GstVideoAncillaryDID16", Layout {size: size_of::<GstVideoAncillaryDID16>(), alignment: align_of::<GstVideoAncillaryDID16>()}),
|
||||
("GstVideoBufferFlags", Layout {size: size_of::<GstVideoBufferFlags>(), alignment: align_of::<GstVideoBufferFlags>()}),
|
||||
("GstVideoBufferPool", Layout {size: size_of::<GstVideoBufferPool>(), alignment: align_of::<GstVideoBufferPool>()}),
|
||||
("GstVideoBufferPoolClass", Layout {size: size_of::<GstVideoBufferPoolClass>(), alignment: align_of::<GstVideoBufferPoolClass>()}),
|
||||
("GstVideoCaptionMeta", Layout {size: size_of::<GstVideoCaptionMeta>(), alignment: align_of::<GstVideoCaptionMeta>()}),
|
||||
("GstVideoCaptionType", Layout {size: size_of::<GstVideoCaptionType>(), alignment: align_of::<GstVideoCaptionType>()}),
|
||||
("GstVideoChromaFlags", Layout {size: size_of::<GstVideoChromaFlags>(), alignment: align_of::<GstVideoChromaFlags>()}),
|
||||
("GstVideoChromaMethod", Layout {size: size_of::<GstVideoChromaMethod>(), alignment: align_of::<GstVideoChromaMethod>()}),
|
||||
("GstVideoChromaMode", Layout {size: size_of::<GstVideoChromaMode>(), alignment: align_of::<GstVideoChromaMode>()}),
|
||||
("GstVideoChromaSite", Layout {size: size_of::<GstVideoChromaSite>(), alignment: align_of::<GstVideoChromaSite>()}),
|
||||
("GstVideoCodecFrame", Layout {size: size_of::<GstVideoCodecFrame>(), alignment: align_of::<GstVideoCodecFrame>()}),
|
||||
("GstVideoCodecFrameFlags", Layout {size: size_of::<GstVideoCodecFrameFlags>(), alignment: align_of::<GstVideoCodecFrameFlags>()}),
|
||||
("GstVideoCodecState", Layout {size: size_of::<GstVideoCodecState>(), alignment: align_of::<GstVideoCodecState>()}),
|
||||
("GstVideoColorMatrix", Layout {size: size_of::<GstVideoColorMatrix>(), alignment: align_of::<GstVideoColorMatrix>()}),
|
||||
("GstVideoColorPrimaries", Layout {size: size_of::<GstVideoColorPrimaries>(), alignment: align_of::<GstVideoColorPrimaries>()}),
|
||||
("GstVideoColorPrimariesInfo", Layout {size: size_of::<GstVideoColorPrimariesInfo>(), alignment: align_of::<GstVideoColorPrimariesInfo>()}),
|
||||
("GstVideoColorRange", Layout {size: size_of::<GstVideoColorRange>(), alignment: align_of::<GstVideoColorRange>()}),
|
||||
("GstVideoColorimetry", Layout {size: size_of::<GstVideoColorimetry>(), alignment: align_of::<GstVideoColorimetry>()}),
|
||||
("GstVideoCropMeta", Layout {size: size_of::<GstVideoCropMeta>(), alignment: align_of::<GstVideoCropMeta>()}),
|
||||
("GstVideoDecoder", Layout {size: size_of::<GstVideoDecoder>(), alignment: align_of::<GstVideoDecoder>()}),
|
||||
("GstVideoDecoderClass", Layout {size: size_of::<GstVideoDecoderClass>(), alignment: align_of::<GstVideoDecoderClass>()}),
|
||||
("GstVideoDirectionInterface", Layout {size: size_of::<GstVideoDirectionInterface>(), alignment: align_of::<GstVideoDirectionInterface>()}),
|
||||
("GstVideoDitherFlags", Layout {size: size_of::<GstVideoDitherFlags>(), alignment: align_of::<GstVideoDitherFlags>()}),
|
||||
("GstVideoDitherMethod", Layout {size: size_of::<GstVideoDitherMethod>(), alignment: align_of::<GstVideoDitherMethod>()}),
|
||||
("GstVideoEncoder", Layout {size: size_of::<GstVideoEncoder>(), alignment: align_of::<GstVideoEncoder>()}),
|
||||
("GstVideoEncoderClass", Layout {size: size_of::<GstVideoEncoderClass>(), alignment: align_of::<GstVideoEncoderClass>()}),
|
||||
("GstVideoFieldOrder", Layout {size: size_of::<GstVideoFieldOrder>(), alignment: align_of::<GstVideoFieldOrder>()}),
|
||||
("GstVideoFilter", Layout {size: size_of::<GstVideoFilter>(), alignment: align_of::<GstVideoFilter>()}),
|
||||
("GstVideoFilterClass", Layout {size: size_of::<GstVideoFilterClass>(), alignment: align_of::<GstVideoFilterClass>()}),
|
||||
("GstVideoFlags", Layout {size: size_of::<GstVideoFlags>(), alignment: align_of::<GstVideoFlags>()}),
|
||||
("GstVideoFormat", Layout {size: size_of::<GstVideoFormat>(), alignment: align_of::<GstVideoFormat>()}),
|
||||
("GstVideoFormatFlags", Layout {size: size_of::<GstVideoFormatFlags>(), alignment: align_of::<GstVideoFormatFlags>()}),
|
||||
("GstVideoFormatInfo", Layout {size: size_of::<GstVideoFormatInfo>(), alignment: align_of::<GstVideoFormatInfo>()}),
|
||||
("GstVideoFrame", Layout {size: size_of::<GstVideoFrame>(), alignment: align_of::<GstVideoFrame>()}),
|
||||
("GstVideoFrameFlags", Layout {size: size_of::<GstVideoFrameFlags>(), alignment: align_of::<GstVideoFrameFlags>()}),
|
||||
("GstVideoFrameMapFlags", Layout {size: size_of::<GstVideoFrameMapFlags>(), alignment: align_of::<GstVideoFrameMapFlags>()}),
|
||||
("GstVideoGLTextureOrientation", Layout {size: size_of::<GstVideoGLTextureOrientation>(), alignment: align_of::<GstVideoGLTextureOrientation>()}),
|
||||
("GstVideoGLTextureType", Layout {size: size_of::<GstVideoGLTextureType>(), alignment: align_of::<GstVideoGLTextureType>()}),
|
||||
("GstVideoGLTextureUploadMeta", Layout {size: size_of::<GstVideoGLTextureUploadMeta>(), alignment: align_of::<GstVideoGLTextureUploadMeta>()}),
|
||||
("GstVideoGammaMode", Layout {size: size_of::<GstVideoGammaMode>(), alignment: align_of::<GstVideoGammaMode>()}),
|
||||
("GstVideoInfo", Layout {size: size_of::<GstVideoInfo>(), alignment: align_of::<GstVideoInfo>()}),
|
||||
("GstVideoInterlaceMode", Layout {size: size_of::<GstVideoInterlaceMode>(), alignment: align_of::<GstVideoInterlaceMode>()}),
|
||||
("GstVideoMatrixMode", Layout {size: size_of::<GstVideoMatrixMode>(), alignment: align_of::<GstVideoMatrixMode>()}),
|
||||
("GstVideoMeta", Layout {size: size_of::<GstVideoMeta>(), alignment: align_of::<GstVideoMeta>()}),
|
||||
("GstVideoMetaTransform", Layout {size: size_of::<GstVideoMetaTransform>(), alignment: align_of::<GstVideoMetaTransform>()}),
|
||||
("GstVideoMultiviewFlags", Layout {size: size_of::<GstVideoMultiviewFlags>(), alignment: align_of::<GstVideoMultiviewFlags>()}),
|
||||
("GstVideoMultiviewFramePacking", Layout {size: size_of::<GstVideoMultiviewFramePacking>(), alignment: align_of::<GstVideoMultiviewFramePacking>()}),
|
||||
("GstVideoMultiviewMode", Layout {size: size_of::<GstVideoMultiviewMode>(), alignment: align_of::<GstVideoMultiviewMode>()}),
|
||||
("GstVideoOrientationInterface", Layout {size: size_of::<GstVideoOrientationInterface>(), alignment: align_of::<GstVideoOrientationInterface>()}),
|
||||
("GstVideoOrientationMethod", Layout {size: size_of::<GstVideoOrientationMethod>(), alignment: align_of::<GstVideoOrientationMethod>()}),
|
||||
("GstVideoOverlayCompositionMeta", Layout {size: size_of::<GstVideoOverlayCompositionMeta>(), alignment: align_of::<GstVideoOverlayCompositionMeta>()}),
|
||||
("GstVideoOverlayFormatFlags", Layout {size: size_of::<GstVideoOverlayFormatFlags>(), alignment: align_of::<GstVideoOverlayFormatFlags>()}),
|
||||
("GstVideoOverlayInterface", Layout {size: size_of::<GstVideoOverlayInterface>(), alignment: align_of::<GstVideoOverlayInterface>()}),
|
||||
("GstVideoPackFlags", Layout {size: size_of::<GstVideoPackFlags>(), alignment: align_of::<GstVideoPackFlags>()}),
|
||||
("GstVideoPrimariesMode", Layout {size: size_of::<GstVideoPrimariesMode>(), alignment: align_of::<GstVideoPrimariesMode>()}),
|
||||
("GstVideoRectangle", Layout {size: size_of::<GstVideoRectangle>(), alignment: align_of::<GstVideoRectangle>()}),
|
||||
("GstVideoRegionOfInterestMeta", Layout {size: size_of::<GstVideoRegionOfInterestMeta>(), alignment: align_of::<GstVideoRegionOfInterestMeta>()}),
|
||||
("GstVideoResampler", Layout {size: size_of::<GstVideoResampler>(), alignment: align_of::<GstVideoResampler>()}),
|
||||
("GstVideoResamplerFlags", Layout {size: size_of::<GstVideoResamplerFlags>(), alignment: align_of::<GstVideoResamplerFlags>()}),
|
||||
("GstVideoResamplerMethod", Layout {size: size_of::<GstVideoResamplerMethod>(), alignment: align_of::<GstVideoResamplerMethod>()}),
|
||||
("GstVideoScalerFlags", Layout {size: size_of::<GstVideoScalerFlags>(), alignment: align_of::<GstVideoScalerFlags>()}),
|
||||
("GstVideoSink", Layout {size: size_of::<GstVideoSink>(), alignment: align_of::<GstVideoSink>()}),
|
||||
("GstVideoSinkClass", Layout {size: size_of::<GstVideoSinkClass>(), alignment: align_of::<GstVideoSinkClass>()}),
|
||||
("GstVideoTileMode", Layout {size: size_of::<GstVideoTileMode>(), alignment: align_of::<GstVideoTileMode>()}),
|
||||
("GstVideoTileType", Layout {size: size_of::<GstVideoTileType>(), alignment: align_of::<GstVideoTileType>()}),
|
||||
("GstVideoTimeCode", Layout {size: size_of::<GstVideoTimeCode>(), alignment: align_of::<GstVideoTimeCode>()}),
|
||||
("GstVideoTimeCodeConfig", Layout {size: size_of::<GstVideoTimeCodeConfig>(), alignment: align_of::<GstVideoTimeCodeConfig>()}),
|
||||
("GstVideoTimeCodeFlags", Layout {size: size_of::<GstVideoTimeCodeFlags>(), alignment: align_of::<GstVideoTimeCodeFlags>()}),
|
||||
("GstVideoTimeCodeInterval", Layout {size: size_of::<GstVideoTimeCodeInterval>(), alignment: align_of::<GstVideoTimeCodeInterval>()}),
|
||||
("GstVideoTimeCodeMeta", Layout {size: size_of::<GstVideoTimeCodeMeta>(), alignment: align_of::<GstVideoTimeCodeMeta>()}),
|
||||
("GstVideoTransferFunction", Layout {size: size_of::<GstVideoTransferFunction>(), alignment: align_of::<GstVideoTransferFunction>()}),
|
||||
("GstVideoVBIParserResult", Layout {size: size_of::<GstVideoVBIParserResult>(), alignment: align_of::<GstVideoVBIParserResult>()}),
|
||||
(
|
||||
"GstColorBalanceChannel",
|
||||
Layout {
|
||||
size: size_of::<GstColorBalanceChannel>(),
|
||||
alignment: align_of::<GstColorBalanceChannel>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstColorBalanceChannelClass",
|
||||
Layout {
|
||||
size: size_of::<GstColorBalanceChannelClass>(),
|
||||
alignment: align_of::<GstColorBalanceChannelClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstColorBalanceInterface",
|
||||
Layout {
|
||||
size: size_of::<GstColorBalanceInterface>(),
|
||||
alignment: align_of::<GstColorBalanceInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstColorBalanceType",
|
||||
Layout {
|
||||
size: size_of::<GstColorBalanceType>(),
|
||||
alignment: align_of::<GstColorBalanceType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNavigationCommand",
|
||||
Layout {
|
||||
size: size_of::<GstNavigationCommand>(),
|
||||
alignment: align_of::<GstNavigationCommand>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNavigationEventType",
|
||||
Layout {
|
||||
size: size_of::<GstNavigationEventType>(),
|
||||
alignment: align_of::<GstNavigationEventType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNavigationInterface",
|
||||
Layout {
|
||||
size: size_of::<GstNavigationInterface>(),
|
||||
alignment: align_of::<GstNavigationInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNavigationMessageType",
|
||||
Layout {
|
||||
size: size_of::<GstNavigationMessageType>(),
|
||||
alignment: align_of::<GstNavigationMessageType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstNavigationQueryType",
|
||||
Layout {
|
||||
size: size_of::<GstNavigationQueryType>(),
|
||||
alignment: align_of::<GstNavigationQueryType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAffineTransformationMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAffineTransformationMeta>(),
|
||||
alignment: align_of::<GstVideoAffineTransformationMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAggregator",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAggregator>(),
|
||||
alignment: align_of::<GstVideoAggregator>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAggregatorClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAggregatorClass>(),
|
||||
alignment: align_of::<GstVideoAggregatorClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAggregatorConvertPad",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAggregatorConvertPad>(),
|
||||
alignment: align_of::<GstVideoAggregatorConvertPad>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAggregatorConvertPadClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAggregatorConvertPadClass>(),
|
||||
alignment: align_of::<GstVideoAggregatorConvertPadClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAggregatorPad",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAggregatorPad>(),
|
||||
alignment: align_of::<GstVideoAggregatorPad>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAggregatorPadClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAggregatorPadClass>(),
|
||||
alignment: align_of::<GstVideoAggregatorPadClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAlignment",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAlignment>(),
|
||||
alignment: align_of::<GstVideoAlignment>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAlphaMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAlphaMode>(),
|
||||
alignment: align_of::<GstVideoAlphaMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAncillary",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAncillary>(),
|
||||
alignment: align_of::<GstVideoAncillary>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAncillaryDID",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAncillaryDID>(),
|
||||
alignment: align_of::<GstVideoAncillaryDID>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoAncillaryDID16",
|
||||
Layout {
|
||||
size: size_of::<GstVideoAncillaryDID16>(),
|
||||
alignment: align_of::<GstVideoAncillaryDID16>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoBufferFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoBufferFlags>(),
|
||||
alignment: align_of::<GstVideoBufferFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoBufferPool",
|
||||
Layout {
|
||||
size: size_of::<GstVideoBufferPool>(),
|
||||
alignment: align_of::<GstVideoBufferPool>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoBufferPoolClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoBufferPoolClass>(),
|
||||
alignment: align_of::<GstVideoBufferPoolClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoCaptionMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoCaptionMeta>(),
|
||||
alignment: align_of::<GstVideoCaptionMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoCaptionType",
|
||||
Layout {
|
||||
size: size_of::<GstVideoCaptionType>(),
|
||||
alignment: align_of::<GstVideoCaptionType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoChromaFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoChromaFlags>(),
|
||||
alignment: align_of::<GstVideoChromaFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoChromaMethod",
|
||||
Layout {
|
||||
size: size_of::<GstVideoChromaMethod>(),
|
||||
alignment: align_of::<GstVideoChromaMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoChromaMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoChromaMode>(),
|
||||
alignment: align_of::<GstVideoChromaMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoChromaSite",
|
||||
Layout {
|
||||
size: size_of::<GstVideoChromaSite>(),
|
||||
alignment: align_of::<GstVideoChromaSite>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoCodecFrame",
|
||||
Layout {
|
||||
size: size_of::<GstVideoCodecFrame>(),
|
||||
alignment: align_of::<GstVideoCodecFrame>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoCodecFrameFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoCodecFrameFlags>(),
|
||||
alignment: align_of::<GstVideoCodecFrameFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoCodecState",
|
||||
Layout {
|
||||
size: size_of::<GstVideoCodecState>(),
|
||||
alignment: align_of::<GstVideoCodecState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoColorMatrix",
|
||||
Layout {
|
||||
size: size_of::<GstVideoColorMatrix>(),
|
||||
alignment: align_of::<GstVideoColorMatrix>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoColorPrimaries",
|
||||
Layout {
|
||||
size: size_of::<GstVideoColorPrimaries>(),
|
||||
alignment: align_of::<GstVideoColorPrimaries>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoColorPrimariesInfo",
|
||||
Layout {
|
||||
size: size_of::<GstVideoColorPrimariesInfo>(),
|
||||
alignment: align_of::<GstVideoColorPrimariesInfo>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoColorRange",
|
||||
Layout {
|
||||
size: size_of::<GstVideoColorRange>(),
|
||||
alignment: align_of::<GstVideoColorRange>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoColorimetry",
|
||||
Layout {
|
||||
size: size_of::<GstVideoColorimetry>(),
|
||||
alignment: align_of::<GstVideoColorimetry>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoCropMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoCropMeta>(),
|
||||
alignment: align_of::<GstVideoCropMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoDecoder",
|
||||
Layout {
|
||||
size: size_of::<GstVideoDecoder>(),
|
||||
alignment: align_of::<GstVideoDecoder>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoDecoderClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoDecoderClass>(),
|
||||
alignment: align_of::<GstVideoDecoderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoDirectionInterface",
|
||||
Layout {
|
||||
size: size_of::<GstVideoDirectionInterface>(),
|
||||
alignment: align_of::<GstVideoDirectionInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoDitherFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoDitherFlags>(),
|
||||
alignment: align_of::<GstVideoDitherFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoDitherMethod",
|
||||
Layout {
|
||||
size: size_of::<GstVideoDitherMethod>(),
|
||||
alignment: align_of::<GstVideoDitherMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoEncoder",
|
||||
Layout {
|
||||
size: size_of::<GstVideoEncoder>(),
|
||||
alignment: align_of::<GstVideoEncoder>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoEncoderClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoEncoderClass>(),
|
||||
alignment: align_of::<GstVideoEncoderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFieldOrder",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFieldOrder>(),
|
||||
alignment: align_of::<GstVideoFieldOrder>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFilter",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFilter>(),
|
||||
alignment: align_of::<GstVideoFilter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFilterClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFilterClass>(),
|
||||
alignment: align_of::<GstVideoFilterClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFlags>(),
|
||||
alignment: align_of::<GstVideoFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFormat",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFormat>(),
|
||||
alignment: align_of::<GstVideoFormat>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFormatFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFormatFlags>(),
|
||||
alignment: align_of::<GstVideoFormatFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFormatInfo",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFormatInfo>(),
|
||||
alignment: align_of::<GstVideoFormatInfo>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFrame",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFrame>(),
|
||||
alignment: align_of::<GstVideoFrame>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFrameFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFrameFlags>(),
|
||||
alignment: align_of::<GstVideoFrameFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoFrameMapFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoFrameMapFlags>(),
|
||||
alignment: align_of::<GstVideoFrameMapFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoGLTextureOrientation",
|
||||
Layout {
|
||||
size: size_of::<GstVideoGLTextureOrientation>(),
|
||||
alignment: align_of::<GstVideoGLTextureOrientation>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoGLTextureType",
|
||||
Layout {
|
||||
size: size_of::<GstVideoGLTextureType>(),
|
||||
alignment: align_of::<GstVideoGLTextureType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoGLTextureUploadMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoGLTextureUploadMeta>(),
|
||||
alignment: align_of::<GstVideoGLTextureUploadMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoGammaMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoGammaMode>(),
|
||||
alignment: align_of::<GstVideoGammaMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoInfo",
|
||||
Layout {
|
||||
size: size_of::<GstVideoInfo>(),
|
||||
alignment: align_of::<GstVideoInfo>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoInterlaceMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoInterlaceMode>(),
|
||||
alignment: align_of::<GstVideoInterlaceMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoMatrixMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoMatrixMode>(),
|
||||
alignment: align_of::<GstVideoMatrixMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoMeta>(),
|
||||
alignment: align_of::<GstVideoMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoMetaTransform",
|
||||
Layout {
|
||||
size: size_of::<GstVideoMetaTransform>(),
|
||||
alignment: align_of::<GstVideoMetaTransform>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoMultiviewFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoMultiviewFlags>(),
|
||||
alignment: align_of::<GstVideoMultiviewFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoMultiviewFramePacking",
|
||||
Layout {
|
||||
size: size_of::<GstVideoMultiviewFramePacking>(),
|
||||
alignment: align_of::<GstVideoMultiviewFramePacking>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoMultiviewMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoMultiviewMode>(),
|
||||
alignment: align_of::<GstVideoMultiviewMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoOrientationInterface",
|
||||
Layout {
|
||||
size: size_of::<GstVideoOrientationInterface>(),
|
||||
alignment: align_of::<GstVideoOrientationInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoOrientationMethod",
|
||||
Layout {
|
||||
size: size_of::<GstVideoOrientationMethod>(),
|
||||
alignment: align_of::<GstVideoOrientationMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoOverlayCompositionMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoOverlayCompositionMeta>(),
|
||||
alignment: align_of::<GstVideoOverlayCompositionMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoOverlayFormatFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoOverlayFormatFlags>(),
|
||||
alignment: align_of::<GstVideoOverlayFormatFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoOverlayInterface",
|
||||
Layout {
|
||||
size: size_of::<GstVideoOverlayInterface>(),
|
||||
alignment: align_of::<GstVideoOverlayInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoPackFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoPackFlags>(),
|
||||
alignment: align_of::<GstVideoPackFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoPrimariesMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoPrimariesMode>(),
|
||||
alignment: align_of::<GstVideoPrimariesMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoRectangle",
|
||||
Layout {
|
||||
size: size_of::<GstVideoRectangle>(),
|
||||
alignment: align_of::<GstVideoRectangle>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoRegionOfInterestMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoRegionOfInterestMeta>(),
|
||||
alignment: align_of::<GstVideoRegionOfInterestMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoResampler",
|
||||
Layout {
|
||||
size: size_of::<GstVideoResampler>(),
|
||||
alignment: align_of::<GstVideoResampler>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoResamplerFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoResamplerFlags>(),
|
||||
alignment: align_of::<GstVideoResamplerFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoResamplerMethod",
|
||||
Layout {
|
||||
size: size_of::<GstVideoResamplerMethod>(),
|
||||
alignment: align_of::<GstVideoResamplerMethod>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoScalerFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoScalerFlags>(),
|
||||
alignment: align_of::<GstVideoScalerFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoSink",
|
||||
Layout {
|
||||
size: size_of::<GstVideoSink>(),
|
||||
alignment: align_of::<GstVideoSink>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoSinkClass",
|
||||
Layout {
|
||||
size: size_of::<GstVideoSinkClass>(),
|
||||
alignment: align_of::<GstVideoSinkClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTileMode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTileMode>(),
|
||||
alignment: align_of::<GstVideoTileMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTileType",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTileType>(),
|
||||
alignment: align_of::<GstVideoTileType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTimeCode",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTimeCode>(),
|
||||
alignment: align_of::<GstVideoTimeCode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTimeCodeConfig",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTimeCodeConfig>(),
|
||||
alignment: align_of::<GstVideoTimeCodeConfig>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTimeCodeFlags",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTimeCodeFlags>(),
|
||||
alignment: align_of::<GstVideoTimeCodeFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTimeCodeInterval",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTimeCodeInterval>(),
|
||||
alignment: align_of::<GstVideoTimeCodeInterval>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTimeCodeMeta",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTimeCodeMeta>(),
|
||||
alignment: align_of::<GstVideoTimeCodeMeta>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoTransferFunction",
|
||||
Layout {
|
||||
size: size_of::<GstVideoTransferFunction>(),
|
||||
alignment: align_of::<GstVideoTransferFunction>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstVideoVBIParserResult",
|
||||
Layout {
|
||||
size: size_of::<GstVideoVBIParserResult>(),
|
||||
alignment: align_of::<GstVideoVBIParserResult>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -735,5 +1294,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_VIDEO_VBI_PARSER_RESULT_ERROR", "2"),
|
||||
("(gint) GST_VIDEO_VBI_PARSER_RESULT_OK", "1"),
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ extern crate pkg_config;
|
|||
|
||||
use pkg_config::{Config, Error};
|
||||
use std::env;
|
||||
use std::io::prelude::*;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::process;
|
||||
|
||||
fn main() {
|
||||
|
@ -34,7 +34,7 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
println!("cargo:rustc-link-search=native={}", lib_dir);
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
|
||||
|
@ -56,8 +56,10 @@ fn find() -> Result<(), Error> {
|
|||
println!("cargo:rustc-link-lib=dylib={}", lib_);
|
||||
}
|
||||
for path in library.link_paths.iter() {
|
||||
println!("cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist"));
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
path.to_str().expect("library path doesn't exist")
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -71,4 +73,3 @@ fn find() -> Result<(), Error> {
|
|||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,18 +3,23 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]
|
||||
#![allow(
|
||||
clippy::approx_constant,
|
||||
clippy::type_complexity,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
|
||||
extern crate libc;
|
||||
extern crate glib_sys as glib;
|
||||
extern crate gobject_sys as gobject;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate gstreamer_sdp_sys as gst_sdp;
|
||||
extern crate gstreamer_sys as gst;
|
||||
extern crate libc;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
|
||||
c_short, c_ushort, c_long, c_ulong,
|
||||
c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
|
||||
use libc::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
||||
intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
|
||||
};
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use glib::{gboolean, gconstpointer, gpointer, GType};
|
||||
|
@ -143,7 +148,10 @@ pub struct GstWebRTCDTLSTransportClass {
|
|||
|
||||
impl ::std::fmt::Debug for GstWebRTCDTLSTransportClass {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstWebRTCDTLSTransportClass @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstWebRTCDTLSTransportClass @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent_class", &self.parent_class)
|
||||
.field("_padding", &self._padding)
|
||||
.finish()
|
||||
|
@ -160,7 +168,10 @@ pub struct GstWebRTCICETransportClass {
|
|||
|
||||
impl ::std::fmt::Debug for GstWebRTCICETransportClass {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstWebRTCICETransportClass @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstWebRTCICETransportClass @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent_class", &self.parent_class)
|
||||
.field("gather_candidates", &self.gather_candidates)
|
||||
.field("_padding", &self._padding)
|
||||
|
@ -177,7 +188,10 @@ pub struct GstWebRTCRTPReceiverClass {
|
|||
|
||||
impl ::std::fmt::Debug for GstWebRTCRTPReceiverClass {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstWebRTCRTPReceiverClass @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstWebRTCRTPReceiverClass @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent_class", &self.parent_class)
|
||||
.field("_padding", &self._padding)
|
||||
.finish()
|
||||
|
@ -209,7 +223,10 @@ pub struct GstWebRTCRTPTransceiverClass {
|
|||
|
||||
impl ::std::fmt::Debug for GstWebRTCRTPTransceiverClass {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstWebRTCRTPTransceiverClass @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstWebRTCRTPTransceiverClass @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("parent_class", &self.parent_class)
|
||||
.field("_padding", &self._padding)
|
||||
.finish()
|
||||
|
@ -225,7 +242,10 @@ pub struct GstWebRTCSessionDescription {
|
|||
|
||||
impl ::std::fmt::Debug for GstWebRTCSessionDescription {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
f.debug_struct(&format!("GstWebRTCSessionDescription @ {:?}", self as *const _))
|
||||
f.debug_struct(&format!(
|
||||
"GstWebRTCSessionDescription @ {:?}",
|
||||
self as *const _
|
||||
))
|
||||
.field("type_", &self.type_)
|
||||
.field("sdp", &self.sdp)
|
||||
.finish()
|
||||
|
@ -457,24 +477,46 @@ extern "C" {
|
|||
// GstWebRTCSessionDescription
|
||||
//=========================================================================
|
||||
pub fn gst_webrtc_session_description_get_type() -> GType;
|
||||
pub fn gst_webrtc_session_description_new(type_: GstWebRTCSDPType, sdp: *mut gst_sdp::GstSDPMessage) -> *mut GstWebRTCSessionDescription;
|
||||
pub fn gst_webrtc_session_description_copy(src: *const GstWebRTCSessionDescription) -> *mut GstWebRTCSessionDescription;
|
||||
pub fn gst_webrtc_session_description_new(
|
||||
type_: GstWebRTCSDPType,
|
||||
sdp: *mut gst_sdp::GstSDPMessage,
|
||||
) -> *mut GstWebRTCSessionDescription;
|
||||
pub fn gst_webrtc_session_description_copy(
|
||||
src: *const GstWebRTCSessionDescription,
|
||||
) -> *mut GstWebRTCSessionDescription;
|
||||
pub fn gst_webrtc_session_description_free(desc: *mut GstWebRTCSessionDescription);
|
||||
|
||||
//=========================================================================
|
||||
// GstWebRTCDTLSTransport
|
||||
//=========================================================================
|
||||
pub fn gst_webrtc_dtls_transport_get_type() -> GType;
|
||||
pub fn gst_webrtc_dtls_transport_new(session_id: c_uint, rtcp: gboolean) -> *mut GstWebRTCDTLSTransport;
|
||||
pub fn gst_webrtc_dtls_transport_set_transport(transport: *mut GstWebRTCDTLSTransport, ice: *mut GstWebRTCICETransport);
|
||||
pub fn gst_webrtc_dtls_transport_new(
|
||||
session_id: c_uint,
|
||||
rtcp: gboolean,
|
||||
) -> *mut GstWebRTCDTLSTransport;
|
||||
pub fn gst_webrtc_dtls_transport_set_transport(
|
||||
transport: *mut GstWebRTCDTLSTransport,
|
||||
ice: *mut GstWebRTCICETransport,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstWebRTCICETransport
|
||||
//=========================================================================
|
||||
pub fn gst_webrtc_ice_transport_get_type() -> GType;
|
||||
pub fn gst_webrtc_ice_transport_connection_state_change(ice: *mut GstWebRTCICETransport, new_state: GstWebRTCICEConnectionState);
|
||||
pub fn gst_webrtc_ice_transport_gathering_state_change(ice: *mut GstWebRTCICETransport, new_state: GstWebRTCICEGatheringState);
|
||||
pub fn gst_webrtc_ice_transport_new_candidate(ice: *mut GstWebRTCICETransport, stream_id: c_uint, component: GstWebRTCICEComponent, attr: *mut c_char);
|
||||
pub fn gst_webrtc_ice_transport_connection_state_change(
|
||||
ice: *mut GstWebRTCICETransport,
|
||||
new_state: GstWebRTCICEConnectionState,
|
||||
);
|
||||
pub fn gst_webrtc_ice_transport_gathering_state_change(
|
||||
ice: *mut GstWebRTCICETransport,
|
||||
new_state: GstWebRTCICEGatheringState,
|
||||
);
|
||||
pub fn gst_webrtc_ice_transport_new_candidate(
|
||||
ice: *mut GstWebRTCICETransport,
|
||||
stream_id: c_uint,
|
||||
component: GstWebRTCICEComponent,
|
||||
attr: *mut c_char,
|
||||
);
|
||||
pub fn gst_webrtc_ice_transport_selected_pair_change(ice: *mut GstWebRTCICETransport);
|
||||
|
||||
//=========================================================================
|
||||
|
@ -482,16 +524,28 @@ extern "C" {
|
|||
//=========================================================================
|
||||
pub fn gst_webrtc_rtp_receiver_get_type() -> GType;
|
||||
pub fn gst_webrtc_rtp_receiver_new() -> *mut GstWebRTCRTPReceiver;
|
||||
pub fn gst_webrtc_rtp_receiver_set_rtcp_transport(receiver: *mut GstWebRTCRTPReceiver, transport: *mut GstWebRTCDTLSTransport);
|
||||
pub fn gst_webrtc_rtp_receiver_set_transport(receiver: *mut GstWebRTCRTPReceiver, transport: *mut GstWebRTCDTLSTransport);
|
||||
pub fn gst_webrtc_rtp_receiver_set_rtcp_transport(
|
||||
receiver: *mut GstWebRTCRTPReceiver,
|
||||
transport: *mut GstWebRTCDTLSTransport,
|
||||
);
|
||||
pub fn gst_webrtc_rtp_receiver_set_transport(
|
||||
receiver: *mut GstWebRTCRTPReceiver,
|
||||
transport: *mut GstWebRTCDTLSTransport,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstWebRTCRTPSender
|
||||
//=========================================================================
|
||||
pub fn gst_webrtc_rtp_sender_get_type() -> GType;
|
||||
pub fn gst_webrtc_rtp_sender_new() -> *mut GstWebRTCRTPSender;
|
||||
pub fn gst_webrtc_rtp_sender_set_rtcp_transport(sender: *mut GstWebRTCRTPSender, transport: *mut GstWebRTCDTLSTransport);
|
||||
pub fn gst_webrtc_rtp_sender_set_transport(sender: *mut GstWebRTCRTPSender, transport: *mut GstWebRTCDTLSTransport);
|
||||
pub fn gst_webrtc_rtp_sender_set_rtcp_transport(
|
||||
sender: *mut GstWebRTCRTPSender,
|
||||
transport: *mut GstWebRTCDTLSTransport,
|
||||
);
|
||||
pub fn gst_webrtc_rtp_sender_set_transport(
|
||||
sender: *mut GstWebRTCRTPSender,
|
||||
transport: *mut GstWebRTCDTLSTransport,
|
||||
);
|
||||
|
||||
//=========================================================================
|
||||
// GstWebRTCRTPTransceiver
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
extern crate gstreamer_webrtc_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempdir;
|
||||
use gstreamer_webrtc_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use gstreamer_webrtc_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["gstreamer-webrtc-1.0"];
|
||||
|
||||
|
@ -47,8 +47,7 @@ impl Compiler {
|
|||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -77,14 +76,12 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
|
|||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
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,
|
||||
|
@ -115,9 +112,8 @@ impl Results {
|
|||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
self.passed, self.failed, self.failed_to_compile
|
||||
)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
|
@ -133,9 +129,11 @@ fn cross_validate_constants_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!("1",
|
||||
assert_eq!(
|
||||
"1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
"failed to obtain correct constant value for 1"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
|
@ -143,14 +141,16 @@ fn cross_validate_constants_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,9 +166,14 @@ fn cross_validate_layout_with_c() {
|
|||
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
assert_eq!(
|
||||
Layout {
|
||||
size: 1,
|
||||
alignment: 1
|
||||
},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
"failed to obtain correct layout for char type"
|
||||
);
|
||||
|
||||
let mut results: Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
|
@ -176,14 +181,16 @@ fn cross_validate_layout_with_c() {
|
|||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
}
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,8 +210,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
|
@ -223,49 +229,218 @@ fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Erro
|
|||
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());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") {
|
||||
return Err(format!(
|
||||
"command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("GstWebRTCBundlePolicy", Layout {size: size_of::<GstWebRTCBundlePolicy>(), alignment: align_of::<GstWebRTCBundlePolicy>()}),
|
||||
("GstWebRTCDTLSSetup", Layout {size: size_of::<GstWebRTCDTLSSetup>(), alignment: align_of::<GstWebRTCDTLSSetup>()}),
|
||||
("GstWebRTCDTLSTransport", Layout {size: size_of::<GstWebRTCDTLSTransport>(), alignment: align_of::<GstWebRTCDTLSTransport>()}),
|
||||
("GstWebRTCDTLSTransportClass", Layout {size: size_of::<GstWebRTCDTLSTransportClass>(), alignment: align_of::<GstWebRTCDTLSTransportClass>()}),
|
||||
("GstWebRTCDTLSTransportState", Layout {size: size_of::<GstWebRTCDTLSTransportState>(), alignment: align_of::<GstWebRTCDTLSTransportState>()}),
|
||||
("GstWebRTCDataChannelState", Layout {size: size_of::<GstWebRTCDataChannelState>(), alignment: align_of::<GstWebRTCDataChannelState>()}),
|
||||
("GstWebRTCFECType", Layout {size: size_of::<GstWebRTCFECType>(), alignment: align_of::<GstWebRTCFECType>()}),
|
||||
("GstWebRTCICEComponent", Layout {size: size_of::<GstWebRTCICEComponent>(), alignment: align_of::<GstWebRTCICEComponent>()}),
|
||||
("GstWebRTCICEConnectionState", Layout {size: size_of::<GstWebRTCICEConnectionState>(), alignment: align_of::<GstWebRTCICEConnectionState>()}),
|
||||
("GstWebRTCICEGatheringState", Layout {size: size_of::<GstWebRTCICEGatheringState>(), alignment: align_of::<GstWebRTCICEGatheringState>()}),
|
||||
("GstWebRTCICERole", Layout {size: size_of::<GstWebRTCICERole>(), alignment: align_of::<GstWebRTCICERole>()}),
|
||||
("GstWebRTCICETransport", Layout {size: size_of::<GstWebRTCICETransport>(), alignment: align_of::<GstWebRTCICETransport>()}),
|
||||
("GstWebRTCICETransportClass", Layout {size: size_of::<GstWebRTCICETransportClass>(), alignment: align_of::<GstWebRTCICETransportClass>()}),
|
||||
("GstWebRTCICETransportPolicy", Layout {size: size_of::<GstWebRTCICETransportPolicy>(), alignment: align_of::<GstWebRTCICETransportPolicy>()}),
|
||||
("GstWebRTCPeerConnectionState", Layout {size: size_of::<GstWebRTCPeerConnectionState>(), alignment: align_of::<GstWebRTCPeerConnectionState>()}),
|
||||
("GstWebRTCPriorityType", Layout {size: size_of::<GstWebRTCPriorityType>(), alignment: align_of::<GstWebRTCPriorityType>()}),
|
||||
("GstWebRTCRTPReceiver", Layout {size: size_of::<GstWebRTCRTPReceiver>(), alignment: align_of::<GstWebRTCRTPReceiver>()}),
|
||||
("GstWebRTCRTPReceiverClass", Layout {size: size_of::<GstWebRTCRTPReceiverClass>(), alignment: align_of::<GstWebRTCRTPReceiverClass>()}),
|
||||
("GstWebRTCRTPSender", Layout {size: size_of::<GstWebRTCRTPSender>(), alignment: align_of::<GstWebRTCRTPSender>()}),
|
||||
("GstWebRTCRTPSenderClass", Layout {size: size_of::<GstWebRTCRTPSenderClass>(), alignment: align_of::<GstWebRTCRTPSenderClass>()}),
|
||||
("GstWebRTCRTPTransceiver", Layout {size: size_of::<GstWebRTCRTPTransceiver>(), alignment: align_of::<GstWebRTCRTPTransceiver>()}),
|
||||
("GstWebRTCRTPTransceiverClass", Layout {size: size_of::<GstWebRTCRTPTransceiverClass>(), alignment: align_of::<GstWebRTCRTPTransceiverClass>()}),
|
||||
("GstWebRTCRTPTransceiverDirection", Layout {size: size_of::<GstWebRTCRTPTransceiverDirection>(), alignment: align_of::<GstWebRTCRTPTransceiverDirection>()}),
|
||||
("GstWebRTCSCTPTransportState", Layout {size: size_of::<GstWebRTCSCTPTransportState>(), alignment: align_of::<GstWebRTCSCTPTransportState>()}),
|
||||
("GstWebRTCSDPType", Layout {size: size_of::<GstWebRTCSDPType>(), alignment: align_of::<GstWebRTCSDPType>()}),
|
||||
("GstWebRTCSessionDescription", Layout {size: size_of::<GstWebRTCSessionDescription>(), alignment: align_of::<GstWebRTCSessionDescription>()}),
|
||||
("GstWebRTCSignalingState", Layout {size: size_of::<GstWebRTCSignalingState>(), alignment: align_of::<GstWebRTCSignalingState>()}),
|
||||
("GstWebRTCStatsType", Layout {size: size_of::<GstWebRTCStatsType>(), alignment: align_of::<GstWebRTCStatsType>()}),
|
||||
(
|
||||
"GstWebRTCBundlePolicy",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCBundlePolicy>(),
|
||||
alignment: align_of::<GstWebRTCBundlePolicy>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCDTLSSetup",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCDTLSSetup>(),
|
||||
alignment: align_of::<GstWebRTCDTLSSetup>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCDTLSTransport",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCDTLSTransport>(),
|
||||
alignment: align_of::<GstWebRTCDTLSTransport>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCDTLSTransportClass",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCDTLSTransportClass>(),
|
||||
alignment: align_of::<GstWebRTCDTLSTransportClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCDTLSTransportState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCDTLSTransportState>(),
|
||||
alignment: align_of::<GstWebRTCDTLSTransportState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCDataChannelState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCDataChannelState>(),
|
||||
alignment: align_of::<GstWebRTCDataChannelState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCFECType",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCFECType>(),
|
||||
alignment: align_of::<GstWebRTCFECType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICEComponent",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICEComponent>(),
|
||||
alignment: align_of::<GstWebRTCICEComponent>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICEConnectionState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICEConnectionState>(),
|
||||
alignment: align_of::<GstWebRTCICEConnectionState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICEGatheringState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICEGatheringState>(),
|
||||
alignment: align_of::<GstWebRTCICEGatheringState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICERole",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICERole>(),
|
||||
alignment: align_of::<GstWebRTCICERole>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICETransport",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICETransport>(),
|
||||
alignment: align_of::<GstWebRTCICETransport>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICETransportClass",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICETransportClass>(),
|
||||
alignment: align_of::<GstWebRTCICETransportClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCICETransportPolicy",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCICETransportPolicy>(),
|
||||
alignment: align_of::<GstWebRTCICETransportPolicy>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCPeerConnectionState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCPeerConnectionState>(),
|
||||
alignment: align_of::<GstWebRTCPeerConnectionState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCPriorityType",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCPriorityType>(),
|
||||
alignment: align_of::<GstWebRTCPriorityType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPReceiver",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPReceiver>(),
|
||||
alignment: align_of::<GstWebRTCRTPReceiver>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPReceiverClass",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPReceiverClass>(),
|
||||
alignment: align_of::<GstWebRTCRTPReceiverClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPSender",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPSender>(),
|
||||
alignment: align_of::<GstWebRTCRTPSender>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPSenderClass",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPSenderClass>(),
|
||||
alignment: align_of::<GstWebRTCRTPSenderClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPTransceiver",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPTransceiver>(),
|
||||
alignment: align_of::<GstWebRTCRTPTransceiver>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPTransceiverClass",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPTransceiverClass>(),
|
||||
alignment: align_of::<GstWebRTCRTPTransceiverClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCRTPTransceiverDirection",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCRTPTransceiverDirection>(),
|
||||
alignment: align_of::<GstWebRTCRTPTransceiverDirection>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCSCTPTransportState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCSCTPTransportState>(),
|
||||
alignment: align_of::<GstWebRTCSCTPTransportState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCSDPType",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCSDPType>(),
|
||||
alignment: align_of::<GstWebRTCSDPType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCSessionDescription",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCSessionDescription>(),
|
||||
alignment: align_of::<GstWebRTCSessionDescription>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCSignalingState",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCSignalingState>(),
|
||||
alignment: align_of::<GstWebRTCSignalingState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"GstWebRTCStatsType",
|
||||
Layout {
|
||||
size: size_of::<GstWebRTCStatsType>(),
|
||||
alignment: align_of::<GstWebRTCStatsType>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
|
@ -332,7 +507,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER", "2"),
|
||||
("(gint) GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER", "4"),
|
||||
("(gint) GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER", "3"),
|
||||
("(gint) GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER", "5"),
|
||||
(
|
||||
"(gint) GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER",
|
||||
"5",
|
||||
),
|
||||
("(gint) GST_WEBRTC_SIGNALING_STATE_STABLE", "0"),
|
||||
("(gint) GST_WEBRTC_STATS_CANDIDATE_PAIR", "11"),
|
||||
("(gint) GST_WEBRTC_STATS_CERTIFICATE", "14"),
|
||||
|
@ -349,5 +527,3 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
|||
("(gint) GST_WEBRTC_STATS_STREAM", "9"),
|
||||
("(gint) GST_WEBRTC_STATS_TRANSPORT", "10"),
|
||||
];
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue