Run everything through rustfmt again

This commit is contained in:
Sebastian Dröge 2018-04-01 11:30:03 +03:00
parent fca0287dec
commit 492c3d656c
79 changed files with 797 additions and 470 deletions

View file

@ -9,9 +9,9 @@ extern crate glib;
extern crate byte_slice_cast;
use byte_slice_cast::*;
use std::error::Error as StdError;
use std::i16;
use std::i32;
use std::error::Error as StdError;
extern crate failure;
use failure::Error;

View file

@ -3,8 +3,8 @@ extern crate gstreamer as gst;
extern crate gstreamer_pbutils as pbutils;
use pbutils::prelude::*;
use pbutils::DiscovererStreamInfo;
use pbutils::DiscovererInfo;
use pbutils::DiscovererStreamInfo;
extern crate glib;

View file

@ -10,14 +10,14 @@ extern crate gstreamer_rtsp as gst_rtsp;
extern crate gstreamer_rtsp_server as gst_rtsp_server;
extern crate gstreamer_rtsp_server_sys as ffi;
use failure::Error;
use std::env;
use std::ptr;
use failure::Error;
use glib::translate::*;
use gst_rtsp::*;
use gst_rtsp_server::prelude::*;
use gst_rtsp_server::*;
use gst_rtsp::*;
#[path = "../examples-common.rs"]
mod examples_common;

View file

@ -8,11 +8,11 @@
use AppSink;
use ffi;
use gst_ffi;
use glib::translate::*;
use gst;
use glib::source::CallbackGuard;
use glib::translate::*;
use glib_ffi::gpointer;
use gst;
use gst_ffi;
use std::ptr;
pub struct AppSinkCallbacks {

View file

@ -8,12 +8,12 @@
use AppSrc;
use ffi;
use glib::translate::*;
use gst;
use glib::source::CallbackGuard;
use glib::translate::*;
use glib_ffi::{gboolean, gpointer};
use std::ptr;
use gst;
use std::mem;
use std::ptr;
pub struct AppSrcCallbacks {
need_data: Option<Box<Fn(&AppSrc, u32) + Send + Sync + 'static>>,

View file

@ -20,14 +20,13 @@ extern crate gstreamer_sys as gst_ffi;
extern crate glib;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
@ -39,10 +38,10 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto;
pub use auto::*;
mod app_src;
mod app_sink;
pub use app_src::*;
mod app_src;
pub use app_sink::*;
pub use app_src::*;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts

View file

@ -6,15 +6,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use AudioChannelPosition;
use ffi;
use std::mem;
use gst;
use gst::MiniObject;
use glib;
use glib::translate::{from_glib, ToGlib};
use gst;
use gst::MiniObject;
use array_init;

View file

@ -10,11 +10,11 @@ use ffi;
use glib_ffi;
use gobject_ffi;
use gst;
use gst::prelude::*;
use glib;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrNone, ToGlib,
ToGlibPtr, ToGlibPtrMut};
use gst;
use gst::prelude::*;
use std::mem;
use std::ptr;

View file

@ -6,22 +6,40 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use AudioStreamAlign;
use ffi;
use gst;
use glib::translate::*;
use gst;
use std::mem;
impl AudioStreamAlign {
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn process(&mut self, discont: bool, timestamp: gst::ClockTime, n_samples: u32) -> (bool, gst::ClockTime, gst::ClockTime, u64) {
pub fn process(
&mut self,
discont: bool,
timestamp: gst::ClockTime,
n_samples: u32,
) -> (bool, gst::ClockTime, gst::ClockTime, u64) {
unsafe {
let mut out_timestamp = mem::uninitialized();
let mut out_duration = mem::uninitialized();
let mut out_sample_position = mem::uninitialized();
let ret = from_glib(ffi::gst_audio_stream_align_process(self.to_glib_none_mut().0, discont.to_glib(), timestamp.to_glib(), n_samples, &mut out_timestamp, &mut out_duration, &mut out_sample_position));
(ret, from_glib(out_timestamp), from_glib(out_duration), out_sample_position)
let ret = from_glib(ffi::gst_audio_stream_align_process(
self.to_glib_none_mut().0,
discont.to_glib(),
timestamp.to_glib(),
n_samples,
&mut out_timestamp,
&mut out_duration,
&mut out_sample_position,
));
(
ret,
from_glib(out_timestamp),
from_glib(out_duration),
out_sample_position,
)
}
}
}

View file

@ -19,22 +19,21 @@ extern crate gstreamer_audio_sys as ffi;
extern crate gstreamer_sys as gst_ffi;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};

View file

@ -6,10 +6,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use Adapter;
use ffi;
use glib::translate::*;
use gst;
use Adapter;
use std::io;
impl Adapter {

View file

@ -6,11 +6,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use BaseSink;
use ffi;
use glib::IsA;
use glib::translate::*;
use gst;
use BaseSink;
pub trait BaseSinkExtManual {
fn get_segment(&self) -> gst::Segment;

View file

@ -6,11 +6,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use BaseSrc;
use ffi;
use glib::IsA;
use glib::translate::*;
use gst;
use BaseSrc;
pub trait BaseSrcExtManual {
fn get_segment(&self) -> gst::Segment;

View file

@ -6,11 +6,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use BaseTransform;
use ffi;
use glib::IsA;
use glib::translate::*;
use gst;
use BaseTransform;
pub trait BaseTransformExtManual {
fn get_segment(&self) -> gst::Segment;

View file

@ -16,17 +16,17 @@ extern crate gstreamer_sys as gst_ffi;
extern crate glib;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
@ -36,8 +36,8 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
mod auto;
pub use auto::*;
pub use auto::functions::*;
pub use auto::*;
pub mod functions;
pub use functions::*;
@ -45,8 +45,8 @@ pub use functions::*;
mod adapter;
mod flow_combiner;
pub use flow_combiner::*;
mod base_src;
mod base_sink;
mod base_src;
mod base_transform;
// Re-export all the traits in a prelude module, so that applications
@ -56,8 +56,8 @@ pub mod prelude {
pub use gst::prelude::*;
pub use auto::traits::*;
pub use base_src::BaseSrcExtManual;
pub use base_sink::BaseSinkExtManual;
pub use base_src::BaseSrcExtManual;
pub use base_transform::BaseTransformExtManual;
}

View file

@ -16,17 +16,17 @@ extern crate gstreamer_sys as gst_ffi;
extern crate glib;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};

View file

@ -6,27 +6,42 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use NetClientClock;
use ffi;
use gst;
use glib::object::Downcast;
use glib::translate::*;
use gst;
impl NetClientClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NetClientClock {
pub fn new<'a, P: Into<Option<&'a str>>>(
name: P,
remote_address: &str,
remote_port: i32,
base_time: gst::ClockTime,
) -> NetClientClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
gst::Clock::from_glib_full(ffi::gst_net_client_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
gst::Clock::from_glib_full(ffi::gst_net_client_clock_new(
name.0,
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
gst::Clock::from_glib_none(ffi::gst_net_client_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
gst::Clock::from_glib_none(ffi::gst_net_client_clock_new(
name.0,
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
}
}
}

View file

@ -6,27 +6,42 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use NtpClock;
use ffi;
use gst;
use glib::object::Downcast;
use glib::translate::*;
use gst;
impl NtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(
name: P,
remote_address: &str,
remote_port: i32,
base_time: gst::ClockTime,
) -> NtpClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(
name.0,
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(
name.0,
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
}
}
}

View file

@ -6,27 +6,42 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use PtpClock;
use ffi;
use gst;
use glib::object::Downcast;
use glib::translate::*;
use gst;
impl PtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> PtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(
name: P,
remote_address: &str,
remote_port: i32,
base_time: gst::ClockTime,
) -> PtpClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(
name.0,
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(
name.0,
remote_address.to_glib_none().0,
remote_port,
base_time.to_glib(),
)).downcast_unchecked()
}
}
}

View file

@ -11,19 +11,19 @@ use gst;
use auto::Discoverer;
use glib::Value;
use glib::IsA;
use glib::signal::connect;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::Value;
use glib::object::Downcast;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
use ffi;
use glib_ffi;
use gobject_ffi;
use std::mem::transmute;
use std::boxed::Box as Box_;
use std::mem::transmute;
impl Discoverer {
pub fn set_property_timeout(&self, timeout: gst::ClockTime) {

View file

@ -9,9 +9,9 @@
use DiscovererVideoInfo;
use gst;
use ffi;
use glib::translate::*;
use gst;
impl DiscovererVideoInfo {
pub fn get_framerate(&self) -> gst::Fraction {

View file

@ -23,25 +23,24 @@ extern crate gstreamer_sys as gst_ffi;
static PBUTILS_INIT: Once = ONCE_INIT;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
::PBUTILS_INIT.call_once(|| {
unsafe{::ffi::gst_pb_utils_init()};
unsafe { ::ffi::gst_pb_utils_init() };
});
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};

View file

@ -7,9 +7,9 @@
// except according to those terms.
use ffi;
use gst_ffi;
use glib::translate::*;
use gst;
use gst_ffi;
use std::mem;
use std::ops;

View file

@ -19,19 +19,17 @@ extern crate gstreamer_video as gst_video;
extern crate glib;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
macro_rules! assert_initialized_main_thread {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
@ -45,14 +43,14 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto;
pub use auto::*;
mod player;
mod config;
mod player;
pub use config::*;
mod player_video_info;
mod player_video_overlay_video_renderer;
mod player_g_main_context_signal_dispatcher;
mod player_video_overlay_video_renderer;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts

View file

@ -10,11 +10,11 @@ use Player;
use PlayerSignalDispatcher;
use PlayerVideoRenderer;
use ffi;
use glib_ffi;
use glib;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;

View file

@ -6,10 +6,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use PlayerVideoInfo;
use ffi;
use glib::translate::*;
use gst;
use PlayerVideoInfo;
use std::mem;
impl PlayerVideoInfo {

View file

@ -28,22 +28,21 @@ extern crate gstreamer_rtsp_sys as gst_rtsp_ffi;
extern crate gstreamer_sys as gst_ffi;
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
@ -55,37 +54,81 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto;
pub use auto::*;
mod r_t_s_p_server;
mod r_t_s_p_address_pool;
mod r_t_s_p_client;
mod r_t_s_p_session_pool;
mod r_t_s_p_context;
mod r_t_s_p_auth;
mod r_t_s_p_token;
mod r_t_s_p_client;
mod r_t_s_p_context;
mod r_t_s_p_media_factory;
mod r_t_s_p_server;
mod r_t_s_p_session_pool;
mod r_t_s_p_token;
pub use r_t_s_p_server::RTSPServerExtManual;
pub use r_t_s_p_address_pool::RTSPAddressPoolExtManual;
pub use r_t_s_p_client::RTSPClientExtManual;
pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual;
pub use r_t_s_p_auth::RTSPAuthExtManual;
pub use r_t_s_p_client::RTSPClientExtManual;
pub use r_t_s_p_media_factory::RTSPMediaFactoryExtManual;
pub use r_t_s_p_server::RTSPServerExtManual;
pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual;
pub use r_t_s_p_context::*;
pub use r_t_s_p_token::*;
lazy_static! {
pub static ref RTSP_ADDRESS_POOL_ANY_IPV4: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV4).to_str().unwrap()};
pub static ref RTSP_ADDRESS_POOL_ANY_IPV6: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV6).to_str().unwrap()};
pub static ref RTSP_AUTH_CHECK_CONNECT: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_CONNECT).to_str().unwrap()};
pub static ref RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS).to_str().unwrap()};
pub static ref RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT).to_str().unwrap()};
pub static ref RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS).to_str().unwrap()};
pub static ref RTSP_AUTH_CHECK_URL: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_URL).to_str().unwrap()};
pub static ref RTSP_PERM_MEDIA_FACTORY_ACCESS: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_PERM_MEDIA_FACTORY_ACCESS).to_str().unwrap()};
pub static ref RTSP_PERM_MEDIA_FACTORY_CONSTRUCT: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT).to_str().unwrap()};
pub static ref RTSP_TOKEN_MEDIA_FACTORY_ROLE: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE).to_str().unwrap()};
pub static ref RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: &'static str = unsafe{CStr::from_ptr(ffi::GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS).to_str().unwrap()};
pub static ref RTSP_ADDRESS_POOL_ANY_IPV4: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV4)
.to_str()
.unwrap()
};
pub static ref RTSP_ADDRESS_POOL_ANY_IPV6: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV6)
.to_str()
.unwrap()
};
pub static ref RTSP_AUTH_CHECK_CONNECT: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_CONNECT)
.to_str()
.unwrap()
};
pub static ref RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS)
.to_str()
.unwrap()
};
pub static ref RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT)
.to_str()
.unwrap()
};
pub static ref RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS)
.to_str()
.unwrap()
};
pub static ref RTSP_AUTH_CHECK_URL: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_URL)
.to_str()
.unwrap()
};
pub static ref RTSP_PERM_MEDIA_FACTORY_ACCESS: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_PERM_MEDIA_FACTORY_ACCESS)
.to_str()
.unwrap()
};
pub static ref RTSP_PERM_MEDIA_FACTORY_CONSTRUCT: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT)
.to_str()
.unwrap()
};
pub static ref RTSP_TOKEN_MEDIA_FACTORY_ROLE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE)
.to_str()
.unwrap()
};
pub static ref RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: &'static str = unsafe {
CStr::from_ptr(ffi::GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS)
.to_str()
.unwrap()
};
}
// Re-export all the traits in a prelude module, so that applications
@ -96,11 +139,11 @@ pub mod prelude {
pub use auto::traits::*;
pub use r_t_s_p_server::RTSPServerExtManual;
pub use r_t_s_p_address_pool::RTSPAddressPoolExtManual;
pub use r_t_s_p_client::RTSPClientExtManual;
pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual;
pub use r_t_s_p_auth::RTSPAuthExtManual;
pub use r_t_s_p_token::GstRcRTSPTokenExt;
pub use r_t_s_p_client::RTSPClientExtManual;
pub use r_t_s_p_media_factory::RTSPMediaFactoryExtManual;
pub use r_t_s_p_server::RTSPServerExtManual;
pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual;
pub use r_t_s_p_token::GstRcRTSPTokenExt;
}

View file

@ -2,8 +2,8 @@ use RTSPClient;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::source::SourceId;
use glib::translate::*;
pub trait RTSPClientExtManual {
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId;

View file

@ -8,11 +8,11 @@
use RTSPMediaFactory;
#[cfg(any(feature = "v1_14", feature = "dox"))]
use ffi;
use glib::IsA;
#[cfg(any(feature = "v1_14", feature = "dox"))]
use gst;
#[cfg(any(feature = "v1_14", feature = "dox"))]
use ffi;
pub trait RTSPMediaFactoryExtManual {
#[cfg(any(feature = "v1_14", feature = "dox"))]
@ -23,7 +23,10 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExtManual for O {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn add_role_from_structure(&self, structure: &gst::StructureRef) {
unsafe {
ffi::gst_rtsp_media_factory_add_role_from_structure(self.to_glib_none().0, structure.as_mut_ptr());
ffi::gst_rtsp_media_factory_add_role_from_structure(
self.to_glib_none().0,
structure.as_mut_ptr(),
);
}
}
}

View file

@ -2,8 +2,8 @@ use RTSPServer;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::source::SourceId;
use glib::translate::*;
pub trait RTSPServerExtManual {
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId;

View file

@ -1,13 +1,13 @@
use std::cell::RefCell;
use std::mem::transmute;
use RTSPSessionPool;
use ffi;
use glib;
use glib_ffi;
use glib::object::IsA;
use glib::translate::*;
use glib::source::{CallbackGuard, Continue, Priority};
use glib::translate::*;
use glib_ffi;
use glib_ffi::{gboolean, gpointer};
use std::cell::RefCell;
use std::mem::transmute;
unsafe extern "C" fn trampoline_watch(
pool: *mut ffi::GstRTSPSessionPool,

View file

@ -1,12 +1,12 @@
use ffi;
use gst_ffi;
use gst;
use glib;
use glib::StaticType;
use glib::value::ToSendValue;
use glib::translate::*;
use glib::value::ToSendValue;
use gst;
use gst_ffi;
use gst::miniobject::{MiniObject, GstRc};
use gst::miniobject::{GstRc, MiniObject};
pub trait GstRcRTSPTokenExt<T: MiniObject> {
fn new_empty() -> Self;
@ -44,19 +44,23 @@ impl GstRcRTSPTokenExt<RTSPTokenRef> for GstRc<RTSPTokenRef> {
impl RTSPTokenRef {
pub fn get_string(&self, field: &str) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_rtsp_token_get_string(self.as_mut_ptr(), field.to_glib_none().0))
from_glib_none(ffi::gst_rtsp_token_get_string(
self.as_mut_ptr(),
field.to_glib_none().0,
))
}
}
pub fn get_structure(&self) -> Option<gst::Structure> {
unsafe {
from_glib_none(ffi::gst_rtsp_token_get_structure(self.as_mut_ptr()))
}
unsafe { from_glib_none(ffi::gst_rtsp_token_get_structure(self.as_mut_ptr())) }
}
pub fn is_allowed(&self, field: &str) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_token_is_allowed(self.as_mut_ptr(), field.to_glib_none().0))
from_glib(ffi::gst_rtsp_token_is_allowed(
self.as_mut_ptr(),
field.to_glib_none().0,
))
}
}
@ -76,7 +80,9 @@ impl ToOwned for RTSPTokenRef {
type Owned = GstRc<RTSPTokenRef>;
fn to_owned(&self) -> GstRc<RTSPTokenRef> {
unsafe { from_glib_full(gst_ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _) }
unsafe {
from_glib_full(gst_ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _)
}
}
}

View file

@ -21,16 +21,15 @@ extern crate gstreamer_sdp_sys as gst_sdp_ffi;
extern crate gstreamer_sys as gst_ffi;
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};

View file

@ -17,8 +17,7 @@ extern crate gstreamer_sdp_sys as ffi;
extern crate gstreamer_sys as gst_ffi;
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};

View file

@ -7,15 +7,15 @@
// except according to those terms.
use ffi;
use gst_ffi;
use glib_ffi;
use gst_ffi;
use gst;
use glib;
use glib::translate::{from_glib_full, ToGlib, ToGlibPtr};
use gst;
use std::ptr;
use std::mem;
use std::ptr;
pub fn convert_sample(
sample: &gst::Sample,
@ -89,8 +89,8 @@ pub fn convert_sample_async<F>(
#[cfg(test)]
mod tests {
use super::*;
use gst;
use glib;
use gst;
use std::sync::{Arc, Mutex};
#[test]

View file

@ -21,22 +21,21 @@ extern crate gstreamer_sys as gst_ffi;
extern crate gstreamer_video_sys as ffi;
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::gst_ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};

View file

@ -9,10 +9,10 @@
use ffi;
use gst_ffi;
use glib::ToSendValue;
use glib::translate::{from_glib, from_glib_full, ToGlib};
use gst;
use gst::MiniObject;
use glib::translate::{from_glib, from_glib_full, ToGlib};
use glib::ToSendValue;
use std::mem;
pub fn is_force_key_unit_event(event: &gst::EventRef) -> bool {
@ -138,15 +138,15 @@ impl<'a> DownstreamForceKeyUnitEventBuilder<'a> {
}
}
event_builder_generic_impl!(|s: &mut Self| {
ffi::gst_video_event_new_downstream_force_key_unit(
event_builder_generic_impl!(
|s: &mut Self| ffi::gst_video_event_new_downstream_force_key_unit(
s.timestamp.to_glib(),
s.stream_time.to_glib(),
s.running_time.to_glib(),
s.all_headers.to_glib(),
s.count,
)
});
);
}
#[derive(Clone, PartialEq, Eq, Debug)]

View file

@ -9,16 +9,16 @@
use ffi;
use gst_ffi;
use gst;
use gst::miniobject::MiniObject;
use glib;
use glib::translate::{from_glib, ToGlibPtr};
use gst;
use gst::miniobject::MiniObject;
use std::mem;
use std::ptr;
use std::marker::PhantomData;
use std::slice;
use std::mem;
use std::ops;
use std::ptr;
use std::slice;
pub struct Readable;
pub struct Writable;

View file

@ -10,16 +10,16 @@ use ffi;
use glib_ffi;
use gobject_ffi;
use gst;
use gst::prelude::*;
use glib;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlib, FromGlibPtrNone,
ToGlib, ToGlibPtr, ToGlibPtrMut};
use gst;
use gst::prelude::*;
use std::fmt;
use std::mem;
use std::ptr;
use std::str;
use std::fmt;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum VideoColorRange {

View file

@ -6,8 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use VideoOverlay;
use ffi;
use libc::uintptr_t;
use glib::IsA;

View file

@ -6,23 +6,23 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::ptr;
use std::mem;
use std::fmt;
use std::slice;
use std::marker::PhantomData;
use std::mem;
use std::ops;
use std::ptr;
use std::slice;
use std::u64;
use std::usize;
use std::marker::PhantomData;
use miniobject::*;
use BufferFlags;
use ClockTime;
use miniobject::*;
use glib;
use glib_ffi;
use ffi;
use glib;
use glib::translate::{from_glib, from_glib_full, ToGlib};
use glib_ffi;
pub struct Readable;
pub struct Writable;
@ -573,8 +573,10 @@ impl<T> Eq for MappedBuffer<T> {}
unsafe impl<T> Send for MappedBuffer<T> {}
lazy_static! {
pub static ref BUFFER_COPY_METADATA: ::BufferCopyFlags = ::BufferCopyFlags::FLAGS | ::BufferCopyFlags::TIMESTAMPS | ::BufferCopyFlags::META;
pub static ref BUFFER_COPY_ALL: ::BufferCopyFlags = *BUFFER_COPY_METADATA | ::BufferCopyFlags::MEMORY;
pub static ref BUFFER_COPY_METADATA: ::BufferCopyFlags =
::BufferCopyFlags::FLAGS | ::BufferCopyFlags::TIMESTAMPS | ::BufferCopyFlags::META;
pub static ref BUFFER_COPY_ALL: ::BufferCopyFlags =
*BUFFER_COPY_METADATA | ::BufferCopyFlags::MEMORY;
}
#[cfg(test)]

View file

@ -16,8 +16,8 @@ use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibP
use ffi;
use std::mem;
use std::ptr;
use std::ops;
use std::ptr;
#[derive(Debug, PartialEq, Eq)]
pub struct BufferPoolConfig(Structure);

View file

@ -12,9 +12,9 @@ use glib::StaticType;
use glib::translate::{from_glib, from_glib_full};
use std::fmt;
use miniobject::*;
use Buffer;
use BufferRef;
use miniobject::*;
pub type BufferList = GstRc<BufferListRef>;
pub struct BufferListRef(ffi::GstBufferList);

View file

@ -6,14 +6,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::cell::RefCell;
use std::mem::transmute;
use ffi;
use glib;
use glib::translate::*;
use glib::source::{CallbackGuard, Continue, Priority, SourceId};
use glib::translate::*;
use glib_ffi;
use glib_ffi::{gboolean, gpointer};
use std::cell::RefCell;
use std::mem::transmute;
use std::ptr;
use Bus;
@ -142,12 +142,12 @@ impl Bus {
#[cfg(any(feature = "futures", feature = "dox"))]
mod futures {
use std::sync::{Arc, Mutex};
use futures;
use futures::{Async, Poll};
use futures::task::Task;
use futures::stream::Stream;
use super::*;
use futures;
use futures::stream::Stream;
use futures::task::Task;
use futures::{Async, Poll};
use std::sync::{Arc, Mutex};
pub struct BusStream(Bus, Arc<Mutex<Option<Task>>>);

View file

@ -6,15 +6,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use miniobject::*;
use std::fmt;
use std::str;
use miniobject::*;
use structure::*;
use CapsIntersectMode;
use glib;
use ffi;
use glib;
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr};
use glib::value::ToSendValue;
@ -392,8 +392,8 @@ impl Builder {
#[cfg(test)]
mod tests {
use super::*;
use Fraction;
use Array;
use Fraction;
#[test]
fn test_simple() {

View file

@ -6,12 +6,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ChildProxy;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use std::ptr;
use ChildProxy;
pub trait ChildProxyExtManual {
fn get_child_property(&self, name: &str) -> Option<glib::Value>;

View file

@ -7,21 +7,21 @@
// except according to those terms.
use Clock;
use ClockReturn;
use ClockTime;
use ClockTimeDiff;
use ClockReturn;
use std::mem;
use std::cmp;
use std::ptr;
use std::mem::transmute;
use ffi;
use glib;
use glib::IsA;
use glib::translate::*;
use glib::source::CallbackGuard;
use glib::translate::*;
use glib_ffi;
use glib_ffi::{gboolean, gpointer};
use libc::c_void;
use std::cmp;
use std::mem;
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct ClockId(Shared<c_void>);
@ -241,8 +241,8 @@ impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExtManual for O {
#[cfg(test)]
mod tests {
use super::*;
use super::super::*;
use super::*;
use std::sync::mpsc::channel;
#[test]

View file

@ -6,8 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::fmt;
use std::ffi::CStr;
use std::fmt;
use ffi;
@ -15,8 +15,8 @@ use glib;
use glib::StaticType;
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr};
use miniobject::*;
use StructureRef;
use miniobject::*;
pub type Context = GstRc<ContextRef>;
pub struct ContextRef(ffi::GstContext);

View file

@ -8,22 +8,22 @@
use Element;
use glib;
use glib::IsA;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlib,
FromGlibPtrContainer, ToGlib, ToGlibPtr};
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::translate::FromGlibPtrBorrow;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::object::Downcast;
use QueryRef;
use Event;
use Format;
use FormattedValue;
use GenericFormattedValue;
use Pad;
use PadTemplate;
use Format;
use GenericFormattedValue;
use FormattedValue;
use QueryRef;
use SpecificFormattedValue;
use glib;
use glib::IsA;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::object::Downcast;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::translate::FromGlibPtrBorrow;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlib, FromGlibPtrContainer,
ToGlib, ToGlibPtr};
use miniobject::MiniObject;
use std::ffi::CStr;
@ -611,13 +611,37 @@ impl<O: IsA<Element>> ElementExtManual for O {
}
}
lazy_static!{
pub static ref ELEMENT_METADATA_AUTHOR: &'static str = unsafe { CStr::from_ptr(ffi::GST_ELEMENT_METADATA_AUTHOR).to_str().unwrap() };
pub static ref ELEMENT_METADATA_DESCRIPTION: &'static str = unsafe { CStr::from_ptr(ffi::GST_ELEMENT_METADATA_DESCRIPTION).to_str().unwrap() };
pub static ref ELEMENT_METADATA_DOC_URI: &'static str = unsafe { CStr::from_ptr(ffi::GST_ELEMENT_METADATA_DOC_URI).to_str().unwrap() };
pub static ref ELEMENT_METADATA_ICON_NAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_ELEMENT_METADATA_ICON_NAME).to_str().unwrap() };
pub static ref ELEMENT_METADATA_KLASS: &'static str = unsafe { CStr::from_ptr(ffi::GST_ELEMENT_METADATA_KLASS).to_str().unwrap() };
pub static ref ELEMENT_METADATA_LONGNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_ELEMENT_METADATA_LONGNAME).to_str().unwrap() };
lazy_static! {
pub static ref ELEMENT_METADATA_AUTHOR: &'static str = unsafe {
CStr::from_ptr(ffi::GST_ELEMENT_METADATA_AUTHOR)
.to_str()
.unwrap()
};
pub static ref ELEMENT_METADATA_DESCRIPTION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_ELEMENT_METADATA_DESCRIPTION)
.to_str()
.unwrap()
};
pub static ref ELEMENT_METADATA_DOC_URI: &'static str = unsafe {
CStr::from_ptr(ffi::GST_ELEMENT_METADATA_DOC_URI)
.to_str()
.unwrap()
};
pub static ref ELEMENT_METADATA_ICON_NAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_ELEMENT_METADATA_ICON_NAME)
.to_str()
.unwrap()
};
pub static ref ELEMENT_METADATA_KLASS: &'static str = unsafe {
CStr::from_ptr(ffi::GST_ELEMENT_METADATA_KLASS)
.to_str()
.unwrap()
};
pub static ref ELEMENT_METADATA_LONGNAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_ELEMENT_METADATA_LONGNAME)
.to_str()
.unwrap()
};
}
#[macro_export]

View file

@ -6,13 +6,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use StateChangeReturn;
use ClockReturn;
use FlowReturn;
use PadLinkReturn;
use ClockReturn;
use StateChangeReturn;
use std::cmp;
use std::error::Error;
use std::fmt;
use std::cmp;
use glib::translate::ToGlib;

View file

@ -6,21 +6,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use GenericFormattedValue;
use ffi;
use miniobject::*;
use structure::*;
use GenericFormattedValue;
use std::ptr;
use std::mem;
use std::cmp;
use std::fmt;
use std::ffi::CStr;
use std::fmt;
use std::mem;
use std::ops::Deref;
use std::ptr;
use glib;
use glib::value::ToSendValue;
use glib::translate::{from_glib, from_glib_full, FromGlib, ToGlib, ToGlibPtr};
use glib::value::ToSendValue;
#[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::translate::FromGlibPtrContainer;

View file

@ -8,8 +8,8 @@
use ClockTime;
use Format;
use std::ops;
use muldiv::MulDiv;
use std::ops;
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
pub enum GenericFormattedValue {

View file

@ -10,10 +10,10 @@ use ffi;
use glib::translate::*;
use std::ptr;
use ParseContext;
use ParseFlags;
use Element;
use Error;
use ParseContext;
use ParseFlags;
pub fn parse_bin_from_description_full<'a, P: Into<Option<&'a mut ParseContext>>>(
bin_description: &str,

View file

@ -6,11 +6,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use Pad;
use PadTemplate;
use Object;
use PadMode;
use GhostPad;
use Object;
use Pad;
use PadMode;
use PadTemplate;
use ffi;
use glib::object::Downcast;
use glib::object::IsA;

View file

@ -7,22 +7,22 @@
// except according to those terms.
use ffi;
use glib;
use glib::StaticType;
use glib::Value;
use glib::translate::*;
use glib::value::{FromValueOptional, ToValue};
use glib_ffi;
use glib_ffi::{gconstpointer, gpointer};
use gobject_ffi;
use std::error::Error;
use std::ffi::CString;
use std::fmt;
use std::iter::Iterator as StdIterator;
use std::marker::PhantomData;
use std::mem;
use std::ptr;
use glib;
use glib::Value;
use glib::StaticType;
use glib::value::{FromValueOptional, ToValue};
use std::sync::Arc;
use std::ffi::CString;
use std::marker::PhantomData;
use std::iter::Iterator as StdIterator;
use std::fmt;
use std::error::Error;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum IteratorError {

View file

@ -33,22 +33,21 @@ extern crate muldiv;
use glib::translate::{from_glib, from_glib_full};
macro_rules! callback_guard {
() => (
() => {
let _guard = ::glib::CallbackGuard::new();
)
};
}
macro_rules! assert_initialized_main_thread {
() => (
if unsafe {::ffi::gst_is_initialized()} != ::glib_ffi::GTRUE {
() => {
if unsafe { ::ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
)
};
}
macro_rules! skip_assert_initialized {
() => (
)
() => {};
}
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
@ -59,8 +58,8 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
mod auto;
pub use auto::*;
pub use auto::functions::*;
pub use auto::*;
#[macro_use]
mod log;
@ -102,9 +101,9 @@ mod promise;
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use promise::*;
mod element;
mod bin;
mod bus;
mod element;
// OS dependent Bus extensions (also import the other plateform mod for doc)
#[cfg(any(feature = "v1_14", feature = "dox"))]
@ -120,24 +119,24 @@ cfg_if! {
}
}
mod pad;
mod object;
mod gobject;
mod proxy_pad;
mod ghost_pad;
mod child_proxy;
mod tag_setter;
mod iterator;
mod device_provider;
mod parse_context;
mod enums;
mod clock_time;
mod date_time;
pub use object::GstObjectExtManual;
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
mod device_provider;
mod enums;
mod ghost_pad;
mod gobject;
mod iterator;
mod object;
mod pad;
mod parse_context;
mod proxy_pad;
mod tag_setter;
pub use bin::BinExtManual;
pub use element::{ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI,
ELEMENT_METADATA_ICON_NAME, ELEMENT_METADATA_KLASS, ELEMENT_METADATA_LONGNAME};
pub use bin::BinExtManual;
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
pub use object::GstObjectExtManual;
// OS dependent Bus extensions (also import the other plateform trait for doc)
#[cfg(any(feature = "v1_14", feature = "dox"))]
@ -153,18 +152,18 @@ cfg_if! {
}
}
pub use pad::{PadExtManual, PadProbeData, PadProbeId, PadProbeInfo};
pub use gobject::GObjectExtManualGst;
pub use child_proxy::ChildProxyExtManual;
pub use tag_setter::TagSetterExtManual;
pub use self::iterator::{Iterator, IteratorError, IteratorImpl};
pub use device_provider::DeviceProviderExtManual;
pub use parse_context::ParseContext;
#[cfg(any(feature = "futures", feature = "dox"))]
pub use bus::BusStream;
pub use child_proxy::ChildProxyExtManual;
pub use clock_time::ClockTime;
pub use device_provider::DeviceProviderExtManual;
pub use enums::{ClockError, ClockSuccess, FlowError, FlowSuccess, PadLinkError, PadLinkSuccess,
StateChangeError, StateChangeSuccess};
pub use clock_time::ClockTime;
pub use gobject::GObjectExtManualGst;
pub use pad::{PadExtManual, PadProbeData, PadProbeId, PadProbeInfo};
pub use parse_context::ParseContext;
pub use tag_setter::TagSetterExtManual;
mod plugin;
#[cfg(any(feature = "v1_10", feature = "dox"))]
@ -236,8 +235,8 @@ pub mod prelude {
pub use auto::traits::*;
pub use element::ElementExtManual;
pub use bin::BinExtManual;
pub use element::ElementExtManual;
// OS dependent Bus extensions (also import the other plateform trait for doc)
#[cfg(any(feature = "v1_14", feature = "dox"))]
@ -253,18 +252,18 @@ pub mod prelude {
}
}
pub use pad::PadExtManual;
pub use object::GstObjectExtManual;
pub use gobject::GObjectExtManualGst;
pub use child_proxy::ChildProxyExtManual;
pub use tag_setter::TagSetterExtManual;
pub use device_provider::DeviceProviderExtManual;
pub use clock::ClockExtManual;
pub use value::GstValueExt;
pub use buffer_pool::BufferPoolExtManual;
pub use child_proxy::ChildProxyExtManual;
pub use clock::ClockExtManual;
pub use device_provider::DeviceProviderExtManual;
pub use gobject::GObjectExtManualGst;
pub use object::GstObjectExtManual;
pub use pad::PadExtManual;
pub use tag_setter::TagSetterExtManual;
pub use value::GstValueExt;
pub use tags::Tag;
pub use miniobject::MiniObject;
pub use tags::Tag;
pub use muldiv::MulDiv;

View file

@ -9,11 +9,11 @@
use libc::c_char;
use std::ffi::CStr;
use std::fmt;
use std::ptr;
use std::mem;
use std::ptr;
use gobject_ffi;
use ffi;
use gobject_ffi;
use glib::IsA;
use glib::translate::{from_glib, ToGlib, ToGlibPtr};

View file

@ -6,27 +6,27 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use GenericFormattedValue;
use GroupId;
use GstObjectExt;
use Object;
use Seqnum;
use TagList;
use ffi;
use miniobject::*;
use structure::*;
use TagList;
use GstObjectExt;
use Seqnum;
use GroupId;
use GenericFormattedValue;
use std::ptr;
use std::mem;
use std::fmt;
use std::ffi::CStr;
use std::fmt;
use std::mem;
use std::ops::Deref;
use std::ptr;
use glib;
use glib::Cast;
use glib::IsA;
use glib::value::ToSendValue;
use glib::translate::{from_glib, from_glib_full, from_glib_none, mut_override, ToGlib, ToGlibPtr};
use glib::value::ToSendValue;
#[repr(C)]
pub struct MessageRef(ffi::GstMessage);
@ -1193,10 +1193,12 @@ impl<'a> MessageBuilder<'a> {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
Self {
other_fields: self.other_fields.iter().cloned()
other_fields: self.other_fields
.iter()
.cloned()
.chain(other_fields.iter().cloned())
.collect(),
.. self
..self
}
}
}

View file

@ -6,20 +6,20 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::{borrow, fmt, ops};
use std::marker::PhantomData;
use std::mem;
use std::ptr;
use std::marker::PhantomData;
use std::{borrow, fmt, ops};
use ffi;
use glib_ffi::gpointer;
use glib_ffi;
use gobject_ffi;
use glib;
use glib::translate::{c_ptr_array_len, from_glib, from_glib_full, from_glib_none,
FromGlibContainerAsVec, FromGlibPtrArrayContainerAsVec, FromGlibPtrBorrow,
FromGlibPtrFull, FromGlibPtrNone, GlibPtrDefault, Stash, StashMut,
ToGlibContainerFromSlice, ToGlibPtr, ToGlibPtrMut};
use glib;
use glib_ffi;
use glib_ffi::gpointer;
use gobject_ffi;
pub struct GstRc<T: MiniObject> {
obj: ptr::NonNull<T>,
@ -422,9 +422,8 @@ impl<T: MiniObject + 'static> FromGlibContainerAsVec<*mut T::GstType, *const *mu
}
}
impl<
T: MiniObject + 'static,
> FromGlibPtrArrayContainerAsVec<*mut T::GstType, *const *mut T::GstType> for GstRc<T>
impl<T: MiniObject + 'static>
FromGlibPtrArrayContainerAsVec<*mut T::GstType, *const *mut T::GstType> for GstRc<T>
{
unsafe fn from_glib_none_as_vec(ptr: *const *mut T::GstType) -> Vec<Self> {
FromGlibPtrArrayContainerAsVec::from_glib_none_as_vec(ptr as *mut *mut _)

View file

@ -8,9 +8,9 @@
use glib;
use glib::IsA;
use glib::translate::ToGlibPtr;
use glib::signal::SignalHandlerId;
use glib::object::{Downcast, ObjectExt};
use glib::signal::SignalHandlerId;
use glib::translate::ToGlibPtr;
use gobject_ffi;

View file

@ -6,35 +6,35 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use Pad;
use PadProbeType;
use PadProbeReturn;
use Buffer;
use BufferList;
use Format;
use GenericFormattedValue;
use FormattedValue;
use SpecificFormattedValue;
use Event;
use FlowReturn;
use Format;
use FormattedValue;
use GenericFormattedValue;
use Pad;
use PadProbeReturn;
use PadProbeType;
use Query;
use QueryRef;
use Event;
use SpecificFormattedValue;
use StaticPadTemplate;
use miniobject::MiniObject;
use std::cell::RefCell;
use std::mem;
use std::mem::transmute;
use std::ptr;
use std::mem;
use std::cell::RefCell;
use glib;
use glib::{IsA, StaticType};
use glib::Object;
use glib::source::CallbackGuard;
use glib::translate::{from_glib, from_glib_borrow, from_glib_full, from_glib_none, mut_override,
FromGlib, ToGlib, ToGlibPtr};
use glib::source::CallbackGuard;
use glib::{IsA, StaticType};
use glib_ffi;
use glib_ffi::gpointer;
use glib::Object;
use libc;
@ -1164,8 +1164,8 @@ fn into_raw_pad_task<F: FnMut() + Send + 'static>(func: F) -> gpointer {
mod tests {
use super::*;
use prelude::*;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::channel;
use std::sync::{Arc, Mutex};
#[test]
fn test_event_chain_functions() {

View file

@ -19,10 +19,18 @@ use glib;
impl PadTemplate {
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn new_from_static_pad_template_with_gtype(pad_template: &StaticPadTemplate, pad_type: glib::types::Type) -> PadTemplate {
pub fn new_from_static_pad_template_with_gtype(
pad_template: &StaticPadTemplate,
pad_type: glib::types::Type,
) -> PadTemplate {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ffi::gst_pad_template_new_from_static_pad_template_with_gtype(mut_override(pad_template.to_glib_none().0), pad_type.to_glib()))
from_glib_none(
ffi::gst_pad_template_new_from_static_pad_template_with_gtype(
mut_override(pad_template.to_glib_none().0),
pad_type.to_glib(),
),
)
}
}
}

View file

@ -6,8 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use glib::translate::*;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;

View file

@ -6,15 +6,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use StructureRef;
use PromiseResult;
use Structure;
use StructureRef;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
use PromiseResult;
glib_wrapper! {
pub struct Promise(Shared<ffi::GstPromise>);
@ -30,14 +30,14 @@ impl Promise {
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn new() -> Promise {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_promise_new())
}
unsafe { from_glib_full(ffi::gst_promise_new()) }
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn new_with_change_func<F>(func: F) -> Promise
where F: FnOnce(&Promise) + Send + 'static {
where
F: FnOnce(&Promise) + Send + 'static,
{
let user_data: Box<Option<Box<F>>> = Box::new(Some(Box::new(func)));
unsafe extern "C" fn trampoline<F: FnOnce(&Promise) + Send + 'static>(
@ -103,9 +103,7 @@ impl Promise {
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn wait(&self) -> PromiseResult {
unsafe {
from_glib(ffi::gst_promise_wait(self.to_glib_none().0))
}
unsafe { from_glib(ffi::gst_promise_wait(self.to_glib_none().0)) }
}
}

View file

@ -6,13 +6,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::ptr;
use Pad;
use ProxyPad;
use Object;
use FlowReturn;
use Buffer;
use BufferList;
use FlowReturn;
use Object;
use Pad;
use ProxyPad;
use std::ptr;
use glib::IsA;
use glib::translate::{from_glib, from_glib_full, ToGlibPtr};

View file

@ -6,16 +6,16 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use GenericFormattedValue;
use ffi;
use miniobject::*;
use structure::*;
use GenericFormattedValue;
use std::ptr;
use std::mem;
use std::fmt;
use std::ffi::CStr;
use std::fmt;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::ptr;
use glib;
use glib::translate::*;

View file

@ -6,8 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::ptr;
use std::fmt;
use std::ptr;
use ffi;
@ -15,14 +15,14 @@ use glib;
use glib::StaticType;
use glib::translate::{from_glib, from_glib_full, from_glib_none, mut_override, ToGlibPtr};
use miniobject::*;
use Buffer;
use BufferList;
use Caps;
use FormattedSegment;
use FormattedValue;
use Segment;
use FormattedSegment;
use StructureRef;
use miniobject::*;
pub type Sample = GstRc<SampleRef>;
pub struct SampleRef(ffi::GstSample);

View file

@ -7,19 +7,19 @@
// except according to those terms.
use Format;
use GenericFormattedValue;
use FormattedValue;
use GenericFormattedValue;
use SeekFlags;
use SeekType;
use ffi;
use glib;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use glib;
use std::mem;
use std::ptr;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ptr;
pub type Segment = FormattedSegment<GenericFormattedValue>;
#[repr(C)]

View file

@ -6,16 +6,16 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use PadTemplate;
use Caps;
use PadTemplate;
use ffi;
use glib_ffi;
use gobject_ffi;
use std::ffi::CStr;
use glib;
use glib::translate::{from_glib, from_glib_full, FromGlibPtrNone, ToGlibPtr, ToGlibPtrMut};
use std::ffi::CStr;
use std::ptr;

View file

@ -6,8 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use StreamCollection;
use Stream;
use StreamCollection;
pub struct Iter<'a> {
collection: &'a StreamCollection,

View file

@ -6,22 +6,22 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::fmt;
use std::ptr;
use std::mem;
use std::str;
use std::ffi::CStr;
use std::ops::{Deref, DerefMut};
use std::borrow::{Borrow, BorrowMut, ToOwned};
use std::ffi::CStr;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::ptr;
use std::str;
use Fraction;
use ffi;
use glib;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrFull, FromGlibPtrNone,
GlibPtrDefault, Stash, StashMut, ToGlib, ToGlibPtr, ToGlibPtrMut};
use glib::value::{FromValueOptional, SendValue, ToSendValue};
use ffi;
use glib_ffi::gpointer;
use gobject_ffi;

View file

@ -6,9 +6,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use TagSetter;
use TagMergeMode;
use TagSetter;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib::value::ToSendValue;

View file

@ -6,21 +6,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::fmt;
use std::mem;
use std::marker::PhantomData;
use std::ffi::CStr;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use ffi;
use glib;
use glib::StaticType;
use glib::value::{FromValueOptional, SetValue, ToSendValue, TypedValue, Value};
use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr, ToGlibPtrMut};
use glib::value::{FromValueOptional, SetValue, ToSendValue, TypedValue, Value};
use miniobject::*;
use TagMergeMode;
use Sample;
use TagMergeMode;
pub trait Tag<'a> {
type TagType: FromValueOptional<'a> + SetValue + Send;
@ -146,92 +146,280 @@ impl_tag!(InterpretedBy, &'a str, *TAG_INTERPRETED_BY);
impl_tag!(MidiBaseNote, &'a str, *TAG_MIDI_BASE_NOTE);
impl_tag!(PrivateData, Sample, *TAG_PRIVATE_DATA);
lazy_static!{
static ref TAG_TITLE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_TITLE).to_str().unwrap() };
static ref TAG_TITLE_SORTNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_TITLE_SORTNAME).to_str().unwrap() };
static ref TAG_ARTIST: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ARTIST).to_str().unwrap() };
static ref TAG_ARTIST_SORTNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ARTIST_SORTNAME).to_str().unwrap() };
static ref TAG_ALBUM: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM).to_str().unwrap() };
static ref TAG_ALBUM_SORTNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_SORTNAME).to_str().unwrap() };
static ref TAG_ALBUM_ARTIST: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_ARTIST).to_str().unwrap() };
static ref TAG_ALBUM_ARTIST_SORTNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_ARTIST_SORTNAME).to_str().unwrap() };
lazy_static! {
static ref TAG_TITLE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_TITLE).to_str().unwrap() };
static ref TAG_TITLE_SORTNAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_TITLE_SORTNAME)
.to_str()
.unwrap()
};
static ref TAG_ARTIST: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ARTIST).to_str().unwrap() };
static ref TAG_ARTIST_SORTNAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_ARTIST_SORTNAME)
.to_str()
.unwrap()
};
static ref TAG_ALBUM: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM).to_str().unwrap() };
static ref TAG_ALBUM_SORTNAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_ALBUM_SORTNAME)
.to_str()
.unwrap()
};
static ref TAG_ALBUM_ARTIST: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_ARTIST).to_str().unwrap() };
static ref TAG_ALBUM_ARTIST_SORTNAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_ALBUM_ARTIST_SORTNAME)
.to_str()
.unwrap()
};
static ref TAG_DATE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_DATE).to_str().unwrap() };
static ref TAG_DATE_TIME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_DATE_TIME).to_str().unwrap() };
static ref TAG_GENRE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GENRE).to_str().unwrap() };
static ref TAG_COMMENT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_COMMENT).to_str().unwrap() };
static ref TAG_EXTENDED_COMMENT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_EXTENDED_COMMENT).to_str().unwrap() };
static ref TAG_TRACK_NUMBER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_NUMBER).to_str().unwrap() };
static ref TAG_TRACK_COUNT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_COUNT).to_str().unwrap() };
static ref TAG_ALBUM_VOLUME_NUMBER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_VOLUME_NUMBER).to_str().unwrap() };
static ref TAG_ALBUM_VOLUME_COUNT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_VOLUME_COUNT).to_str().unwrap() };
static ref TAG_LOCATION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_LOCATION).to_str().unwrap() };
static ref TAG_HOMEPAGE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_HOMEPAGE).to_str().unwrap() };
static ref TAG_DESCRIPTION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_DESCRIPTION).to_str().unwrap() };
static ref TAG_VERSION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_VERSION).to_str().unwrap() };
static ref TAG_DATE_TIME: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_DATE_TIME).to_str().unwrap() };
static ref TAG_GENRE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_GENRE).to_str().unwrap() };
static ref TAG_COMMENT: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_COMMENT).to_str().unwrap() };
static ref TAG_EXTENDED_COMMENT: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_EXTENDED_COMMENT)
.to_str()
.unwrap()
};
static ref TAG_TRACK_NUMBER: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_NUMBER).to_str().unwrap() };
static ref TAG_TRACK_COUNT: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_COUNT).to_str().unwrap() };
static ref TAG_ALBUM_VOLUME_NUMBER: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_ALBUM_VOLUME_NUMBER)
.to_str()
.unwrap()
};
static ref TAG_ALBUM_VOLUME_COUNT: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_ALBUM_VOLUME_COUNT)
.to_str()
.unwrap()
};
static ref TAG_LOCATION: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_LOCATION).to_str().unwrap() };
static ref TAG_HOMEPAGE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_HOMEPAGE).to_str().unwrap() };
static ref TAG_DESCRIPTION: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_DESCRIPTION).to_str().unwrap() };
static ref TAG_VERSION: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_VERSION).to_str().unwrap() };
static ref TAG_ISRC: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ISRC).to_str().unwrap() };
static ref TAG_ORGANIZATION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ORGANIZATION).to_str().unwrap() };
static ref TAG_COPYRIGHT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_COPYRIGHT).to_str().unwrap() };
static ref TAG_COPYRIGHT_URI: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_COPYRIGHT_URI).to_str().unwrap() };
static ref TAG_ENCODED_BY: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ENCODED_BY).to_str().unwrap() };
static ref TAG_COMPOSER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_COMPOSER).to_str().unwrap() };
static ref TAG_CONDUCTOR: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_CONDUCTOR).to_str().unwrap() };
static ref TAG_CONTACT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_CONTACT).to_str().unwrap() };
static ref TAG_LICENSE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_LICENSE).to_str().unwrap() };
static ref TAG_LICENSE_URI: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_LICENSE_URI).to_str().unwrap() };
static ref TAG_PERFORMER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_PERFORMER).to_str().unwrap() };
static ref TAG_DURATION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_DURATION).to_str().unwrap() };
static ref TAG_CODEC: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_CODEC).to_str().unwrap() };
static ref TAG_VIDEO_CODEC: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_VIDEO_CODEC).to_str().unwrap() };
static ref TAG_AUDIO_CODEC: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_AUDIO_CODEC).to_str().unwrap() };
static ref TAG_SUBTITLE_CODEC: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_SUBTITLE_CODEC).to_str().unwrap() };
static ref TAG_CONTAINER_FORMAT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_CONTAINER_FORMAT).to_str().unwrap() };
static ref TAG_BITRATE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_BITRATE).to_str().unwrap() };
static ref TAG_NOMINAL_BITRATE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_NOMINAL_BITRATE).to_str().unwrap() };
static ref TAG_MINIMUM_BITRATE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_MINIMUM_BITRATE).to_str().unwrap() };
static ref TAG_MAXIMUM_BITRATE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_MAXIMUM_BITRATE).to_str().unwrap() };
static ref TAG_SERIAL: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_SERIAL).to_str().unwrap() };
static ref TAG_ENCODER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ENCODER).to_str().unwrap() };
static ref TAG_ENCODER_VERSION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ENCODER_VERSION).to_str().unwrap() };
static ref TAG_TRACK_GAIN: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_GAIN).to_str().unwrap() };
static ref TAG_TRACK_PEAK: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_PEAK).to_str().unwrap() };
static ref TAG_ALBUM_GAIN: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_GAIN).to_str().unwrap() };
static ref TAG_ALBUM_PEAK: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_PEAK).to_str().unwrap() };
static ref TAG_REFERENCE_LEVEL: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_REFERENCE_LEVEL).to_str().unwrap() };
static ref TAG_LANGUAGE_CODE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_LANGUAGE_CODE).to_str().unwrap() };
static ref TAG_LANGUAGE_NAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_LANGUAGE_NAME).to_str().unwrap() };
static ref TAG_IMAGE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_IMAGE).to_str().unwrap() };
static ref TAG_PREVIEW_IMAGE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_PREVIEW_IMAGE).to_str().unwrap() };
static ref TAG_ATTACHMENT: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_ATTACHMENT).to_str().unwrap() };
static ref TAG_BEATS_PER_MINUTE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_BEATS_PER_MINUTE).to_str().unwrap() };
static ref TAG_KEYWORDS: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_KEYWORDS).to_str().unwrap() };
static ref TAG_GEO_LOCATION_NAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_NAME).to_str().unwrap() };
static ref TAG_GEO_LOCATION_LATITUDE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_LATITUDE).to_str().unwrap() };
static ref TAG_GEO_LOCATION_LONGITUDE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_LONGITUDE).to_str().unwrap() };
static ref TAG_GEO_LOCATION_ELEVATION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_ELEVATION).to_str().unwrap() };
static ref TAG_GEO_LOCATION_CITY: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_CITY).to_str().unwrap() };
static ref TAG_GEO_LOCATION_COUNTRY: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_COUNTRY).to_str().unwrap() };
static ref TAG_GEO_LOCATION_SUBLOCATION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_SUBLOCATION).to_str().unwrap() };
static ref TAG_GEO_LOCATION_HORIZONTAL_ERROR: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR).to_str().unwrap() };
static ref TAG_GEO_LOCATION_MOVEMENT_DIRECTION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION).to_str().unwrap() };
static ref TAG_GEO_LOCATION_MOVEMENT_SPEED: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_MOVEMENT_SPEED).to_str().unwrap() };
static ref TAG_GEO_LOCATION_CAPTURE_DIRECTION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION).to_str().unwrap() };
static ref TAG_SHOW_NAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_SHOW_NAME).to_str().unwrap() };
static ref TAG_SHOW_SORTNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_SHOW_SORTNAME).to_str().unwrap() };
static ref TAG_SHOW_EPISODE_NUMBER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_SHOW_EPISODE_NUMBER).to_str().unwrap() };
static ref TAG_SHOW_SEASON_NUMBER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_SHOW_SEASON_NUMBER).to_str().unwrap() };
static ref TAG_LYRICS: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_LYRICS).to_str().unwrap() };
static ref TAG_COMPOSER_SORTNAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_COMPOSER_SORTNAME).to_str().unwrap() };
static ref TAG_GROUPING: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_GROUPING).to_str().unwrap() };
static ref TAG_USER_RATING: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_USER_RATING).to_str().unwrap() };
static ref TAG_DEVICE_MANUFACTURER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_DEVICE_MANUFACTURER).to_str().unwrap() };
static ref TAG_DEVICE_MODEL: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_DEVICE_MODEL).to_str().unwrap() };
static ref TAG_APPLICATION_NAME: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_APPLICATION_NAME).to_str().unwrap() };
static ref TAG_APPLICATION_DATA: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_APPLICATION_DATA).to_str().unwrap() };
static ref TAG_IMAGE_ORIENTATION: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_IMAGE_ORIENTATION).to_str().unwrap() };
static ref TAG_PUBLISHER: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_PUBLISHER).to_str().unwrap() };
static ref TAG_INTERPRETED_BY: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_INTERPRETED_BY).to_str().unwrap() };
static ref TAG_MIDI_BASE_NOTE: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_MIDI_BASE_NOTE).to_str().unwrap() };
static ref TAG_PRIVATE_DATA: &'static str = unsafe { CStr::from_ptr(ffi::GST_TAG_PRIVATE_DATA).to_str().unwrap() };
static ref TAG_ORGANIZATION: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ORGANIZATION).to_str().unwrap() };
static ref TAG_COPYRIGHT: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_COPYRIGHT).to_str().unwrap() };
static ref TAG_COPYRIGHT_URI: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_COPYRIGHT_URI).to_str().unwrap() };
static ref TAG_ENCODED_BY: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ENCODED_BY).to_str().unwrap() };
static ref TAG_COMPOSER: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_COMPOSER).to_str().unwrap() };
static ref TAG_CONDUCTOR: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_CONDUCTOR).to_str().unwrap() };
static ref TAG_CONTACT: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_CONTACT).to_str().unwrap() };
static ref TAG_LICENSE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_LICENSE).to_str().unwrap() };
static ref TAG_LICENSE_URI: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_LICENSE_URI).to_str().unwrap() };
static ref TAG_PERFORMER: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_PERFORMER).to_str().unwrap() };
static ref TAG_DURATION: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_DURATION).to_str().unwrap() };
static ref TAG_CODEC: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_CODEC).to_str().unwrap() };
static ref TAG_VIDEO_CODEC: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_VIDEO_CODEC).to_str().unwrap() };
static ref TAG_AUDIO_CODEC: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_AUDIO_CODEC).to_str().unwrap() };
static ref TAG_SUBTITLE_CODEC: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_SUBTITLE_CODEC)
.to_str()
.unwrap()
};
static ref TAG_CONTAINER_FORMAT: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_CONTAINER_FORMAT)
.to_str()
.unwrap()
};
static ref TAG_BITRATE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_BITRATE).to_str().unwrap() };
static ref TAG_NOMINAL_BITRATE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_NOMINAL_BITRATE)
.to_str()
.unwrap()
};
static ref TAG_MINIMUM_BITRATE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_MINIMUM_BITRATE)
.to_str()
.unwrap()
};
static ref TAG_MAXIMUM_BITRATE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_MAXIMUM_BITRATE)
.to_str()
.unwrap()
};
static ref TAG_SERIAL: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_SERIAL).to_str().unwrap() };
static ref TAG_ENCODER: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ENCODER).to_str().unwrap() };
static ref TAG_ENCODER_VERSION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_ENCODER_VERSION)
.to_str()
.unwrap()
};
static ref TAG_TRACK_GAIN: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_GAIN).to_str().unwrap() };
static ref TAG_TRACK_PEAK: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_TRACK_PEAK).to_str().unwrap() };
static ref TAG_ALBUM_GAIN: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_GAIN).to_str().unwrap() };
static ref TAG_ALBUM_PEAK: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ALBUM_PEAK).to_str().unwrap() };
static ref TAG_REFERENCE_LEVEL: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_REFERENCE_LEVEL)
.to_str()
.unwrap()
};
static ref TAG_LANGUAGE_CODE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_LANGUAGE_CODE).to_str().unwrap() };
static ref TAG_LANGUAGE_NAME: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_LANGUAGE_NAME).to_str().unwrap() };
static ref TAG_IMAGE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_IMAGE).to_str().unwrap() };
static ref TAG_PREVIEW_IMAGE: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_PREVIEW_IMAGE).to_str().unwrap() };
static ref TAG_ATTACHMENT: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_ATTACHMENT).to_str().unwrap() };
static ref TAG_BEATS_PER_MINUTE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_BEATS_PER_MINUTE)
.to_str()
.unwrap()
};
static ref TAG_KEYWORDS: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_KEYWORDS).to_str().unwrap() };
static ref TAG_GEO_LOCATION_NAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_NAME)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_LATITUDE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_LATITUDE)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_LONGITUDE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_LONGITUDE)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_ELEVATION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_ELEVATION)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_CITY: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_CITY)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_COUNTRY: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_COUNTRY)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_SUBLOCATION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_SUBLOCATION)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_HORIZONTAL_ERROR: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_MOVEMENT_DIRECTION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_MOVEMENT_SPEED: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_MOVEMENT_SPEED)
.to_str()
.unwrap()
};
static ref TAG_GEO_LOCATION_CAPTURE_DIRECTION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION)
.to_str()
.unwrap()
};
static ref TAG_SHOW_NAME: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_SHOW_NAME).to_str().unwrap() };
static ref TAG_SHOW_SORTNAME: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_SHOW_SORTNAME).to_str().unwrap() };
static ref TAG_SHOW_EPISODE_NUMBER: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_SHOW_EPISODE_NUMBER)
.to_str()
.unwrap()
};
static ref TAG_SHOW_SEASON_NUMBER: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_SHOW_SEASON_NUMBER)
.to_str()
.unwrap()
};
static ref TAG_LYRICS: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_LYRICS).to_str().unwrap() };
static ref TAG_COMPOSER_SORTNAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_COMPOSER_SORTNAME)
.to_str()
.unwrap()
};
static ref TAG_GROUPING: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_GROUPING).to_str().unwrap() };
static ref TAG_USER_RATING: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_USER_RATING).to_str().unwrap() };
static ref TAG_DEVICE_MANUFACTURER: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_DEVICE_MANUFACTURER)
.to_str()
.unwrap()
};
static ref TAG_DEVICE_MODEL: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_DEVICE_MODEL).to_str().unwrap() };
static ref TAG_APPLICATION_NAME: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_APPLICATION_NAME)
.to_str()
.unwrap()
};
static ref TAG_APPLICATION_DATA: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_APPLICATION_DATA)
.to_str()
.unwrap()
};
static ref TAG_IMAGE_ORIENTATION: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_IMAGE_ORIENTATION)
.to_str()
.unwrap()
};
static ref TAG_PUBLISHER: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_PUBLISHER).to_str().unwrap() };
static ref TAG_INTERPRETED_BY: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_INTERPRETED_BY)
.to_str()
.unwrap()
};
static ref TAG_MIDI_BASE_NOTE: &'static str = unsafe {
CStr::from_ptr(ffi::GST_TAG_MIDI_BASE_NOTE)
.to_str()
.unwrap()
};
static ref TAG_PRIVATE_DATA: &'static str =
unsafe { CStr::from_ptr(ffi::GST_TAG_PRIVATE_DATA).to_str().unwrap() };
}
pub type TagList = GstRc<TagListRef>;

View file

@ -16,12 +16,12 @@ use glib;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrContainer, ToGlib,
ToGlibPtr};
use miniobject::*;
use TocEntryType;
use TocScope;
use TocLoopType;
use TagList;
use TagMergeMode;
use TocEntryType;
use TocLoopType;
use TocScope;
use miniobject::*;
pub type Toc = GstRc<TocRef>;
pub struct TocRef(ffi::GstToc);

View file

@ -6,18 +6,18 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use Plugin;
use TypeFindProbability;
use TypeFindFactory;
use Caps;
use Plugin;
use TypeFindFactory;
use TypeFindProbability;
use ffi;
use glib::translate::*;
use glib_ffi;
use std::marker::PhantomData;
use std::mem;
use std::ptr;
use std::slice;
use std::marker::PhantomData;
use glib_ffi;
use glib::translate::*;
#[repr(C)]
pub struct TypeFind<'a>(ffi::GstTypeFind, PhantomData<&'a ()>);

View file

@ -7,15 +7,15 @@
// except according to those terms.
use num_rational::Rational32;
use std::borrow::{Borrow, Cow};
use std::fmt;
use std::ops;
use std::borrow::{Borrow, Cow};
use std::slice;
use glib;
use glib::value::{FromValue, FromValueOptional, SetValue, ToSendValue, Value};
use glib::translate::{from_glib, from_glib_full, FromGlib, ToGlib, ToGlibPtr, ToGlibPtrMut,
Uninitialized};
use glib::value::{FromValue, FromValueOptional, SetValue, ToSendValue, Value};
use ffi;
use glib_ffi;

View file

@ -1,8 +1,8 @@
extern crate gstreamer as gst;
use gst::MessageView;
use gst::prelude::*;
use std::io;
use std::io::Write;
use gst::prelude::*;
use gst::MessageView;
#[path = "../tutorials-common.rs"]
mod tutorials_common;

View file

@ -1,7 +1,7 @@
#[cfg(feature = "tutorial5")]
mod tutorial5 {
use std::process;
use std::os::raw::c_void;
use std::process;
extern crate glib;
use self::glib::translate::*;

View file

@ -1,6 +1,6 @@
extern crate gstreamer as gst;
use gst::prelude::*;
use gst::MessageView;
use gst::prelude::*;
#[path = "../tutorials-common.rs"]
mod tutorials_common;