Commit e7a0543c authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Clean up global functions

parent 33fb38ef
......@@ -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
......@@ -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,
......
......@@ -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;
......
This diff is collapsed.
......@@ -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;
......
......@@ -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};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment