Clean up global functions

This commit is contained in:
Sebastian Dröge 2017-08-17 15:31:00 +03:00
parent 33fb38efd9
commit e7a0543c73
6 changed files with 388 additions and 629 deletions

View file

@ -68,6 +68,9 @@ generate = [
"Gst.ElementFlags",
"Gst.Rank",
"Gst.PadLinkCheck",
"Gst.DebugLevel",
"Gst.StackTraceFlags",
"Gst.DebugGraphDetails",
]
manual = [
@ -558,3 +561,154 @@ status = "generate"
name = "calculate_linear_regression"
ignore = true
[[object.function]]
pattern = "value_.*"
ignore = true
[[object.function]]
pattern = ".*_get_type"
ignore = true
[[object.function]]
pattern = "tag_.*"
ignore = true
[[object.function]]
pattern = "segtrap_.*"
ignore = true
[[object.function]]
pattern = "util_[g]?double_.*"
ignore = true
[[object.function]]
pattern = "util_fraction_.*"
ignore = true
[[object.function]]
pattern = "util_greatest_.*"
ignore = true
[[object.function]]
pattern = "util_[g]?uint64.*"
ignore = true
[[object.function]]
name = "deinit"
ignore = true
[[object.function]]
name = "util_set_object_arg"
ignore = true
[[object.function]]
name = "util_seqnum_compare"
ignore = true
[[object.function]]
name = "dynamic_type_register"
ignore = true
[[object.function]]
name = "flow_get_name"
ignore = true
[[object.function]]
name = "filename_to_uri"
ignore = true
[[object.function]]
name = "is_initialized"
ignore = true
[[object.function]]
name = "debug_add_log_function"
ignore = true
[[object.function]]
name = "debug_remove_log_function"
ignore = true
[[object.function]]
name = "debug_remove_log_function_by_data"
ignore = true
[[object.function]]
name = "debug_construct_term_color"
ignore = true
[[object.function]]
name = "debug_construct_win_color"
ignore = true
[[object.function]]
name = "debug_get_all_categories"
ignore = true
[[object.function]]
name = "debug_get_color_mode"
ignore = true
[[object.function]]
pattern = "debug_log.*"
ignore = true
[[object.function]]
name = "debug_set_color_mode"
ignore = true
[[object.function]]
name = "debug_set_color_mode_from_string"
ignore = true
[[object.function]]
name = "error_get_message"
ignore = true
[[object.function]]
name = "flow_to_quark"
ignore = true
[[object.function]]
name = "formats_contains"
ignore = true
[[object.function]]
pattern = "info_.*"
ignore = true
[[object.function]]
pattern = "print.*"
ignore = true
[[object.function]]
pattern = "init.*"
ignore = true
[[object.function]]
pattern = "param_spec_.*"
ignore = true
[[object.function]]
name = "is_caps_features"
ignore = true
[[object.function]]
name = "make_element_message_details"
ignore = true
[[object.function]]
name = "util_array_binary_search"
ignore = true
[[object.function]]
name = "util_get_object_array"
ignore = true
[[object.function]]
name = "util_set_object_array"
ignore = true
[[object.function]]
name = "util_set_value_from_string"
ignore = true

View file

@ -455,6 +455,87 @@ impl SetValue for CoreError {
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum DebugLevel {
None,
Error,
Warning,
Fixme,
Info,
Debug,
Log,
Trace,
Memdump,
Count,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for DebugLevel {
type GlibType = ffi::GstDebugLevel;
fn to_glib(&self) -> ffi::GstDebugLevel {
match *self {
DebugLevel::None => ffi::GST_LEVEL_NONE,
DebugLevel::Error => ffi::GST_LEVEL_ERROR,
DebugLevel::Warning => ffi::GST_LEVEL_WARNING,
DebugLevel::Fixme => ffi::GST_LEVEL_FIXME,
DebugLevel::Info => ffi::GST_LEVEL_INFO,
DebugLevel::Debug => ffi::GST_LEVEL_DEBUG,
DebugLevel::Log => ffi::GST_LEVEL_LOG,
DebugLevel::Trace => ffi::GST_LEVEL_TRACE,
DebugLevel::Memdump => ffi::GST_LEVEL_MEMDUMP,
DebugLevel::Count => ffi::GST_LEVEL_COUNT,
DebugLevel::__Unknown(value) => unsafe{std::mem::transmute(value)}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstDebugLevel> for DebugLevel {
fn from_glib(value: ffi::GstDebugLevel) -> Self {
skip_assert_initialized!();
match value as i32 {
0 => DebugLevel::None,
1 => DebugLevel::Error,
2 => DebugLevel::Warning,
3 => DebugLevel::Fixme,
4 => DebugLevel::Info,
5 => DebugLevel::Debug,
6 => DebugLevel::Log,
7 => DebugLevel::Trace,
9 => DebugLevel::Memdump,
10 => DebugLevel::Count,
value => DebugLevel::__Unknown(value),
}
}
}
impl StaticType for DebugLevel {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_debug_level_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for DebugLevel {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for DebugLevel {
unsafe fn from_value(value: &Value) -> Self {
from_glib(std::mem::transmute::<i32, ffi::GstDebugLevel>(gobject_ffi::g_value_get_enum(value.to_glib_none().0)))
}
}
impl SetValue for DebugLevel {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32)
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum EventType {
Unknown,

View file

@ -67,6 +67,59 @@ impl SetValue for BufferFlags {
}
}
bitflags! {
pub struct DebugGraphDetails: u32 {
const DEBUG_GRAPH_SHOW_MEDIA_TYPE = 1;
const DEBUG_GRAPH_SHOW_CAPS_DETAILS = 2;
const DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS = 4;
const DEBUG_GRAPH_SHOW_STATES = 8;
const DEBUG_GRAPH_SHOW_FULL_PARAMS = 16;
const DEBUG_GRAPH_SHOW_ALL = 15;
const DEBUG_GRAPH_SHOW_VERBOSE = 4294967295;
}
}
#[doc(hidden)]
impl ToGlib for DebugGraphDetails {
type GlibType = ffi::GstDebugGraphDetails;
fn to_glib(&self) -> ffi::GstDebugGraphDetails {
ffi::GstDebugGraphDetails::from_bits_truncate(self.bits())
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstDebugGraphDetails> for DebugGraphDetails {
fn from_glib(value: ffi::GstDebugGraphDetails) -> DebugGraphDetails {
skip_assert_initialized!();
DebugGraphDetails::from_bits_truncate(value.bits())
}
}
impl StaticType for DebugGraphDetails {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_debug_graph_details_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for DebugGraphDetails {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for DebugGraphDetails {
unsafe fn from_value(value: &Value) -> Self {
from_glib(ffi::GstDebugGraphDetails::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
}
}
impl SetValue for DebugGraphDetails {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
}
}
bitflags! {
pub struct ElementFlags: u32 {
const ELEMENT_FLAG_LOCKED_STATE = 16;
@ -400,6 +453,53 @@ impl SetValue for SegmentFlags {
}
}
bitflags! {
pub struct StackTraceFlags: u32 {
const STACK_TRACE_SHOW_FULL = 1;
}
}
#[doc(hidden)]
impl ToGlib for StackTraceFlags {
type GlibType = ffi::GstStackTraceFlags;
fn to_glib(&self) -> ffi::GstStackTraceFlags {
ffi::GstStackTraceFlags::from_bits_truncate(self.bits())
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstStackTraceFlags> for StackTraceFlags {
fn from_glib(value: ffi::GstStackTraceFlags) -> StackTraceFlags {
skip_assert_initialized!();
StackTraceFlags::from_bits_truncate(value.bits())
}
}
impl StaticType for StackTraceFlags {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_stack_trace_flags_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for StackTraceFlags {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for StackTraceFlags {
unsafe fn from_value(value: &Value) -> Self {
from_glib(ffi::GstStackTraceFlags::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
}
}
impl SetValue for StackTraceFlags {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
}
}
bitflags! {
pub struct StreamFlags: u32 {
const STREAM_FLAG_NONE = 0;

View file

@ -3,10 +3,12 @@
use Bin;
use ClockTime;
use DebugGraphDetails;
use DebugLevel;
use Element;
use Error;
use FlowReturn;
use Plugin;
#[cfg(feature = "v1_12")]
use StackTraceFlags;
use ffi;
use glib;
use glib::object::IsA;
@ -15,52 +17,41 @@ use std::mem;
use std::ptr;
//pub fn debug_add_log_function<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(func: /*Unknown conversion*//*Unimplemented*/LogFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_debug_add_log_function() }
//}
//pub fn debug_bin_to_dot_data<P: IsA<Bin>>(bin: &P, details: /*Ignored*/DebugGraphDetails) -> Option<String> {
// unsafe { TODO: call ffi::gst_debug_bin_to_dot_data() }
//}
//pub fn debug_bin_to_dot_file<P: IsA<Bin>>(bin: &P, details: /*Ignored*/DebugGraphDetails, file_name: &str) {
// unsafe { TODO: call ffi::gst_debug_bin_to_dot_file() }
//}
//pub fn debug_bin_to_dot_file_with_ts<P: IsA<Bin>>(bin: &P, details: /*Ignored*/DebugGraphDetails, file_name: &str) {
// unsafe { TODO: call ffi::gst_debug_bin_to_dot_file_with_ts() }
//}
pub fn debug_construct_term_color(colorinfo: u32) -> Option<String> {
assert_initialized_main_thread!();
pub fn debug_bin_to_dot_data<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails) -> Option<String> {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::gst_debug_construct_term_color(colorinfo))
from_glib_full(ffi::gst_debug_bin_to_dot_data(bin.to_glib_none().0, details.to_glib()))
}
}
pub fn debug_construct_win_color(colorinfo: u32) -> i32 {
assert_initialized_main_thread!();
pub fn debug_bin_to_dot_file<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails, file_name: &str) {
skip_assert_initialized!();
unsafe {
ffi::gst_debug_construct_win_color(colorinfo)
ffi::gst_debug_bin_to_dot_file(bin.to_glib_none().0, details.to_glib(), file_name.to_glib_none().0);
}
}
//pub fn debug_get_all_categories() -> /*Ignored*/Vec<DebugCategory> {
// unsafe { TODO: call ffi::gst_debug_get_all_categories() }
//}
pub fn debug_bin_to_dot_file_with_ts<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails, file_name: &str) {
skip_assert_initialized!();
unsafe {
ffi::gst_debug_bin_to_dot_file_with_ts(bin.to_glib_none().0, details.to_glib(), file_name.to_glib_none().0);
}
}
//pub fn debug_get_color_mode() -> /*Ignored*/DebugColorMode {
// unsafe { TODO: call ffi::gst_debug_get_color_mode() }
//}
pub fn debug_get_default_threshold() -> DebugLevel {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_debug_get_default_threshold())
}
}
//pub fn debug_get_default_threshold() -> /*Ignored*/DebugLevel {
// unsafe { TODO: call ffi::gst_debug_get_default_threshold() }
//}
//#[cfg(feature = "v1_12")]
//pub fn debug_get_stack_trace(flags: /*Ignored*/StackTraceFlags) -> Option<String> {
// unsafe { TODO: call ffi::gst_debug_get_stack_trace() }
//}
#[cfg(feature = "v1_12")]
pub fn debug_get_stack_trace(flags: StackTraceFlags) -> Option<String> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_debug_get_stack_trace(flags.to_glib()))
}
}
pub fn debug_is_active() -> bool {
assert_initialized_main_thread!();
@ -76,18 +67,6 @@ pub fn debug_is_colored() -> bool {
}
}
//pub fn debug_log<'a, P: IsA<glib::Object> + 'a, Q: Into<Option<&'a P>>>(category: /*Ignored*/&mut DebugCategory, level: /*Ignored*/DebugLevel, file: &str, function: &str, line: i32, object: Q, format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_debug_log() }
//}
//pub fn debug_log_default<'a, P: IsA<glib::Object> + 'a, Q: Into<Option<&'a P>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(category: /*Ignored*/&mut DebugCategory, level: /*Ignored*/DebugLevel, file: &str, function: &str, line: i32, object: Q, message: /*Ignored*/&mut DebugMessage, user_data: R) {
// unsafe { TODO: call ffi::gst_debug_log_default() }
//}
//pub fn debug_log_valist<'a, P: IsA<glib::Object> + 'a, Q: Into<Option<&'a P>>>(category: /*Ignored*/&mut DebugCategory, level: /*Ignored*/DebugLevel, file: &str, function: &str, line: i32, object: Q, format: &str, args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
// unsafe { TODO: call ffi::gst_debug_log_valist() }
//}
pub fn debug_print_stack_trace() {
assert_initialized_main_thread!();
unsafe {
@ -95,14 +74,6 @@ pub fn debug_print_stack_trace() {
}
}
//pub fn debug_remove_log_function<'a, P: Into<Option<&'a /*Unimplemented*/LogFunction>>>(func: P) -> u32 {
// unsafe { TODO: call ffi::gst_debug_remove_log_function() }
//}
//pub fn debug_remove_log_function_by_data<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(data: P) -> u32 {
// unsafe { TODO: call ffi::gst_debug_remove_log_function_by_data() }
//}
pub fn debug_set_active(active: bool) {
assert_initialized_main_thread!();
unsafe {
@ -110,17 +81,6 @@ pub fn debug_set_active(active: bool) {
}
}
//pub fn debug_set_color_mode(mode: /*Ignored*/DebugColorMode) {
// unsafe { TODO: call ffi::gst_debug_set_color_mode() }
//}
pub fn debug_set_color_mode_from_string(mode: &str) {
assert_initialized_main_thread!();
unsafe {
ffi::gst_debug_set_color_mode_from_string(mode.to_glib_none().0);
}
}
pub fn debug_set_colored(colored: bool) {
assert_initialized_main_thread!();
unsafe {
@ -128,13 +88,19 @@ pub fn debug_set_colored(colored: bool) {
}
}
//pub fn debug_set_default_threshold(level: /*Ignored*/DebugLevel) {
// unsafe { TODO: call ffi::gst_debug_set_default_threshold() }
//}
pub fn debug_set_default_threshold(level: DebugLevel) {
assert_initialized_main_thread!();
unsafe {
ffi::gst_debug_set_default_threshold(level.to_glib());
}
}
//pub fn debug_set_threshold_for_name(name: &str, level: /*Ignored*/DebugLevel) {
// unsafe { TODO: call ffi::gst_debug_set_threshold_for_name() }
//}
pub fn debug_set_threshold_for_name(name: &str, level: DebugLevel) {
assert_initialized_main_thread!();
unsafe {
ffi::gst_debug_set_threshold_for_name(name.to_glib_none().0, level.to_glib());
}
}
pub fn debug_set_threshold_from_string(list: &str, reset: bool) {
assert_initialized_main_thread!();
@ -150,102 +116,6 @@ pub fn debug_unset_threshold_for_name(name: &str) {
}
}
pub fn deinit() {
assert_initialized_main_thread!();
unsafe {
ffi::gst_deinit();
}
}
pub fn dynamic_type_register(plugin: &Plugin, type_: glib::types::Type) -> bool {
skip_assert_initialized!();
unsafe {
from_glib(ffi::gst_dynamic_type_register(plugin.to_glib_none().0, type_.to_glib()))
}
}
//pub fn error_get_message(domain: /*Ignored*/glib::Quark, code: i32) -> Option<String> {
// unsafe { TODO: call ffi::gst_error_get_message() }
//}
pub fn filename_to_uri(filename: &str) -> Result<String, Error> {
assert_initialized_main_thread!();
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::gst_filename_to_uri(filename.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
pub fn flow_get_name(ret: FlowReturn) -> Option<String> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ffi::gst_flow_get_name(ret.to_glib()))
}
}
//pub fn flow_to_quark(ret: FlowReturn) -> /*Ignored*/glib::Quark {
// unsafe { TODO: call ffi::gst_flow_to_quark() }
//}
//pub fn formats_contains(formats: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 56 }, format: Format) -> bool {
// unsafe { TODO: call ffi::gst_formats_contains() }
//}
//pub fn info_strdup_printf(format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<String> {
// unsafe { TODO: call ffi::gst_info_strdup_printf() }
//}
//pub fn info_strdup_vprintf(format: &str, args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<String> {
// unsafe { TODO: call ffi::gst_info_strdup_vprintf() }
//}
//pub fn info_vasprintf(format: &str, args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> (i32, String) {
// unsafe { TODO: call ffi::gst_info_vasprintf() }
//}
//pub fn init<P: Into<Option<i32>>>(argv: /*Unimplemented*/Vec<String>) {
// unsafe { TODO: call ffi::gst_init() }
//}
//pub fn init_check<P: Into<Option<i32>>>(argv: /*Unimplemented*/Vec<String>) -> Result<(), Error> {
// unsafe { TODO: call ffi::gst_init_check() }
//}
//pub fn init_get_option_group() -> /*Ignored*/Option<glib::OptionGroup> {
// unsafe { TODO: call ffi::gst_init_get_option_group() }
//}
//pub fn is_caps_features<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(obj: P) -> bool {
// unsafe { TODO: call ffi::gst_is_caps_features() }
//}
pub fn is_initialized() -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_is_initialized())
}
}
//pub fn make_element_message_details(name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<Structure> {
// unsafe { TODO: call ffi::gst_make_element_message_details() }
//}
//pub fn param_spec_array<P: IsA</*Ignored*/glib::ParamSpec>>(name: &str, nick: &str, blurb: &str, element_spec: &P, flags: /*Ignored*/glib::ParamFlags) -> /*Ignored*/Option<glib::ParamSpec> {
// unsafe { TODO: call ffi::gst_param_spec_array() }
//}
//pub fn param_spec_fraction(name: &str, nick: &str, blurb: &str, min_num: i32, min_denom: i32, max_num: i32, max_denom: i32, default_num: i32, default_denom: i32, flags: /*Ignored*/glib::ParamFlags) -> /*Ignored*/Option<glib::ParamSpec> {
// unsafe { TODO: call ffi::gst_param_spec_fraction() }
//}
pub fn parent_buffer_meta_api_get_type() -> glib::types::Type {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_parent_buffer_meta_api_get_type())
}
}
pub fn parse_bin_from_description(bin_description: &str, ghost_unlinked_pads: bool) -> Result<Option<Bin>, Error> {
assert_initialized_main_thread!();
unsafe {
@ -285,123 +155,6 @@ pub fn parse_launchv(argv: &[&str]) -> Result<Element, Error> {
// unsafe { TODO: call ffi::gst_parse_launchv_full() }
//}
//#[cfg(feature = "v1_12")]
//pub fn print(format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_print() }
//}
//#[cfg(feature = "v1_12")]
//pub fn printerr(format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_printerr() }
//}
//#[cfg(feature = "v1_12")]
//pub fn printerrln(format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_printerrln() }
//}
//#[cfg(feature = "v1_12")]
//pub fn println(format: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_println() }
//}
pub fn protection_meta_api_get_type() -> glib::types::Type {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_protection_meta_api_get_type())
}
}
pub fn segtrap_is_enabled() -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_segtrap_is_enabled())
}
}
pub fn segtrap_set_enabled(enabled: bool) {
assert_initialized_main_thread!();
unsafe {
ffi::gst_segtrap_set_enabled(enabled.to_glib());
}
}
pub fn static_caps_get_type() -> glib::types::Type {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_static_caps_get_type())
}
}
pub fn static_pad_template_get_type() -> glib::types::Type {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_static_pad_template_get_type())
}
}
pub fn tag_exists(tag: &str) -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_tag_exists(tag.to_glib_none().0))
}
}
pub fn tag_get_description(tag: &str) -> Option<String> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ffi::gst_tag_get_description(tag.to_glib_none().0))
}
}
//pub fn tag_get_flag(tag: &str) -> /*Ignored*/TagFlag {
// unsafe { TODO: call ffi::gst_tag_get_flag() }
//}
pub fn tag_get_nick(tag: &str) -> Option<String> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ffi::gst_tag_get_nick(tag.to_glib_none().0))
}
}
pub fn tag_get_type(tag: &str) -> glib::types::Type {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_tag_get_type(tag.to_glib_none().0))
}
}
pub fn tag_is_fixed(tag: &str) -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_tag_is_fixed(tag.to_glib_none().0))
}
}
//pub fn tag_merge_strings_with_comma(dest: /*Ignored*/glib::Value, src: /*Ignored*/&glib::Value) {
// unsafe { TODO: call ffi::gst_tag_merge_strings_with_comma() }
//}
//pub fn tag_merge_use_first(dest: /*Ignored*/glib::Value, src: /*Ignored*/&glib::Value) {
// unsafe { TODO: call ffi::gst_tag_merge_use_first() }
//}
//pub fn tag_register<'a, P: Into<Option<&'a /*Unimplemented*/TagMergeFunc>>>(name: &str, flag: /*Ignored*/TagFlag, type_: glib::types::Type, nick: &str, blurb: &str, func: P) {
// unsafe { TODO: call ffi::gst_tag_register() }
//}
//pub fn tag_register_static<'a, P: Into<Option<&'a /*Unimplemented*/TagMergeFunc>>>(name: &str, flag: /*Ignored*/TagFlag, type_: glib::types::Type, nick: &str, blurb: &str, func: P) {
// unsafe { TODO: call ffi::gst_tag_register_static() }
//}
pub fn type_find_get_type() -> glib::types::Type {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_type_find_get_type())
}
}
pub fn update_registry() -> Result<(), glib::error::BoolError> {
assert_initialized_main_thread!();
unsafe {
@ -409,68 +162,6 @@ pub fn update_registry() -> Result<(), glib::error::BoolError> {
}
}
//pub fn util_array_binary_search<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>, R: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(array: P, num_elements: u32, element_size: usize, search_func: /*Unknown conversion*//*Unimplemented*/CompareDataFunc, mode: /*Ignored*/SearchMode, search_data: Q, user_data: R) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::gst_util_array_binary_search() }
//}
pub fn util_double_to_fraction(src: f64) -> (i32, i32) {
assert_initialized_main_thread!();
unsafe {
let mut dest_n = mem::uninitialized();
let mut dest_d = mem::uninitialized();
ffi::gst_util_double_to_fraction(src, &mut dest_n, &mut dest_d);
(dest_n, dest_d)
}
}
pub fn util_fraction_add(a_n: i32, a_d: i32, b_n: i32, b_d: i32) -> Option<(i32, i32)> {
assert_initialized_main_thread!();
unsafe {
let mut res_n = mem::uninitialized();
let mut res_d = mem::uninitialized();
let ret = from_glib(ffi::gst_util_fraction_add(a_n, a_d, b_n, b_d, &mut res_n, &mut res_d));
if ret { Some((res_n, res_d)) } else { None }
}
}
pub fn util_fraction_compare(a_n: i32, a_d: i32, b_n: i32, b_d: i32) -> i32 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_fraction_compare(a_n, a_d, b_n, b_d)
}
}
pub fn util_fraction_multiply(a_n: i32, a_d: i32, b_n: i32, b_d: i32) -> Option<(i32, i32)> {
assert_initialized_main_thread!();
unsafe {
let mut res_n = mem::uninitialized();
let mut res_d = mem::uninitialized();
let ret = from_glib(ffi::gst_util_fraction_multiply(a_n, a_d, b_n, b_d, &mut res_n, &mut res_d));
if ret { Some((res_n, res_d)) } else { None }
}
}
pub fn util_fraction_to_double(src_n: i32, src_d: i32) -> f64 {
assert_initialized_main_thread!();
unsafe {
let mut dest = mem::uninitialized();
ffi::gst_util_fraction_to_double(src_n, src_d, &mut dest);
dest
}
}
pub fn util_gdouble_to_guint64(value: f64) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_gdouble_to_guint64(value)
}
}
//#[cfg(feature = "v1_12")]
//pub fn util_get_object_array<P: IsA<glib::Object>>(object: &P, name: &str, array: /*Ignored*/glib::ValueArray) -> bool {
// unsafe { TODO: call ffi::gst_util_get_object_array() }
//}
pub fn util_get_timestamp() -> ClockTime {
assert_initialized_main_thread!();
unsafe {
@ -478,20 +169,6 @@ pub fn util_get_timestamp() -> ClockTime {
}
}
pub fn util_greatest_common_divisor(a: i32, b: i32) -> i32 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_greatest_common_divisor(a, b)
}
}
pub fn util_greatest_common_divisor_int64(a: i64, b: i64) -> i64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_greatest_common_divisor_int64(a, b)
}
}
pub fn util_group_id_next() -> u32 {
assert_initialized_main_thread!();
unsafe {
@ -499,20 +176,6 @@ pub fn util_group_id_next() -> u32 {
}
}
pub fn util_guint64_to_gdouble(value: u64) -> f64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_guint64_to_gdouble(value)
}
}
pub fn util_seqnum_compare(s1: u32, s2: u32) -> i32 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_seqnum_compare(s1, s2)
}
}
pub fn util_seqnum_next() -> u32 {
assert_initialized_main_thread!();
unsafe {
@ -520,256 +183,6 @@ pub fn util_seqnum_next() -> u32 {
}
}
pub fn util_set_object_arg<P: IsA<glib::Object>>(object: &P, name: &str, value: &str) {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_set_object_arg(object.to_glib_none().0, name.to_glib_none().0, value.to_glib_none().0);
}
}
//#[cfg(feature = "v1_12")]
//pub fn util_set_object_array<P: IsA<glib::Object>>(object: &P, name: &str, array: /*Ignored*/&glib::ValueArray) -> bool {
// unsafe { TODO: call ffi::gst_util_set_object_array() }
//}
//pub fn util_set_value_from_string(value: /*Ignored*/glib::Value, value_str: &str) {
// unsafe { TODO: call ffi::gst_util_set_value_from_string() }
//}
pub fn util_uint64_scale(val: u64, num: u64, denom: u64) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_uint64_scale(val, num, denom)
}
}
pub fn util_uint64_scale_ceil(val: u64, num: u64, denom: u64) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_uint64_scale_ceil(val, num, denom)
}
}
pub fn util_uint64_scale_int(val: u64, num: i32, denom: i32) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_uint64_scale_int(val, num, denom)
}
}
pub fn util_uint64_scale_int_ceil(val: u64, num: i32, denom: i32) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_uint64_scale_int_ceil(val, num, denom)
}
}
pub fn util_uint64_scale_int_round(val: u64, num: i32, denom: i32) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_uint64_scale_int_round(val, num, denom)
}
}
pub fn util_uint64_scale_round(val: u64, num: u64, denom: u64) -> u64 {
assert_initialized_main_thread!();
unsafe {
ffi::gst_util_uint64_scale_round(val, num, denom)
}
}
//pub fn value_can_compare(value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_can_compare() }
//}
//pub fn value_can_intersect(value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_can_intersect() }
//}
//pub fn value_can_subtract(minuend: /*Ignored*/&glib::Value, subtrahend: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_can_subtract() }
//}
//pub fn value_can_union(value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_can_union() }
//}
//pub fn value_compare(value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> i32 {
// unsafe { TODO: call ffi::gst_value_compare() }
//}
//pub fn value_deserialize(dest: /*Ignored*/glib::Value, src: &str) -> bool {
// unsafe { TODO: call ffi::gst_value_deserialize() }
//}
//pub fn value_fixate(dest: /*Ignored*/&mut glib::Value, src: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_fixate() }
//}
//pub fn value_fraction_multiply(product: /*Ignored*/&mut glib::Value, factor1: /*Ignored*/&glib::Value, factor2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_fraction_multiply() }
//}
//pub fn value_fraction_subtract(dest: /*Ignored*/&mut glib::Value, minuend: /*Ignored*/&glib::Value, subtrahend: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_fraction_subtract() }
//}
//pub fn value_get_bitmask(value: /*Ignored*/&glib::Value) -> u64 {
// unsafe { TODO: call ffi::gst_value_get_bitmask() }
//}
//pub fn value_get_caps(value: /*Ignored*/&glib::Value) -> Option<Caps> {
// unsafe { TODO: call ffi::gst_value_get_caps() }
//}
//pub fn value_get_caps_features(value: /*Ignored*/&glib::Value) -> /*Ignored*/Option<CapsFeatures> {
// unsafe { TODO: call ffi::gst_value_get_caps_features() }
//}
//pub fn value_get_double_range_max(value: /*Ignored*/&glib::Value) -> f64 {
// unsafe { TODO: call ffi::gst_value_get_double_range_max() }
//}
//pub fn value_get_double_range_min(value: /*Ignored*/&glib::Value) -> f64 {
// unsafe { TODO: call ffi::gst_value_get_double_range_min() }
//}
//pub fn value_get_flagset_flags(value: /*Ignored*/&glib::Value) -> u32 {
// unsafe { TODO: call ffi::gst_value_get_flagset_flags() }
//}
//pub fn value_get_flagset_mask(value: /*Ignored*/&glib::Value) -> u32 {
// unsafe { TODO: call ffi::gst_value_get_flagset_mask() }
//}
//pub fn value_get_fraction_denominator(value: /*Ignored*/&glib::Value) -> i32 {
// unsafe { TODO: call ffi::gst_value_get_fraction_denominator() }
//}
//pub fn value_get_fraction_numerator(value: /*Ignored*/&glib::Value) -> i32 {
// unsafe { TODO: call ffi::gst_value_get_fraction_numerator() }
//}
//pub fn value_get_fraction_range_max(value: /*Ignored*/&glib::Value) -> /*Ignored*/Option<glib::Value> {
// unsafe { TODO: call ffi::gst_value_get_fraction_range_max() }
//}
//pub fn value_get_fraction_range_min(value: /*Ignored*/&glib::Value) -> /*Ignored*/Option<glib::Value> {
// unsafe { TODO: call ffi::gst_value_get_fraction_range_min() }
//}
//pub fn value_get_int64_range_max(value: /*Ignored*/&glib::Value) -> i64 {
// unsafe { TODO: call ffi::gst_value_get_int64_range_max() }
//}
//pub fn value_get_int64_range_min(value: /*Ignored*/&glib::Value) -> i64 {
// unsafe { TODO: call ffi::gst_value_get_int64_range_min() }
//}
//pub fn value_get_int64_range_step(value: /*Ignored*/&glib::Value) -> i64 {
// unsafe { TODO: call ffi::gst_value_get_int64_range_step() }
//}
//pub fn value_get_int_range_max(value: /*Ignored*/&glib::Value) -> i32 {
// unsafe { TODO: call ffi::gst_value_get_int_range_max() }
//}
//pub fn value_get_int_range_min(value: /*Ignored*/&glib::Value) -> i32 {
// unsafe { TODO: call ffi::gst_value_get_int_range_min() }
//}
//pub fn value_get_int_range_step(value: /*Ignored*/&glib::Value) -> i32 {
// unsafe { TODO: call ffi::gst_value_get_int_range_step() }
//}
//pub fn value_get_structure(value: /*Ignored*/&glib::Value) -> Option<Structure> {
// unsafe { TODO: call ffi::gst_value_get_structure() }
//}
//pub fn value_init_and_copy(dest: /*Ignored*/glib::Value, src: /*Ignored*/&glib::Value) {
// unsafe { TODO: call ffi::gst_value_init_and_copy() }
//}
//pub fn value_intersect(dest: /*Ignored*/glib::Value, value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_intersect() }
//}
//pub fn value_is_fixed(value: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_is_fixed() }
//}
//pub fn value_is_subset(value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_is_subset() }
//}
//pub fn value_register(table: /*Ignored*/&ValueTable) {
// unsafe { TODO: call ffi::gst_value_register() }
//}
//pub fn value_serialize(value: /*Ignored*/&glib::Value) -> Option<String> {
// unsafe { TODO: call ffi::gst_value_serialize() }
//}
//pub fn value_set_bitmask(value: /*Ignored*/&mut glib::Value, bitmask: u64) {
// unsafe { TODO: call ffi::gst_value_set_bitmask() }
//}
//pub fn value_set_caps(value: /*Ignored*/&mut glib::Value, caps: &Caps) {
// unsafe { TODO: call ffi::gst_value_set_caps() }
//}
//pub fn value_set_caps_features(value: /*Ignored*/&mut glib::Value, features: /*Ignored*/&CapsFeatures) {
// unsafe { TODO: call ffi::gst_value_set_caps_features() }
//}
//pub fn value_set_double_range(value: /*Ignored*/&mut glib::Value, start: f64, end: f64) {
// unsafe { TODO: call ffi::gst_value_set_double_range() }
//}
//pub fn value_set_flagset(value: /*Ignored*/&mut glib::Value, flags: u32, mask: u32) {
// unsafe { TODO: call ffi::gst_value_set_flagset() }
//}
//pub fn value_set_fraction(value: /*Ignored*/&mut glib::Value, numerator: i32, denominator: i32) {
// unsafe { TODO: call ffi::gst_value_set_fraction() }
//}
//pub fn value_set_fraction_range(value: /*Ignored*/&mut glib::Value, start: /*Ignored*/&glib::Value, end: /*Ignored*/&glib::Value) {
// unsafe { TODO: call ffi::gst_value_set_fraction_range() }
//}
//pub fn value_set_fraction_range_full(value: /*Ignored*/&mut glib::Value, numerator_start: i32, denominator_start: i32, numerator_end: i32, denominator_end: i32) {
// unsafe { TODO: call ffi::gst_value_set_fraction_range_full() }
//}
//pub fn value_set_int64_range(value: /*Ignored*/&mut glib::Value, start: i64, end: i64) {
// unsafe { TODO: call ffi::gst_value_set_int64_range() }
//}
//pub fn value_set_int64_range_step(value: /*Ignored*/&mut glib::Value, start: i64, end: i64, step: i64) {
// unsafe { TODO: call ffi::gst_value_set_int64_range_step() }
//}
//pub fn value_set_int_range(value: /*Ignored*/&mut glib::Value, start: i32, end: i32) {
// unsafe { TODO: call ffi::gst_value_set_int_range() }
//}
//pub fn value_set_int_range_step(value: /*Ignored*/&mut glib::Value, start: i32, end: i32, step: i32) {
// unsafe { TODO: call ffi::gst_value_set_int_range_step() }
//}
//pub fn value_set_structure(value: /*Ignored*/&mut glib::Value, structure: &Structure) {
// unsafe { TODO: call ffi::gst_value_set_structure() }
//}
//pub fn value_subtract(dest: /*Ignored*/glib::Value, minuend: /*Ignored*/&glib::Value, subtrahend: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_subtract() }
//}
//pub fn value_union(dest: /*Ignored*/glib::Value, value1: /*Ignored*/&glib::Value, value2: /*Ignored*/&glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_value_union() }
//}
pub fn version() -> (u32, u32, u32, u32) {
assert_initialized_main_thread!();
unsafe {

View file

@ -104,6 +104,7 @@ pub use self::enums::CapsIntersectMode;
pub use self::enums::ClockReturn;
pub use self::enums::ClockType;
pub use self::enums::CoreError;
pub use self::enums::DebugLevel;
pub use self::enums::EventType;
pub use self::enums::FlowReturn;
pub use self::enums::Format;
@ -149,6 +150,14 @@ pub use self::flags::BUFFER_FLAG_DELTA_UNIT;
pub use self::flags::BUFFER_FLAG_TAG_MEMORY;
pub use self::flags::BUFFER_FLAG_SYNC_AFTER;
pub use self::flags::BUFFER_FLAG_LAST;
pub use self::flags::DebugGraphDetails;
pub use self::flags::DEBUG_GRAPH_SHOW_MEDIA_TYPE;
pub use self::flags::DEBUG_GRAPH_SHOW_CAPS_DETAILS;
pub use self::flags::DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS;
pub use self::flags::DEBUG_GRAPH_SHOW_STATES;
pub use self::flags::DEBUG_GRAPH_SHOW_FULL_PARAMS;
pub use self::flags::DEBUG_GRAPH_SHOW_ALL;
pub use self::flags::DEBUG_GRAPH_SHOW_VERBOSE;
pub use self::flags::ElementFlags;
pub use self::flags::ELEMENT_FLAG_LOCKED_STATE;
pub use self::flags::ELEMENT_FLAG_SINK;
@ -212,6 +221,8 @@ pub use self::flags::SEGMENT_FLAG_SKIP;
pub use self::flags::SEGMENT_FLAG_SEGMENT;
pub use self::flags::SEGMENT_FLAG_TRICKMODE_KEY_UNITS;
pub use self::flags::SEGMENT_FLAG_TRICKMODE_NO_AUDIO;
pub use self::flags::StackTraceFlags;
pub use self::flags::STACK_TRACE_SHOW_FULL;
pub use self::flags::StreamFlags;
pub use self::flags::STREAM_FLAG_NONE;
pub use self::flags::STREAM_FLAG_SPARSE;

View file

@ -53,7 +53,7 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto;
pub use auto::*;
pub use auto::traits::*;
pub use auto::functions::{parse_bin_from_description, parse_launch, version, version_string};
pub use auto::functions::*;
pub mod miniobject;
pub use miniobject::{GstRc, MiniObject};