forked from mirrors/gstreamer-rs
Update manual code
This commit is contained in:
parent
24305a19e8
commit
e7898c1b24
159 changed files with 3387 additions and 2859 deletions
|
@ -14,7 +14,7 @@ extern crate failure_derive;
|
|||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_rtsp as gst_rtsp;
|
||||
extern crate gstreamer_rtsp_server as gst_rtsp_server;
|
||||
extern crate gstreamer_rtsp_server_sys as ffi;
|
||||
extern crate gstreamer_rtsp_server_sys as gst_rtsp_server_sys;
|
||||
|
||||
use failure::Error;
|
||||
use std::env;
|
||||
|
@ -93,7 +93,7 @@ fn main_loop() -> Result<(), Error> {
|
|||
// This declares that the user "user" (once authenticated) has a role that
|
||||
// allows them to access and construct media factories.
|
||||
unsafe {
|
||||
ffi::gst_rtsp_media_factory_add_role(
|
||||
gst_rtsp_server_sys::gst_rtsp_media_factory_add_role(
|
||||
factory.to_glib_none().0,
|
||||
"user".to_glib_none().0,
|
||||
RTSP_PERM_MEDIA_FACTORY_ACCESS.to_glib_none().0,
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::ObjectType;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_ffi::gpointer;
|
||||
use glib_sys::gpointer;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use gst_app_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::cell::RefCell;
|
||||
use std::mem::transmute;
|
||||
|
@ -29,7 +29,7 @@ pub struct AppSinkCallbacks {
|
|||
new_sample: Option<
|
||||
RefCell<Box<FnMut(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static>>,
|
||||
>,
|
||||
callbacks: ffi::GstAppSinkCallbacks,
|
||||
callbacks: gst_app_sys::GstAppSinkCallbacks,
|
||||
}
|
||||
|
||||
unsafe impl Send for AppSinkCallbacks {}
|
||||
|
@ -99,7 +99,7 @@ impl AppSinkCallbacksBuilder {
|
|||
eos: self.eos,
|
||||
new_preroll: self.new_preroll,
|
||||
new_sample: self.new_sample,
|
||||
callbacks: ffi::GstAppSinkCallbacks {
|
||||
callbacks: gst_app_sys::GstAppSinkCallbacks {
|
||||
eos: if have_eos { Some(trampoline_eos) } else { None },
|
||||
new_preroll: if have_new_preroll {
|
||||
Some(trampoline_new_preroll)
|
||||
|
@ -122,7 +122,7 @@ impl AppSinkCallbacksBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_eos(appsink: *mut ffi::GstAppSink, callbacks: gpointer) {
|
||||
unsafe extern "C" fn trampoline_eos(appsink: *mut gst_app_sys::GstAppSink, callbacks: gpointer) {
|
||||
let callbacks = &*(callbacks as *const AppSinkCallbacks);
|
||||
|
||||
if let Some(ref eos) = callbacks.eos {
|
||||
|
@ -131,9 +131,9 @@ unsafe extern "C" fn trampoline_eos(appsink: *mut ffi::GstAppSink, callbacks: gp
|
|||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_new_preroll(
|
||||
appsink: *mut ffi::GstAppSink,
|
||||
appsink: *mut gst_app_sys::GstAppSink,
|
||||
callbacks: gpointer,
|
||||
) -> gst_ffi::GstFlowReturn {
|
||||
) -> gst_sys::GstFlowReturn {
|
||||
let callbacks = &*(callbacks as *const AppSinkCallbacks);
|
||||
|
||||
let ret = if let Some(ref new_preroll) = callbacks.new_preroll {
|
||||
|
@ -146,9 +146,9 @@ unsafe extern "C" fn trampoline_new_preroll(
|
|||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_new_sample(
|
||||
appsink: *mut ffi::GstAppSink,
|
||||
appsink: *mut gst_app_sys::GstAppSink,
|
||||
callbacks: gpointer,
|
||||
) -> gst_ffi::GstFlowReturn {
|
||||
) -> gst_sys::GstFlowReturn {
|
||||
let callbacks = &*(callbacks as *const AppSinkCallbacks);
|
||||
|
||||
let ret = if let Some(ref new_sample) = callbacks.new_sample {
|
||||
|
@ -167,7 +167,7 @@ unsafe extern "C" fn destroy_callbacks(ptr: gpointer) {
|
|||
impl AppSink {
|
||||
pub fn set_callbacks(&self, callbacks: AppSinkCallbacks) {
|
||||
unsafe {
|
||||
ffi::gst_app_sink_set_callbacks(
|
||||
gst_app_sys::gst_app_sink_set_callbacks(
|
||||
self.to_glib_none().0,
|
||||
mut_override(&callbacks.callbacks),
|
||||
Box::into_raw(Box::new(callbacks)) as *mut _,
|
||||
|
@ -214,9 +214,9 @@ impl AppSink {
|
|||
unsafe extern "C" fn new_sample_trampoline<
|
||||
F: Fn(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstAppSink,
|
||||
f: glib_ffi::gpointer,
|
||||
) -> gst_ffi::GstFlowReturn {
|
||||
this: *mut gst_app_sys::GstAppSink,
|
||||
f: glib_sys::gpointer,
|
||||
) -> gst_sys::GstFlowReturn {
|
||||
let f: &F = &*(f as *const F);
|
||||
let ret: gst::FlowReturn = f(&from_glib_borrow(this)).into();
|
||||
ret.to_glib()
|
||||
|
@ -225,9 +225,9 @@ unsafe extern "C" fn new_sample_trampoline<
|
|||
unsafe extern "C" fn new_preroll_trampoline<
|
||||
F: Fn(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstAppSink,
|
||||
f: glib_ffi::gpointer,
|
||||
) -> gst_ffi::GstFlowReturn {
|
||||
this: *mut gst_app_sys::GstAppSink,
|
||||
f: glib_sys::gpointer,
|
||||
) -> gst_sys::GstFlowReturn {
|
||||
let f: &F = &*(f as *const F);
|
||||
let ret: gst::FlowReturn = f(&from_glib_borrow(this)).into();
|
||||
ret.to_glib()
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi::{gboolean, gpointer};
|
||||
use glib_sys::{gboolean, gpointer};
|
||||
use gst;
|
||||
use gst_app_sys;
|
||||
use std::cell::RefCell;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
@ -20,7 +20,7 @@ pub struct AppSrcCallbacks {
|
|||
need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
|
||||
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>,
|
||||
seek_data: Option<Box<Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>>,
|
||||
callbacks: ffi::GstAppSrcCallbacks,
|
||||
callbacks: gst_app_sys::GstAppSrcCallbacks,
|
||||
}
|
||||
|
||||
unsafe impl Send for AppSrcCallbacks {}
|
||||
|
@ -80,7 +80,7 @@ impl AppSrcCallbacksBuilder {
|
|||
need_data: self.need_data,
|
||||
enough_data: self.enough_data,
|
||||
seek_data: self.seek_data,
|
||||
callbacks: ffi::GstAppSrcCallbacks {
|
||||
callbacks: gst_app_sys::GstAppSrcCallbacks {
|
||||
need_data: if have_need_data {
|
||||
Some(trampoline_need_data)
|
||||
} else {
|
||||
|
@ -108,7 +108,7 @@ impl AppSrcCallbacksBuilder {
|
|||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_need_data(
|
||||
appsrc: *mut ffi::GstAppSrc,
|
||||
appsrc: *mut gst_app_sys::GstAppSrc,
|
||||
length: u32,
|
||||
callbacks: gpointer,
|
||||
) {
|
||||
|
@ -119,7 +119,10 @@ unsafe extern "C" fn trampoline_need_data(
|
|||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_enough_data(appsrc: *mut ffi::GstAppSrc, callbacks: gpointer) {
|
||||
unsafe extern "C" fn trampoline_enough_data(
|
||||
appsrc: *mut gst_app_sys::GstAppSrc,
|
||||
callbacks: gpointer,
|
||||
) {
|
||||
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
||||
|
||||
if let Some(ref enough_data) = callbacks.enough_data {
|
||||
|
@ -128,7 +131,7 @@ unsafe extern "C" fn trampoline_enough_data(appsrc: *mut ffi::GstAppSrc, callbac
|
|||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_seek_data(
|
||||
appsrc: *mut ffi::GstAppSrc,
|
||||
appsrc: *mut gst_app_sys::GstAppSrc,
|
||||
offset: u64,
|
||||
callbacks: gpointer,
|
||||
) -> gboolean {
|
||||
|
@ -149,14 +152,17 @@ unsafe extern "C" fn destroy_callbacks(ptr: gpointer) {
|
|||
|
||||
impl AppSrc {
|
||||
pub fn end_of_stream(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn =
|
||||
unsafe { from_glib(ffi::gst_app_src_end_of_stream(self.to_glib_none().0)) };
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_app_sys::gst_app_src_end_of_stream(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
pub fn push_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_app_src_push_buffer(
|
||||
from_glib(gst_app_sys::gst_app_src_push_buffer(
|
||||
self.to_glib_none().0,
|
||||
buffer.into_ptr(),
|
||||
))
|
||||
|
@ -170,7 +176,7 @@ impl AppSrc {
|
|||
list: gst::BufferList,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_app_src_push_buffer_list(
|
||||
from_glib(gst_app_sys::gst_app_src_push_buffer_list(
|
||||
self.to_glib_none().0,
|
||||
list.into_ptr(),
|
||||
))
|
||||
|
@ -180,7 +186,7 @@ impl AppSrc {
|
|||
|
||||
pub fn push_sample(&self, sample: &gst::Sample) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_app_src_push_sample(
|
||||
from_glib(gst_app_sys::gst_app_src_push_sample(
|
||||
self.to_glib_none().0,
|
||||
sample.to_glib_none().0,
|
||||
))
|
||||
|
@ -190,7 +196,7 @@ impl AppSrc {
|
|||
|
||||
pub fn set_callbacks(&self, callbacks: AppSrcCallbacks) {
|
||||
unsafe {
|
||||
ffi::gst_app_src_set_callbacks(
|
||||
gst_app_sys::gst_app_src_set_callbacks(
|
||||
self.to_glib_none().0,
|
||||
mut_override(&callbacks.callbacks),
|
||||
Box::into_raw(Box::new(callbacks)) as *mut _,
|
||||
|
@ -201,7 +207,11 @@ impl AppSrc {
|
|||
|
||||
pub fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::gst_app_src_set_latency(self.to_glib_none().0, min.to_glib(), max.to_glib());
|
||||
gst_app_sys::gst_app_src_set_latency(
|
||||
self.to_glib_none().0,
|
||||
min.to_glib(),
|
||||
max.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,7 +219,7 @@ impl AppSrc {
|
|||
unsafe {
|
||||
let mut min = mem::uninitialized();
|
||||
let mut max = mem::uninitialized();
|
||||
ffi::gst_app_src_get_latency(self.to_glib_none().0, &mut min, &mut max);
|
||||
gst_app_sys::gst_app_src_get_latency(self.to_glib_none().0, &mut min, &mut max);
|
||||
(from_glib(min), from_glib(max))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_app_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
extern crate libc;
|
||||
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_app_sys as ffi;
|
||||
extern crate gstreamer_app_sys as gst_app_sys;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_base_sys as gst_base_ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_base_sys as gst_base_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_audio_sys;
|
||||
use AudioChannelPosition;
|
||||
|
||||
use std::mem;
|
||||
|
@ -25,7 +25,7 @@ impl AudioChannelPosition {
|
|||
return 0;
|
||||
}
|
||||
unsafe {
|
||||
let val = mem::transmute::<ffi::GstAudioChannelPosition, u32>(pos);
|
||||
let val = mem::transmute::<gst_audio_sys::GstAudioChannelPosition, u32>(pos);
|
||||
1 << val
|
||||
}
|
||||
}
|
||||
|
@ -38,17 +38,18 @@ impl AudioChannelPosition {
|
|||
return None;
|
||||
}
|
||||
|
||||
let positions_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
positions[i].to_glib()
|
||||
}
|
||||
});
|
||||
let positions_raw: [gst_audio_sys::GstAudioChannelPosition; 64] =
|
||||
array_init::array_init_copy(|i| {
|
||||
if i >= len as usize {
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
positions[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
unsafe {
|
||||
let mut mask = mem::uninitialized();
|
||||
let valid: bool = from_glib(ffi::gst_audio_channel_positions_to_mask(
|
||||
let valid: bool = from_glib(gst_audio_sys::gst_audio_channel_positions_to_mask(
|
||||
positions_raw.as_ptr() as *mut _,
|
||||
len as i32,
|
||||
force_order.to_glib(),
|
||||
|
@ -73,10 +74,10 @@ impl AudioChannelPosition {
|
|||
}
|
||||
|
||||
let len = positions.len();
|
||||
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] =
|
||||
[ffi::GST_AUDIO_CHANNEL_POSITION_INVALID; 64];
|
||||
let mut positions_raw: [gst_audio_sys::GstAudioChannelPosition; 64] =
|
||||
[gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID; 64];
|
||||
let valid: bool = unsafe {
|
||||
from_glib(ffi::gst_audio_channel_positions_from_mask(
|
||||
from_glib(gst_audio_sys::gst_audio_channel_positions_from_mask(
|
||||
len as i32,
|
||||
mask,
|
||||
positions_raw.as_mut_ptr(),
|
||||
|
@ -105,17 +106,17 @@ impl AudioChannelPosition {
|
|||
}
|
||||
|
||||
let len = positions.len();
|
||||
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] =
|
||||
let mut positions_raw: [gst_audio_sys::GstAudioChannelPosition; 64] =
|
||||
array_init::array_init_copy(|i| {
|
||||
if i >= len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
positions[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let valid: bool = unsafe {
|
||||
from_glib(ffi::gst_audio_channel_positions_to_valid_order(
|
||||
from_glib(gst_audio_sys::gst_audio_channel_positions_to_valid_order(
|
||||
positions_raw.as_mut_ptr(),
|
||||
len as i32,
|
||||
))
|
||||
|
@ -136,7 +137,7 @@ impl AudioChannelPosition {
|
|||
pub fn get_fallback_mask(channels: u32) -> u64 {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe { ffi::gst_audio_channel_get_fallback_mask(channels as i32) }
|
||||
unsafe { gst_audio_sys::gst_audio_channel_get_fallback_mask(channels as i32) }
|
||||
}
|
||||
|
||||
pub fn check_valid_channel_positions(
|
||||
|
@ -150,16 +151,17 @@ impl AudioChannelPosition {
|
|||
}
|
||||
|
||||
let len = positions.len();
|
||||
let positions_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
positions[i].to_glib()
|
||||
}
|
||||
});
|
||||
let positions_raw: [gst_audio_sys::GstAudioChannelPosition; 64] =
|
||||
array_init::array_init_copy(|i| {
|
||||
if i >= len as usize {
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
positions[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
unsafe {
|
||||
from_glib(ffi::gst_audio_check_valid_channel_positions(
|
||||
from_glib(gst_audio_sys::gst_audio_check_valid_channel_positions(
|
||||
positions_raw.as_ptr() as *mut _,
|
||||
len as i32,
|
||||
force_order.to_glib(),
|
||||
|
@ -184,24 +186,24 @@ pub fn buffer_reorder_channels(
|
|||
let from_len = from.len();
|
||||
let to_len = to.len();
|
||||
|
||||
let from_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
let from_raw: [gst_audio_sys::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= from_len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
from[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let to_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
let to_raw: [gst_audio_sys::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= to_len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
to[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let valid: bool = unsafe {
|
||||
from_glib(ffi::gst_audio_buffer_reorder_channels(
|
||||
from_glib(gst_audio_sys::gst_audio_buffer_reorder_channels(
|
||||
buffer.as_mut_ptr(),
|
||||
format.to_glib(),
|
||||
channels as i32,
|
||||
|
@ -233,24 +235,24 @@ pub fn reorder_channels(
|
|||
let from_len = from.len();
|
||||
let to_len = to.len();
|
||||
|
||||
let from_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
let from_raw: [gst_audio_sys::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= from_len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
from[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let to_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
let to_raw: [gst_audio_sys::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= to_len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
to[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let valid: bool = unsafe {
|
||||
from_glib(ffi::gst_audio_reorder_channels(
|
||||
from_glib(gst_audio_sys::gst_audio_reorder_channels(
|
||||
data.as_mut_ptr() as *mut _,
|
||||
data.len(),
|
||||
format.to_glib(),
|
||||
|
@ -281,17 +283,17 @@ pub fn get_channel_reorder_map(
|
|||
let from_len = from.len();
|
||||
let to_len = to.len();
|
||||
|
||||
let from_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
let from_raw: [gst_audio_sys::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= from_len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
from[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let to_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
let to_raw: [gst_audio_sys::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||
if i >= to_len as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
to[i].to_glib()
|
||||
}
|
||||
|
@ -299,7 +301,7 @@ pub fn get_channel_reorder_map(
|
|||
|
||||
let mut reorder_map_raw = [0i32, 64];
|
||||
let valid: bool = unsafe {
|
||||
from_glib(ffi::gst_audio_get_channel_reorder_map(
|
||||
from_glib(gst_audio_sys::gst_audio_get_channel_reorder_map(
|
||||
from_len as i32,
|
||||
from_raw.as_ptr() as *mut _,
|
||||
to_raw.as_ptr() as *mut _,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_audio_sys;
|
||||
|
||||
use std::ffi::CStr;
|
||||
use std::fmt;
|
||||
|
@ -24,7 +24,7 @@ impl ::AudioFormat {
|
|||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe {
|
||||
from_glib(ffi::gst_audio_format_build_integer(
|
||||
from_glib(gst_audio_sys::gst_audio_format_build_integer(
|
||||
sign.to_glib(),
|
||||
endianness.to_glib(),
|
||||
width,
|
||||
|
@ -36,7 +36,11 @@ impl ::AudioFormat {
|
|||
pub fn from_string(s: &str) -> ::AudioFormat {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe { from_glib(ffi::gst_audio_format_from_string(s.to_glib_none().0)) }
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_format_from_string(
|
||||
s.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_string<'a>(self) -> &'a str {
|
||||
|
@ -45,7 +49,7 @@ impl ::AudioFormat {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
CStr::from_ptr(ffi::gst_audio_format_to_string(self.to_glib()))
|
||||
CStr::from_ptr(gst_audio_sys::gst_audio_format_to_string(self.to_glib()))
|
||||
.to_str()
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_audio_sys;
|
||||
|
||||
use std::ffi::CStr;
|
||||
use std::fmt;
|
||||
|
@ -48,14 +48,14 @@ impl ToGlib for AudioEndianness {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct AudioFormatInfo(&'static ffi::GstAudioFormatInfo);
|
||||
pub struct AudioFormatInfo(&'static gst_audio_sys::GstAudioFormatInfo);
|
||||
|
||||
impl AudioFormatInfo {
|
||||
pub fn from_format(format: ::AudioFormat) -> AudioFormatInfo {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe {
|
||||
let info = ffi::gst_audio_format_get_info(format.to_glib());
|
||||
let info = gst_audio_sys::gst_audio_format_get_info(format.to_glib());
|
||||
assert!(!info.is_null());
|
||||
|
||||
AudioFormatInfo(&*info)
|
||||
|
@ -178,7 +178,11 @@ impl AudioFormatInfo {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
ffi::gst_audio_format_fill_silence(self.0, dest.as_mut_ptr() as *mut _, dest.len())
|
||||
gst_audio_sys::gst_audio_format_fill_silence(
|
||||
self.0,
|
||||
dest.as_mut_ptr() as *mut _,
|
||||
dest.len(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,26 +249,29 @@ impl From<::AudioFormat> for AudioFormatInfo {
|
|||
|
||||
impl glib::types::StaticType for AudioFormatInfo {
|
||||
fn static_type() -> glib::types::Type {
|
||||
unsafe { glib::translate::from_glib(ffi::gst_audio_format_info_get_type()) }
|
||||
unsafe { glib::translate::from_glib(gst_audio_sys::gst_audio_format_info_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::value::FromValueOptional<'a> for AudioFormatInfo {
|
||||
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
|
||||
Option::<AudioFormatInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(
|
||||
Option::<AudioFormatInfo>::from_glib_none(gobject_sys::g_value_get_boxed(
|
||||
value.to_glib_none().0,
|
||||
) as *mut ffi::GstAudioFormatInfo)
|
||||
)
|
||||
as *mut gst_audio_sys::GstAudioFormatInfo)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::value::SetValue for AudioFormatInfo {
|
||||
unsafe fn set_value(value: &mut glib::Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
glib::translate::ToGlibPtr::<*const ffi::GstAudioFormatInfo>::to_glib_none(this).0
|
||||
as glib_ffi::gpointer,
|
||||
glib::translate::ToGlibPtr::<*const gst_audio_sys::GstAudioFormatInfo>::to_glib_none(
|
||||
this,
|
||||
)
|
||||
.0 as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -272,36 +279,42 @@ impl glib::value::SetValue for AudioFormatInfo {
|
|||
#[doc(hidden)]
|
||||
impl glib::value::SetValueOptional for AudioFormatInfo {
|
||||
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
glib::translate::ToGlibPtr::<*const ffi::GstAudioFormatInfo>::to_glib_none(&this).0
|
||||
as glib_ffi::gpointer,
|
||||
glib::translate::ToGlibPtr::<*const gst_audio_sys::GstAudioFormatInfo>::to_glib_none(
|
||||
&this,
|
||||
)
|
||||
.0 as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::GlibPtrDefault for AudioFormatInfo {
|
||||
type GlibType = *mut ffi::GstAudioFormatInfo;
|
||||
type GlibType = *mut gst_audio_sys::GstAudioFormatInfo;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const ffi::GstAudioFormatInfo> for AudioFormatInfo {
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const gst_audio_sys::GstAudioFormatInfo>
|
||||
for AudioFormatInfo
|
||||
{
|
||||
type Storage = &'a AudioFormatInfo;
|
||||
|
||||
fn to_glib_none(&'a self) -> glib::translate::Stash<'a, *const ffi::GstAudioFormatInfo, Self> {
|
||||
fn to_glib_none(
|
||||
&'a self,
|
||||
) -> glib::translate::Stash<'a, *const gst_audio_sys::GstAudioFormatInfo, Self> {
|
||||
glib::translate::Stash(self.0, self)
|
||||
}
|
||||
|
||||
fn to_glib_full(&self) -> *const ffi::GstAudioFormatInfo {
|
||||
fn to_glib_full(&self) -> *const gst_audio_sys::GstAudioFormatInfo {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrNone<*mut ffi::GstAudioFormatInfo> for AudioFormatInfo {
|
||||
impl glib::translate::FromGlibPtrNone<*mut gst_audio_sys::GstAudioFormatInfo> for AudioFormatInfo {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *mut ffi::GstAudioFormatInfo) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *mut gst_audio_sys::GstAudioFormatInfo) -> Self {
|
||||
AudioFormatInfo(&*ptr)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_audio_sys;
|
||||
|
||||
use glib;
|
||||
use glib::translate::{
|
||||
|
@ -23,7 +23,7 @@ use std::ptr;
|
|||
|
||||
use array_init;
|
||||
|
||||
pub struct AudioInfo(ffi::GstAudioInfo, [::AudioChannelPosition; 64]);
|
||||
pub struct AudioInfo(gst_audio_sys::GstAudioInfo, [::AudioChannelPosition; 64]);
|
||||
|
||||
impl fmt::Debug for AudioInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
|
@ -57,20 +57,21 @@ impl<'a> AudioInfoBuilder<'a> {
|
|||
return None;
|
||||
}
|
||||
|
||||
let positions: [ffi::GstAudioChannelPosition; 64] =
|
||||
let positions: [gst_audio_sys::GstAudioChannelPosition; 64] =
|
||||
array_init::array_init_copy(|i| {
|
||||
if i >= self.channels as usize {
|
||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||
} else {
|
||||
p[i].to_glib()
|
||||
}
|
||||
});
|
||||
|
||||
let valid: bool = from_glib(ffi::gst_audio_check_valid_channel_positions(
|
||||
positions.as_ptr() as *mut _,
|
||||
self.channels as i32,
|
||||
true.to_glib(),
|
||||
));
|
||||
let valid: bool =
|
||||
from_glib(gst_audio_sys::gst_audio_check_valid_channel_positions(
|
||||
positions.as_ptr() as *mut _,
|
||||
self.channels as i32,
|
||||
true.to_glib(),
|
||||
));
|
||||
if !valid {
|
||||
return None;
|
||||
}
|
||||
|
@ -85,7 +86,7 @@ impl<'a> AudioInfoBuilder<'a> {
|
|||
.map(|p| p.as_ptr())
|
||||
.unwrap_or(ptr::null());
|
||||
|
||||
ffi::gst_audio_info_set_format(
|
||||
gst_audio_sys::gst_audio_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.rate as i32,
|
||||
|
@ -152,7 +153,10 @@ impl AudioInfo {
|
|||
|
||||
unsafe {
|
||||
let mut info = mem::uninitialized();
|
||||
if from_glib(ffi::gst_audio_info_from_caps(&mut info, caps.as_ptr())) {
|
||||
if from_glib(gst_audio_sys::gst_audio_info_from_caps(
|
||||
&mut info,
|
||||
caps.as_ptr(),
|
||||
)) {
|
||||
let positions = array_init::array_init_copy(|i| from_glib(info.position[i]));
|
||||
Some(AudioInfo(info, positions))
|
||||
} else {
|
||||
|
@ -162,7 +166,7 @@ impl AudioInfo {
|
|||
}
|
||||
|
||||
pub fn to_caps(&self) -> Option<gst::Caps> {
|
||||
unsafe { from_glib_full(ffi::gst_audio_info_to_caps(&self.0)) }
|
||||
unsafe { from_glib_full(gst_audio_sys::gst_audio_info_to_caps(&self.0)) }
|
||||
}
|
||||
|
||||
pub fn convert<V: Into<gst::GenericFormattedValue>, U: gst::SpecificFormattedValue>(
|
||||
|
@ -174,7 +178,7 @@ impl AudioInfo {
|
|||
let src_val = src_val.into();
|
||||
unsafe {
|
||||
let mut dest_val = mem::uninitialized();
|
||||
if from_glib(ffi::gst_audio_info_convert(
|
||||
if from_glib(gst_audio_sys::gst_audio_info_convert(
|
||||
&self.0,
|
||||
src_val.get_format().to_glib(),
|
||||
src_val.to_raw_value(),
|
||||
|
@ -198,7 +202,7 @@ impl AudioInfo {
|
|||
let src_val = src_val.into();
|
||||
unsafe {
|
||||
let mut dest_val = mem::uninitialized();
|
||||
if from_glib(ffi::gst_audio_info_convert(
|
||||
if from_glib(gst_audio_sys::gst_audio_info_convert(
|
||||
&self.0,
|
||||
src_val.get_format().to_glib(),
|
||||
src_val.to_raw_value(),
|
||||
|
@ -297,7 +301,7 @@ impl Clone for AudioInfo {
|
|||
|
||||
impl PartialEq for AudioInfo {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_audio_info_is_equal(&self.0, &other.0)) }
|
||||
unsafe { from_glib(gst_audio_sys::gst_audio_info_is_equal(&self.0, &other.0)) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,26 +312,25 @@ unsafe impl Sync for AudioInfo {}
|
|||
|
||||
impl glib::types::StaticType for AudioInfo {
|
||||
fn static_type() -> glib::types::Type {
|
||||
unsafe { glib::translate::from_glib(ffi::gst_audio_info_get_type()) }
|
||||
unsafe { glib::translate::from_glib(gst_audio_sys::gst_audio_info_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::value::FromValueOptional<'a> for AudioInfo {
|
||||
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
|
||||
Option::<AudioInfo>::from_glib_none(
|
||||
gobject_ffi::g_value_get_boxed(value.to_glib_none().0) as *mut ffi::GstAudioInfo
|
||||
)
|
||||
Option::<AudioInfo>::from_glib_none(gobject_sys::g_value_get_boxed(value.to_glib_none().0)
|
||||
as *mut gst_audio_sys::GstAudioInfo)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::value::SetValue for AudioInfo {
|
||||
unsafe fn set_value(value: &mut glib::Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
glib::translate::ToGlibPtr::<*const ffi::GstAudioInfo>::to_glib_none(this).0
|
||||
as glib_ffi::gpointer,
|
||||
glib::translate::ToGlibPtr::<*const gst_audio_sys::GstAudioInfo>::to_glib_none(this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -335,10 +338,10 @@ impl glib::value::SetValue for AudioInfo {
|
|||
#[doc(hidden)]
|
||||
impl glib::value::SetValueOptional for AudioInfo {
|
||||
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
glib::translate::ToGlibPtr::<*const ffi::GstAudioInfo>::to_glib_none(&this).0
|
||||
as glib_ffi::gpointer,
|
||||
glib::translate::ToGlibPtr::<*const gst_audio_sys::GstAudioInfo>::to_glib_none(&this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -352,26 +355,28 @@ impl glib::translate::Uninitialized for AudioInfo {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::GlibPtrDefault for AudioInfo {
|
||||
type GlibType = *mut ffi::GstAudioInfo;
|
||||
type GlibType = *mut gst_audio_sys::GstAudioInfo;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const ffi::GstAudioInfo> for AudioInfo {
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const gst_audio_sys::GstAudioInfo> for AudioInfo {
|
||||
type Storage = &'a AudioInfo;
|
||||
|
||||
fn to_glib_none(&'a self) -> glib::translate::Stash<'a, *const ffi::GstAudioInfo, Self> {
|
||||
fn to_glib_none(
|
||||
&'a self,
|
||||
) -> glib::translate::Stash<'a, *const gst_audio_sys::GstAudioInfo, Self> {
|
||||
glib::translate::Stash(&self.0, self)
|
||||
}
|
||||
|
||||
fn to_glib_full(&self) -> *const ffi::GstAudioInfo {
|
||||
fn to_glib_full(&self) -> *const gst_audio_sys::GstAudioInfo {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrNone<*mut ffi::GstAudioInfo> for AudioInfo {
|
||||
impl glib::translate::FromGlibPtrNone<*mut gst_audio_sys::GstAudioInfo> for AudioInfo {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *mut ffi::GstAudioInfo) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *mut gst_audio_sys::GstAudioInfo) -> Self {
|
||||
AudioInfo(
|
||||
ptr::read(ptr),
|
||||
array_init::array_init_copy(|i| from_glib((*ptr).position[i])),
|
||||
|
@ -380,11 +385,11 @@ impl glib::translate::FromGlibPtrNone<*mut ffi::GstAudioInfo> for AudioInfo {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrFull<*mut ffi::GstAudioInfo> for AudioInfo {
|
||||
impl glib::translate::FromGlibPtrFull<*mut gst_audio_sys::GstAudioInfo> for AudioInfo {
|
||||
#[inline]
|
||||
unsafe fn from_glib_full(ptr: *mut ffi::GstAudioInfo) -> Self {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_audio_sys::GstAudioInfo) -> Self {
|
||||
let info = from_glib_none(ptr);
|
||||
glib_ffi::g_free(ptr as *mut _);
|
||||
glib_sys::g_free(ptr as *mut _);
|
||||
info
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_audio_sys;
|
||||
use AudioStreamAlign;
|
||||
|
||||
use glib::translate::*;
|
||||
|
@ -25,7 +25,7 @@ impl AudioStreamAlign {
|
|||
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(
|
||||
let ret = from_glib(gst_audio_sys::gst_audio_stream_align_process(
|
||||
self.to_glib_none_mut().0,
|
||||
discont.to_glib(),
|
||||
timestamp.to_glib(),
|
||||
|
|
|
@ -12,15 +12,15 @@ extern crate bitflags;
|
|||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_audio_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_audio_sys as gst_audio_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
@ -60,7 +60,7 @@ pub fn audio_buffer_clip(
|
|||
skip_assert_initialized!();
|
||||
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_audio_buffer_clip(
|
||||
from_glib_full(gst_audio_sys::gst_audio_buffer_clip(
|
||||
buffer.into_ptr(),
|
||||
segment.to_glib_none().0,
|
||||
rate as i32,
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
use std::io;
|
||||
use std::ops;
|
||||
use Adapter;
|
||||
|
@ -17,7 +17,7 @@ impl Adapter {
|
|||
pub fn copy(&self, offset: usize, dest: &mut [u8]) {
|
||||
unsafe {
|
||||
let size = dest.len();
|
||||
ffi::gst_adapter_copy(
|
||||
gst_base_sys::gst_adapter_copy(
|
||||
self.to_glib_none().0,
|
||||
dest.as_mut_ptr() as *mut _,
|
||||
offset,
|
||||
|
@ -28,7 +28,7 @@ impl Adapter {
|
|||
|
||||
pub fn push(&self, buf: gst::Buffer) {
|
||||
unsafe {
|
||||
ffi::gst_adapter_push(self.to_glib_none().0, buf.into_ptr());
|
||||
gst_base_sys::gst_adapter_push(self.to_glib_none().0, buf.into_ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ impl UniqueAdapter {
|
|||
use std::slice;
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_adapter_map(self.0.to_glib_none().0, nbytes);
|
||||
let ptr = gst_base_sys::gst_adapter_map(self.0.to_glib_none().0, nbytes);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -206,7 +206,7 @@ pub struct UniqueAdapterMap<'a>(&'a UniqueAdapter, &'a [u8]);
|
|||
impl<'a> Drop for UniqueAdapterMap<'a> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_adapter_unmap((self.0).0.to_glib_none().0);
|
||||
gst_base_sys::gst_adapter_unmap((self.0).0.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
use Aggregator;
|
||||
|
||||
pub trait AggregatorExtManual: 'static {
|
||||
|
@ -19,7 +19,7 @@ pub trait AggregatorExtManual: 'static {
|
|||
impl<O: IsA<Aggregator>> AggregatorExtManual for O {
|
||||
fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_aggregator_finish_buffer(
|
||||
from_glib(gst_base_sys::gst_aggregator_finish_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.into_ptr(),
|
||||
))
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use gst_base_sys;
|
||||
use gst_sys;
|
||||
use AggregatorPad;
|
||||
|
||||
pub trait AggregatorPadExtManual: 'static {
|
||||
|
@ -20,9 +20,9 @@ pub trait AggregatorPadExtManual: 'static {
|
|||
impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O {
|
||||
fn get_segment(&self) -> gst::Segment {
|
||||
unsafe {
|
||||
let ptr: &ffi::GstAggregatorPad = &*(self.as_ptr() as *const _);
|
||||
let ptr: &gst_base_sys::GstAggregatorPad = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&ptr.parent.object.lock);
|
||||
from_glib_none(&ptr.segment as *const gst_ffi::GstSegment)
|
||||
from_glib_none(&ptr.segment as *const gst_sys::GstSegment)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_base_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_base_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
use std::mem;
|
||||
use BaseSink;
|
||||
|
||||
|
@ -27,7 +27,7 @@ pub trait BaseSinkExtManual: 'static {
|
|||
impl<O: IsA<BaseSink>> BaseSinkExtManual for O {
|
||||
fn get_segment(&self) -> gst::Segment {
|
||||
unsafe {
|
||||
let sink: &ffi::GstBaseSink = &*(self.as_ptr() as *const _);
|
||||
let sink: &gst_base_sys::GstBaseSink = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&sink.element.object.lock);
|
||||
from_glib_none(&sink.segment as *const _)
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ impl<O: IsA<BaseSink>> BaseSinkExtManual for O {
|
|||
) -> (Result<gst::FlowSuccess, gst::FlowError>, gst::ClockTimeDiff) {
|
||||
unsafe {
|
||||
let mut jitter = mem::uninitialized();
|
||||
let ret: gst::FlowReturn = from_glib(ffi::gst_base_sink_wait(
|
||||
let ret: gst::FlowReturn = from_glib(gst_base_sys::gst_base_sink_wait(
|
||||
self.as_ref().to_glib_none().0,
|
||||
time.to_glib(),
|
||||
&mut jitter,
|
||||
|
@ -50,7 +50,7 @@ impl<O: IsA<BaseSink>> BaseSinkExtManual for O {
|
|||
|
||||
fn wait_preroll(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_base_sink_wait_preroll(
|
||||
from_glib(gst_base_sys::gst_base_sink_wait_preroll(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
};
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
use BaseSrc;
|
||||
|
||||
pub trait BaseSrcExtManual: 'static {
|
||||
|
@ -25,7 +25,7 @@ pub trait BaseSrcExtManual: 'static {
|
|||
impl<O: IsA<BaseSrc>> BaseSrcExtManual for O {
|
||||
fn get_segment(&self) -> gst::Segment {
|
||||
unsafe {
|
||||
let src: &ffi::GstBaseSrc = &*(self.as_ptr() as *const _);
|
||||
let src: &gst_base_sys::GstBaseSrc = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&src.element.object.lock);
|
||||
from_glib_none(&src.segment as *const _)
|
||||
}
|
||||
|
@ -34,19 +34,25 @@ impl<O: IsA<BaseSrc>> BaseSrcExtManual for O {
|
|||
fn start_complete(&self, ret: Result<gst::FlowSuccess, gst::FlowError>) {
|
||||
let ret: gst::FlowReturn = ret.into();
|
||||
unsafe {
|
||||
ffi::gst_base_src_start_complete(self.as_ref().to_glib_none().0, ret.to_glib());
|
||||
gst_base_sys::gst_base_src_start_complete(
|
||||
self.as_ref().to_glib_none().0,
|
||||
ret.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn start_wait(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn =
|
||||
unsafe { from_glib(ffi::gst_base_src_start_wait(self.as_ref().to_glib_none().0)) };
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_base_sys::gst_base_src_start_wait(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
fn wait_playing(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_base_src_wait_playing(
|
||||
from_glib(gst_base_sys::gst_base_src_wait_playing(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
};
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
use BaseTransform;
|
||||
|
||||
pub trait BaseTransformExtManual: 'static {
|
||||
|
@ -19,7 +19,7 @@ pub trait BaseTransformExtManual: 'static {
|
|||
impl<O: IsA<BaseTransform>> BaseTransformExtManual for O {
|
||||
fn get_segment(&self) -> gst::Segment {
|
||||
unsafe {
|
||||
let trans: &ffi::GstBaseTransform = &*(self.as_ptr() as *const _);
|
||||
let trans: &gst_base_sys::GstBaseTransform = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&trans.element.object.lock);
|
||||
from_glib_none(&trans.segment as *const _)
|
||||
}
|
||||
|
|
|
@ -6,50 +6,56 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gobject_ffi;
|
||||
use gobject_sys;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct FlowCombiner(Shared<ffi::GstFlowCombiner>);
|
||||
pub struct FlowCombiner(Shared<gst_base_sys::GstFlowCombiner>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| gobject_ffi::g_boxed_copy(ffi::gst_flow_combiner_get_type(), ptr as *mut _),
|
||||
unref => |ptr| gobject_ffi::g_boxed_free(ffi::gst_flow_combiner_get_type(), ptr as *mut _),
|
||||
get_type => || ffi::gst_flow_combiner_get_type(),
|
||||
ref => |ptr| gobject_sys::g_boxed_copy(gst_base_sys::gst_flow_combiner_get_type(), ptr as *mut _),
|
||||
unref => |ptr| gobject_sys::g_boxed_free(gst_base_sys::gst_flow_combiner_get_type(), ptr as *mut _),
|
||||
get_type => || gst_base_sys::gst_flow_combiner_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl FlowCombiner {
|
||||
pub fn new() -> FlowCombiner {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_flow_combiner_new()) }
|
||||
unsafe { from_glib_full(gst_base_sys::gst_flow_combiner_new()) }
|
||||
}
|
||||
|
||||
pub fn add_pad<P: IsA<gst::Pad>>(&self, pad: &P) {
|
||||
unsafe {
|
||||
ffi::gst_flow_combiner_add_pad(self.to_glib_none().0, pad.as_ref().to_glib_none().0);
|
||||
gst_base_sys::gst_flow_combiner_add_pad(
|
||||
self.to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
unsafe {
|
||||
ffi::gst_flow_combiner_clear(self.to_glib_none().0);
|
||||
gst_base_sys::gst_flow_combiner_clear(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_pad<P: IsA<gst::Pad>>(&self, pad: &P) {
|
||||
unsafe {
|
||||
ffi::gst_flow_combiner_remove_pad(self.to_glib_none().0, pad.as_ref().to_glib_none().0);
|
||||
gst_base_sys::gst_flow_combiner_remove_pad(
|
||||
self.to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reset(&self) {
|
||||
unsafe {
|
||||
ffi::gst_flow_combiner_reset(self.to_glib_none().0);
|
||||
gst_base_sys::gst_flow_combiner_reset(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +65,7 @@ impl FlowCombiner {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let fret: gst::FlowReturn = fret.into();
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_flow_combiner_update_flow(
|
||||
from_glib(gst_base_sys::gst_flow_combiner_update_flow(
|
||||
self.to_glib_none().0,
|
||||
fret.to_glib(),
|
||||
))
|
||||
|
@ -74,7 +80,7 @@ impl FlowCombiner {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let fret: gst::FlowReturn = fret.into();
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_flow_combiner_update_pad_flow(
|
||||
from_glib(gst_base_sys::gst_flow_combiner_update_pad_flow(
|
||||
self.to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0,
|
||||
fret.to_glib(),
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
use std::mem;
|
||||
|
||||
pub fn type_find_helper_for_data<
|
||||
|
@ -27,7 +27,7 @@ pub fn type_find_helper_for_data<
|
|||
let mut prob = mem::uninitialized();
|
||||
let data = data.as_ref();
|
||||
let (ptr, len) = (data.as_ptr(), data.len());
|
||||
let ret = from_glib_full(ffi::gst_type_find_helper_for_data(
|
||||
let ret = from_glib_full(gst_base_sys::gst_type_find_helper_for_data(
|
||||
obj.map(|p| p.as_ref()).to_glib_none().0,
|
||||
mut_override(ptr),
|
||||
len,
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
#[cfg_attr(feature = "subclassing", macro_use)]
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_base_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_base_sys as gst_base_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
extern crate libc;
|
||||
|
||||
|
@ -20,7 +20,7 @@ extern crate glib;
|
|||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
use libc;
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use glib_sys;
|
||||
use gst_base_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
use prelude::*;
|
||||
|
@ -211,7 +211,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
(*parent_class)
|
||||
.flush
|
||||
.map(|f| from_glib(f(aggregator.to_glib_none().0)))
|
||||
|
@ -228,7 +229,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Option<gst::Buffer> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
match (*parent_class).clip {
|
||||
None => Some(buffer),
|
||||
Some(ref func) => from_glib_full(func(
|
||||
|
@ -247,7 +249,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.finish_buffer
|
||||
.expect("Missing parent function `finish_buffer`");
|
||||
|
@ -264,7 +267,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.sink_event
|
||||
.expect("Missing parent function `sink_event`");
|
||||
|
@ -284,7 +288,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.sink_query
|
||||
.expect("Missing parent function `sink_query`");
|
||||
|
@ -299,7 +304,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_src_event(&self, aggregator: &Aggregator, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.src_event
|
||||
.expect("Missing parent function `src_event`");
|
||||
|
@ -310,7 +316,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_src_query(&self, aggregator: &Aggregator, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.src_query
|
||||
.expect("Missing parent function `src_query`");
|
||||
|
@ -326,7 +333,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
match (*parent_class).src_activate {
|
||||
None => Ok(()),
|
||||
Some(f) => gst_result_from_gboolean!(
|
||||
|
@ -349,7 +357,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.aggregate
|
||||
.expect("Missing parent function `aggregate`");
|
||||
|
@ -361,7 +370,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
(*parent_class)
|
||||
.start
|
||||
.map(|f| {
|
||||
|
@ -381,7 +391,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_stop(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
(*parent_class)
|
||||
.stop
|
||||
.map(|f| {
|
||||
|
@ -401,7 +412,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_get_next_time(&self, aggregator: &Aggregator) -> gst::ClockTime {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
(*parent_class)
|
||||
.get_next_time
|
||||
.map(|f| from_glib(f(aggregator.to_glib_none().0)))
|
||||
|
@ -418,7 +430,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Option<AggregatorPad> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.create_new_pad
|
||||
.expect("Missing parent function `create_new_pad`");
|
||||
|
@ -438,7 +451,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Result<gst::Caps, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
let f = (*parent_class)
|
||||
.update_src_caps
|
||||
.expect("Missing parent function `update_src_caps`");
|
||||
|
@ -456,7 +470,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
fn parent_fixate_src_caps(&self, aggregator: &Aggregator, caps: gst::Caps) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
|
||||
let f = (*parent_class)
|
||||
.fixate_src_caps
|
||||
|
@ -472,7 +487,8 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
|
|||
) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
|
||||
(*parent_class)
|
||||
.negotiated_src_caps
|
||||
.map(|f| {
|
||||
|
@ -494,7 +510,7 @@ where
|
|||
fn override_vfuncs(&mut self) {
|
||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut ffi::GstAggregatorClass);
|
||||
let klass = &mut *(self as *mut Self as *mut gst_base_sys::GstAggregatorClass);
|
||||
klass.flush = Some(aggregator_flush::<T>);
|
||||
klass.clip = Some(aggregator_clip::<T>);
|
||||
klass.finish_buffer = Some(aggregator_finish_buffer::<T>);
|
||||
|
@ -516,8 +532,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_flush<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -534,10 +550,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_clip<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
buffer: *mut gst_ffi::GstBuffer,
|
||||
) -> *mut gst_ffi::GstBuffer
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
|
||||
buffer: *mut gst_sys::GstBuffer,
|
||||
) -> *mut gst_sys::GstBuffer
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -559,9 +575,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_finish_buffer<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
buffer: *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
buffer: *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -578,10 +594,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
event: *mut gst_ffi::GstEvent,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -602,10 +618,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_sink_query<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
query: *mut gst_ffi::GstQuery,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -626,9 +642,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
event: *mut gst_ffi::GstEvent,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -645,9 +661,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_src_query<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
query: *mut gst_ffi::GstQuery,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -664,10 +680,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_src_activate<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
mode: gst_ffi::GstPadMode,
|
||||
active: glib_ffi::gboolean,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
mode: gst_sys::GstPadMode,
|
||||
active: glib_sys::gboolean,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -690,9 +706,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_aggregate<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
timeout: glib_ffi::gboolean,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
timeout: glib_sys::gboolean,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -709,8 +725,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_start<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -733,8 +749,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_stop<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -757,8 +773,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_get_next_time<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> gst_ffi::GstClockTime
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
) -> gst_sys::GstClockTime
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -775,11 +791,11 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_create_new_pad<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
templ: *mut gst_ffi::GstPadTemplate,
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
templ: *mut gst_sys::GstPadTemplate,
|
||||
req_name: *const libc::c_char,
|
||||
caps: *const gst_ffi::GstCaps,
|
||||
) -> *mut ffi::GstAggregatorPad
|
||||
caps: *const gst_sys::GstCaps,
|
||||
) -> *mut gst_base_sys::GstAggregatorPad
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -817,10 +833,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_update_src_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
res: *mut *mut gst_ffi::GstCaps,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
res: *mut *mut gst_sys::GstCaps,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -845,9 +861,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_fixate_src_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -864,9 +880,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_negotiated_src_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregator,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use glib_sys;
|
||||
use gst_base_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
|
@ -63,7 +63,8 @@ impl<T: AggregatorPadImpl + ObjectImpl> AggregatorPadImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorPadClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorPadClass;
|
||||
(*parent_class)
|
||||
.flush
|
||||
.map(|f| {
|
||||
|
@ -85,7 +86,8 @@ impl<T: AggregatorPadImpl + ObjectImpl> AggregatorPadImplExt for T {
|
|||
) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstAggregatorPadClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorPadClass;
|
||||
(*parent_class)
|
||||
.skip_buffer
|
||||
.map(|f| {
|
||||
|
@ -103,7 +105,7 @@ unsafe impl<T: ObjectSubclass + AggregatorPadImpl> IsSubclassable<T> for Aggrega
|
|||
fn override_vfuncs(&mut self) {
|
||||
<gst::PadClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut ffi::GstAggregatorPadClass);
|
||||
let klass = &mut *(self as *mut Self as *mut gst_base_sys::GstAggregatorPadClass);
|
||||
klass.flush = Some(aggregator_pad_flush::<T>);
|
||||
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);
|
||||
}
|
||||
|
@ -111,9 +113,9 @@ unsafe impl<T: ObjectSubclass + AggregatorPadImpl> IsSubclassable<T> for Aggrega
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_pad_flush<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregatorPad,
|
||||
aggregator: *mut ffi::GstAggregator,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstAggregatorPad,
|
||||
aggregator: *mut gst_base_sys::GstAggregator,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AggregatorPadImpl,
|
||||
{
|
||||
|
@ -127,10 +129,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_pad_skip_buffer<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstAggregatorPad,
|
||||
aggregator: *mut ffi::GstAggregator,
|
||||
buffer: *mut gst_ffi::GstBuffer,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstAggregatorPad,
|
||||
aggregator: *mut gst_base_sys::GstAggregator,
|
||||
buffer: *mut gst_sys::GstBuffer,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AggregatorPadImpl,
|
||||
{
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use glib_sys;
|
||||
use gst_base_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
use prelude::*;
|
||||
|
@ -146,7 +146,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_start(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.start
|
||||
.map(|f| {
|
||||
|
@ -166,7 +167,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.stop
|
||||
.map(|f| {
|
||||
|
@ -190,7 +192,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.render
|
||||
.map(|f| {
|
||||
|
@ -208,7 +211,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.prepare
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, buffer.as_mut_ptr())))
|
||||
|
@ -224,7 +228,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.render_list
|
||||
.map(|f| {
|
||||
|
@ -247,7 +252,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.prepare_list
|
||||
.map(|f| {
|
||||
|
@ -266,7 +272,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_query(&self, element: &BaseSink, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.query
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, query.as_mut_ptr())))
|
||||
|
@ -277,7 +284,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_event(&self, element: &BaseSink, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.event
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, event.into_ptr())))
|
||||
|
@ -292,7 +300,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
let filter_ptr = if let Some(filter) = filter {
|
||||
filter.as_mut_ptr()
|
||||
} else {
|
||||
|
@ -313,7 +322,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.set_caps
|
||||
.map(|f| {
|
||||
|
@ -330,7 +340,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_fixate(&self, element: &BaseSink, caps: gst::Caps) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
|
||||
match (*parent_class).fixate {
|
||||
Some(fixate) => from_glib_full(fixate(element.to_glib_none().0, caps.into_ptr())),
|
||||
|
@ -342,7 +353,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_unlock(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.unlock
|
||||
.map(|f| {
|
||||
|
@ -362,7 +374,8 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
|
|||
fn parent_unlock_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSinkClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
|
||||
(*parent_class)
|
||||
.unlock_stop
|
||||
.map(|f| {
|
||||
|
@ -387,7 +400,7 @@ where
|
|||
fn override_vfuncs(&mut self) {
|
||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseSinkClass);
|
||||
let klass = &mut *(self as *mut Self as *mut gst_base_sys::GstBaseSinkClass);
|
||||
klass.start = Some(base_sink_start::<T>);
|
||||
klass.stop = Some(base_sink_stop::<T>);
|
||||
klass.render = Some(base_sink_render::<T>);
|
||||
|
@ -406,8 +419,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_start<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -430,8 +443,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_stop<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -454,9 +467,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_render<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
buffer: *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
buffer: *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -474,9 +487,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_prepare<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
buffer: *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
buffer: *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -494,9 +507,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_render_list<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
list: *mut gst_ffi::GstBufferList,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
list: *mut gst_sys::GstBufferList,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -514,9 +527,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_prepare_list<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
list: *mut gst_ffi::GstBufferList,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
list: *mut gst_sys::GstBufferList,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -534,9 +547,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_query<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
query_ptr: *mut gst_ffi::GstQuery,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
query_ptr: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -554,9 +567,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
event_ptr: *mut gst_ffi::GstEvent,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
event_ptr: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -573,9 +586,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_get_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
filter: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -598,9 +611,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_set_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -624,9 +637,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_fixate<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -644,8 +657,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_unlock<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -668,8 +681,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_unlock_stop<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSink,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSink,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSinkImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use glib_sys;
|
||||
use gst_base_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
use prelude::*;
|
||||
|
@ -150,7 +150,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_start(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.start
|
||||
.map(|f| {
|
||||
|
@ -170,7 +171,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.stop
|
||||
.map(|f| {
|
||||
|
@ -190,7 +192,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_is_seekable(&self, element: &BaseSrc) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.is_seekable
|
||||
.map(|f| from_glib(f(element.to_glib_none().0)))
|
||||
|
@ -201,7 +204,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_get_size(&self, element: &BaseSrc) -> Option<u64> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.get_size
|
||||
.map(|f| {
|
||||
|
@ -225,7 +229,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.fill
|
||||
.map(|f| {
|
||||
|
@ -249,14 +254,15 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
) -> Result<gst::Buffer, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.create
|
||||
.map(|f| {
|
||||
let mut buffer: *mut gst_ffi::GstBuffer = ptr::null_mut();
|
||||
let mut buffer: *mut gst_sys::GstBuffer = ptr::null_mut();
|
||||
// FIXME: Wrong signature in -sys bindings
|
||||
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
|
||||
let buffer_ref = &mut buffer as *mut _ as *mut gst_ffi::GstBuffer;
|
||||
let buffer_ref = &mut buffer as *mut _ as *mut gst_sys::GstBuffer;
|
||||
let ret: gst::FlowReturn =
|
||||
from_glib(f(element.to_glib_none().0, offset, length, buffer_ref));
|
||||
|
||||
|
@ -269,7 +275,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_do_seek(&self, element: &BaseSrc, segment: &mut gst::Segment) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.do_seek
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, segment.to_glib_none_mut().0)))
|
||||
|
@ -280,7 +287,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_query(&self, element: &BaseSrc, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.query
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, query.as_mut_ptr())))
|
||||
|
@ -291,7 +299,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_event(&self, element: &BaseSrc, event: &gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.event
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, event.to_glib_none().0)))
|
||||
|
@ -306,7 +315,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
let filter_ptr = if let Some(filter) = filter {
|
||||
filter.as_mut_ptr()
|
||||
} else {
|
||||
|
@ -323,7 +333,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_negotiate(&self, element: &BaseSrc) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.negotiate
|
||||
.map(|f| {
|
||||
|
@ -344,7 +355,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.set_caps
|
||||
.map(|f| {
|
||||
|
@ -361,7 +373,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_fixate(&self, element: &BaseSrc, caps: gst::Caps) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
|
||||
match (*parent_class).fixate {
|
||||
Some(fixate) => from_glib_full(fixate(element.to_glib_none().0, caps.into_ptr())),
|
||||
|
@ -373,7 +386,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_unlock(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.unlock
|
||||
.map(|f| {
|
||||
|
@ -393,7 +407,8 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
|
|||
fn parent_unlock_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseSrcClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
|
||||
(*parent_class)
|
||||
.unlock_stop
|
||||
.map(|f| {
|
||||
|
@ -418,7 +433,7 @@ where
|
|||
fn override_vfuncs(&mut self) {
|
||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseSrcClass);
|
||||
let klass = &mut *(self as *mut Self as *mut gst_base_sys::GstBaseSrcClass);
|
||||
klass.start = Some(base_src_start::<T>);
|
||||
klass.stop = Some(base_src_stop::<T>);
|
||||
klass.is_seekable = Some(base_src_is_seekable::<T>);
|
||||
|
@ -439,8 +454,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_start<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -463,8 +478,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_stop<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -487,8 +502,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_is_seekable<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -505,9 +520,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_get_size<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
size: *mut u64,
|
||||
) -> glib_ffi::gboolean
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -530,11 +545,11 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_fill<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
offset: u64,
|
||||
length: u32,
|
||||
buffer: *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
buffer: *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -552,11 +567,11 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_create<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
offset: u64,
|
||||
length: u32,
|
||||
buffer_ptr: *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
buffer_ptr: *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -567,7 +582,7 @@ where
|
|||
let wrap: BaseSrc = from_glib_borrow(ptr);
|
||||
// FIXME: Wrong signature in -sys bindings
|
||||
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
|
||||
let buffer_ptr = buffer_ptr as *mut *mut gst_ffi::GstBuffer;
|
||||
let buffer_ptr = buffer_ptr as *mut *mut gst_sys::GstBuffer;
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
match imp.create(&wrap, offset, length) {
|
||||
|
@ -582,9 +597,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_do_seek<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
segment: *mut gst_ffi::GstSegment,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
segment: *mut gst_sys::GstSegment,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -601,9 +616,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_query<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
query_ptr: *mut gst_ffi::GstQuery,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
query_ptr: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -621,9 +636,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
event_ptr: *mut gst_ffi::GstEvent,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
event_ptr: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -640,9 +655,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_get_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
filter: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -665,8 +680,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_negotiate<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -689,9 +704,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_set_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -715,9 +730,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_fixate<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -735,8 +750,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_unlock<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -759,8 +774,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_src_unlock_stop<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseSrc,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseSrc,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseSrcImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use glib_sys;
|
||||
use gst_base_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
use prelude::*;
|
||||
|
@ -201,7 +201,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
fn parent_start(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.start
|
||||
.map(|f| {
|
||||
|
@ -221,7 +222,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
fn parent_stop(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.stop
|
||||
.map(|f| {
|
||||
|
@ -247,7 +249,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.transform_caps
|
||||
.map(|f| {
|
||||
|
@ -271,7 +274,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
match (*parent_class).fixate_caps {
|
||||
Some(f) => from_glib_full(f(
|
||||
element.to_glib_none().0,
|
||||
|
@ -292,7 +296,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.set_caps
|
||||
.map(|f| {
|
||||
|
@ -314,7 +319,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.accept_caps
|
||||
.map(|f| {
|
||||
|
@ -336,7 +342,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.query
|
||||
.map(|f| {
|
||||
|
@ -360,7 +367,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> Option<usize> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.transform_size
|
||||
.map(|f| {
|
||||
|
@ -386,7 +394,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
fn parent_get_unit_size(&self, element: &BaseTransform, caps: &gst::Caps) -> Option<usize> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
|
||||
if !element.is_in_place() {
|
||||
unimplemented!(concat!(
|
||||
|
@ -417,7 +426,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
fn parent_sink_event(&self, element: &BaseTransform, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.sink_event
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, event.into_ptr())))
|
||||
|
@ -428,7 +438,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
fn parent_src_event(&self, element: &BaseTransform, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.src_event
|
||||
.map(|f| from_glib(f(element.to_glib_none().0, event.into_ptr())))
|
||||
|
@ -444,7 +455,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
(*parent_class)
|
||||
.transform
|
||||
.map(|f| {
|
||||
|
@ -475,7 +487,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
|
||||
if element.is_in_place() {
|
||||
panic!(concat!(
|
||||
|
@ -502,7 +515,8 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
|
|||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut ffi::GstBaseTransformClass;
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
|
||||
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
|
||||
if element.is_in_place() {
|
||||
panic!(concat!(
|
||||
|
@ -537,7 +551,7 @@ where
|
|||
fn override_vfuncs(&mut self) {
|
||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseTransformClass);
|
||||
let klass = &mut *(self as *mut Self as *mut gst_base_sys::GstBaseTransformClass);
|
||||
klass.start = Some(base_transform_start::<T>);
|
||||
klass.stop = Some(base_transform_stop::<T>);
|
||||
klass.transform_caps = Some(base_transform_transform_caps::<T>);
|
||||
|
@ -564,7 +578,7 @@ pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static {
|
|||
<T as ObjectSubclass>::Instance: PanicPoison,
|
||||
{
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseTransformClass);
|
||||
let klass = &mut *(self as *mut Self as *mut gst_base_sys::GstBaseTransformClass);
|
||||
|
||||
klass.passthrough_on_same_caps = passthrough_on_same_caps.to_glib();
|
||||
klass.transform_ip_on_passthrough = transform_ip_on_passthrough.to_glib();
|
||||
|
@ -593,8 +607,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_start<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -617,8 +631,8 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_stop<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -641,11 +655,11 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_transform_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
direction: gst_ffi::GstPadDirection,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
filter: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
direction: gst_sys::GstPadDirection,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -674,11 +688,11 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_fixate_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
direction: gst_ffi::GstPadDirection,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
othercaps: *mut gst_ffi::GstCaps,
|
||||
) -> *mut gst_ffi::GstCaps
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
direction: gst_sys::GstPadDirection,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
othercaps: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -700,10 +714,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_set_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
incaps: *mut gst_ffi::GstCaps,
|
||||
outcaps: *mut gst_ffi::GstCaps,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
incaps: *mut gst_sys::GstCaps,
|
||||
outcaps: *mut gst_sys::GstCaps,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -720,10 +734,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_accept_caps<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
direction: gst_ffi::GstPadDirection,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
direction: gst_sys::GstPadDirection,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -740,10 +754,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_query<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
direction: gst_ffi::GstPadDirection,
|
||||
query: *mut gst_ffi::GstQuery,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
direction: gst_sys::GstPadDirection,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -765,13 +779,13 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_transform_size<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
direction: gst_ffi::GstPadDirection,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
direction: gst_sys::GstPadDirection,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
size: usize,
|
||||
othercaps: *mut gst_ffi::GstCaps,
|
||||
othercaps: *mut gst_sys::GstCaps,
|
||||
othersize: *mut usize,
|
||||
) -> glib_ffi::gboolean
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -800,10 +814,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_get_unit_size<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
caps: *mut gst_ffi::GstCaps,
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
size: *mut usize,
|
||||
) -> glib_ffi::gboolean
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -826,9 +840,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
event: *mut gst_ffi::GstEvent,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -845,9 +859,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
event: *mut gst_ffi::GstEvent,
|
||||
) -> glib_ffi::gboolean
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -864,10 +878,10 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_transform<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
inbuf: *mut gst_ffi::GstBuffer,
|
||||
outbuf: *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
inbuf: *mut gst_sys::GstBuffer,
|
||||
outbuf: *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -889,9 +903,9 @@ where
|
|||
}
|
||||
|
||||
unsafe extern "C" fn base_transform_transform_ip<T: ObjectSubclass>(
|
||||
ptr: *mut ffi::GstBaseTransform,
|
||||
buf: *mut *mut gst_ffi::GstBuffer,
|
||||
) -> gst_ffi::GstFlowReturn
|
||||
ptr: *mut gst_base_sys::GstBaseTransform,
|
||||
buf: *mut *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: BaseTransformImpl,
|
||||
T::Instance: PanicPoison,
|
||||
|
@ -902,10 +916,10 @@ where
|
|||
let wrap: BaseTransform = from_glib_borrow(ptr);
|
||||
|
||||
// FIXME: Wrong signature in FFI
|
||||
let buf = buf as *mut gst_ffi::GstBuffer;
|
||||
let buf = buf as *mut gst_sys::GstBuffer;
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
if from_glib(ffi::gst_base_transform_is_passthrough(ptr)) {
|
||||
if from_glib(gst_base_sys::gst_base_transform_is_passthrough(ptr)) {
|
||||
imp.transform_ip_passthrough(&wrap, gst::BufferRef::from_ptr(buf))
|
||||
.into()
|
||||
} else {
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
// except according to those terms.
|
||||
|
||||
use glib::translate::mut_override;
|
||||
use glib_ffi;
|
||||
use glib_sys;
|
||||
|
||||
pub struct MutexGuard<'a>(&'a glib_ffi::GMutex);
|
||||
pub struct MutexGuard<'a>(&'a glib_sys::GMutex);
|
||||
|
||||
impl<'a> MutexGuard<'a> {
|
||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||
pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self {
|
||||
pub fn lock(mutex: &'a glib_sys::GMutex) -> Self {
|
||||
unsafe {
|
||||
glib_ffi::g_mutex_lock(mut_override(mutex));
|
||||
glib_sys::g_mutex_lock(mut_override(mutex));
|
||||
}
|
||||
MutexGuard(mutex)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl<'a> MutexGuard<'a> {
|
|||
impl<'a> Drop for MutexGuard<'a> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
glib_ffi::g_mutex_unlock(mut_override(self.0));
|
||||
glib_sys::g_mutex_unlock(mut_override(self.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_check_sys;
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::ops;
|
||||
|
@ -22,12 +22,15 @@ use std::ptr;
|
|||
use TestClock;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Harness(ptr::NonNull<ffi::GstHarness>, PhantomData<ffi::GstHarness>);
|
||||
pub struct Harness(
|
||||
ptr::NonNull<gst_check_sys::GstHarness>,
|
||||
PhantomData<gst_check_sys::GstHarness>,
|
||||
);
|
||||
|
||||
impl Drop for Harness {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_teardown(self.0.as_ptr());
|
||||
gst_check_sys::gst_harness_teardown(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +63,7 @@ impl Harness {
|
|||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_harness_add_element_full(
|
||||
gst_check_sys::gst_harness_add_element_full(
|
||||
self.0.as_ptr(),
|
||||
element.as_ref().to_glib_none().0,
|
||||
hsrc.to_glib_none().0 as *mut _,
|
||||
|
@ -73,7 +76,7 @@ impl Harness {
|
|||
|
||||
pub fn add_element_sink_pad<P: IsA<gst::Pad>>(&mut self, sinkpad: &P) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_element_sink_pad(
|
||||
gst_check_sys::gst_harness_add_element_sink_pad(
|
||||
self.0.as_ptr(),
|
||||
sinkpad.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -82,13 +85,16 @@ impl Harness {
|
|||
|
||||
pub fn add_element_src_pad<P: IsA<gst::Pad>>(&mut self, srcpad: &P) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_element_src_pad(self.0.as_ptr(), srcpad.as_ref().to_glib_none().0);
|
||||
gst_check_sys::gst_harness_add_element_src_pad(
|
||||
self.0.as_ptr(),
|
||||
srcpad.as_ref().to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_parse(&mut self, launchline: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_parse(self.0.as_ptr(), launchline.to_glib_none().0);
|
||||
gst_check_sys::gst_harness_add_parse(self.0.as_ptr(), launchline.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,19 +123,26 @@ impl Harness {
|
|||
let params = params.into();
|
||||
unsafe {
|
||||
let params = params.map(|p| p.as_ptr()).unwrap_or(ptr::null_mut());
|
||||
ffi::gst_harness_add_propose_allocation_meta(self.0.as_ptr(), api.to_glib(), params);
|
||||
gst_check_sys::gst_harness_add_propose_allocation_meta(
|
||||
self.0.as_ptr(),
|
||||
api.to_glib(),
|
||||
params,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_sink(&mut self, sink_element_name: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_sink(self.0.as_ptr(), sink_element_name.to_glib_none().0);
|
||||
gst_check_sys::gst_harness_add_sink(
|
||||
self.0.as_ptr(),
|
||||
sink_element_name.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_sink_harness(&mut self, sink_harness: Harness) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_sink_harness(self.0.as_ptr(), sink_harness.0.as_ptr());
|
||||
gst_check_sys::gst_harness_add_sink_harness(self.0.as_ptr(), sink_harness.0.as_ptr());
|
||||
|
||||
mem::forget(sink_harness);
|
||||
}
|
||||
|
@ -137,13 +150,13 @@ impl Harness {
|
|||
|
||||
pub fn add_sink_parse(&mut self, launchline: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_sink_parse(self.0.as_ptr(), launchline.to_glib_none().0);
|
||||
gst_check_sys::gst_harness_add_sink_parse(self.0.as_ptr(), launchline.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_src(&mut self, src_element_name: &str, has_clock_wait: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_src(
|
||||
gst_check_sys::gst_harness_add_src(
|
||||
self.0.as_ptr(),
|
||||
src_element_name.to_glib_none().0,
|
||||
has_clock_wait.to_glib(),
|
||||
|
@ -153,7 +166,7 @@ impl Harness {
|
|||
|
||||
pub fn add_src_harness(&mut self, src_harness: Harness, has_clock_wait: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_src_harness(
|
||||
gst_check_sys::gst_harness_add_src_harness(
|
||||
self.0.as_ptr(),
|
||||
src_harness.0.as_ptr(),
|
||||
has_clock_wait.to_glib(),
|
||||
|
@ -165,7 +178,7 @@ impl Harness {
|
|||
|
||||
pub fn add_src_parse(&mut self, launchline: &str, has_clock_wait: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_src_parse(
|
||||
gst_check_sys::gst_harness_add_src_parse(
|
||||
self.0.as_ptr(),
|
||||
launchline.to_glib_none().0,
|
||||
has_clock_wait.to_glib(),
|
||||
|
@ -174,17 +187,17 @@ impl Harness {
|
|||
}
|
||||
|
||||
pub fn buffers_in_queue(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_buffers_in_queue(self.0.as_ptr()) }
|
||||
unsafe { gst_check_sys::gst_harness_buffers_in_queue(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn buffers_received(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_buffers_received(self.0.as_ptr()) }
|
||||
unsafe { gst_check_sys::gst_harness_buffers_received(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn crank_multiple_clock_waits(&mut self, waits: u32) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_harness_crank_multiple_clock_waits(self.0.as_ptr(), waits),
|
||||
gst_check_sys::gst_harness_crank_multiple_clock_waits(self.0.as_ptr(), waits),
|
||||
"Failed to crank multiple clock waits",
|
||||
)
|
||||
}
|
||||
|
@ -193,43 +206,51 @@ impl Harness {
|
|||
pub fn crank_single_clock_wait(&mut self) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_harness_crank_single_clock_wait(self.0.as_ptr()),
|
||||
gst_check_sys::gst_harness_crank_single_clock_wait(self.0.as_ptr()),
|
||||
"Failed to crank single clock wait",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_buffer(&mut self, size: usize) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_create_buffer(self.0.as_ptr(), size)) }
|
||||
unsafe {
|
||||
from_glib_full(gst_check_sys::gst_harness_create_buffer(
|
||||
self.0.as_ptr(),
|
||||
size,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn dump_to_file<P: AsRef<path::Path>>(&mut self, filename: P) {
|
||||
let filename = filename.as_ref();
|
||||
unsafe {
|
||||
ffi::gst_harness_dump_to_file(self.0.as_ptr(), filename.to_glib_none().0);
|
||||
gst_check_sys::gst_harness_dump_to_file(self.0.as_ptr(), filename.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn events_in_queue(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_events_in_queue(self.0.as_ptr()) }
|
||||
unsafe { gst_check_sys::gst_harness_events_in_queue(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn events_received(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_events_received(self.0.as_ptr()) }
|
||||
unsafe { gst_check_sys::gst_harness_events_received(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn find_element(&mut self, element_name: &str) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
|
||||
let ptr = ffi::gst_harness_find_element(self.0.as_ptr(), element_name.to_glib_none().0);
|
||||
let ptr = gst_check_sys::gst_harness_find_element(
|
||||
self.0.as_ptr(),
|
||||
element_name.to_glib_none().0,
|
||||
);
|
||||
|
||||
if ptr.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
if gobject_sys::g_object_is_floating(ptr as *mut _) != glib_sys::GFALSE {
|
||||
gobject_sys::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_full(ptr)
|
||||
|
@ -237,48 +258,60 @@ impl Harness {
|
|||
}
|
||||
|
||||
//pub fn get(&mut self, element_name: &str, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::gst_harness_get() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_get() }
|
||||
//}
|
||||
|
||||
//pub fn get_allocator(&mut self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams) {
|
||||
// unsafe { TODO: call ffi::gst_harness_get_allocator() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_get_allocator() }
|
||||
//}
|
||||
|
||||
pub fn get_last_pushed_timestamp(&self) -> gst::ClockTime {
|
||||
unsafe { from_glib(ffi::gst_harness_get_last_pushed_timestamp(self.0.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib(gst_check_sys::gst_harness_get_last_pushed_timestamp(
|
||||
self.0.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_testclock(&self) -> Option<TestClock> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_get_testclock(self.0.as_ptr())) }
|
||||
unsafe { from_glib_full(gst_check_sys::gst_harness_get_testclock(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn play(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_play(self.0.as_ptr());
|
||||
gst_check_sys::gst_harness_play(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pull(&mut self) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_pull(self.0.as_ptr())) }
|
||||
unsafe { from_glib_full(gst_check_sys::gst_harness_pull(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn pull_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_pull_event(self.0.as_ptr())) }
|
||||
unsafe { from_glib_full(gst_check_sys::gst_harness_pull_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn pull_upstream_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_pull_upstream_event(self.0.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_check_sys::gst_harness_pull_upstream_event(
|
||||
self.0.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn push(&mut self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn =
|
||||
unsafe { from_glib(ffi::gst_harness_push(self.0.as_ptr(), buffer.into_ptr())) };
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_check_sys::gst_harness_push(
|
||||
self.0.as_ptr(),
|
||||
buffer.into_ptr(),
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
pub fn push_and_pull(&mut self, buffer: gst::Buffer) -> Option<gst::Buffer> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_harness_push_and_pull(
|
||||
from_glib_full(gst_check_sys::gst_harness_push_and_pull(
|
||||
self.0.as_ptr(),
|
||||
buffer.into_ptr(),
|
||||
))
|
||||
|
@ -287,7 +320,7 @@ impl Harness {
|
|||
|
||||
pub fn push_event(&mut self, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_harness_push_event(
|
||||
from_glib(gst_check_sys::gst_harness_push_event(
|
||||
self.0.as_ptr(),
|
||||
event.into_ptr(),
|
||||
))
|
||||
|
@ -296,19 +329,19 @@ impl Harness {
|
|||
|
||||
pub fn push_from_src(&mut self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn =
|
||||
unsafe { from_glib(ffi::gst_harness_push_from_src(self.0.as_ptr())) };
|
||||
unsafe { from_glib(gst_check_sys::gst_harness_push_from_src(self.0.as_ptr())) };
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
pub fn push_to_sink(&mut self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn =
|
||||
unsafe { from_glib(ffi::gst_harness_push_to_sink(self.0.as_ptr())) };
|
||||
unsafe { from_glib(gst_check_sys::gst_harness_push_to_sink(self.0.as_ptr())) };
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
pub fn push_upstream_event(&mut self, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_harness_push_upstream_event(
|
||||
from_glib(gst_check_sys::gst_harness_push_upstream_event(
|
||||
self.0.as_ptr(),
|
||||
event.into_ptr(),
|
||||
))
|
||||
|
@ -316,28 +349,28 @@ impl Harness {
|
|||
}
|
||||
|
||||
pub fn query_latency(&self) -> gst::ClockTime {
|
||||
unsafe { from_glib(ffi::gst_harness_query_latency(self.0.as_ptr())) }
|
||||
unsafe { from_glib(gst_check_sys::gst_harness_query_latency(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
//pub fn set(&mut self, element_name: &str, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::gst_harness_set() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_set() }
|
||||
//}
|
||||
|
||||
pub fn set_blocking_push_mode(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_blocking_push_mode(self.0.as_ptr());
|
||||
gst_check_sys::gst_harness_set_blocking_push_mode(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_caps(&mut self, in_: gst::Caps, out: gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_caps(self.0.as_ptr(), in_.into_ptr(), out.into_ptr());
|
||||
gst_check_sys::gst_harness_set_caps(self.0.as_ptr(), in_.into_ptr(), out.into_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_caps_str(&mut self, in_: &str, out: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_caps_str(
|
||||
gst_check_sys::gst_harness_set_caps_str(
|
||||
self.0.as_ptr(),
|
||||
in_.to_glib_none().0,
|
||||
out.to_glib_none().0,
|
||||
|
@ -347,48 +380,48 @@ impl Harness {
|
|||
|
||||
pub fn set_drop_buffers(&mut self, drop_buffers: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_drop_buffers(self.0.as_ptr(), drop_buffers.to_glib());
|
||||
gst_check_sys::gst_harness_set_drop_buffers(self.0.as_ptr(), drop_buffers.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_forwarding(&mut self, forwarding: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_forwarding(self.0.as_ptr(), forwarding.to_glib());
|
||||
gst_check_sys::gst_harness_set_forwarding(self.0.as_ptr(), forwarding.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn set_propose_allocator<'a, 'b, P: Into<Option<&'a /*Ignored*/gst::Allocator>>, Q: Into<Option<&'b /*Ignored*/gst::AllocationParams>>>(&mut self, allocator: P, params: Q) {
|
||||
// unsafe { TODO: call ffi::gst_harness_set_propose_allocator() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_set_propose_allocator() }
|
||||
//}
|
||||
|
||||
pub fn set_sink_caps(&mut self, caps: gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_sink_caps(self.0.as_ptr(), caps.into_ptr());
|
||||
gst_check_sys::gst_harness_set_sink_caps(self.0.as_ptr(), caps.into_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_sink_caps_str(&mut self, str: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_sink_caps_str(self.0.as_ptr(), str.to_glib_none().0);
|
||||
gst_check_sys::gst_harness_set_sink_caps_str(self.0.as_ptr(), str.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_src_caps(&mut self, caps: gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_src_caps(self.0.as_ptr(), caps.into_ptr());
|
||||
gst_check_sys::gst_harness_set_src_caps(self.0.as_ptr(), caps.into_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_src_caps_str(&mut self, str: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_src_caps_str(self.0.as_ptr(), str.to_glib_none().0);
|
||||
gst_check_sys::gst_harness_set_src_caps_str(self.0.as_ptr(), str.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_time(&mut self, time: gst::ClockTime) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_harness_set_time(self.0.as_ptr(), time.to_glib()),
|
||||
gst_check_sys::gst_harness_set_time(self.0.as_ptr(), time.to_glib()),
|
||||
"Failed to set time",
|
||||
)
|
||||
}
|
||||
|
@ -396,13 +429,13 @@ impl Harness {
|
|||
|
||||
pub fn set_upstream_latency(&mut self, latency: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_upstream_latency(self.0.as_ptr(), latency.to_glib());
|
||||
gst_check_sys::gst_harness_set_upstream_latency(self.0.as_ptr(), latency.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sink_push_many(&mut self, pushes: u32) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_harness_sink_push_many(
|
||||
from_glib(gst_check_sys::gst_harness_sink_push_many(
|
||||
self.0.as_ptr(),
|
||||
pushes as i32,
|
||||
))
|
||||
|
@ -416,7 +449,7 @@ impl Harness {
|
|||
pushes: u32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_harness_src_crank_and_push_many(
|
||||
from_glib(gst_check_sys::gst_harness_src_crank_and_push_many(
|
||||
self.0.as_ptr(),
|
||||
cranks as i32,
|
||||
pushes as i32,
|
||||
|
@ -426,88 +459,100 @@ impl Harness {
|
|||
}
|
||||
|
||||
pub fn src_push_event(&mut self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_harness_src_push_event(self.0.as_ptr())) }
|
||||
unsafe { from_glib(gst_check_sys::gst_harness_src_push_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
//pub fn stress_custom_start<'a, P: Into<Option<&'a /*Ignored*/glib::Func>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, init: P, callback: /*Unknown conversion*//*Unimplemented*/Func, data: Q, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_custom_start() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_custom_start() }
|
||||
//}
|
||||
|
||||
//pub fn stress_property_start_full(&mut self, name: &str, value: /*Ignored*/&glib::Value, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_property_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_property_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_buffer_start_full(&mut self, caps: &mut gst::Caps, segment: /*Ignored*/&gst::Segment, buf: &mut gst::Buffer, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_buffer_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_push_buffer_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_buffer_with_cb_start_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, caps: &mut gst::Caps, segment: /*Ignored*/&gst::Segment, func: /*Unknown conversion*//*Unimplemented*/HarnessPrepareBufferFunc, data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_buffer_with_cb_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_push_buffer_with_cb_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_event_start_full(&mut self, event: &mut gst::Event, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_event_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_push_event_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_event_with_cb_start_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, func: /*Unknown conversion*//*Unimplemented*/HarnessPrepareEventFunc, data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_event_with_cb_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_push_event_with_cb_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_upstream_event_start_full(&mut self, event: &mut gst::Event, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_upstream_event_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_push_upstream_event_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_upstream_event_with_cb_start_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, func: /*Unknown conversion*//*Unimplemented*/HarnessPrepareEventFunc, data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_upstream_event_with_cb_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_push_upstream_event_with_cb_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_requestpad_start_full(&mut self, templ: /*Ignored*/&gst::PadTemplate, name: &str, caps: &mut gst::Caps, release: bool, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_requestpad_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_requestpad_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_statechange_start_full(&mut self, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_statechange_start_full() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_statechange_start_full() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn take_all_data_as_buffer(&mut self) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_take_all_data_as_buffer(self.0.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_check_sys::gst_harness_take_all_data_as_buffer(
|
||||
self.0.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn take_all_data_as_bytes(&mut self) -> Option<glib::Bytes> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_take_all_data_as_bytes(self.0.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_check_sys::gst_harness_take_all_data_as_bytes(
|
||||
self.0.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn try_pull(&mut self) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_try_pull(self.0.as_ptr())) }
|
||||
unsafe { from_glib_full(gst_check_sys::gst_harness_try_pull(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn try_pull_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_try_pull_event(self.0.as_ptr())) }
|
||||
unsafe { from_glib_full(gst_check_sys::gst_harness_try_pull_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn try_pull_upstream_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_try_pull_upstream_event(self.0.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_check_sys::gst_harness_try_pull_upstream_event(
|
||||
self.0.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn upstream_events_in_queue(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_upstream_events_in_queue(self.0.as_ptr()) }
|
||||
unsafe { gst_check_sys::gst_harness_upstream_events_in_queue(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn upstream_events_received(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_upstream_events_received(self.0.as_ptr()) }
|
||||
unsafe { gst_check_sys::gst_harness_upstream_events_received(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn use_systemclock(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_use_systemclock(self.0.as_ptr());
|
||||
gst_check_sys::gst_harness_use_systemclock(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn use_testclock(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_use_testclock(self.0.as_ptr());
|
||||
gst_check_sys::gst_harness_use_testclock(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -518,13 +563,13 @@ impl Harness {
|
|||
) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_harness_wait_for_clock_id_waits(self.0.as_ptr(), waits, timeout),
|
||||
gst_check_sys::gst_harness_wait_for_clock_id_waits(self.0.as_ptr(), waits, timeout),
|
||||
"Failed to wait for clock id waits",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn from_glib_full(ptr: *mut ffi::GstHarness) -> Harness {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_check_sys::GstHarness) -> Harness {
|
||||
assert!(!ptr.is_null());
|
||||
|
||||
Harness(ptr::NonNull::new_unchecked(ptr), PhantomData)
|
||||
|
@ -532,12 +577,16 @@ impl Harness {
|
|||
|
||||
pub fn new(element_name: &str) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { Self::from_glib_full(ffi::gst_harness_new(element_name.to_glib_none().0)) }
|
||||
unsafe {
|
||||
Self::from_glib_full(gst_check_sys::gst_harness_new(
|
||||
element_name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_empty() -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { Self::from_glib_full(ffi::gst_harness_new_empty()) }
|
||||
unsafe { Self::from_glib_full(gst_check_sys::gst_harness_new_empty()) }
|
||||
}
|
||||
|
||||
pub fn new_full<
|
||||
|
@ -565,7 +614,7 @@ impl Harness {
|
|||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_full(
|
||||
Self::from_glib_full(gst_check_sys::gst_harness_new_full(
|
||||
element.as_ref().to_glib_none().0,
|
||||
hsrc.to_glib_none().0 as *mut _,
|
||||
element_sinkpad_name.0,
|
||||
|
@ -577,7 +626,11 @@ impl Harness {
|
|||
|
||||
pub fn new_parse(launchline: &str) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { Self::from_glib_full(ffi::gst_harness_new_parse(launchline.to_glib_none().0)) }
|
||||
unsafe {
|
||||
Self::from_glib_full(gst_check_sys::gst_harness_new_parse(
|
||||
launchline.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_element<
|
||||
|
@ -597,7 +650,7 @@ impl Harness {
|
|||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_with_element(
|
||||
Self::from_glib_full(gst_check_sys::gst_harness_new_with_element(
|
||||
element.as_ref().to_glib_none().0,
|
||||
element_sinkpad_name.0,
|
||||
element_srcpad_name.0,
|
||||
|
@ -616,7 +669,7 @@ impl Harness {
|
|||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_with_padnames(
|
||||
Self::from_glib_full(gst_check_sys::gst_harness_new_with_padnames(
|
||||
element_name.to_glib_none().0,
|
||||
element_sinkpad_name.0,
|
||||
element_srcpad_name.0,
|
||||
|
@ -638,7 +691,7 @@ impl Harness {
|
|||
let hsrc = hsrc.into();
|
||||
let hsink = hsink.into();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_with_templates(
|
||||
Self::from_glib_full(gst_check_sys::gst_harness_new_with_templates(
|
||||
element_name.to_glib_none().0,
|
||||
hsrc.to_glib_none().0 as *mut _,
|
||||
hsink.to_glib_none().0 as *mut _,
|
||||
|
@ -647,7 +700,7 @@ impl Harness {
|
|||
}
|
||||
|
||||
//pub fn stress_thread_stop(t: /*Ignored*/&mut HarnessThread) -> u32 {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_thread_stop() }
|
||||
// unsafe { TODO: call gst_check_sys::gst_harness_stress_thread_stop() }
|
||||
//}
|
||||
|
||||
pub fn get_element(&self) -> Option<gst::Element> {
|
||||
|
@ -660,8 +713,8 @@ impl Harness {
|
|||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
if gobject_sys::g_object_is_floating(ptr as *mut _) != glib_sys::GFALSE {
|
||||
gobject_sys::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_none(ptr)
|
||||
|
@ -678,8 +731,8 @@ impl Harness {
|
|||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
if gobject_sys::g_object_is_floating(ptr as *mut _) != glib_sys::GFALSE {
|
||||
gobject_sys::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_none(ptr)
|
||||
|
@ -696,8 +749,8 @@ impl Harness {
|
|||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
if gobject_sys::g_object_is_floating(ptr as *mut _) != glib_sys::GFALSE {
|
||||
gobject_sys::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_none(ptr)
|
||||
|
@ -774,7 +827,7 @@ impl Harness {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Ref<'a>(Option<Harness>, PhantomData<&'a ffi::GstHarness>);
|
||||
pub struct Ref<'a>(Option<Harness>, PhantomData<&'a gst_check_sys::GstHarness>);
|
||||
|
||||
impl<'a> ops::Deref for Ref<'a> {
|
||||
type Target = Harness;
|
||||
|
@ -792,7 +845,10 @@ impl<'a> Drop for Ref<'a> {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RefMut<'a>(Option<Harness>, PhantomData<&'a mut ffi::GstHarness>);
|
||||
pub struct RefMut<'a>(
|
||||
Option<Harness>,
|
||||
PhantomData<&'a mut gst_check_sys::GstHarness>,
|
||||
);
|
||||
|
||||
impl<'a> ops::Deref for RefMut<'a> {
|
||||
type Target = Harness;
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_check_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_check_sys as gst_check_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_check_sys;
|
||||
use std::ptr;
|
||||
use TestClock;
|
||||
|
||||
impl TestClock {
|
||||
pub fn has_id(&self, id: &gst::ClockId) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_test_clock_has_id(
|
||||
from_glib(gst_check_sys::gst_test_clock_has_id(
|
||||
self.to_glib_none().0,
|
||||
id.to_glib_none().0,
|
||||
))
|
||||
|
@ -25,7 +25,7 @@ impl TestClock {
|
|||
pub fn peek_next_pending_id(&self) -> Option<gst::ClockId> {
|
||||
unsafe {
|
||||
let mut id = ptr::null_mut();
|
||||
let ret: bool = from_glib(ffi::gst_test_clock_peek_next_pending_id(
|
||||
let ret: bool = from_glib(gst_check_sys::gst_test_clock_peek_next_pending_id(
|
||||
self.to_glib_none().0,
|
||||
&mut id,
|
||||
));
|
||||
|
@ -39,7 +39,7 @@ impl TestClock {
|
|||
|
||||
pub fn process_id_list(&self, pending_list: &[&gst::ClockId]) -> u32 {
|
||||
unsafe {
|
||||
ffi::gst_test_clock_process_id_list(
|
||||
gst_check_sys::gst_test_clock_process_id_list(
|
||||
self.to_glib_none().0,
|
||||
pending_list.to_glib_none().0,
|
||||
)
|
||||
|
@ -48,7 +48,7 @@ impl TestClock {
|
|||
|
||||
pub fn process_next_clock_id(&self) -> Option<gst::ClockId> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_test_clock_process_next_clock_id(
|
||||
from_glib_full(gst_check_sys::gst_test_clock_process_next_clock_id(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ impl TestClock {
|
|||
pub fn wait_for_multiple_pending_ids(&self, count: u32) -> Vec<gst::ClockId> {
|
||||
unsafe {
|
||||
let mut pending_list = ptr::null_mut();
|
||||
ffi::gst_test_clock_wait_for_multiple_pending_ids(
|
||||
gst_check_sys::gst_test_clock_wait_for_multiple_pending_ids(
|
||||
self.to_glib_none().0,
|
||||
count,
|
||||
&mut pending_list,
|
||||
|
@ -69,7 +69,7 @@ impl TestClock {
|
|||
pub fn wait_for_next_pending_id(&self) -> gst::ClockId {
|
||||
unsafe {
|
||||
let mut id = ptr::null_mut();
|
||||
ffi::gst_test_clock_wait_for_next_pending_id(self.to_glib_none().0, &mut id);
|
||||
gst_check_sys::gst_test_clock_wait_for_next_pending_id(self.to_glib_none().0, &mut id);
|
||||
from_glib_full(id)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,16 +10,16 @@ extern crate libc;
|
|||
|
||||
use std::sync::{Once, ONCE_INIT};
|
||||
|
||||
extern crate gio_sys as gio_ffi;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate gio_sys;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_base_sys as gst_base_ffi;
|
||||
extern crate gstreamer_editing_services_sys as ffi;
|
||||
extern crate gstreamer_base_sys as gst_base_sys;
|
||||
extern crate gstreamer_editing_services_sys as ges_sys;
|
||||
extern crate gstreamer_pbutils as gst_pbutils;
|
||||
extern crate gstreamer_pbutils_sys as gst_pbutils_ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_pbutils_sys as gst_pbutils_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
use glib::translate::from_glib;
|
||||
|
||||
|
@ -39,7 +39,7 @@ pub fn init() -> Result<(), BoolError> {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
if from_glib(ffi::ges_init()) {
|
||||
if from_glib(ges_sys::ges_init()) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(glib_bool_error!("Could not initialize GES."))
|
||||
|
@ -48,16 +48,16 @@ pub fn init() -> Result<(), BoolError> {
|
|||
}
|
||||
|
||||
pub unsafe fn deinit() {
|
||||
ffi::ges_deinit();
|
||||
ges_sys::ges_deinit();
|
||||
}
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
::GES_INIT.call_once(|| {
|
||||
unsafe { ::ffi::ges_init() };
|
||||
unsafe { ::ges_sys::ges_init() };
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use ges_sys;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
|
@ -21,7 +21,7 @@ pub trait TimelineElementExtManual: 'static {
|
|||
impl<O: IsA<TimelineElement>> TimelineElementExtManual for O {
|
||||
fn get_child_property(&self, name: &str) -> Option<glib::Value> {
|
||||
unsafe {
|
||||
let found: bool = from_glib(ffi::ges_timeline_element_lookup_child(
|
||||
let found: bool = from_glib(ges_sys::ges_timeline_element_lookup_child(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
ptr::null_mut(),
|
||||
|
@ -32,7 +32,7 @@ impl<O: IsA<TimelineElement>> TimelineElementExtManual for O {
|
|||
}
|
||||
|
||||
let mut value = glib::Value::uninitialized();
|
||||
ffi::ges_timeline_element_get_child_property(
|
||||
ges_sys::ges_timeline_element_get_child_property(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
value.to_glib_none_mut().0,
|
||||
|
@ -43,7 +43,7 @@ impl<O: IsA<TimelineElement>> TimelineElementExtManual for O {
|
|||
|
||||
fn set_child_property(&self, name: &str, value: &glib::ToValue) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
let found: bool = from_glib(ffi::ges_timeline_element_lookup_child(
|
||||
let found: bool = from_glib(ges_sys::ges_timeline_element_lookup_child(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
ptr::null_mut(),
|
||||
|
@ -54,7 +54,7 @@ impl<O: IsA<TimelineElement>> TimelineElementExtManual for O {
|
|||
}
|
||||
|
||||
let value = value.to_value();
|
||||
ffi::ges_timeline_element_set_child_property(
|
||||
ges_sys::ges_timeline_element_set_child_property(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
value.to_glib_none().0,
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst::CapsFeatures;
|
||||
use gst_gl_sys;
|
||||
use std::ffi::CStr;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref CAPS_FEATURE_MEMORY_GL_MEMORY: &'static str = unsafe {
|
||||
CStr::from_ptr(ffi::GST_CAPS_FEATURE_MEMORY_GL_MEMORY)
|
||||
CStr::from_ptr(gst_gl_sys::GST_CAPS_FEATURE_MEMORY_GL_MEMORY)
|
||||
.to_str()
|
||||
.unwrap()
|
||||
};
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
use gst::{ContextRef, MiniObject};
|
||||
use gst_gl_sys;
|
||||
use std::ptr;
|
||||
use GLDisplay;
|
||||
|
||||
|
@ -22,7 +22,7 @@ impl ContextGLExt for ContextRef {
|
|||
fn get_gl_display(&self) -> Option<GLDisplay> {
|
||||
unsafe {
|
||||
let mut display = ptr::null_mut();
|
||||
if from_glib(ffi::gst_context_get_gl_display(
|
||||
if from_glib(gst_gl_sys::gst_context_get_gl_display(
|
||||
self.as_mut_ptr(),
|
||||
&mut display,
|
||||
)) {
|
||||
|
@ -35,7 +35,10 @@ impl ContextGLExt for ContextRef {
|
|||
|
||||
fn set_gl_display<T: IsA<GLDisplay>>(&self, display: &T) {
|
||||
unsafe {
|
||||
ffi::gst_context_set_gl_display(self.as_mut_ptr(), display.as_ref().to_glib_none().0);
|
||||
gst_gl_sys::gst_context_set_gl_display(
|
||||
self.as_mut_ptr(),
|
||||
display.as_ref().to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
use gst_gl_sys;
|
||||
use libc::uintptr_t;
|
||||
use GLContext;
|
||||
use GLDisplay;
|
||||
|
@ -22,7 +22,7 @@ impl GLContext {
|
|||
context_type: GLPlatform,
|
||||
available_apis: GLAPI,
|
||||
) -> Option<GLContext> {
|
||||
from_glib_full(ffi::gst_gl_context_new_wrapped(
|
||||
from_glib_full(gst_gl_sys::gst_gl_context_new_wrapped(
|
||||
display.as_ref().to_glib_none().0,
|
||||
handle,
|
||||
context_type.to_glib(),
|
||||
|
@ -31,7 +31,9 @@ impl GLContext {
|
|||
}
|
||||
|
||||
pub fn get_current_gl_context(context_type: GLPlatform) -> uintptr_t {
|
||||
unsafe { ffi::gst_gl_context_get_current_gl_context(context_type.to_glib()) as uintptr_t }
|
||||
unsafe {
|
||||
gst_gl_sys::gst_gl_context_get_current_gl_context(context_type.to_glib()) as uintptr_t
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_proc_address_with_platform(
|
||||
|
@ -40,7 +42,7 @@ impl GLContext {
|
|||
name: &str,
|
||||
) -> uintptr_t {
|
||||
unsafe {
|
||||
ffi::gst_gl_context_get_proc_address_with_platform(
|
||||
gst_gl_sys::gst_gl_context_get_proc_address_with_platform(
|
||||
context_type.to_glib(),
|
||||
gl_api.to_glib(),
|
||||
name.to_glib_none().0,
|
||||
|
@ -57,12 +59,14 @@ pub trait GLContextExtManual: 'static {
|
|||
|
||||
impl<O: IsA<GLContext>> GLContextExtManual for O {
|
||||
fn get_gl_context(&self) -> uintptr_t {
|
||||
unsafe { ffi::gst_gl_context_get_gl_context(self.as_ref().to_glib_none().0) as uintptr_t }
|
||||
unsafe {
|
||||
gst_gl_sys::gst_gl_context_get_gl_context(self.as_ref().to_glib_none().0) as uintptr_t
|
||||
}
|
||||
}
|
||||
|
||||
fn get_proc_address(&self, name: &str) -> uintptr_t {
|
||||
unsafe {
|
||||
ffi::gst_gl_context_get_proc_address(
|
||||
gst_gl_sys::gst_gl_context_get_proc_address(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
) as uintptr_t
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_gl_sys;
|
||||
use std::ffi::CStr;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref GL_DISPLAY_CONTEXT_TYPE: &'static str = unsafe {
|
||||
CStr::from_ptr(ffi::GST_GL_DISPLAY_CONTEXT_TYPE)
|
||||
CStr::from_ptr(gst_gl_sys::GST_GL_DISPLAY_CONTEXT_TYPE)
|
||||
.to_str()
|
||||
.unwrap()
|
||||
};
|
||||
|
|
|
@ -6,21 +6,21 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi::gpointer;
|
||||
use glib_sys::gpointer;
|
||||
use gst_gl_sys;
|
||||
use libc::uintptr_t;
|
||||
use GLDisplayEGL;
|
||||
use GLDisplayType;
|
||||
|
||||
impl GLDisplayEGL {
|
||||
pub unsafe fn new_with_egl_display(display: uintptr_t) -> Option<GLDisplayEGL> {
|
||||
from_glib_full(ffi::gst_gl_display_egl_new_with_egl_display(
|
||||
from_glib_full(gst_gl_sys::gst_gl_display_egl_new_with_egl_display(
|
||||
display as gpointer,
|
||||
))
|
||||
}
|
||||
|
||||
pub unsafe fn get_from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer {
|
||||
ffi::gst_gl_display_egl_get_from_native(display_type.to_glib(), display)
|
||||
gst_gl_sys::gst_gl_display_egl_get_from_native(display_type.to_glib(), display)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi::gpointer;
|
||||
use glib_sys::gpointer;
|
||||
use gst_gl_sys;
|
||||
use libc::uintptr_t;
|
||||
use GLDisplayWayland;
|
||||
|
||||
impl GLDisplayWayland {
|
||||
pub unsafe fn new_with_display(display: uintptr_t) -> Option<GLDisplayWayland> {
|
||||
from_glib_full(ffi::gst_gl_display_wayland_new_with_display(
|
||||
from_glib_full(gst_gl_sys::gst_gl_display_wayland_new_with_display(
|
||||
display as gpointer,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi::gpointer;
|
||||
use glib_sys::gpointer;
|
||||
use gst_gl_sys;
|
||||
use libc::uintptr_t;
|
||||
use GLDisplayX11;
|
||||
|
||||
impl GLDisplayX11 {
|
||||
pub unsafe fn new_with_display(display: uintptr_t) -> Option<GLDisplayX11> {
|
||||
from_glib_full(ffi::gst_gl_display_x11_new_with_display(
|
||||
from_glib_full(gst_gl_sys::gst_gl_display_x11_new_with_display(
|
||||
display as gpointer,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
use std::fmt;
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_gl_sys;
|
||||
|
||||
use GLContext;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct GLSyncMeta(ffi::GstGLSyncMeta);
|
||||
pub struct GLSyncMeta(gst_gl_sys::GstGLSyncMeta);
|
||||
|
||||
impl GLSyncMeta {
|
||||
pub fn add<'a, C: IsA<GLContext>>(
|
||||
|
@ -17,7 +17,7 @@ impl GLSyncMeta {
|
|||
context: &C,
|
||||
) -> gst::MetaRefMut<'a, Self, gst::meta::Standalone> {
|
||||
unsafe {
|
||||
let meta = ffi::gst_buffer_add_gl_sync_meta(
|
||||
let meta = gst_gl_sys::gst_buffer_add_gl_sync_meta(
|
||||
context.as_ref().to_glib_none().0,
|
||||
buffer.as_mut_ptr(),
|
||||
);
|
||||
|
@ -31,7 +31,7 @@ impl GLSyncMeta {
|
|||
|
||||
pub fn set_sync_point<C: IsA<GLContext>>(&self, context: &C) {
|
||||
unsafe {
|
||||
ffi::gst_gl_sync_meta_set_sync_point(
|
||||
gst_gl_sys::gst_gl_sync_meta_set_sync_point(
|
||||
&self.0 as *const _ as *mut _,
|
||||
context.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -40,7 +40,7 @@ impl GLSyncMeta {
|
|||
|
||||
pub fn wait<C: IsA<GLContext>>(&self, context: &C) {
|
||||
unsafe {
|
||||
ffi::gst_gl_sync_meta_wait(
|
||||
gst_gl_sys::gst_gl_sync_meta_wait(
|
||||
&self.0 as *const _ as *mut _,
|
||||
context.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -49,7 +49,7 @@ impl GLSyncMeta {
|
|||
|
||||
pub fn wait_cpu<C: IsA<GLContext>>(&self, context: &C) {
|
||||
unsafe {
|
||||
ffi::gst_gl_sync_meta_wait_cpu(
|
||||
gst_gl_sys::gst_gl_sync_meta_wait_cpu(
|
||||
&self.0 as *const _ as *mut _,
|
||||
context.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -58,10 +58,10 @@ impl GLSyncMeta {
|
|||
}
|
||||
|
||||
unsafe impl MetaAPI for GLSyncMeta {
|
||||
type GstType = ffi::GstGLSyncMeta;
|
||||
type GstType = gst_gl_sys::GstGLSyncMeta;
|
||||
|
||||
fn get_meta_api() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_gl_sync_meta_api_get_type()) }
|
||||
unsafe { from_glib(gst_gl_sys::gst_gl_sync_meta_api_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use gst_video_ffi;
|
||||
use glib_sys;
|
||||
use gst_gl_sys;
|
||||
use gst_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
use glib::translate::{from_glib, ToGlibPtr};
|
||||
use gst;
|
||||
|
@ -75,13 +75,13 @@ impl<'a> VideoFrameGLExt for VideoFrameRef<&'a gst::BufferRef> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(gst_video_ffi::gst_video_frame_map(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.to_glib_none().0,
|
||||
gst_video_ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_ffi::GST_MAP_READ
|
||||
| ffi::GST_MAP_GL as u32,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_sys::GST_MAP_READ
|
||||
| gst_gl_sys::GST_MAP_GL as u32,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -112,13 +112,13 @@ impl<'a> VideoFrameGLExt for VideoFrameRef<&'a gst::BufferRef> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(gst_video_ffi::gst_video_frame_map(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.as_mut_ptr(),
|
||||
gst_video_ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_ffi::GST_MAP_READ
|
||||
| ffi::GST_MAP_GL as u32,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_sys::GST_MAP_READ
|
||||
| gst_gl_sys::GST_MAP_GL as u32,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -151,10 +151,10 @@ impl<'a> VideoFrameGLExt for VideoFrameRef<&'a gst::BufferRef> {
|
|||
fn buffer_n_gl_memory(buffer: &gst::BufferRef) -> Option<u32> {
|
||||
unsafe {
|
||||
let buf = buffer.as_mut_ptr();
|
||||
let num = gst_ffi::gst_buffer_n_memory(buf);
|
||||
let num = gst_sys::gst_buffer_n_memory(buf);
|
||||
for i in 0..num - 1 {
|
||||
let mem = gst_ffi::gst_buffer_peek_memory(buf, i);
|
||||
if ffi::gst_is_gl_memory(mem) != glib_ffi::GTRUE {
|
||||
let mem = gst_sys::gst_buffer_peek_memory(buf, i);
|
||||
if gst_gl_sys::gst_is_gl_memory(mem) != glib_sys::GTRUE {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,18 +15,18 @@ extern crate lazy_static;
|
|||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_gl_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_gl_sys as gst_gl_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
extern crate gstreamer_video as gst_video;
|
||||
extern crate gstreamer_video_sys as gst_video_ffi;
|
||||
extern crate gstreamer_video_sys as gst_video_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_net_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_net_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -7,18 +7,18 @@
|
|||
// except according to those terms.
|
||||
|
||||
extern crate gio;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_net_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_net_sys as gst_net_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
use std::fmt;
|
||||
|
||||
use ffi;
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_net_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct NetAddressMeta(ffi::GstNetAddressMeta);
|
||||
pub struct NetAddressMeta(gst_net_sys::GstNetAddressMeta);
|
||||
|
||||
impl NetAddressMeta {
|
||||
pub fn add<'a, A: IsA<gio::SocketAddress>>(
|
||||
|
@ -16,7 +16,7 @@ impl NetAddressMeta {
|
|||
addr: &A,
|
||||
) -> gst::MetaRefMut<'a, Self, gst::meta::Standalone> {
|
||||
unsafe {
|
||||
let meta = ffi::gst_buffer_add_net_address_meta(
|
||||
let meta = gst_net_sys::gst_buffer_add_net_address_meta(
|
||||
buffer.as_mut_ptr(),
|
||||
addr.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -31,17 +31,17 @@ impl NetAddressMeta {
|
|||
pub fn set_addr<T: IsA<gio::SocketAddress>>(&mut self, addr: &T) {
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
gobject_ffi::g_object_unref(self.0.addr as *mut _);
|
||||
gobject_sys::g_object_unref(self.0.addr as *mut _);
|
||||
self.0.addr = addr.as_ref().to_glib_full();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl MetaAPI for NetAddressMeta {
|
||||
type GstType = ffi::GstNetAddressMeta;
|
||||
type GstType = gst_net_sys::GstNetAddressMeta;
|
||||
|
||||
fn get_meta_api() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_net_address_meta_api_get_type()) }
|
||||
unsafe { from_glib(gst_net_sys::gst_net_address_meta_api_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_net_sys;
|
||||
use NetClientClock;
|
||||
|
||||
use glib::object::Cast;
|
||||
|
@ -26,7 +26,7 @@ impl NetClientClock {
|
|||
let (major, minor, _, _) = gst::version();
|
||||
if (major, minor) > (1, 12) {
|
||||
unsafe {
|
||||
gst::Clock::from_glib_full(ffi::gst_net_client_clock_new(
|
||||
gst::Clock::from_glib_full(gst_net_sys::gst_net_client_clock_new(
|
||||
name.0,
|
||||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
|
@ -37,7 +37,7 @@ impl NetClientClock {
|
|||
} 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(
|
||||
gst::Clock::from_glib_none(gst_net_sys::gst_net_client_clock_new(
|
||||
name.0,
|
||||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_net_sys;
|
||||
use NetTimeProvider;
|
||||
|
||||
use glib::translate::*;
|
||||
|
@ -26,7 +26,7 @@ impl NetTimeProvider {
|
|||
let (major, minor, _, _) = gst::version();
|
||||
if (major, minor) > (1, 12) {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_net_time_provider_new(
|
||||
from_glib_full(gst_net_sys::gst_net_time_provider_new(
|
||||
clock.as_ref().to_glib_none().0,
|
||||
address.0,
|
||||
port,
|
||||
|
@ -35,7 +35,7 @@ impl NetTimeProvider {
|
|||
} else {
|
||||
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_net_time_provider_new(
|
||||
from_glib_none(gst_net_sys::gst_net_time_provider_new(
|
||||
clock.as_ref().to_glib_none().0,
|
||||
address.0,
|
||||
port,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_net_sys;
|
||||
use NtpClock;
|
||||
|
||||
use glib::object::Cast;
|
||||
|
@ -26,7 +26,7 @@ impl NtpClock {
|
|||
let (major, minor, _, _) = gst::version();
|
||||
if (major, minor) > (1, 12) {
|
||||
unsafe {
|
||||
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(
|
||||
gst::Clock::from_glib_full(gst_net_sys::gst_ntp_clock_new(
|
||||
name.0,
|
||||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
|
@ -37,7 +37,7 @@ impl NtpClock {
|
|||
} 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(
|
||||
gst::Clock::from_glib_none(gst_net_sys::gst_ntp_clock_new(
|
||||
name.0,
|
||||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_net_sys;
|
||||
use PtpClock;
|
||||
|
||||
use glib::object::Cast;
|
||||
|
@ -21,12 +21,14 @@ impl PtpClock {
|
|||
let (major, minor, _, _) = gst::version();
|
||||
if (major, minor) > (1, 12) {
|
||||
unsafe {
|
||||
gst::Clock::from_glib_full(ffi::gst_ptp_clock_new(name.0, domain)).unsafe_cast()
|
||||
gst::Clock::from_glib_full(gst_net_sys::gst_ptp_clock_new(name.0, domain))
|
||||
.unsafe_cast()
|
||||
}
|
||||
} 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_ptp_clock_new(name.0, domain)).unsafe_cast()
|
||||
gst::Clock::from_glib_none(gst_net_sys::gst_ptp_clock_new(name.0, domain))
|
||||
.unsafe_cast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,9 +18,9 @@ use glib::translate::*;
|
|||
use glib::IsA;
|
||||
use glib::Value;
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_pbutils_sys;
|
||||
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
|
@ -28,7 +28,7 @@ use std::mem::transmute;
|
|||
impl Discoverer {
|
||||
pub fn set_property_timeout(&self, timeout: gst::ClockTime) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(
|
||||
gobject_sys::g_object_set_property(
|
||||
self.as_ptr() as *mut _,
|
||||
"timeout".to_glib_none().0,
|
||||
Value::from(&timeout).to_glib_none().0,
|
||||
|
@ -39,7 +39,7 @@ impl Discoverer {
|
|||
pub fn get_property_timeout(&self) -> gst::ClockTime {
|
||||
let mut value = Value::from(&0u64);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(
|
||||
gobject_sys::g_object_get_property(
|
||||
self.as_ptr() as *mut _,
|
||||
"timeout".to_glib_none().0,
|
||||
value.to_glib_none_mut().0,
|
||||
|
@ -65,9 +65,9 @@ impl Discoverer {
|
|||
}
|
||||
|
||||
unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut ffi::GstDiscoverer,
|
||||
_param_spec: glib_ffi::gpointer,
|
||||
f: glib_ffi::gpointer,
|
||||
this: *mut gst_pbutils_sys::GstDiscoverer,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<Discoverer>,
|
||||
{
|
||||
|
|
|
@ -9,16 +9,19 @@
|
|||
|
||||
use DiscovererVideoInfo;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_pbutils_sys;
|
||||
|
||||
impl DiscovererVideoInfo {
|
||||
pub fn get_framerate(&self) -> gst::Fraction {
|
||||
unsafe {
|
||||
gst::Fraction::new(
|
||||
ffi::gst_discoverer_video_info_get_framerate_num(self.to_glib_none().0) as i32,
|
||||
ffi::gst_discoverer_video_info_get_framerate_denom(self.to_glib_none().0) as i32,
|
||||
gst_pbutils_sys::gst_discoverer_video_info_get_framerate_num(self.to_glib_none().0)
|
||||
as i32,
|
||||
gst_pbutils_sys::gst_discoverer_video_info_get_framerate_denom(
|
||||
self.to_glib_none().0,
|
||||
) as i32,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +29,10 @@ impl DiscovererVideoInfo {
|
|||
pub fn get_par(&self) -> gst::Fraction {
|
||||
unsafe {
|
||||
gst::Fraction::new(
|
||||
ffi::gst_discoverer_video_info_get_par_num(self.to_glib_none().0) as i32,
|
||||
ffi::gst_discoverer_video_info_get_par_denom(self.to_glib_none().0) as i32,
|
||||
gst_pbutils_sys::gst_discoverer_video_info_get_par_num(self.to_glib_none().0)
|
||||
as i32,
|
||||
gst_pbutils_sys::gst_discoverer_video_info_get_par_denom(self.to_glib_none().0)
|
||||
as i32,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use gst_pbutils_sys;
|
||||
use gst_sys;
|
||||
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
|
@ -46,7 +46,7 @@ trait EncodingProfileBuilderCommon {
|
|||
impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
||||
fn set_allow_dynamic_output(&self, allow_dynamic_output: bool) {
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_allow_dynamic_output(
|
||||
gst_pbutils_sys::gst_encoding_profile_set_allow_dynamic_output(
|
||||
self.as_ref().to_glib_none().0,
|
||||
allow_dynamic_output.to_glib(),
|
||||
);
|
||||
|
@ -57,7 +57,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
let description = description.into();
|
||||
let description = description.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_description(
|
||||
gst_pbutils_sys::gst_encoding_profile_set_description(
|
||||
self.as_ref().to_glib_none().0,
|
||||
description.0,
|
||||
);
|
||||
|
@ -66,7 +66,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
|
||||
fn set_enabled(&self, enabled: bool) {
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_enabled(
|
||||
gst_pbutils_sys::gst_encoding_profile_set_enabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
|
@ -75,7 +75,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
|
||||
fn set_format(&self, format: &gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_format(
|
||||
gst_pbutils_sys::gst_encoding_profile_set_format(
|
||||
self.as_ref().to_glib_none().0,
|
||||
format.to_glib_none().0,
|
||||
);
|
||||
|
@ -86,13 +86,16 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
let name = name.into();
|
||||
let name = name.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_name(self.as_ref().to_glib_none().0, name.0);
|
||||
gst_pbutils_sys::gst_encoding_profile_set_name(self.as_ref().to_glib_none().0, name.0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_presence(&self, presence: u32) {
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_presence(self.as_ref().to_glib_none().0, presence);
|
||||
gst_pbutils_sys::gst_encoding_profile_set_presence(
|
||||
self.as_ref().to_glib_none().0,
|
||||
presence,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +103,10 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
let preset = preset.into();
|
||||
let preset = preset.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_preset(self.as_ref().to_glib_none().0, preset.0);
|
||||
gst_pbutils_sys::gst_encoding_profile_set_preset(
|
||||
self.as_ref().to_glib_none().0,
|
||||
preset.0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +114,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
let preset_name = preset_name.into();
|
||||
let preset_name = preset_name.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_encoding_profile_set_preset_name(
|
||||
gst_pbutils_sys::gst_encoding_profile_set_preset_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
preset_name.0,
|
||||
);
|
||||
|
@ -120,10 +126,13 @@ impl<O: IsA<EncodingProfile>> EncodingProfileBuilderCommon for O {
|
|||
unsafe {
|
||||
let restriction = match restriction {
|
||||
Some(restriction) => restriction.to_glib_full(),
|
||||
None => gst_ffi::gst_caps_new_any(),
|
||||
None => gst_sys::gst_caps_new_any(),
|
||||
};
|
||||
|
||||
ffi::gst_encoding_profile_set_restriction(self.as_ref().to_glib_none().0, restriction);
|
||||
gst_pbutils_sys::gst_encoding_profile_set_restriction(
|
||||
self.as_ref().to_glib_none().0,
|
||||
restriction,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +150,7 @@ impl EncodingAudioProfile {
|
|||
let restriction = restriction.into();
|
||||
let restriction = restriction.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_encoding_audio_profile_new(
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_audio_profile_new(
|
||||
format.to_glib_none().0,
|
||||
preset.0,
|
||||
restriction.0,
|
||||
|
@ -164,7 +173,7 @@ impl EncodingVideoProfile {
|
|||
let restriction = restriction.into();
|
||||
let restriction = restriction.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_encoding_video_profile_new(
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_video_profile_new(
|
||||
format.to_glib_none().0,
|
||||
preset.0,
|
||||
restriction.0,
|
||||
|
@ -175,13 +184,13 @@ impl EncodingVideoProfile {
|
|||
|
||||
fn set_pass(&self, pass: u32) {
|
||||
unsafe {
|
||||
ffi::gst_encoding_video_profile_set_pass(self.to_glib_none().0, pass);
|
||||
gst_pbutils_sys::gst_encoding_video_profile_set_pass(self.to_glib_none().0, pass);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_variableframerate(&self, variableframerate: bool) {
|
||||
unsafe {
|
||||
ffi::gst_encoding_video_profile_set_variableframerate(
|
||||
gst_pbutils_sys::gst_encoding_video_profile_set_variableframerate(
|
||||
self.to_glib_none().0,
|
||||
variableframerate.to_glib(),
|
||||
);
|
||||
|
@ -211,7 +220,7 @@ impl EncodingContainerProfile {
|
|||
let preset = preset.into();
|
||||
let preset = preset.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_encoding_container_profile_new(
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_container_profile_new(
|
||||
name.0,
|
||||
description.0,
|
||||
format.to_glib_none().0,
|
||||
|
@ -226,7 +235,7 @@ impl EncodingContainerProfile {
|
|||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_encoding_container_profile_add_profile(
|
||||
gst_pbutils_sys::gst_encoding_container_profile_add_profile(
|
||||
self.to_glib_none().0,
|
||||
profile.as_ref().to_glib_full(),
|
||||
),
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst::MiniObject;
|
||||
use gst_pbutils_sys;
|
||||
use std::ptr;
|
||||
|
||||
pub unsafe trait CodecTag<'a>: gst::Tag<'a, TagType = &'a str> {}
|
||||
|
@ -29,7 +29,7 @@ pub fn pb_utils_add_codec_description_to_tag_list_for_tag<'a, T: CodecTag<'a>>(
|
|||
let codec_tag = T::tag_name();
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_pb_utils_add_codec_description_to_tag_list(
|
||||
gst_pbutils_sys::gst_pb_utils_add_codec_description_to_tag_list(
|
||||
taglist.as_mut_ptr(),
|
||||
codec_tag.to_glib_none().0,
|
||||
caps.as_ptr(),
|
||||
|
@ -46,7 +46,7 @@ pub fn pb_utils_add_codec_description_to_tag_list(
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_pb_utils_add_codec_description_to_tag_list(
|
||||
gst_pbutils_sys::gst_pb_utils_add_codec_description_to_tag_list(
|
||||
taglist.as_mut_ptr(),
|
||||
ptr::null_mut(),
|
||||
caps.as_ptr(),
|
||||
|
@ -58,15 +58,27 @@ pub fn pb_utils_add_codec_description_to_tag_list(
|
|||
|
||||
pub fn pb_utils_get_encoder_description(caps: &gst::CapsRef) -> Option<String> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_pb_utils_get_encoder_description(caps.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_encoder_description(
|
||||
caps.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pb_utils_get_decoder_description(caps: &gst::CapsRef) -> Option<String> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_pb_utils_get_decoder_description(caps.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_decoder_description(
|
||||
caps.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pb_utils_get_codec_description(caps: &gst::CapsRef) -> Option<String> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_pb_utils_get_codec_description(caps.as_ptr())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_codec_description(
|
||||
caps.as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,21 +14,21 @@ use std::sync::{Once, ONCE_INIT};
|
|||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_pbutils_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_pbutils_sys as gst_pbutils_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
static PBUTILS_INIT: Once = ONCE_INIT;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
::PBUTILS_INIT.call_once(|| {
|
||||
unsafe { ::ffi::gst_pb_utils_init() };
|
||||
unsafe { ::gst_pbutils_sys::gst_pb_utils_init() };
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_player_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use gst_player_sys;
|
||||
use gst_sys;
|
||||
|
||||
use std::mem;
|
||||
use std::ops;
|
||||
|
@ -46,13 +46,15 @@ impl AsMut<gst::StructureRef> for PlayerConfig {
|
|||
impl PlayerConfig {
|
||||
pub fn get_position_update_interval(&self) -> u32 {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { ffi::gst_player_config_get_position_update_interval(self.0.to_glib_none().0) }
|
||||
unsafe {
|
||||
gst_player_sys::gst_player_config_get_position_update_interval(self.0.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_seek_accurate(&self) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_config_get_seek_accurate(
|
||||
from_glib(gst_player_sys::gst_player_config_get_seek_accurate(
|
||||
self.0.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -61,7 +63,7 @@ impl PlayerConfig {
|
|||
pub fn get_user_agent(&self) -> Option<String> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_config_get_user_agent(
|
||||
from_glib_full(gst_player_sys::gst_player_config_get_user_agent(
|
||||
self.0.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -70,7 +72,7 @@ impl PlayerConfig {
|
|||
pub fn set_position_update_interval(&mut self, interval: u32) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_player_config_set_position_update_interval(
|
||||
gst_player_sys::gst_player_config_set_position_update_interval(
|
||||
self.0.to_glib_none_mut().0,
|
||||
interval,
|
||||
);
|
||||
|
@ -87,22 +89,22 @@ impl PlayerConfig {
|
|||
pub fn set_user_agent(&mut self, agent: &str) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_player_config_set_user_agent(
|
||||
gst_player_sys::gst_player_config_set_user_agent(
|
||||
self.0.to_glib_none_mut().0,
|
||||
agent.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn into_ptr(mut self) -> *mut gst_ffi::GstStructure {
|
||||
pub unsafe fn into_ptr(mut self) -> *mut gst_sys::GstStructure {
|
||||
let ptr = self.0.to_glib_none_mut().0;
|
||||
mem::forget(self);
|
||||
ptr
|
||||
}
|
||||
}
|
||||
|
||||
impl FromGlibPtrFull<*mut gst_ffi::GstStructure> for PlayerConfig {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_ffi::GstStructure) -> Self {
|
||||
impl FromGlibPtrFull<*mut gst_sys::GstStructure> for PlayerConfig {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_sys::GstStructure) -> Self {
|
||||
PlayerConfig(from_glib_full(ptr))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
extern crate libc;
|
||||
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_player_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_player_sys as gst_player_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
extern crate gstreamer_video as gst_video;
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::ObjectType;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use glib_sys;
|
||||
use gst;
|
||||
use gst_player_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Player;
|
||||
|
@ -31,22 +31,32 @@ impl Player {
|
|||
|
||||
let (major, minor, _, _) = gst::version();
|
||||
if (major, minor) > (1, 12) {
|
||||
unsafe { from_glib_full(ffi::gst_player_new(video_renderer, signal_dispatcher)) }
|
||||
unsafe {
|
||||
from_glib_full(gst_player_sys::gst_player_new(
|
||||
video_renderer,
|
||||
signal_dispatcher,
|
||||
))
|
||||
}
|
||||
} else {
|
||||
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13 in
|
||||
// https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/gst-libs/gst/player/gstplayer.c?id=634cd87c76f58b5e1383715bafd5614db825c7d1
|
||||
unsafe { from_glib_none(ffi::gst_player_new(video_renderer, signal_dispatcher)) }
|
||||
unsafe {
|
||||
from_glib_none(gst_player_sys::gst_player_new(
|
||||
video_renderer,
|
||||
signal_dispatcher,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_config(&self) -> ::PlayerConfig {
|
||||
unsafe { from_glib_full(ffi::gst_player_get_config(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(gst_player_sys::gst_player_get_config(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn set_config(&self, config: ::PlayerConfig) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_player_set_config(self.to_glib_none().0, config.into_ptr()),
|
||||
gst_player_sys::gst_player_set_config(self.to_glib_none().0, config.into_ptr()),
|
||||
"Failed to set config",
|
||||
)
|
||||
}
|
||||
|
@ -104,9 +114,9 @@ impl Player {
|
|||
unsafe extern "C" fn duration_changed_trampoline<
|
||||
F: Fn(&Player, gst::ClockTime) + Send + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstPlayer,
|
||||
this: *mut gst_player_sys::GstPlayer,
|
||||
object: u64,
|
||||
f: glib_ffi::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), gst::ClockTime(Some(object)))
|
||||
|
@ -115,18 +125,18 @@ unsafe extern "C" fn duration_changed_trampoline<
|
|||
unsafe extern "C" fn position_updated_trampoline<
|
||||
F: Fn(&Player, gst::ClockTime) + Send + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstPlayer,
|
||||
this: *mut gst_player_sys::GstPlayer,
|
||||
object: u64,
|
||||
f: glib_ffi::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), gst::ClockTime(Some(object)))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn seek_done_trampoline<F: Fn(&Player, gst::ClockTime) + Send + 'static>(
|
||||
this: *mut ffi::GstPlayer,
|
||||
this: *mut gst_player_sys::GstPlayer,
|
||||
object: u64,
|
||||
f: glib_ffi::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), gst::ClockTime(Some(object)))
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use gst_player_sys;
|
||||
use PlayerGMainContextSignalDispatcher;
|
||||
|
||||
impl PlayerGMainContextSignalDispatcher {
|
||||
|
@ -19,10 +19,11 @@ impl PlayerGMainContextSignalDispatcher {
|
|||
let application_context = application_context.into();
|
||||
let application_context = application_context.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_g_main_context_signal_dispatcher_new(
|
||||
application_context.0,
|
||||
from_glib_full(
|
||||
gst_player_sys::gst_player_g_main_context_signal_dispatcher_new(
|
||||
application_context.0,
|
||||
) as *mut gst_player_sys::GstPlayerGMainContextSignalDispatcher,
|
||||
)
|
||||
as *mut ffi::GstPlayerGMainContextSignalDispatcher)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_player_sys;
|
||||
use std::mem;
|
||||
use PlayerVideoInfo;
|
||||
|
||||
|
@ -17,7 +17,11 @@ impl PlayerVideoInfo {
|
|||
unsafe {
|
||||
let mut fps_n = mem::uninitialized();
|
||||
let mut fps_d = mem::uninitialized();
|
||||
ffi::gst_player_video_info_get_framerate(self.to_glib_none().0, &mut fps_n, &mut fps_d);
|
||||
gst_player_sys::gst_player_video_info_get_framerate(
|
||||
self.to_glib_none().0,
|
||||
&mut fps_n,
|
||||
&mut fps_d,
|
||||
);
|
||||
(fps_n as i32, fps_d as i32).into()
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +30,7 @@ impl PlayerVideoInfo {
|
|||
unsafe {
|
||||
let mut par_n = mem::uninitialized();
|
||||
let mut par_d = mem::uninitialized();
|
||||
ffi::gst_player_video_info_get_pixel_aspect_ratio(
|
||||
gst_player_sys::gst_player_video_info_get_pixel_aspect_ratio(
|
||||
self.to_glib_none().0,
|
||||
&mut par_n,
|
||||
&mut par_d,
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
use gst;
|
||||
use gst_player_sys;
|
||||
use PlayerVideoOverlayVideoRenderer;
|
||||
|
||||
use std::ptr;
|
||||
|
@ -20,9 +20,9 @@ impl PlayerVideoOverlayVideoRenderer {
|
|||
pub unsafe fn new(window_handle: uintptr_t) -> PlayerVideoOverlayVideoRenderer {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
from_glib_full(
|
||||
ffi::gst_player_video_overlay_video_renderer_new(window_handle as *mut _) as *mut _,
|
||||
)
|
||||
from_glib_full(gst_player_sys::gst_player_video_overlay_video_renderer_new(
|
||||
window_handle as *mut _,
|
||||
) as *mut _)
|
||||
}
|
||||
|
||||
pub unsafe fn new_with_handle_and_sink<P: IsA<gst::Element>>(
|
||||
|
@ -31,30 +31,35 @@ impl PlayerVideoOverlayVideoRenderer {
|
|||
) -> PlayerVideoOverlayVideoRenderer {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
from_glib_full(ffi::gst_player_video_overlay_video_renderer_new_with_sink(
|
||||
window_handle as *mut _,
|
||||
video_sink.as_ref().to_glib_none().0,
|
||||
) as *mut _)
|
||||
from_glib_full(
|
||||
gst_player_sys::gst_player_video_overlay_video_renderer_new_with_sink(
|
||||
window_handle as *mut _,
|
||||
video_sink.as_ref().to_glib_none().0,
|
||||
) as *mut _,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn new_with_sink<P: IsA<gst::Element>>(video_sink: &P) -> PlayerVideoOverlayVideoRenderer {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_video_overlay_video_renderer_new_with_sink(
|
||||
ptr::null_mut(),
|
||||
video_sink.as_ref().to_glib_none().0,
|
||||
) as *mut _)
|
||||
from_glib_full(
|
||||
gst_player_sys::gst_player_video_overlay_video_renderer_new_with_sink(
|
||||
ptr::null_mut(),
|
||||
video_sink.as_ref().to_glib_none().0,
|
||||
) as *mut _,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn get_window_handle(&self) -> uintptr_t {
|
||||
ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0)
|
||||
as uintptr_t
|
||||
gst_player_sys::gst_player_video_overlay_video_renderer_get_window_handle(
|
||||
self.to_glib_none().0,
|
||||
) as uintptr_t
|
||||
}
|
||||
|
||||
pub unsafe fn set_window_handle(&self, window_handle: uintptr_t) {
|
||||
ffi::gst_player_video_overlay_video_renderer_set_window_handle(
|
||||
gst_player_sys::gst_player_video_overlay_video_renderer_set_window_handle(
|
||||
self.to_glib_none().0,
|
||||
window_handle as *mut _,
|
||||
)
|
||||
|
|
|
@ -13,24 +13,24 @@ extern crate lazy_static;
|
|||
extern crate libc;
|
||||
|
||||
extern crate gio;
|
||||
extern crate gio_sys as gio_ffi;
|
||||
extern crate gio_sys as gio_sys;
|
||||
use std::ffi::CStr;
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
#[macro_use]
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_net as gst_net;
|
||||
extern crate gstreamer_net_sys as gst_net_ffi;
|
||||
extern crate gstreamer_net_sys as gst_net_sys;
|
||||
extern crate gstreamer_rtsp as gst_rtsp;
|
||||
extern crate gstreamer_rtsp_server_sys as ffi;
|
||||
extern crate gstreamer_rtsp_sys as gst_rtsp_ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_rtsp_server_sys as gst_rtsp_server_sys;
|
||||
extern crate gstreamer_rtsp_sys as gst_rtsp_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
@ -73,57 +73,57 @@ pub use rtsp_token::*;
|
|||
|
||||
lazy_static! {
|
||||
pub static ref RTSP_ADDRESS_POOL_ANY_IPV4: &'static str = unsafe {
|
||||
CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV4)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::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)
|
||||
CStr::from_ptr(gst_rtsp_server_sys::GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS)
|
||||
.to_str()
|
||||
.unwrap()
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_rtsp_server_sys;
|
||||
use std::ptr;
|
||||
use RTSPAddress;
|
||||
use RTSPAddressPool;
|
||||
|
@ -26,7 +26,7 @@ impl<O: IsA<RTSPAddressPool>> RTSPAddressPoolExtManual for O {
|
|||
) -> Result<RTSPAddress, RTSPAddressPoolResult> {
|
||||
unsafe {
|
||||
let mut address = ptr::null_mut();
|
||||
let ret = from_glib(ffi::gst_rtsp_address_pool_reserve_address(
|
||||
let ret = from_glib(gst_rtsp_server_sys::gst_rtsp_address_pool_reserve_address(
|
||||
self.as_ref().to_glib_none().0,
|
||||
ip_address.to_glib_none().0,
|
||||
port,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use ffi;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use gst_rtsp_server_sys;
|
||||
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
|
@ -34,7 +34,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExtManual for O {
|
|||
fn set_default_token<'a, P: Into<Option<&'a mut RTSPToken>>>(&self, token: P) {
|
||||
let mut token = token.into();
|
||||
unsafe {
|
||||
ffi::gst_rtsp_auth_set_default_token(
|
||||
gst_rtsp_server_sys::gst_rtsp_auth_set_default_token(
|
||||
self.as_ref().to_glib_none().0,
|
||||
token.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -79,12 +79,12 @@ unsafe extern "C" fn accept_certificate_trampoline<
|
|||
+ Sync
|
||||
+ 'static,
|
||||
>(
|
||||
this: *mut ffi::GstRTSPAuth,
|
||||
connection: *mut gio_ffi::GTlsConnection,
|
||||
peer_cert: *mut gio_ffi::GTlsCertificate,
|
||||
errors: gio_ffi::GTlsCertificateFlags,
|
||||
f: glib_ffi::gpointer,
|
||||
) -> glib_ffi::gboolean
|
||||
this: *mut gst_rtsp_server_sys::GstRTSPAuth,
|
||||
connection: *mut gio_sys::GTlsConnection,
|
||||
peer_cert: *mut gio_sys::GTlsCertificate,
|
||||
errors: gio_sys::GTlsCertificateFlags,
|
||||
f: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
P: IsA<RTSPAuth>,
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::source::SourceId;
|
||||
use glib::translate::*;
|
||||
use gst_rtsp_server_sys;
|
||||
use RTSPClient;
|
||||
|
||||
pub trait RTSPClientExtManual: 'static {
|
||||
|
@ -13,7 +13,7 @@ impl<O: IsA<RTSPClient>> RTSPClientExtManual for O {
|
|||
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId {
|
||||
let context = context.into();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_rtsp_client_attach(
|
||||
from_glib(gst_rtsp_server_sys::gst_rtsp_client_attach(
|
||||
self.as_ref().to_glib_none().0,
|
||||
context.to_glib_none().0,
|
||||
))
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use gst_rtsp_server_sys;
|
||||
use std::ptr;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct RTSPContext(ptr::NonNull<ffi::GstRTSPContext>);
|
||||
pub struct RTSPContext(ptr::NonNull<gst_rtsp_server_sys::GstRTSPContext>);
|
||||
|
||||
impl RTSPContext {
|
||||
pub fn with_current_context<F: FnOnce(&RTSPContext) -> T, T>(func: F) -> Option<T> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_rtsp_context_get_current();
|
||||
let ptr = gst_rtsp_server_sys::gst_rtsp_context_get_current();
|
||||
if ptr.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ impl RTSPContext {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrBorrow<*mut ffi::GstRTSPContext> for RTSPContext {
|
||||
impl glib::translate::FromGlibPtrBorrow<*mut gst_rtsp_server_sys::GstRTSPContext> for RTSPContext {
|
||||
#[inline]
|
||||
unsafe fn from_glib_borrow(ptr: *mut ffi::GstRTSPContext) -> Self {
|
||||
unsafe fn from_glib_borrow(ptr: *mut gst_rtsp_server_sys::GstRTSPContext) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
RTSPContext(ptr::NonNull::new_unchecked(ptr))
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
use RTSPMediaFactory;
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
use ffi;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
use gst;
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
use gst_rtsp_server_sys;
|
||||
|
||||
pub trait RTSPMediaFactoryExtManual: 'static {
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
|
@ -25,7 +25,7 @@ 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(
|
||||
gst_rtsp_server_sys::gst_rtsp_media_factory_add_role_from_structure(
|
||||
self.as_ref().to_glib_none().0,
|
||||
structure.as_mut_ptr(),
|
||||
);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::source::SourceId;
|
||||
use glib::translate::*;
|
||||
use gst_rtsp_server_sys;
|
||||
use RTSPServer;
|
||||
|
||||
pub trait RTSPServerExtManual: 'static {
|
||||
|
@ -13,7 +13,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExtManual for O {
|
|||
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId {
|
||||
let context = context.into();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_rtsp_server_attach(
|
||||
from_glib(gst_rtsp_server_sys::gst_rtsp_server_attach(
|
||||
self.as_ref().to_glib_none().0,
|
||||
context.to_glib_none().0,
|
||||
))
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::source::{Continue, Priority};
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use glib_ffi::{gboolean, gpointer};
|
||||
use glib_sys;
|
||||
use glib_sys::{gboolean, gpointer};
|
||||
use gst_rtsp_server_sys;
|
||||
use std::cell::RefCell;
|
||||
use std::mem::transmute;
|
||||
use RTSPSessionPool;
|
||||
|
||||
unsafe extern "C" fn trampoline_watch<F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static>(
|
||||
pool: *mut ffi::GstRTSPSessionPool,
|
||||
pool: *mut gst_rtsp_server_sys::GstRTSPSessionPool,
|
||||
func: gpointer,
|
||||
) -> gboolean {
|
||||
let func: &RefCell<F> = &*(func as *const RefCell<F>);
|
||||
|
@ -54,18 +54,20 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExtManual for O {
|
|||
{
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
let source = ffi::gst_rtsp_session_pool_create_watch(self.as_ref().to_glib_none().0);
|
||||
glib_ffi::g_source_set_callback(
|
||||
let source = gst_rtsp_server_sys::gst_rtsp_session_pool_create_watch(
|
||||
self.as_ref().to_glib_none().0,
|
||||
);
|
||||
glib_sys::g_source_set_callback(
|
||||
source,
|
||||
Some(transmute(trampoline_watch::<F> as usize)),
|
||||
into_raw_watch(func),
|
||||
Some(destroy_closure_watch::<F>),
|
||||
);
|
||||
glib_ffi::g_source_set_priority(source, priority.to_glib());
|
||||
glib_sys::g_source_set_priority(source, priority.to_glib());
|
||||
|
||||
let name = name.into();
|
||||
if let Some(name) = name {
|
||||
glib_ffi::g_source_set_name(source, name.to_glib_none().0);
|
||||
glib_sys::g_source_set_name(source, name.to_glib_none().0);
|
||||
}
|
||||
|
||||
from_glib_full(source)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_rtsp_server_sys;
|
||||
use RTSPStream;
|
||||
|
||||
pub trait RTSPStreamExtManual: 'static {
|
||||
|
@ -13,7 +13,7 @@ pub trait RTSPStreamExtManual: 'static {
|
|||
impl<O: IsA<RTSPStream>> RTSPStreamExtManual for O {
|
||||
fn recv_rtcp(&self, buffer: &gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_rtsp_stream_recv_rtcp(
|
||||
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_recv_rtcp(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.to_glib_full(),
|
||||
))
|
||||
|
@ -23,7 +23,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExtManual for O {
|
|||
|
||||
fn recv_rtp(&self, buffer: &gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_rtsp_stream_recv_rtp(
|
||||
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_recv_rtp(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.to_glib_full(),
|
||||
))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_rtsp_server_sys;
|
||||
use RTSPStreamTransport;
|
||||
|
||||
pub trait RTSPStreamTransportExtManual: 'static {
|
||||
|
@ -19,7 +19,7 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExtManual for O {
|
|||
buffer: &gst::Buffer,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(ffi::gst_rtsp_stream_transport_recv_data(
|
||||
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_transport_recv_data(
|
||||
self.as_ref().to_glib_none().0,
|
||||
channel,
|
||||
buffer.to_glib_full(),
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
use ffi;
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use glib::value::ToSendValue;
|
||||
use gst;
|
||||
use gst::miniobject::*;
|
||||
use gst_rtsp_server_sys;
|
||||
|
||||
use std::fmt;
|
||||
|
||||
gst_define_mini_object_wrapper!(RTSPToken, RTSPTokenRef, ffi::GstRTSPToken, [Debug,], || {
|
||||
ffi::gst_rtsp_token_get_type()
|
||||
});
|
||||
gst_define_mini_object_wrapper!(
|
||||
RTSPToken,
|
||||
RTSPTokenRef,
|
||||
gst_rtsp_server_sys::GstRTSPToken,
|
||||
[Debug,],
|
||||
|| gst_rtsp_server_sys::gst_rtsp_token_get_type()
|
||||
);
|
||||
|
||||
impl RTSPToken {
|
||||
pub fn new_empty() -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_rtsp_token_new_empty()) }
|
||||
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_token_new_empty()) }
|
||||
}
|
||||
|
||||
pub fn new(values: &[(&str, &ToSendValue)]) -> Self {
|
||||
|
@ -36,7 +40,7 @@ impl RTSPToken {
|
|||
impl RTSPTokenRef {
|
||||
pub fn get_string(&self, field: &str) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_rtsp_token_get_string(
|
||||
from_glib_none(gst_rtsp_server_sys::gst_rtsp_token_get_string(
|
||||
self.as_mut_ptr(),
|
||||
field.to_glib_none().0,
|
||||
))
|
||||
|
@ -44,12 +48,16 @@ impl RTSPTokenRef {
|
|||
}
|
||||
|
||||
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(gst_rtsp_server_sys::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(
|
||||
from_glib(gst_rtsp_server_sys::gst_rtsp_token_is_allowed(
|
||||
self.as_mut_ptr(),
|
||||
field.to_glib_none().0,
|
||||
))
|
||||
|
@ -58,7 +66,8 @@ impl RTSPTokenRef {
|
|||
|
||||
pub fn get_mut_structure(&mut self) -> Option<&mut gst::StructureRef> {
|
||||
unsafe {
|
||||
let structure = ffi::gst_rtsp_token_writable_structure(self.as_mut_ptr());
|
||||
let structure =
|
||||
gst_rtsp_server_sys::gst_rtsp_token_writable_structure(self.as_mut_ptr());
|
||||
if structure.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
|
|
@ -12,17 +12,17 @@ extern crate libc;
|
|||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_rtsp_sys as ffi;
|
||||
extern crate gstreamer_rtsp_sys as gst_rtsp_sys;
|
||||
extern crate gstreamer_sdp as gst_sdp;
|
||||
extern crate gstreamer_sdp_sys as gst_sdp_ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_sdp_sys as gst_sdp_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -11,15 +11,15 @@ extern crate libc;
|
|||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_sdp_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_sdp_sys as gst_sdp_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -10,18 +10,22 @@ use std::ffi::CStr;
|
|||
use std::fmt;
|
||||
use std::mem;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPAttribute(pub(crate) ffi::GstSDPAttribute);
|
||||
pub struct SDPAttribute(pub(crate) gst_sdp_sys::GstSDPAttribute);
|
||||
|
||||
impl SDPAttribute {
|
||||
pub fn new(key: &str, value: Option<&str>) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut attr = mem::zeroed();
|
||||
ffi::gst_sdp_attribute_set(&mut attr, key.to_glib_none().0, value.to_glib_none().0);
|
||||
gst_sdp_sys::gst_sdp_attribute_set(
|
||||
&mut attr,
|
||||
key.to_glib_none().0,
|
||||
value.to_glib_none().0,
|
||||
);
|
||||
SDPAttribute(attr)
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +56,7 @@ impl Clone for SDPAttribute {
|
|||
impl Drop for SDPAttribute {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_attribute_clear(&mut self.0);
|
||||
gst_sdp_sys::gst_sdp_attribute_clear(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,18 +10,18 @@ use std::ffi::CStr;
|
|||
use std::fmt;
|
||||
use std::mem;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPBandwidth(pub(crate) ffi::GstSDPBandwidth);
|
||||
pub struct SDPBandwidth(pub(crate) gst_sdp_sys::GstSDPBandwidth);
|
||||
|
||||
impl SDPBandwidth {
|
||||
pub fn new(bwtype: &str, bandwidth: u32) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut bw = mem::zeroed();
|
||||
ffi::gst_sdp_bandwidth_set(&mut bw, bwtype.to_glib_none().0, bandwidth);
|
||||
gst_sdp_sys::gst_sdp_bandwidth_set(&mut bw, bwtype.to_glib_none().0, bandwidth);
|
||||
SDPBandwidth(bw)
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ impl Clone for SDPBandwidth {
|
|||
impl Drop for SDPBandwidth {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_bandwidth_clear(&mut self.0);
|
||||
gst_sdp_sys::gst_sdp_bandwidth_clear(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,18 +10,18 @@ use std::ffi::CStr;
|
|||
use std::fmt;
|
||||
use std::mem;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPConnection(pub(crate) ffi::GstSDPConnection);
|
||||
pub struct SDPConnection(pub(crate) gst_sdp_sys::GstSDPConnection);
|
||||
|
||||
impl SDPConnection {
|
||||
pub fn new(nettype: &str, addrtype: &str, address: &str, ttl: u32, addr_number: u32) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut conn = mem::zeroed();
|
||||
ffi::gst_sdp_connection_set(
|
||||
gst_sdp_sys::gst_sdp_connection_set(
|
||||
&mut conn,
|
||||
nettype.to_glib_none().0,
|
||||
addrtype.to_glib_none().0,
|
||||
|
@ -69,7 +69,7 @@ impl Clone for SDPConnection {
|
|||
impl Drop for SDPConnection {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_connection_clear(&mut self.0);
|
||||
gst_sdp_sys::gst_sdp_connection_clear(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
use std::ffi::CStr;
|
||||
use std::fmt;
|
||||
|
||||
use ffi;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPKey(ffi::GstSDPKey);
|
||||
pub struct SDPKey(gst_sdp_sys::GstSDPKey);
|
||||
|
||||
impl SDPKey {
|
||||
pub fn type_(&self) -> &str {
|
||||
|
|
|
@ -13,10 +13,10 @@ use std::mem;
|
|||
use std::ops;
|
||||
use std::ptr;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_sdp_sys;
|
||||
|
||||
use sdp_attribute::SDPAttribute;
|
||||
use sdp_bandwidth::SDPBandwidth;
|
||||
|
@ -25,16 +25,16 @@ use sdp_key::SDPKey;
|
|||
|
||||
glib_wrapper! {
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct SDPMedia(Boxed<ffi::GstSDPMedia>);
|
||||
pub struct SDPMedia(Boxed<gst_sdp_sys::GstSDPMedia>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| {
|
||||
let mut copy = ptr::null_mut();
|
||||
ffi::gst_sdp_media_copy(ptr as *const ffi::GstSDPMedia, &mut copy);
|
||||
gst_sdp_sys::gst_sdp_media_copy(ptr as *const gst_sdp_sys::GstSDPMedia, &mut copy);
|
||||
copy
|
||||
},
|
||||
free => |ptr| {
|
||||
ffi::gst_sdp_media_free(ptr);
|
||||
gst_sdp_sys::gst_sdp_media_free(ptr);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ impl SDPMedia {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut media = ptr::null_mut();
|
||||
ffi::gst_sdp_media_new(&mut media);
|
||||
gst_sdp_sys::gst_sdp_media_new(&mut media);
|
||||
from_glib_full(media)
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ impl fmt::Display for SDPMedia {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPMediaRef(ffi::GstSDPMedia);
|
||||
pub struct SDPMediaRef(gst_sdp_sys::GstSDPMedia);
|
||||
|
||||
impl fmt::Debug for SDPMediaRef {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
@ -127,12 +127,18 @@ impl SDPMediaRef {
|
|||
pub fn add_attribute<'a, P: Into<Option<&'a str>>>(&mut self, key: &str, value: P) {
|
||||
let value = value.into();
|
||||
let value = value.to_glib_none();
|
||||
unsafe { ffi::gst_sdp_media_add_attribute(&mut self.0, key.to_glib_none().0, value.0) };
|
||||
unsafe {
|
||||
gst_sdp_sys::gst_sdp_media_add_attribute(&mut self.0, key.to_glib_none().0, value.0)
|
||||
};
|
||||
}
|
||||
|
||||
pub fn add_bandwidth(&mut self, bwtype: &str, bandwidth: u32) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_media_add_bandwidth(&mut self.0, bwtype.to_glib_none().0, bandwidth)
|
||||
gst_sdp_sys::gst_sdp_media_add_bandwidth(
|
||||
&mut self.0,
|
||||
bwtype.to_glib_none().0,
|
||||
bandwidth,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -145,7 +151,7 @@ impl SDPMediaRef {
|
|||
addr_number: u32,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_media_add_connection(
|
||||
gst_sdp_sys::gst_sdp_media_add_connection(
|
||||
&mut self.0,
|
||||
nettype.to_glib_none().0,
|
||||
addrtype.to_glib_none().0,
|
||||
|
@ -157,11 +163,11 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
pub fn add_format(&mut self, format: &str) {
|
||||
unsafe { ffi::gst_sdp_media_add_format(&mut self.0, format.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_add_format(&mut self.0, format.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn as_text(&self) -> Option<String> {
|
||||
unsafe { from_glib_full(ffi::gst_sdp_media_as_text(&self.0)) }
|
||||
unsafe { from_glib_full(gst_sdp_sys::gst_sdp_media_as_text(&self.0)) }
|
||||
}
|
||||
|
||||
pub fn attributes(&self) -> AttributesIter {
|
||||
|
@ -181,27 +187,28 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
pub fn attributes_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_media_attributes_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_attributes_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn attributes_to_caps(&self, caps: &mut gst::CapsRef) -> Result<(), ()> {
|
||||
let result = unsafe { ffi::gst_sdp_media_attributes_to_caps(&self.0, caps.as_mut_ptr()) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_attributes_to_caps(&self.0, caps.as_mut_ptr()) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bandwidths_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_media_bandwidths_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_bandwidths_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn connections_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_media_connections_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_connections_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn formats_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_media_formats_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_formats_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn get_attribute(&self, idx: u32) -> Option<&SDPAttribute> {
|
||||
|
@ -210,7 +217,7 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_attribute(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_attribute(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -221,7 +228,7 @@ impl SDPMediaRef {
|
|||
|
||||
pub fn get_attribute_val(&self, key: &str) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_attribute_val(&self.0, key.to_glib_none().0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_attribute_val(&self.0, key.to_glib_none().0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -236,7 +243,8 @@ impl SDPMediaRef {
|
|||
|
||||
pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_attribute_val_n(&self.0, key.to_glib_none().0, nth);
|
||||
let ptr =
|
||||
gst_sdp_sys::gst_sdp_media_get_attribute_val_n(&self.0, key.to_glib_none().0, nth);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -255,7 +263,7 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_bandwidth(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_bandwidth(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -265,7 +273,7 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
pub fn get_caps_from_media(&self, pt: i32) -> Option<gst::Caps> {
|
||||
unsafe { from_glib_full(ffi::gst_sdp_media_get_caps_from_media(&self.0, pt)) }
|
||||
unsafe { from_glib_full(gst_sdp_sys::gst_sdp_media_get_caps_from_media(&self.0, pt)) }
|
||||
}
|
||||
|
||||
pub fn get_connection(&self, idx: u32) -> Option<&SDPConnection> {
|
||||
|
@ -274,7 +282,7 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_connection(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_connection(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -289,7 +297,7 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_format(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_format(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -304,7 +312,7 @@ impl SDPMediaRef {
|
|||
|
||||
pub fn get_information(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_information(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_information(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -319,7 +327,7 @@ impl SDPMediaRef {
|
|||
|
||||
pub fn get_key(&self) -> Option<&SDPKey> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_key(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_key(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -330,7 +338,7 @@ impl SDPMediaRef {
|
|||
|
||||
pub fn get_media(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_media(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_media(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -344,16 +352,16 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
pub fn get_num_ports(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_media_get_num_ports(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_get_num_ports(&self.0) }
|
||||
}
|
||||
|
||||
pub fn get_port(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_media_get_port(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_get_port(&self.0) }
|
||||
}
|
||||
|
||||
pub fn get_proto(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_media_get_proto(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_media_get_proto(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -374,10 +382,11 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result = unsafe { ffi::gst_sdp_media_insert_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_insert_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
mem::forget(attr);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -390,10 +399,11 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result = unsafe { ffi::gst_sdp_media_insert_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_insert_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
mem::forget(bw);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -410,10 +420,11 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result = unsafe { ffi::gst_sdp_media_insert_connection(&mut self.0, idx, &mut conn.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_insert_connection(&mut self.0, idx, &mut conn.0) };
|
||||
mem::forget(conn);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -426,10 +437,11 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_media_insert_format(&mut self.0, idx, format.to_glib_none().0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_media_insert_format(&mut self.0, idx, format.to_glib_none().0)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -439,9 +451,9 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_media_remove_attribute(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_media_remove_attribute(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -451,9 +463,9 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_media_remove_bandwidth(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_media_remove_bandwidth(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -463,9 +475,9 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_media_remove_connection(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_media_remove_connection(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -475,9 +487,9 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_media_remove_format(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_media_remove_format(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -487,10 +499,11 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_media_replace_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_replace_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
mem::forget(attr);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -500,10 +513,11 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_media_replace_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_replace_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
mem::forget(bw);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -514,10 +528,10 @@ impl SDPMediaRef {
|
|||
}
|
||||
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_media_replace_connection(&mut self.0, idx, &mut conn.0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_replace_connection(&mut self.0, idx, &mut conn.0) };
|
||||
mem::forget(conn);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -527,46 +541,53 @@ impl SDPMediaRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_media_replace_format(&mut self.0, idx, format.to_glib_none().0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_media_replace_format(&mut self.0, idx, format.to_glib_none().0)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_information(&mut self, information: &str) {
|
||||
unsafe { ffi::gst_sdp_media_set_information(&mut self.0, information.to_glib_none().0) };
|
||||
unsafe {
|
||||
gst_sdp_sys::gst_sdp_media_set_information(&mut self.0, information.to_glib_none().0)
|
||||
};
|
||||
}
|
||||
|
||||
pub fn set_key(&mut self, type_: &str, data: &str) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_media_set_key(&mut self.0, type_.to_glib_none().0, data.to_glib_none().0)
|
||||
gst_sdp_sys::gst_sdp_media_set_key(
|
||||
&mut self.0,
|
||||
type_.to_glib_none().0,
|
||||
data.to_glib_none().0,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
pub fn set_media(&mut self, med: &str) {
|
||||
unsafe { ffi::gst_sdp_media_set_media(&mut self.0, med.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_set_media(&mut self.0, med.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn set_port_info(&mut self, port: u32, num_ports: u32) {
|
||||
unsafe { ffi::gst_sdp_media_set_port_info(&mut self.0, port, num_ports) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_set_port_info(&mut self.0, port, num_ports) };
|
||||
}
|
||||
|
||||
pub fn set_proto(&mut self, proto: &str) {
|
||||
unsafe { ffi::gst_sdp_media_set_proto(&mut self.0, proto.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_media_set_proto(&mut self.0, proto.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn set_media_from_caps(caps: &gst::Caps, media: &mut SDPMedia) -> Result<(), ()> {
|
||||
assert_initialized_main_thread!();
|
||||
let result = unsafe {
|
||||
ffi::gst_sdp_media_set_media_from_caps(
|
||||
gst_sdp_sys::gst_sdp_media_set_media_from_caps(
|
||||
caps.to_glib_none().0,
|
||||
media.to_glib_none_mut().0,
|
||||
)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -590,7 +611,7 @@ impl ToOwned for SDPMediaRef {
|
|||
fn to_owned(&self) -> SDPMedia {
|
||||
unsafe {
|
||||
let mut ptr = ptr::null_mut();
|
||||
ffi::gst_sdp_media_copy(&self.0, &mut ptr);
|
||||
gst_sdp_sys::gst_sdp_media_copy(&self.0, &mut ptr);
|
||||
from_glib_full(ptr)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ use std::mem;
|
|||
use std::ops;
|
||||
use std::ptr;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gobject_ffi;
|
||||
use gobject_sys;
|
||||
use gst;
|
||||
use gst::MiniObject;
|
||||
use gst_sdp_sys;
|
||||
|
||||
use sdp_attribute::SDPAttribute;
|
||||
use sdp_bandwidth::SDPBandwidth;
|
||||
|
@ -31,12 +31,12 @@ use sdp_zone::SDPZone;
|
|||
|
||||
glib_wrapper! {
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct SDPMessage(Boxed<ffi::GstSDPMessage>);
|
||||
pub struct SDPMessage(Boxed<gst_sdp_sys::GstSDPMessage>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_ffi::g_boxed_copy(ffi::gst_sdp_message_get_type(), ptr as *mut _) as *mut ffi::GstSDPMessage,
|
||||
free => |ptr| gobject_ffi::g_boxed_free(ffi::gst_sdp_message_get_type(), ptr as *mut _),
|
||||
get_type => || ffi::gst_sdp_message_get_type(),
|
||||
copy => |ptr| gobject_sys::g_boxed_copy(gst_sdp_sys::gst_sdp_message_get_type(), ptr as *mut _) as *mut gst_sdp_sys::GstSDPMessage,
|
||||
free => |ptr| gobject_sys::g_boxed_free(gst_sdp_sys::gst_sdp_message_get_type(), ptr as *mut _),
|
||||
get_type => || gst_sdp_sys::gst_sdp_message_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ impl SDPMessage {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut msg = mem::zeroed();
|
||||
ffi::gst_sdp_message_new(&mut msg);
|
||||
gst_sdp_sys::gst_sdp_message_new(&mut msg);
|
||||
from_glib_full(msg)
|
||||
}
|
||||
}
|
||||
|
@ -90,12 +90,13 @@ impl SDPMessage {
|
|||
unsafe {
|
||||
let size = data.len() as u32;
|
||||
let mut msg = mem::zeroed();
|
||||
ffi::gst_sdp_message_new(&mut msg);
|
||||
let result = ffi::gst_sdp_message_parse_buffer(data.to_glib_none().0, size, msg);
|
||||
gst_sdp_sys::gst_sdp_message_new(&mut msg);
|
||||
let result =
|
||||
gst_sdp_sys::gst_sdp_message_parse_buffer(data.to_glib_none().0, size, msg);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(from_glib_full(msg)),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(from_glib_full(msg)),
|
||||
_ => {
|
||||
ffi::gst_sdp_message_uninit(msg);
|
||||
gst_sdp_sys::gst_sdp_message_uninit(msg);
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
|
@ -106,12 +107,12 @@ impl SDPMessage {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut msg = mem::zeroed();
|
||||
ffi::gst_sdp_message_new(&mut msg);
|
||||
let result = ffi::gst_sdp_message_parse_uri(uri.to_glib_none().0, msg);
|
||||
gst_sdp_sys::gst_sdp_message_new(&mut msg);
|
||||
let result = gst_sdp_sys::gst_sdp_message_parse_uri(uri.to_glib_none().0, msg);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(from_glib_full(msg)),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(from_glib_full(msg)),
|
||||
_ => {
|
||||
ffi::gst_sdp_message_uninit(msg);
|
||||
gst_sdp_sys::gst_sdp_message_uninit(msg);
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +121,7 @@ impl SDPMessage {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPMessageRef(ffi::GstSDPMessage);
|
||||
pub struct SDPMessageRef(gst_sdp_sys::GstSDPMessage);
|
||||
|
||||
impl fmt::Debug for SDPMessageRef {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
@ -170,7 +171,7 @@ unsafe impl Sync for SDPMessageRef {}
|
|||
impl SDPMessageRef {
|
||||
pub fn add_attribute<'a, P: Into<Option<&'a str>>>(&mut self, key: &str, value: P) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_add_attribute(
|
||||
gst_sdp_sys::gst_sdp_message_add_attribute(
|
||||
&mut self.0,
|
||||
key.to_glib_none().0,
|
||||
value.into().to_glib_none().0,
|
||||
|
@ -179,25 +180,25 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
pub fn add_email(&mut self, email: &str) {
|
||||
unsafe { ffi::gst_sdp_message_add_email(&mut self.0, email.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_add_email(&mut self.0, email.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn add_media(&mut self, media: SDPMedia) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_add_media(
|
||||
gst_sdp_sys::gst_sdp_message_add_media(
|
||||
&mut self.0,
|
||||
media.to_glib_none().0 as *mut ffi::GstSDPMedia,
|
||||
media.to_glib_none().0 as *mut gst_sdp_sys::GstSDPMedia,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_phone(&mut self, phone: &str) {
|
||||
unsafe { ffi::gst_sdp_message_add_phone(&mut self.0, phone.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_add_phone(&mut self.0, phone.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn add_time(&mut self, start: &str, stop: &str, repeat: &[&str]) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_add_time(
|
||||
gst_sdp_sys::gst_sdp_message_add_time(
|
||||
&mut self.0,
|
||||
start.to_glib_none().0,
|
||||
stop.to_glib_none().0,
|
||||
|
@ -208,7 +209,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn add_zone(&mut self, adj_time: &str, typed_time: &str) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_add_zone(
|
||||
gst_sdp_sys::gst_sdp_message_add_zone(
|
||||
&mut self.0,
|
||||
adj_time.to_glib_none().0,
|
||||
typed_time.to_glib_none().0,
|
||||
|
@ -217,31 +218,32 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
pub fn as_text(&self) -> Option<String> {
|
||||
unsafe { from_glib_full(ffi::gst_sdp_message_as_text(&self.0)) }
|
||||
unsafe { from_glib_full(gst_sdp_sys::gst_sdp_message_as_text(&self.0)) }
|
||||
}
|
||||
|
||||
pub fn attributes_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_attributes_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_attributes_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn attributes_to_caps(&self, caps: &mut gst::CapsRef) -> Result<(), ()> {
|
||||
let result = unsafe { ffi::gst_sdp_message_attributes_to_caps(&self.0, caps.as_mut_ptr()) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_attributes_to_caps(&self.0, caps.as_mut_ptr()) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bandwidths_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_bandwidths_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_bandwidths_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn dump(&self) {
|
||||
unsafe { ffi::gst_sdp_message_dump(&self.0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_dump(&self.0) };
|
||||
}
|
||||
|
||||
pub fn emails_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_emails_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_emails_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn get_attribute(&self, idx: u32) -> Option<&SDPAttribute> {
|
||||
|
@ -250,7 +252,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_attribute(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_attribute(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -261,7 +263,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_attribute_val(&self, key: &str) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_attribute_val(&self.0, key.to_glib_none().0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_attribute_val(&self.0, key.to_glib_none().0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -276,7 +278,11 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_attribute_val_n(&self.0, key.to_glib_none().0, nth);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_attribute_val_n(
|
||||
&self.0,
|
||||
key.to_glib_none().0,
|
||||
nth,
|
||||
);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -295,7 +301,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_bandwidth(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_bandwidth(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -306,7 +312,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_connection(&self) -> Option<&SDPConnection> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_connection(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_connection(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -321,7 +327,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_email(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_email(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -336,7 +342,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_information(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_information(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_information(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -351,7 +357,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_key(&self) -> Option<&SDPKey> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_key(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_key(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -366,7 +372,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_media(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_media(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -377,7 +383,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_origin(&self) -> Option<&SDPOrigin> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_origin(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_origin(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -392,7 +398,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_phone(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_phone(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -407,7 +413,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_session_name(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_session_name(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_session_name(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -426,7 +432,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_time(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_time(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -437,7 +443,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_uri(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_uri(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_uri(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -452,7 +458,7 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn get_version(&self) -> Option<&str> {
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_version(&self.0);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_version(&self.0);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -471,7 +477,7 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
let ptr = ffi::gst_sdp_message_get_zone(&self.0, idx);
|
||||
let ptr = gst_sdp_sys::gst_sdp_message_get_zone(&self.0, idx);
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
@ -489,10 +495,10 @@ impl SDPMessageRef {
|
|||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_message_insert_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_insert_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
mem::forget(attr);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -505,10 +511,11 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result = unsafe { ffi::gst_sdp_message_insert_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_insert_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
mem::forget(bw);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -521,10 +528,11 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_message_insert_email(&mut self.0, idx, email.to_glib_none().0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_message_insert_email(&mut self.0, idx, email.to_glib_none().0)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -537,10 +545,11 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_message_insert_phone(&mut self.0, idx, phone.to_glib_none().0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_message_insert_phone(&mut self.0, idx, phone.to_glib_none().0)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -553,10 +562,11 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result = unsafe { ffi::gst_sdp_message_insert_time(&mut self.0, idx, &mut time.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_insert_time(&mut self.0, idx, &mut time.0) };
|
||||
mem::forget(time);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -569,20 +579,21 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
let idx = idx.map(|idx| idx as i32).unwrap_or(-1);
|
||||
let result = unsafe { ffi::gst_sdp_message_insert_zone(&mut self.0, idx, &mut zone.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_insert_zone(&mut self.0, idx, &mut zone.0) };
|
||||
mem::forget(zone);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn medias_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_medias_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_medias_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn phones_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_phones_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_phones_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> {
|
||||
|
@ -590,9 +601,9 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_remove_attribute(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_message_remove_attribute(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -602,9 +613,9 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_remove_bandwidth(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_message_remove_bandwidth(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -614,9 +625,9 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_remove_email(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_message_remove_email(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -626,9 +637,9 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_remove_phone(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_message_remove_phone(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -638,9 +649,9 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_remove_time(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_message_remove_time(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -650,9 +661,9 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_remove_zone(&mut self.0, idx) };
|
||||
let result = unsafe { gst_sdp_sys::gst_sdp_message_remove_zone(&mut self.0, idx) };
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -662,11 +673,12 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_message_replace_attribute(&mut self.0, idx, &mut attr.0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_message_replace_attribute(&mut self.0, idx, &mut attr.0)
|
||||
};
|
||||
mem::forget(attr);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -676,10 +688,11 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_replace_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_replace_bandwidth(&mut self.0, idx, &mut bw.0) };
|
||||
mem::forget(bw);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -689,10 +702,11 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_message_replace_email(&mut self.0, idx, email.to_glib_none().0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_message_replace_email(&mut self.0, idx, email.to_glib_none().0)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -702,10 +716,11 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result =
|
||||
unsafe { ffi::gst_sdp_message_replace_phone(&mut self.0, idx, phone.to_glib_none().0) };
|
||||
let result = unsafe {
|
||||
gst_sdp_sys::gst_sdp_message_replace_phone(&mut self.0, idx, phone.to_glib_none().0)
|
||||
};
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -715,10 +730,11 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_replace_time(&mut self.0, idx, &mut time.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_replace_time(&mut self.0, idx, &mut time.0) };
|
||||
mem::forget(time);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -728,10 +744,11 @@ impl SDPMessageRef {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
let result = unsafe { ffi::gst_sdp_message_replace_zone(&mut self.0, idx, &mut zone.0) };
|
||||
let result =
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_replace_zone(&mut self.0, idx, &mut zone.0) };
|
||||
mem::forget(zone);
|
||||
match result {
|
||||
ffi::GST_SDP_OK => Ok(()),
|
||||
gst_sdp_sys::GST_SDP_OK => Ok(()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -745,7 +762,7 @@ impl SDPMessageRef {
|
|||
addr_number: u32,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_set_connection(
|
||||
gst_sdp_sys::gst_sdp_message_set_connection(
|
||||
&mut self.0,
|
||||
nettype.to_glib_none().0,
|
||||
addrtype.to_glib_none().0,
|
||||
|
@ -757,12 +774,18 @@ impl SDPMessageRef {
|
|||
}
|
||||
|
||||
pub fn set_information(&mut self, information: &str) {
|
||||
unsafe { ffi::gst_sdp_message_set_information(&mut self.0, information.to_glib_none().0) };
|
||||
unsafe {
|
||||
gst_sdp_sys::gst_sdp_message_set_information(&mut self.0, information.to_glib_none().0)
|
||||
};
|
||||
}
|
||||
|
||||
pub fn set_key(&mut self, type_: &str, data: &str) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_set_key(&mut self.0, type_.to_glib_none().0, data.to_glib_none().0)
|
||||
gst_sdp_sys::gst_sdp_message_set_key(
|
||||
&mut self.0,
|
||||
type_.to_glib_none().0,
|
||||
data.to_glib_none().0,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -776,7 +799,7 @@ impl SDPMessageRef {
|
|||
addr: &str,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_set_origin(
|
||||
gst_sdp_sys::gst_sdp_message_set_origin(
|
||||
&mut self.0,
|
||||
username.to_glib_none().0,
|
||||
sess_id.to_glib_none().0,
|
||||
|
@ -790,30 +813,33 @@ impl SDPMessageRef {
|
|||
|
||||
pub fn set_session_name(&mut self, session_name: &str) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_message_set_session_name(&mut self.0, session_name.to_glib_none().0)
|
||||
gst_sdp_sys::gst_sdp_message_set_session_name(
|
||||
&mut self.0,
|
||||
session_name.to_glib_none().0,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
pub fn set_uri(&mut self, uri: &str) {
|
||||
unsafe { ffi::gst_sdp_message_set_uri(&mut self.0, uri.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_set_uri(&mut self.0, uri.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn set_version(&mut self, version: &str) {
|
||||
unsafe { ffi::gst_sdp_message_set_version(&mut self.0, version.to_glib_none().0) };
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_set_version(&mut self.0, version.to_glib_none().0) };
|
||||
}
|
||||
|
||||
pub fn times_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_times_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_times_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn zones_len(&self) -> u32 {
|
||||
unsafe { ffi::gst_sdp_message_zones_len(&self.0) }
|
||||
unsafe { gst_sdp_sys::gst_sdp_message_zones_len(&self.0) }
|
||||
}
|
||||
|
||||
pub fn as_uri(&self, scheme: &str) -> Option<String> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_sdp_message_as_uri(
|
||||
from_glib_full(gst_sdp_sys::gst_sdp_message_as_uri(
|
||||
scheme.to_glib_none().0,
|
||||
&self.0,
|
||||
))
|
||||
|
@ -867,7 +893,7 @@ impl ToOwned for SDPMessageRef {
|
|||
fn to_owned(&self) -> SDPMessage {
|
||||
unsafe {
|
||||
let mut ptr = ptr::null_mut();
|
||||
ffi::gst_sdp_message_copy(&self.0, &mut ptr);
|
||||
gst_sdp_sys::gst_sdp_message_copy(&self.0, &mut ptr);
|
||||
from_glib_full(ptr)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
use std::ffi::CStr;
|
||||
use std::fmt;
|
||||
|
||||
use ffi;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPOrigin(pub(crate) ffi::GstSDPOrigin);
|
||||
pub struct SDPOrigin(pub(crate) gst_sdp_sys::GstSDPOrigin);
|
||||
|
||||
impl SDPOrigin {
|
||||
pub fn username(&self) -> &str {
|
||||
|
|
|
@ -11,18 +11,18 @@ use std::fmt;
|
|||
use std::mem;
|
||||
use std::os::raw::c_char;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPTime(pub(crate) ffi::GstSDPTime);
|
||||
pub struct SDPTime(pub(crate) gst_sdp_sys::GstSDPTime);
|
||||
|
||||
impl SDPTime {
|
||||
pub fn new(start: &str, stop: &str, repeat: &[&str]) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut time = mem::zeroed();
|
||||
ffi::gst_sdp_time_set(
|
||||
gst_sdp_sys::gst_sdp_time_set(
|
||||
&mut time,
|
||||
start.to_glib_none().0,
|
||||
stop.to_glib_none().0,
|
||||
|
@ -63,7 +63,7 @@ impl Clone for SDPTime {
|
|||
impl Drop for SDPTime {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_time_clear(&mut self.0);
|
||||
gst_sdp_sys::gst_sdp_time_clear(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,18 +10,18 @@ use std::ffi::CStr;
|
|||
use std::fmt;
|
||||
use std::mem;
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst_sdp_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct SDPZone(pub(crate) ffi::GstSDPZone);
|
||||
pub struct SDPZone(pub(crate) gst_sdp_sys::GstSDPZone);
|
||||
|
||||
impl SDPZone {
|
||||
pub fn new(time: &str, typed_time: &str) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut zone = mem::zeroed();
|
||||
ffi::gst_sdp_zone_set(
|
||||
gst_sdp_sys::gst_sdp_zone_set(
|
||||
&mut zone,
|
||||
time.to_glib_none().0,
|
||||
typed_time.to_glib_none().0,
|
||||
|
@ -48,7 +48,7 @@ impl Clone for SDPZone {
|
|||
impl Drop for SDPZone {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_sdp_zone_clear(&mut self.0);
|
||||
gst_sdp_sys::gst_sdp_zone_clear(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gst_ffi;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
use glib;
|
||||
use glib::translate::{from_glib_full, ToGlib, ToGlibPtr};
|
||||
|
@ -24,7 +24,7 @@ pub fn convert_sample(
|
|||
) -> Result<gst::Sample, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::gst_video_convert_sample(
|
||||
let ret = gst_video_sys::gst_video_convert_sample(
|
||||
sample.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
timeout.to_glib(),
|
||||
|
@ -73,9 +73,9 @@ unsafe fn convert_sample_async_unsafe<F>(
|
|||
F: FnOnce(Result<gst::Sample, glib::Error>) + 'static,
|
||||
{
|
||||
unsafe extern "C" fn convert_sample_async_trampoline<F>(
|
||||
sample: *mut gst_ffi::GstSample,
|
||||
error: *mut glib_ffi::GError,
|
||||
user_data: glib_ffi::gpointer,
|
||||
sample: *mut gst_sys::GstSample,
|
||||
error: *mut glib_sys::GError,
|
||||
user_data: glib_sys::gpointer,
|
||||
) where
|
||||
F: FnOnce(Result<gst::Sample, glib::Error>) + 'static,
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ unsafe fn convert_sample_async_unsafe<F>(
|
|||
callback(Err(from_glib_full(error)))
|
||||
}
|
||||
}
|
||||
unsafe extern "C" fn convert_sample_async_free<F>(user_data: glib_ffi::gpointer)
|
||||
unsafe extern "C" fn convert_sample_async_free<F>(user_data: glib_sys::gpointer)
|
||||
where
|
||||
F: FnOnce(Result<gst::Sample, glib::Error>) + 'static,
|
||||
{
|
||||
|
@ -97,12 +97,12 @@ unsafe fn convert_sample_async_unsafe<F>(
|
|||
|
||||
let user_data: Box<Option<F>> = Box::new(Some(func));
|
||||
|
||||
ffi::gst_video_convert_sample_async(
|
||||
gst_video_sys::gst_video_convert_sample_async(
|
||||
sample.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
timeout.to_glib(),
|
||||
Some(convert_sample_async_trampoline::<F>),
|
||||
Box::into_raw(user_data) as glib_ffi::gpointer,
|
||||
Box::into_raw(user_data) as glib_sys::gpointer,
|
||||
Some(mem::transmute(convert_sample_async_free::<F> as usize)),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -12,18 +12,18 @@ extern crate libc;
|
|||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
#[macro_use]
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_base_sys as gst_base_ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_video_sys as ffi;
|
||||
extern crate gstreamer_base_sys as gst_base_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
extern crate gstreamer_video_sys as gst_video_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_ffi;
|
||||
use gst_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
use glib::translate::{from_glib, from_glib_full, ToGlib};
|
||||
use glib::ToSendValue;
|
||||
|
@ -16,7 +16,11 @@ use gst::MiniObject;
|
|||
use std::mem;
|
||||
|
||||
pub fn is_force_key_unit_event(event: &gst::EventRef) -> bool {
|
||||
unsafe { from_glib(ffi::gst_video_event_is_force_key_unit(event.as_mut_ptr())) }
|
||||
unsafe {
|
||||
from_glib(gst_video_sys::gst_video_event_is_force_key_unit(
|
||||
event.as_mut_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Copy from gstreamer/src/event.rs
|
||||
|
@ -50,16 +54,16 @@ macro_rules! event_builder_generic_impl {
|
|||
unsafe {
|
||||
let event = $new_fn(&mut self);
|
||||
if let Some(seqnum) = self.seqnum {
|
||||
gst_ffi::gst_event_set_seqnum(event, seqnum.to_glib());
|
||||
gst_sys::gst_event_set_seqnum(event, seqnum.to_glib());
|
||||
}
|
||||
|
||||
if let Some(running_time_offset) = self.running_time_offset {
|
||||
gst_ffi::gst_event_set_running_time_offset(event, running_time_offset);
|
||||
gst_sys::gst_event_set_running_time_offset(event, running_time_offset);
|
||||
}
|
||||
|
||||
{
|
||||
let s = gst::StructureRef::from_glib_borrow_mut(
|
||||
gst_ffi::gst_event_writable_structure(event)
|
||||
gst_sys::gst_event_writable_structure(event)
|
||||
);
|
||||
|
||||
for (k, v) in self.other_fields {
|
||||
|
@ -132,15 +136,15 @@ impl<'a> DownstreamForceKeyUnitEventBuilder<'a> {
|
|||
Self { count, ..self }
|
||||
}
|
||||
|
||||
event_builder_generic_impl!(
|
||||
|s: &mut Self| ffi::gst_video_event_new_downstream_force_key_unit(
|
||||
event_builder_generic_impl!(|s: &mut Self| {
|
||||
gst_video_sys::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)]
|
||||
|
@ -162,14 +166,16 @@ pub fn parse_downstream_force_key_unit_event(
|
|||
let mut all_headers = mem::uninitialized();
|
||||
let mut count = mem::uninitialized();
|
||||
|
||||
let res: bool = from_glib(ffi::gst_video_event_parse_downstream_force_key_unit(
|
||||
event.as_mut_ptr(),
|
||||
&mut timestamp,
|
||||
&mut stream_time,
|
||||
&mut running_time,
|
||||
&mut all_headers,
|
||||
&mut count,
|
||||
));
|
||||
let res: bool = from_glib(
|
||||
gst_video_sys::gst_video_event_parse_downstream_force_key_unit(
|
||||
event.as_mut_ptr(),
|
||||
&mut timestamp,
|
||||
&mut stream_time,
|
||||
&mut running_time,
|
||||
&mut all_headers,
|
||||
&mut count,
|
||||
),
|
||||
);
|
||||
if res {
|
||||
Some(DownstreamForceKeyUnitEvent {
|
||||
timestamp: from_glib(timestamp),
|
||||
|
@ -228,13 +234,13 @@ impl<'a> UpstreamForceKeyUnitEventBuilder<'a> {
|
|||
Self { count, ..self }
|
||||
}
|
||||
|
||||
event_builder_generic_impl!(
|
||||
|s: &mut Self| ffi::gst_video_event_new_upstream_force_key_unit(
|
||||
event_builder_generic_impl!(|s: &mut Self| {
|
||||
gst_video_sys::gst_video_event_new_upstream_force_key_unit(
|
||||
s.running_time.to_glib(),
|
||||
s.all_headers.to_glib(),
|
||||
s.count,
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
|
@ -252,12 +258,14 @@ pub fn parse_upstream_force_key_unit_event(
|
|||
let mut all_headers = mem::uninitialized();
|
||||
let mut count = mem::uninitialized();
|
||||
|
||||
let res: bool = from_glib(ffi::gst_video_event_parse_upstream_force_key_unit(
|
||||
event.as_mut_ptr(),
|
||||
&mut running_time,
|
||||
&mut all_headers,
|
||||
&mut count,
|
||||
));
|
||||
let res: bool = from_glib(
|
||||
gst_video_sys::gst_video_event_parse_upstream_force_key_unit(
|
||||
event.as_mut_ptr(),
|
||||
&mut running_time,
|
||||
&mut all_headers,
|
||||
&mut count,
|
||||
),
|
||||
);
|
||||
if res {
|
||||
Some(UpstreamForceKeyUnitEvent {
|
||||
running_time: from_glib(running_time),
|
||||
|
@ -306,9 +314,9 @@ impl<'a> StillFrameEventBuilder<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
event_builder_generic_impl!(|s: &mut Self| ffi::gst_video_event_new_still_frame(
|
||||
s.in_still.to_glib()
|
||||
));
|
||||
event_builder_generic_impl!(
|
||||
|s: &mut Self| gst_video_sys::gst_video_event_new_still_frame(s.in_still.to_glib())
|
||||
);
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
|
@ -320,7 +328,7 @@ pub fn parse_still_frame_event(event: &gst::EventRef) -> Option<StillFrameEvent>
|
|||
unsafe {
|
||||
let mut in_still = mem::uninitialized();
|
||||
|
||||
let res: bool = from_glib(ffi::gst_video_event_parse_still_frame(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_event_parse_still_frame(
|
||||
event.as_mut_ptr(),
|
||||
&mut in_still,
|
||||
));
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_video_sys;
|
||||
|
||||
use std::ffi::CStr;
|
||||
use std::fmt;
|
||||
|
@ -49,13 +49,17 @@ impl ::VideoFormat {
|
|||
pub fn from_string(s: &str) -> ::VideoFormat {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe { from_glib(ffi::gst_video_format_from_string(s.to_glib_none().0)) }
|
||||
unsafe {
|
||||
from_glib(gst_video_sys::gst_video_format_from_string(
|
||||
s.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_fourcc(fourcc: u32) -> ::VideoFormat {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe { from_glib(ffi::gst_video_format_from_fourcc(fourcc)) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_format_from_fourcc(fourcc)) }
|
||||
}
|
||||
|
||||
pub fn from_masks(
|
||||
|
@ -70,7 +74,7 @@ impl ::VideoFormat {
|
|||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe {
|
||||
from_glib(ffi::gst_video_format_from_masks(
|
||||
from_glib(gst_video_sys::gst_video_format_from_masks(
|
||||
depth as i32,
|
||||
bpp as i32,
|
||||
endianness.to_glib(),
|
||||
|
@ -88,7 +92,7 @@ impl ::VideoFormat {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
CStr::from_ptr(ffi::gst_video_format_to_string(self.to_glib()))
|
||||
CStr::from_ptr(gst_video_sys::gst_video_format_to_string(self.to_glib()))
|
||||
.to_str()
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_video_sys;
|
||||
|
||||
use std::ffi::CStr;
|
||||
use std::fmt;
|
||||
|
@ -15,14 +15,14 @@ use std::str;
|
|||
use glib;
|
||||
use glib::translate::{from_glib, ToGlib};
|
||||
|
||||
pub struct VideoFormatInfo(&'static ffi::GstVideoFormatInfo);
|
||||
pub struct VideoFormatInfo(&'static gst_video_sys::GstVideoFormatInfo);
|
||||
|
||||
impl VideoFormatInfo {
|
||||
pub fn from_format(format: ::VideoFormat) -> VideoFormatInfo {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe {
|
||||
let info = ffi::gst_video_format_get_info(format.to_glib());
|
||||
let info = gst_video_sys::gst_video_format_get_info(format.to_glib());
|
||||
assert!(!info.is_null());
|
||||
|
||||
VideoFormatInfo(&*info)
|
||||
|
@ -106,35 +106,35 @@ impl VideoFormatInfo {
|
|||
}
|
||||
|
||||
pub fn has_alpha(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_ALPHA != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_ALPHA != 0
|
||||
}
|
||||
|
||||
pub fn has_palette(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_PALETTE != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_PALETTE != 0
|
||||
}
|
||||
|
||||
pub fn is_complex(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_COMPLEX != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_COMPLEX != 0
|
||||
}
|
||||
|
||||
pub fn is_gray(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_GRAY != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_GRAY != 0
|
||||
}
|
||||
|
||||
pub fn is_le(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_LE != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_LE != 0
|
||||
}
|
||||
|
||||
pub fn is_rgb(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_RGB != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_RGB != 0
|
||||
}
|
||||
|
||||
pub fn is_tiled(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_TILED != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_TILED != 0
|
||||
}
|
||||
|
||||
pub fn is_yuv(&self) -> bool {
|
||||
self.0.flags & ffi::GST_VIDEO_FORMAT_FLAG_YUV != 0
|
||||
self.0.flags & gst_video_sys::GST_VIDEO_FORMAT_FLAG_YUV != 0
|
||||
}
|
||||
|
||||
pub fn scale_width(&self, component: u8, width: u32) -> u32 {
|
||||
|
@ -190,26 +190,30 @@ impl From<::VideoFormat> for VideoFormatInfo {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::GlibPtrDefault for VideoFormatInfo {
|
||||
type GlibType = *mut ffi::GstVideoFormatInfo;
|
||||
type GlibType = *mut gst_video_sys::GstVideoFormatInfo;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const ffi::GstVideoFormatInfo> for VideoFormatInfo {
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const gst_video_sys::GstVideoFormatInfo>
|
||||
for VideoFormatInfo
|
||||
{
|
||||
type Storage = &'a VideoFormatInfo;
|
||||
|
||||
fn to_glib_none(&'a self) -> glib::translate::Stash<'a, *const ffi::GstVideoFormatInfo, Self> {
|
||||
fn to_glib_none(
|
||||
&'a self,
|
||||
) -> glib::translate::Stash<'a, *const gst_video_sys::GstVideoFormatInfo, Self> {
|
||||
glib::translate::Stash(self.0, self)
|
||||
}
|
||||
|
||||
fn to_glib_full(&self) -> *const ffi::GstVideoFormatInfo {
|
||||
fn to_glib_full(&self) -> *const gst_video_sys::GstVideoFormatInfo {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrNone<*mut ffi::GstVideoFormatInfo> for VideoFormatInfo {
|
||||
impl glib::translate::FromGlibPtrNone<*mut gst_video_sys::GstVideoFormatInfo> for VideoFormatInfo {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *mut ffi::GstVideoFormatInfo) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *mut gst_video_sys::GstVideoFormatInfo) -> Self {
|
||||
VideoFormatInfo(&*ptr)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use gst_ffi;
|
||||
use gst_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
use glib;
|
||||
use glib::translate::{from_glib, ToGlibPtr};
|
||||
|
@ -25,7 +25,7 @@ pub enum Writable {}
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct VideoFrame<T>(
|
||||
ffi::GstVideoFrame,
|
||||
gst_video_sys::GstVideoFrame,
|
||||
Option<gst::Buffer>,
|
||||
::VideoInfo,
|
||||
PhantomData<T>,
|
||||
|
@ -53,7 +53,7 @@ impl<T> VideoFrame<T> {
|
|||
|
||||
pub fn copy(&self, dest: &mut VideoFrame<Writable>) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
let res: bool = from_glib(ffi::gst_video_frame_copy(&mut dest.0, &self.0));
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_copy(&mut dest.0, &self.0));
|
||||
if res {
|
||||
Ok(())
|
||||
} else {
|
||||
|
@ -70,7 +70,11 @@ impl<T> VideoFrame<T> {
|
|||
skip_assert_initialized!();
|
||||
|
||||
unsafe {
|
||||
let res: bool = from_glib(ffi::gst_video_frame_copy_plane(&mut dest.0, &self.0, plane));
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_copy_plane(
|
||||
&mut dest.0,
|
||||
&self.0,
|
||||
plane,
|
||||
));
|
||||
if res {
|
||||
Ok(())
|
||||
} else {
|
||||
|
@ -162,7 +166,7 @@ impl<T> VideoFrame<T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub unsafe fn from_glib_full(frame: ffi::GstVideoFrame) -> Self {
|
||||
pub unsafe fn from_glib_full(frame: gst_video_sys::GstVideoFrame) -> Self {
|
||||
let info = ::VideoInfo(ptr::read(&frame.info));
|
||||
let buffer = gst::Buffer::from_glib_none(frame.buffer);
|
||||
VideoFrame(frame, Some(buffer), info, PhantomData)
|
||||
|
@ -172,7 +176,7 @@ impl<T> VideoFrame<T> {
|
|||
impl<T> Drop for VideoFrame<T> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_video_frame_unmap(&mut self.0);
|
||||
gst_video_sys::gst_video_frame_unmap(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,11 +190,11 @@ impl VideoFrame<Readable> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.to_glib_none().0,
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_ffi::GST_MAP_READ,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_sys::GST_MAP_READ,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -211,12 +215,12 @@ impl VideoFrame<Readable> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map_id(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.to_glib_none().0,
|
||||
id,
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_ffi::GST_MAP_READ,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_sys::GST_MAP_READ,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -234,7 +238,7 @@ impl VideoFrame<Readable> {
|
|||
VideoFrameRef(vframe, Some(self.buffer()), info, true)
|
||||
}
|
||||
|
||||
pub fn as_ptr(&self) -> *const ffi::GstVideoFrame {
|
||||
pub fn as_ptr(&self) -> *const gst_video_sys::GstVideoFrame {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
@ -248,13 +252,13 @@ impl VideoFrame<Writable> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.to_glib_none().0,
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_ffi::GST_MAP_READ
|
||||
| gst_ffi::GST_MAP_WRITE,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_sys::GST_MAP_READ
|
||||
| gst_sys::GST_MAP_WRITE,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -275,14 +279,14 @@ impl VideoFrame<Writable> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map_id(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.to_glib_none().0,
|
||||
id,
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_ffi::GST_MAP_READ
|
||||
| gst_ffi::GST_MAP_WRITE,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_sys::GST_MAP_READ
|
||||
| gst_sys::GST_MAP_WRITE,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -334,20 +338,20 @@ impl VideoFrame<Writable> {
|
|||
VideoFrameRef(vframe, Some(self.buffer_mut()), info, true)
|
||||
}
|
||||
|
||||
pub fn as_mut_ptr(&mut self) -> *mut ffi::GstVideoFrame {
|
||||
pub fn as_mut_ptr(&mut self) -> *mut gst_video_sys::GstVideoFrame {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct VideoFrameRef<T>(ffi::GstVideoFrame, Option<T>, ::VideoInfo, bool);
|
||||
pub struct VideoFrameRef<T>(gst_video_sys::GstVideoFrame, Option<T>, ::VideoInfo, bool);
|
||||
|
||||
impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
||||
pub fn as_ptr(&self) -> *const ffi::GstVideoFrame {
|
||||
pub fn as_ptr(&self) -> *const gst_video_sys::GstVideoFrame {
|
||||
&self.0
|
||||
}
|
||||
|
||||
pub unsafe fn from_glib_borrow(frame: *const ffi::GstVideoFrame) -> Self {
|
||||
pub unsafe fn from_glib_borrow(frame: *const gst_video_sys::GstVideoFrame) -> Self {
|
||||
assert!(!frame.is_null());
|
||||
|
||||
let frame = ptr::read(frame);
|
||||
|
@ -364,11 +368,11 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.as_mut_ptr(),
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_ffi::GST_MAP_READ,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_sys::GST_MAP_READ,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -389,12 +393,12 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map_id(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.as_mut_ptr(),
|
||||
id,
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_ffi::GST_MAP_READ,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF | gst_sys::GST_MAP_READ,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -423,7 +427,7 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
dest: &mut VideoFrameRef<&mut gst::BufferRef>,
|
||||
) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
let res: bool = from_glib(ffi::gst_video_frame_copy(&mut dest.0, &self.0));
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_copy(&mut dest.0, &self.0));
|
||||
if res {
|
||||
Ok(())
|
||||
} else {
|
||||
|
@ -440,7 +444,11 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
skip_assert_initialized!();
|
||||
|
||||
unsafe {
|
||||
let res: bool = from_glib(ffi::gst_video_frame_copy_plane(&mut dest.0, &self.0, plane));
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_copy_plane(
|
||||
&mut dest.0,
|
||||
&self.0,
|
||||
plane,
|
||||
));
|
||||
if res {
|
||||
Ok(())
|
||||
} else {
|
||||
|
@ -534,7 +542,7 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
}
|
||||
|
||||
impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
||||
pub unsafe fn from_glib_borrow_mut(frame: *mut ffi::GstVideoFrame) -> Self {
|
||||
pub unsafe fn from_glib_borrow_mut(frame: *mut gst_video_sys::GstVideoFrame) -> Self {
|
||||
assert!(!frame.is_null());
|
||||
|
||||
let frame = ptr::read(frame);
|
||||
|
@ -551,13 +559,13 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.as_mut_ptr(),
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_ffi::GST_MAP_READ
|
||||
| gst_ffi::GST_MAP_WRITE,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_sys::GST_MAP_READ
|
||||
| gst_sys::GST_MAP_WRITE,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -578,14 +586,14 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
|||
|
||||
unsafe {
|
||||
let mut frame = mem::zeroed();
|
||||
let res: bool = from_glib(ffi::gst_video_frame_map_id(
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
&mut frame,
|
||||
info.to_glib_none().0 as *mut _,
|
||||
buffer.as_mut_ptr(),
|
||||
id,
|
||||
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_ffi::GST_MAP_READ
|
||||
| gst_ffi::GST_MAP_WRITE,
|
||||
gst_video_sys::GST_VIDEO_FRAME_MAP_FLAG_NO_REF
|
||||
| gst_sys::GST_MAP_READ
|
||||
| gst_sys::GST_MAP_WRITE,
|
||||
));
|
||||
|
||||
if !res {
|
||||
|
@ -631,7 +639,7 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn as_mut_ptr(&mut self) -> *mut ffi::GstVideoFrame {
|
||||
pub fn as_mut_ptr(&mut self) -> *mut gst_video_sys::GstVideoFrame {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
@ -651,7 +659,7 @@ impl<T> Drop for VideoFrameRef<T> {
|
|||
fn drop(&mut self) {
|
||||
if !self.3 {
|
||||
unsafe {
|
||||
ffi::gst_video_frame_unmap(&mut self.0);
|
||||
gst_video_sys::gst_video_frame_unmap(&mut self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
use glib;
|
||||
use glib::translate::{
|
||||
|
@ -34,21 +34,21 @@ pub enum VideoColorRange {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for VideoColorRange {
|
||||
type GlibType = ffi::GstVideoColorRange;
|
||||
type GlibType = gst_video_sys::GstVideoColorRange;
|
||||
|
||||
fn to_glib(&self) -> ffi::GstVideoColorRange {
|
||||
fn to_glib(&self) -> gst_video_sys::GstVideoColorRange {
|
||||
match *self {
|
||||
VideoColorRange::Unknown => ffi::GST_VIDEO_COLOR_RANGE_UNKNOWN,
|
||||
VideoColorRange::Range0255 => ffi::GST_VIDEO_COLOR_RANGE_0_255,
|
||||
VideoColorRange::Range16235 => ffi::GST_VIDEO_COLOR_RANGE_16_235,
|
||||
VideoColorRange::Unknown => gst_video_sys::GST_VIDEO_COLOR_RANGE_UNKNOWN,
|
||||
VideoColorRange::Range0255 => gst_video_sys::GST_VIDEO_COLOR_RANGE_0_255,
|
||||
VideoColorRange::Range16235 => gst_video_sys::GST_VIDEO_COLOR_RANGE_16_235,
|
||||
VideoColorRange::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVideoColorRange> for VideoColorRange {
|
||||
fn from_glib(value: ffi::GstVideoColorRange) -> Self {
|
||||
impl FromGlib<gst_video_sys::GstVideoColorRange> for VideoColorRange {
|
||||
fn from_glib(value: gst_video_sys::GstVideoColorRange) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value as i32 {
|
||||
0 => VideoColorRange::Unknown,
|
||||
|
@ -61,7 +61,7 @@ impl FromGlib<ffi::GstVideoColorRange> for VideoColorRange {
|
|||
|
||||
impl glib::StaticType for VideoColorRange {
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_video_color_range_get_type()) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_color_range_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,17 +73,17 @@ impl<'a> glib::value::FromValueOptional<'a> for VideoColorRange {
|
|||
|
||||
impl<'a> glib::value::FromValue<'a> for VideoColorRange {
|
||||
unsafe fn from_value(value: &glib::value::Value) -> Self {
|
||||
from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::SetValue for VideoColorRange {
|
||||
unsafe fn set_value(value: &mut glib::value::Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32)
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct VideoColorimetry(ffi::GstVideoColorimetry);
|
||||
pub struct VideoColorimetry(gst_video_sys::GstVideoColorimetry);
|
||||
|
||||
impl VideoColorimetry {
|
||||
pub fn new(
|
||||
|
@ -95,7 +95,7 @@ impl VideoColorimetry {
|
|||
assert_initialized_main_thread!();
|
||||
|
||||
let colorimetry = unsafe {
|
||||
let mut colorimetry: ffi::GstVideoColorimetry = mem::zeroed();
|
||||
let mut colorimetry: gst_video_sys::GstVideoColorimetry = mem::zeroed();
|
||||
|
||||
colorimetry.range = range.to_glib();
|
||||
colorimetry.matrix = matrix.to_glib();
|
||||
|
@ -109,7 +109,7 @@ impl VideoColorimetry {
|
|||
}
|
||||
|
||||
pub fn to_string(&self) -> String {
|
||||
unsafe { from_glib_full(ffi::gst_video_colorimetry_to_string(&self.0)) }
|
||||
unsafe { from_glib_full(gst_video_sys::gst_video_colorimetry_to_string(&self.0)) }
|
||||
}
|
||||
|
||||
pub fn from_string(s: &str) -> Option<Self> {
|
||||
|
@ -117,7 +117,7 @@ impl VideoColorimetry {
|
|||
|
||||
unsafe {
|
||||
let mut colorimetry = mem::zeroed();
|
||||
let valid: bool = from_glib(ffi::gst_video_colorimetry_from_string(
|
||||
let valid: bool = from_glib(gst_video_sys::gst_video_colorimetry_from_string(
|
||||
&mut colorimetry,
|
||||
s.to_glib_none().0,
|
||||
));
|
||||
|
@ -154,7 +154,11 @@ impl Clone for VideoColorimetry {
|
|||
|
||||
impl PartialEq for VideoColorimetry {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_video_colorimetry_is_equal(&self.0, &other.0)) }
|
||||
unsafe {
|
||||
from_glib(gst_video_sys::gst_video_colorimetry_is_equal(
|
||||
&self.0, &other.0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +210,7 @@ impl ::VideoMultiviewFramePacking {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct VideoInfo(pub(crate) ffi::GstVideoInfo);
|
||||
pub struct VideoInfo(pub(crate) gst_video_sys::GstVideoInfo);
|
||||
|
||||
impl fmt::Debug for VideoInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
|
@ -263,7 +267,7 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
unsafe {
|
||||
let mut info = mem::uninitialized();
|
||||
|
||||
ffi::gst_video_info_set_format(
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
|
@ -494,7 +498,10 @@ impl VideoInfo {
|
|||
|
||||
unsafe {
|
||||
let mut info = mem::uninitialized();
|
||||
if from_glib(ffi::gst_video_info_from_caps(&mut info, caps.as_ptr())) {
|
||||
if from_glib(gst_video_sys::gst_video_info_from_caps(
|
||||
&mut info,
|
||||
caps.as_ptr(),
|
||||
)) {
|
||||
Some(VideoInfo(info))
|
||||
} else {
|
||||
None
|
||||
|
@ -503,7 +510,11 @@ impl VideoInfo {
|
|||
}
|
||||
|
||||
pub fn to_caps(&self) -> Option<gst::Caps> {
|
||||
unsafe { from_glib_full(ffi::gst_video_info_to_caps(&self.0 as *const _ as *mut _)) }
|
||||
unsafe {
|
||||
from_glib_full(gst_video_sys::gst_video_info_to_caps(
|
||||
&self.0 as *const _ as *mut _,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn format(&self) -> ::VideoFormat {
|
||||
|
@ -621,7 +632,7 @@ impl VideoInfo {
|
|||
let src_val = src_val.into();
|
||||
unsafe {
|
||||
let mut dest_val = mem::uninitialized();
|
||||
if from_glib(ffi::gst_video_info_convert(
|
||||
if from_glib(gst_video_sys::gst_video_info_convert(
|
||||
&self.0 as *const _ as *mut _,
|
||||
src_val.get_format().to_glib(),
|
||||
src_val.to_raw_value(),
|
||||
|
@ -645,7 +656,7 @@ impl VideoInfo {
|
|||
let src_val = src_val.into();
|
||||
unsafe {
|
||||
let mut dest_val = mem::uninitialized();
|
||||
if from_glib(ffi::gst_video_info_convert(
|
||||
if from_glib(gst_video_sys::gst_video_info_convert(
|
||||
&self.0 as *const _ as *mut _,
|
||||
src_val.get_format().to_glib(),
|
||||
src_val.to_raw_value(),
|
||||
|
@ -668,7 +679,7 @@ impl Clone for VideoInfo {
|
|||
|
||||
impl PartialEq for VideoInfo {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_video_info_is_equal(&self.0, &other.0)) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_info_is_equal(&self.0, &other.0)) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -679,26 +690,25 @@ unsafe impl Sync for VideoInfo {}
|
|||
|
||||
impl glib::types::StaticType for VideoInfo {
|
||||
fn static_type() -> glib::types::Type {
|
||||
unsafe { glib::translate::from_glib(ffi::gst_video_info_get_type()) }
|
||||
unsafe { glib::translate::from_glib(gst_video_sys::gst_video_info_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::value::FromValueOptional<'a> for VideoInfo {
|
||||
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
|
||||
Option::<VideoInfo>::from_glib_none(
|
||||
gobject_ffi::g_value_get_boxed(value.to_glib_none().0) as *mut ffi::GstVideoInfo
|
||||
)
|
||||
Option::<VideoInfo>::from_glib_none(gobject_sys::g_value_get_boxed(value.to_glib_none().0)
|
||||
as *mut gst_video_sys::GstVideoInfo)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::value::SetValue for VideoInfo {
|
||||
unsafe fn set_value(value: &mut glib::Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
glib::translate::ToGlibPtr::<*const ffi::GstVideoInfo>::to_glib_none(this).0
|
||||
as glib_ffi::gpointer,
|
||||
glib::translate::ToGlibPtr::<*const gst_video_sys::GstVideoInfo>::to_glib_none(this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -706,10 +716,10 @@ impl glib::value::SetValue for VideoInfo {
|
|||
#[doc(hidden)]
|
||||
impl glib::value::SetValueOptional for VideoInfo {
|
||||
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
glib::translate::ToGlibPtr::<*const ffi::GstVideoInfo>::to_glib_none(&this).0
|
||||
as glib_ffi::gpointer,
|
||||
glib::translate::ToGlibPtr::<*const gst_video_sys::GstVideoInfo>::to_glib_none(&this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -723,36 +733,38 @@ impl glib::translate::Uninitialized for VideoInfo {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::GlibPtrDefault for VideoInfo {
|
||||
type GlibType = *mut ffi::GstVideoInfo;
|
||||
type GlibType = *mut gst_video_sys::GstVideoInfo;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const ffi::GstVideoInfo> for VideoInfo {
|
||||
impl<'a> glib::translate::ToGlibPtr<'a, *const gst_video_sys::GstVideoInfo> for VideoInfo {
|
||||
type Storage = &'a VideoInfo;
|
||||
|
||||
fn to_glib_none(&'a self) -> glib::translate::Stash<'a, *const ffi::GstVideoInfo, Self> {
|
||||
fn to_glib_none(
|
||||
&'a self,
|
||||
) -> glib::translate::Stash<'a, *const gst_video_sys::GstVideoInfo, Self> {
|
||||
glib::translate::Stash(&self.0, self)
|
||||
}
|
||||
|
||||
fn to_glib_full(&self) -> *const ffi::GstVideoInfo {
|
||||
fn to_glib_full(&self) -> *const gst_video_sys::GstVideoInfo {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrNone<*mut ffi::GstVideoInfo> for VideoInfo {
|
||||
impl glib::translate::FromGlibPtrNone<*mut gst_video_sys::GstVideoInfo> for VideoInfo {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *mut ffi::GstVideoInfo) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *mut gst_video_sys::GstVideoInfo) -> Self {
|
||||
VideoInfo(ptr::read(ptr))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::translate::FromGlibPtrFull<*mut ffi::GstVideoInfo> for VideoInfo {
|
||||
impl glib::translate::FromGlibPtrFull<*mut gst_video_sys::GstVideoInfo> for VideoInfo {
|
||||
#[inline]
|
||||
unsafe fn from_glib_full(ptr: *mut ffi::GstVideoInfo) -> Self {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_video_sys::GstVideoInfo) -> Self {
|
||||
let info = from_glib_none(ptr);
|
||||
glib_ffi::g_free(ptr as *mut _);
|
||||
glib_sys::g_free(ptr as *mut _);
|
||||
info
|
||||
}
|
||||
}
|
||||
|
@ -760,13 +772,21 @@ impl glib::translate::FromGlibPtrFull<*mut ffi::GstVideoInfo> for VideoInfo {
|
|||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
impl ::VideoFieldOrder {
|
||||
pub fn to_string(self) -> String {
|
||||
unsafe { from_glib_full(ffi::gst_video_field_order_to_string(self.to_glib())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_video_sys::gst_video_field_order_to_string(
|
||||
self.to_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_string(s: &str) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe { from_glib(ffi::gst_video_field_order_from_string(s.to_glib_none().0)) }
|
||||
unsafe {
|
||||
from_glib(gst_video_sys::gst_video_field_order_from_string(
|
||||
s.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -789,14 +809,18 @@ impl fmt::Display for ::VideoFieldOrder {
|
|||
|
||||
impl ::VideoInterlaceMode {
|
||||
pub fn to_string(self) -> String {
|
||||
unsafe { from_glib_full(ffi::gst_video_interlace_mode_to_string(self.to_glib())) }
|
||||
unsafe {
|
||||
from_glib_full(gst_video_sys::gst_video_interlace_mode_to_string(
|
||||
self.to_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_string(s: &str) -> Self {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
unsafe {
|
||||
from_glib(ffi::gst_video_interlace_mode_from_string(
|
||||
from_glib(gst_video_sys::gst_video_interlace_mode_from_string(
|
||||
s.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::translate::{from_glib, ToGlib};
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_ffi;
|
||||
use gst_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct VideoMeta(ffi::GstVideoMeta);
|
||||
pub struct VideoMeta(gst_video_sys::GstVideoMeta);
|
||||
|
||||
impl VideoMeta {
|
||||
pub fn add(
|
||||
|
@ -30,7 +30,7 @@ impl VideoMeta {
|
|||
assert!(buffer.get_size() >= info.size());
|
||||
|
||||
unsafe {
|
||||
let meta = ffi::gst_buffer_add_video_meta(
|
||||
let meta = gst_video_sys::gst_buffer_add_video_meta(
|
||||
buffer.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
format.to_glib(),
|
||||
|
@ -61,7 +61,7 @@ impl VideoMeta {
|
|||
assert!(buffer.get_size() >= info.size());
|
||||
|
||||
unsafe {
|
||||
let meta = ffi::gst_buffer_add_video_meta_full(
|
||||
let meta = gst_video_sys::gst_buffer_add_video_meta_full(
|
||||
buffer.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
format.to_glib(),
|
||||
|
@ -110,10 +110,10 @@ impl VideoMeta {
|
|||
}
|
||||
|
||||
unsafe impl MetaAPI for VideoMeta {
|
||||
type GstType = ffi::GstVideoMeta;
|
||||
type GstType = gst_video_sys::GstVideoMeta;
|
||||
|
||||
fn get_meta_api() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_video_meta_api_get_type()) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_meta_api_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ impl fmt::Debug for VideoMeta {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct VideoOverlayCompositionMeta(ffi::GstVideoOverlayCompositionMeta);
|
||||
pub struct VideoOverlayCompositionMeta(gst_video_sys::GstVideoOverlayCompositionMeta);
|
||||
|
||||
impl VideoOverlayCompositionMeta {
|
||||
pub fn add<'a>(
|
||||
|
@ -141,7 +141,7 @@ impl VideoOverlayCompositionMeta {
|
|||
overlay: &::VideoOverlayComposition,
|
||||
) -> gst::MetaRefMut<'a, Self, gst::meta::Standalone> {
|
||||
unsafe {
|
||||
let meta = ffi::gst_buffer_add_video_overlay_composition_meta(
|
||||
let meta = gst_video_sys::gst_buffer_add_video_overlay_composition_meta(
|
||||
buffer.as_mut_ptr(),
|
||||
overlay.as_mut_ptr(),
|
||||
);
|
||||
|
@ -157,17 +157,17 @@ impl VideoOverlayCompositionMeta {
|
|||
pub fn set_overlay(&mut self, overlay: &::VideoOverlayComposition) {
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
gst_ffi::gst_mini_object_unref(self.0.overlay as *mut _);
|
||||
self.0.overlay = gst_ffi::gst_mini_object_ref(overlay.as_mut_ptr() as *mut _) as *mut _;
|
||||
gst_sys::gst_mini_object_unref(self.0.overlay as *mut _);
|
||||
self.0.overlay = gst_sys::gst_mini_object_ref(overlay.as_mut_ptr() as *mut _) as *mut _;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl MetaAPI for VideoOverlayCompositionMeta {
|
||||
type GstType = ffi::GstVideoOverlayCompositionMeta;
|
||||
type GstType = gst_video_sys::GstVideoOverlayCompositionMeta;
|
||||
|
||||
fn get_meta_api() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_video_overlay_composition_meta_api_get_type()) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_overlay_composition_meta_api_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_video_sys;
|
||||
use libc::uintptr_t;
|
||||
use VideoOverlay;
|
||||
|
||||
|
@ -22,18 +22,18 @@ pub trait VideoOverlayExtManual: 'static {
|
|||
|
||||
impl<O: IsA<VideoOverlay>> VideoOverlayExtManual for O {
|
||||
unsafe fn set_window_handle(&self, handle: uintptr_t) {
|
||||
ffi::gst_video_overlay_set_window_handle(self.as_ref().to_glib_none().0, handle)
|
||||
gst_video_sys::gst_video_overlay_set_window_handle(self.as_ref().to_glib_none().0, handle)
|
||||
}
|
||||
|
||||
unsafe fn got_window_handle(&self, handle: uintptr_t) {
|
||||
ffi::gst_video_overlay_got_window_handle(self.as_ref().to_glib_none().0, handle)
|
||||
gst_video_sys::gst_video_overlay_got_window_handle(self.as_ref().to_glib_none().0, handle)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_video_overlay_prepare_window_handle_message(msg: &gst::MessageRef) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_is_video_overlay_prepare_window_handle_message(
|
||||
msg.as_mut_ptr(),
|
||||
))
|
||||
from_glib(
|
||||
gst_video_sys::gst_is_video_overlay_prepare_window_handle_message(msg.as_mut_ptr()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use ffi;
|
||||
use gst;
|
||||
use gst::miniobject::*;
|
||||
use gst_video_sys;
|
||||
|
||||
use glib;
|
||||
use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib};
|
||||
|
@ -18,9 +18,9 @@ use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib};
|
|||
gst_define_mini_object_wrapper!(
|
||||
VideoOverlayRectangle,
|
||||
VideoOverlayRectangleRef,
|
||||
ffi::GstVideoOverlayRectangle,
|
||||
gst_video_sys::GstVideoOverlayRectangle,
|
||||
[Debug,],
|
||||
|| ffi::gst_video_overlay_rectangle_get_type()
|
||||
|| gst_video_sys::gst_video_overlay_rectangle_get_type()
|
||||
);
|
||||
|
||||
impl fmt::Debug for VideoOverlayRectangleRef {
|
||||
|
@ -44,7 +44,7 @@ impl VideoOverlayRectangle {
|
|||
) -> Self {
|
||||
assert!(buffer.get_meta::<::VideoMeta>().is_some());
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_video_overlay_rectangle_new_raw(
|
||||
from_glib_full(gst_video_sys::gst_video_overlay_rectangle_new_raw(
|
||||
buffer.as_mut_ptr(),
|
||||
render_x,
|
||||
render_y,
|
||||
|
@ -59,22 +59,24 @@ impl VideoOverlayRectangle {
|
|||
impl VideoOverlayRectangleRef {
|
||||
pub fn get_flags(&self) -> ::VideoOverlayFormatFlags {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_video_overlay_rectangle_get_flags(
|
||||
from_glib(gst_video_sys::gst_video_overlay_rectangle_get_flags(
|
||||
self.as_mut_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_global_alpha(&self) -> f32 {
|
||||
unsafe { ffi::gst_video_overlay_rectangle_get_global_alpha(self.as_mut_ptr()) }
|
||||
unsafe { gst_video_sys::gst_video_overlay_rectangle_get_global_alpha(self.as_mut_ptr()) }
|
||||
}
|
||||
|
||||
pub fn set_global_alpha(&mut self, alpha: f32) {
|
||||
unsafe { ffi::gst_video_overlay_rectangle_set_global_alpha(self.as_mut_ptr(), alpha) }
|
||||
unsafe {
|
||||
gst_video_sys::gst_video_overlay_rectangle_set_global_alpha(self.as_mut_ptr(), alpha)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_seqnum(&self) -> u32 {
|
||||
unsafe { ffi::gst_video_overlay_rectangle_get_seqnum(self.as_mut_ptr()) }
|
||||
unsafe { gst_video_sys::gst_video_overlay_rectangle_get_seqnum(self.as_mut_ptr()) }
|
||||
}
|
||||
|
||||
pub fn get_render_rectangle(&self) -> (i32, i32, u32, u32) {
|
||||
|
@ -84,7 +86,7 @@ impl VideoOverlayRectangleRef {
|
|||
let mut render_width = 0;
|
||||
let mut render_height = 0;
|
||||
|
||||
ffi::gst_video_overlay_rectangle_get_render_rectangle(
|
||||
gst_video_sys::gst_video_overlay_rectangle_get_render_rectangle(
|
||||
self.as_mut_ptr(),
|
||||
&mut render_x,
|
||||
&mut render_y,
|
||||
|
@ -104,7 +106,7 @@ impl VideoOverlayRectangleRef {
|
|||
render_height: u32,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_video_overlay_rectangle_set_render_rectangle(
|
||||
gst_video_sys::gst_video_overlay_rectangle_set_render_rectangle(
|
||||
self.as_mut_ptr(),
|
||||
render_x,
|
||||
render_y,
|
||||
|
@ -116,34 +118,40 @@ impl VideoOverlayRectangleRef {
|
|||
|
||||
pub fn get_pixels_unscaled_raw(&self, flags: ::VideoOverlayFormatFlags) -> gst::Buffer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_raw(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
))
|
||||
from_glib_none(
|
||||
gst_video_sys::gst_video_overlay_rectangle_get_pixels_unscaled_raw(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_pixels_unscaled_ayuv(&self, flags: ::VideoOverlayFormatFlags) -> gst::Buffer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_ayuv(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
))
|
||||
from_glib_none(
|
||||
gst_video_sys::gst_video_overlay_rectangle_get_pixels_unscaled_ayuv(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_pixels_unscaled_argb(&self, flags: ::VideoOverlayFormatFlags) -> gst::Buffer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_argb(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
))
|
||||
from_glib_none(
|
||||
gst_video_sys::gst_video_overlay_rectangle_get_pixels_unscaled_argb(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_pixels_raw(&self, flags: ::VideoOverlayFormatFlags) -> gst::Buffer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_raw(
|
||||
from_glib_none(gst_video_sys::gst_video_overlay_rectangle_get_pixels_raw(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
))
|
||||
|
@ -152,7 +160,7 @@ impl VideoOverlayRectangleRef {
|
|||
|
||||
pub fn get_pixels_ayuv(&self, flags: ::VideoOverlayFormatFlags) -> gst::Buffer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_ayuv(
|
||||
from_glib_none(gst_video_sys::gst_video_overlay_rectangle_get_pixels_ayuv(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
))
|
||||
|
@ -161,7 +169,7 @@ impl VideoOverlayRectangleRef {
|
|||
|
||||
pub fn get_pixels_argb(&self, flags: ::VideoOverlayFormatFlags) -> gst::Buffer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_argb(
|
||||
from_glib_none(gst_video_sys::gst_video_overlay_rectangle_get_pixels_argb(
|
||||
self.as_mut_ptr(),
|
||||
flags.to_glib(),
|
||||
))
|
||||
|
@ -172,9 +180,9 @@ impl VideoOverlayRectangleRef {
|
|||
gst_define_mini_object_wrapper!(
|
||||
VideoOverlayComposition,
|
||||
VideoOverlayCompositionRef,
|
||||
ffi::GstVideoOverlayComposition,
|
||||
gst_video_sys::GstVideoOverlayComposition,
|
||||
[Debug,],
|
||||
|| ffi::gst_video_overlay_composition_get_type()
|
||||
|| gst_video_sys::gst_video_overlay_composition_get_type()
|
||||
);
|
||||
|
||||
impl fmt::Debug for VideoOverlayCompositionRef {
|
||||
|
@ -193,11 +201,12 @@ impl VideoOverlayComposition {
|
|||
Some(first) => first,
|
||||
};
|
||||
|
||||
let composition =
|
||||
Self::from_glib_full(ffi::gst_video_overlay_composition_new(first.as_mut_ptr()));
|
||||
let composition = Self::from_glib_full(
|
||||
gst_video_sys::gst_video_overlay_composition_new(first.as_mut_ptr()),
|
||||
);
|
||||
|
||||
for rect in iter {
|
||||
ffi::gst_video_overlay_composition_add_rectangle(
|
||||
gst_video_sys::gst_video_overlay_composition_add_rectangle(
|
||||
composition.as_mut_ptr(),
|
||||
rect.as_mut_ptr(),
|
||||
);
|
||||
|
@ -210,7 +219,7 @@ impl VideoOverlayComposition {
|
|||
|
||||
impl VideoOverlayCompositionRef {
|
||||
pub fn n_rectangles(&self) -> u32 {
|
||||
unsafe { ffi::gst_video_overlay_composition_n_rectangles(self.as_mut_ptr()) }
|
||||
unsafe { gst_video_sys::gst_video_overlay_composition_n_rectangles(self.as_mut_ptr()) }
|
||||
}
|
||||
|
||||
pub fn get_rectangle(&self, idx: u32) -> Option<VideoOverlayRectangle> {
|
||||
|
@ -219,7 +228,7 @@ impl VideoOverlayCompositionRef {
|
|||
}
|
||||
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_video_overlay_composition_get_rectangle(
|
||||
from_glib_none(gst_video_sys::gst_video_overlay_composition_get_rectangle(
|
||||
self.as_mut_ptr(),
|
||||
idx,
|
||||
))
|
||||
|
@ -227,7 +236,7 @@ impl VideoOverlayCompositionRef {
|
|||
}
|
||||
|
||||
pub fn get_seqnum(&self) -> u32 {
|
||||
unsafe { ffi::gst_video_overlay_composition_get_seqnum(self.as_mut_ptr()) }
|
||||
unsafe { gst_video_sys::gst_video_overlay_composition_get_seqnum(self.as_mut_ptr()) }
|
||||
}
|
||||
|
||||
pub fn blend(
|
||||
|
@ -236,7 +245,10 @@ impl VideoOverlayCompositionRef {
|
|||
) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
ffi::gst_video_overlay_composition_blend(self.as_mut_ptr(), frame.as_mut_ptr()),
|
||||
gst_video_sys::gst_video_overlay_composition_blend(
|
||||
self.as_mut_ptr(),
|
||||
frame.as_mut_ptr()
|
||||
),
|
||||
"Failed to blend overlay composition",
|
||||
)
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::ToGlib;
|
||||
use gst_video_sys;
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
||||
pub struct VideoRectangle {
|
||||
|
@ -28,26 +28,26 @@ pub fn center_video_rectangle(
|
|||
dst: &VideoRectangle,
|
||||
scale: bool,
|
||||
) -> VideoRectangle {
|
||||
let mut result = ffi::GstVideoRectangle {
|
||||
let mut result = gst_video_sys::GstVideoRectangle {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 0,
|
||||
h: 0,
|
||||
};
|
||||
let src_rect = ffi::GstVideoRectangle {
|
||||
let src_rect = gst_video_sys::GstVideoRectangle {
|
||||
x: src.x,
|
||||
y: src.y,
|
||||
w: src.w,
|
||||
h: src.h,
|
||||
};
|
||||
let dst_rect = ffi::GstVideoRectangle {
|
||||
let dst_rect = gst_video_sys::GstVideoRectangle {
|
||||
x: dst.x,
|
||||
y: dst.y,
|
||||
w: dst.w,
|
||||
h: dst.h,
|
||||
};
|
||||
unsafe {
|
||||
ffi::gst_video_sink_center_rect(src_rect, dst_rect, &mut result, scale.to_glib());
|
||||
gst_video_sys::gst_video_sink_center_rect(src_rect, dst_rect, &mut result, scale.to_glib());
|
||||
}
|
||||
VideoRectangle::new(result.x, result.y, result.w, result.h)
|
||||
}
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::prelude::*;
|
||||
use glib::translate::*;
|
||||
use glib::value;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_video_sys;
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
|
@ -26,15 +26,15 @@ use VideoTimeCodeFlags;
|
|||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
use VideoTimeCodeInterval;
|
||||
|
||||
pub struct VideoTimeCode(ffi::GstVideoTimeCode);
|
||||
pub struct ValidVideoTimeCode(ffi::GstVideoTimeCode);
|
||||
pub struct VideoTimeCode(gst_video_sys::GstVideoTimeCode);
|
||||
pub struct ValidVideoTimeCode(gst_video_sys::GstVideoTimeCode);
|
||||
|
||||
impl VideoTimeCode {
|
||||
pub fn new_empty() -> VideoTimeCode {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut v = mem::zeroed();
|
||||
ffi::gst_video_time_code_clear(&mut v);
|
||||
gst_video_sys::gst_video_time_code_clear(&mut v);
|
||||
VideoTimeCode(v)
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ impl VideoTimeCode {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut v = mem::zeroed();
|
||||
ffi::gst_video_time_code_init(
|
||||
gst_video_sys::gst_video_time_code_init(
|
||||
&mut v,
|
||||
*fps.numer() as u32,
|
||||
*fps.denom() as u32,
|
||||
|
@ -81,7 +81,7 @@ impl VideoTimeCode {
|
|||
// assert!(fps_d > 0);
|
||||
// unsafe {
|
||||
// let mut v = mem::zeroed();
|
||||
// let res = ffi::gst_video_time_code_init_from_date_time_full(
|
||||
// let res = gst_video_sys::gst_video_time_code_init_from_date_time_full(
|
||||
// &mut v,
|
||||
// *fps.numer() as u32,
|
||||
// *fps.denom() as u32,
|
||||
|
@ -90,7 +90,7 @@ impl VideoTimeCode {
|
|||
// field_count,
|
||||
// );
|
||||
//
|
||||
// if res == glib_ffi::GFALSE {
|
||||
// if res == glib_sys::GFALSE {
|
||||
// None
|
||||
// } else {
|
||||
// Some(VideoTimeCode(v))
|
||||
|
@ -102,14 +102,18 @@ impl VideoTimeCode {
|
|||
pub fn from_string(tc_str: &str) -> Option<VideoTimeCode> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_video_time_code_new_from_string(
|
||||
from_glib_full(gst_video_sys::gst_video_time_code_new_from_string(
|
||||
tc_str.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_valid(&self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_video_time_code_is_valid(self.to_glib_none().0)) }
|
||||
unsafe {
|
||||
from_glib(gst_video_sys::gst_video_time_code_is_valid(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_fps(&mut self, fps: gst::Fraction) {
|
||||
|
@ -191,14 +195,14 @@ impl ValidVideoTimeCode {
|
|||
|
||||
pub fn add_frames(&mut self, frames: i64) {
|
||||
unsafe {
|
||||
ffi::gst_video_time_code_add_frames(self.to_glib_none_mut().0, frames);
|
||||
gst_video_sys::gst_video_time_code_add_frames(self.to_glib_none_mut().0, frames);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
pub fn add_interval(&self, tc_inter: &VideoTimeCodeInterval) -> Option<VideoTimeCode> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_video_time_code_add_interval(
|
||||
from_glib_full(gst_video_sys::gst_video_time_code_add_interval(
|
||||
self.to_glib_none().0,
|
||||
tc_inter.to_glib_none().0,
|
||||
))
|
||||
|
@ -206,25 +210,31 @@ impl ValidVideoTimeCode {
|
|||
}
|
||||
|
||||
fn compare(&self, tc2: &ValidVideoTimeCode) -> i32 {
|
||||
unsafe { ffi::gst_video_time_code_compare(self.to_glib_none().0, tc2.to_glib_none().0) }
|
||||
unsafe {
|
||||
gst_video_sys::gst_video_time_code_compare(self.to_glib_none().0, tc2.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn frames_since_daily_jam(&self) -> u64 {
|
||||
unsafe { ffi::gst_video_time_code_frames_since_daily_jam(self.to_glib_none().0) }
|
||||
unsafe { gst_video_sys::gst_video_time_code_frames_since_daily_jam(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn increment_frame(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_video_time_code_increment_frame(self.to_glib_none_mut().0);
|
||||
gst_video_sys::gst_video_time_code_increment_frame(self.to_glib_none_mut().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn nsec_since_daily_jam(&self) -> u64 {
|
||||
unsafe { ffi::gst_video_time_code_nsec_since_daily_jam(self.to_glib_none().0) }
|
||||
unsafe { gst_video_sys::gst_video_time_code_nsec_since_daily_jam(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn to_date_time(&self) -> Option<glib::DateTime> {
|
||||
unsafe { from_glib_full(ffi::gst_video_time_code_to_date_time(self.to_glib_none().0)) }
|
||||
unsafe {
|
||||
from_glib_full(gst_video_sys::gst_video_time_code_to_date_time(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +242,11 @@ macro_rules! generic_impl {
|
|||
($name:ident) => {
|
||||
impl $name {
|
||||
pub fn to_string(&self) -> String {
|
||||
unsafe { from_glib_full(ffi::gst_video_time_code_to_string(self.to_glib_none().0)) }
|
||||
unsafe {
|
||||
from_glib_full(gst_video_sys::gst_video_time_code_to_string(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_hours(&self) -> u32 {
|
||||
|
@ -270,7 +284,7 @@ macro_rules! generic_impl {
|
|||
pub fn set_latest_daily_jam(&mut self, latest_daily_jam: Option<&glib::DateTime>) {
|
||||
unsafe {
|
||||
if !self.0.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_unref(self.0.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_unref(self.0.config.latest_daily_jam);
|
||||
}
|
||||
|
||||
self.0.config.latest_daily_jam = latest_daily_jam.to_glib_full()
|
||||
|
@ -283,7 +297,7 @@ macro_rules! generic_impl {
|
|||
unsafe {
|
||||
let v = self.0;
|
||||
if !v.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_ref(v.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_ref(v.config.latest_daily_jam);
|
||||
}
|
||||
|
||||
$name(v)
|
||||
|
@ -295,7 +309,7 @@ macro_rules! generic_impl {
|
|||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
if !self.0.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_unref(self.0.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_unref(self.0.config.latest_daily_jam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,43 +342,45 @@ macro_rules! generic_impl {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl GlibPtrDefault for $name {
|
||||
type GlibType = *mut ffi::GstVideoTimeCode;
|
||||
type GlibType = *mut gst_video_sys::GstVideoTimeCode;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> ToGlibPtr<'a, *const ffi::GstVideoTimeCode> for $name {
|
||||
impl<'a> ToGlibPtr<'a, *const gst_video_sys::GstVideoTimeCode> for $name {
|
||||
type Storage = &'a Self;
|
||||
|
||||
#[inline]
|
||||
fn to_glib_none(&'a self) -> Stash<'a, *const ffi::GstVideoTimeCode, Self> {
|
||||
fn to_glib_none(&'a self) -> Stash<'a, *const gst_video_sys::GstVideoTimeCode, Self> {
|
||||
Stash(&self.0 as *const _, self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn to_glib_full(&self) -> *const ffi::GstVideoTimeCode {
|
||||
unsafe { ffi::gst_video_time_code_copy(&self.0 as *const _) }
|
||||
fn to_glib_full(&self) -> *const gst_video_sys::GstVideoTimeCode {
|
||||
unsafe { gst_video_sys::gst_video_time_code_copy(&self.0 as *const _) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> ToGlibPtrMut<'a, *mut ffi::GstVideoTimeCode> for $name {
|
||||
impl<'a> ToGlibPtrMut<'a, *mut gst_video_sys::GstVideoTimeCode> for $name {
|
||||
type Storage = &'a mut Self;
|
||||
|
||||
#[inline]
|
||||
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ffi::GstVideoTimeCode, Self> {
|
||||
fn to_glib_none_mut(
|
||||
&'a mut self,
|
||||
) -> StashMut<'a, *mut gst_video_sys::GstVideoTimeCode, Self> {
|
||||
let ptr = &mut self.0 as *mut _;
|
||||
StashMut(ptr, self)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrNone<*mut ffi::GstVideoTimeCode> for $name {
|
||||
impl FromGlibPtrNone<*mut gst_video_sys::GstVideoTimeCode> for $name {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *mut ffi::GstVideoTimeCode) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *mut gst_video_sys::GstVideoTimeCode) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
let v = ptr::read(ptr);
|
||||
if !v.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_ref(v.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_ref(v.config.latest_daily_jam);
|
||||
}
|
||||
|
||||
$name(v)
|
||||
|
@ -372,13 +388,13 @@ macro_rules! generic_impl {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrNone<*const ffi::GstVideoTimeCode> for $name {
|
||||
impl FromGlibPtrNone<*const gst_video_sys::GstVideoTimeCode> for $name {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *const ffi::GstVideoTimeCode) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *const gst_video_sys::GstVideoTimeCode) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
let v = ptr::read(ptr);
|
||||
if !v.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_ref(v.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_ref(v.config.latest_daily_jam);
|
||||
}
|
||||
|
||||
$name(v)
|
||||
|
@ -386,28 +402,28 @@ macro_rules! generic_impl {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrFull<*mut ffi::GstVideoTimeCode> for $name {
|
||||
impl FromGlibPtrFull<*mut gst_video_sys::GstVideoTimeCode> for $name {
|
||||
#[inline]
|
||||
unsafe fn from_glib_full(ptr: *mut ffi::GstVideoTimeCode) -> Self {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_video_sys::GstVideoTimeCode) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
let v = ptr::read(ptr);
|
||||
if !v.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_ref(v.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_ref(v.config.latest_daily_jam);
|
||||
}
|
||||
ffi::gst_video_time_code_free(ptr);
|
||||
gst_video_sys::gst_video_time_code_free(ptr);
|
||||
|
||||
$name(v)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrBorrow<*mut ffi::GstVideoTimeCode> for $name {
|
||||
impl FromGlibPtrBorrow<*mut gst_video_sys::GstVideoTimeCode> for $name {
|
||||
#[inline]
|
||||
unsafe fn from_glib_borrow(ptr: *mut ffi::GstVideoTimeCode) -> Self {
|
||||
unsafe fn from_glib_borrow(ptr: *mut gst_video_sys::GstVideoTimeCode) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
let v = ptr::read(ptr);
|
||||
if !v.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_ref(v.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_ref(v.config.latest_daily_jam);
|
||||
}
|
||||
|
||||
$name(v)
|
||||
|
@ -416,26 +432,26 @@ macro_rules! generic_impl {
|
|||
|
||||
impl StaticType for $name {
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_video_time_code_get_type()) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_time_code_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> value::FromValueOptional<'a> for $name {
|
||||
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
|
||||
Option::<$name>::from_glib_none(gobject_ffi::g_value_get_boxed(
|
||||
Option::<$name>::from_glib_none(gobject_sys::g_value_get_boxed(
|
||||
value.to_glib_none().0,
|
||||
) as *mut ffi::GstVideoTimeCode)
|
||||
) as *mut gst_video_sys::GstVideoTimeCode)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl value::SetValue for $name {
|
||||
unsafe fn set_value(value: &mut glib::Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
ToGlibPtr::<*const ffi::GstVideoTimeCode>::to_glib_none(this).0
|
||||
as glib_ffi::gpointer,
|
||||
ToGlibPtr::<*const gst_video_sys::GstVideoTimeCode>::to_glib_none(this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -443,10 +459,10 @@ macro_rules! generic_impl {
|
|||
#[doc(hidden)]
|
||||
impl value::SetValueOptional for $name {
|
||||
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
ToGlibPtr::<*const ffi::GstVideoTimeCode>::to_glib_none(&this).0
|
||||
as glib_ffi::gpointer,
|
||||
ToGlibPtr::<*const gst_video_sys::GstVideoTimeCode>::to_glib_none(&this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -496,7 +512,7 @@ impl From<ValidVideoTimeCode> for VideoTimeCode {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct VideoTimeCodeMeta(ffi::GstVideoTimeCodeMeta);
|
||||
pub struct VideoTimeCodeMeta(gst_video_sys::GstVideoTimeCodeMeta);
|
||||
|
||||
impl VideoTimeCodeMeta {
|
||||
pub fn add<'a>(
|
||||
|
@ -504,7 +520,7 @@ impl VideoTimeCodeMeta {
|
|||
tc: &ValidVideoTimeCode,
|
||||
) -> gst::MetaRefMut<'a, Self, gst::meta::Standalone> {
|
||||
unsafe {
|
||||
let meta = ffi::gst_buffer_add_video_time_code_meta(
|
||||
let meta = gst_video_sys::gst_buffer_add_video_time_code_meta(
|
||||
buffer.as_mut_ptr(),
|
||||
tc.to_glib_none().0 as *mut _,
|
||||
);
|
||||
|
@ -520,20 +536,20 @@ impl VideoTimeCodeMeta {
|
|||
pub fn set_tc(&mut self, tc: ValidVideoTimeCode) {
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
ffi::gst_video_time_code_clear(&mut self.0.tc);
|
||||
gst_video_sys::gst_video_time_code_clear(&mut self.0.tc);
|
||||
self.0.tc = tc.0;
|
||||
if !self.0.tc.config.latest_daily_jam.is_null() {
|
||||
glib_ffi::g_date_time_ref(self.0.tc.config.latest_daily_jam);
|
||||
glib_sys::g_date_time_ref(self.0.tc.config.latest_daily_jam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl MetaAPI for VideoTimeCodeMeta {
|
||||
type GstType = ffi::GstVideoTimeCodeMeta;
|
||||
type GstType = gst_video_sys::GstVideoTimeCodeMeta;
|
||||
|
||||
fn get_meta_api() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_video_time_code_meta_api_get_type()) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_time_code_meta_api_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,26 +6,26 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::prelude::*;
|
||||
use glib::translate::*;
|
||||
use glib::value;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_video_sys;
|
||||
use std::cmp;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct VideoTimeCodeInterval(ffi::GstVideoTimeCodeInterval);
|
||||
pub struct VideoTimeCodeInterval(gst_video_sys::GstVideoTimeCodeInterval);
|
||||
|
||||
impl VideoTimeCodeInterval {
|
||||
pub fn from_string(tc_inter_str: &str) -> Option<Self> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_video_time_code_interval_new_from_string(
|
||||
from_glib_full(gst_video_sys::gst_video_time_code_interval_new_from_string(
|
||||
tc_inter_str.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -35,7 +35,9 @@ impl VideoTimeCodeInterval {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut v = mem::zeroed();
|
||||
ffi::gst_video_time_code_interval_init(&mut v, hours, minutes, seconds, frames);
|
||||
gst_video_sys::gst_video_time_code_interval_init(
|
||||
&mut v, hours, minutes, seconds, frames,
|
||||
);
|
||||
VideoTimeCodeInterval(v)
|
||||
}
|
||||
}
|
||||
|
@ -131,69 +133,71 @@ impl fmt::Display for VideoTimeCodeInterval {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl GlibPtrDefault for VideoTimeCodeInterval {
|
||||
type GlibType = *mut ffi::GstVideoTimeCodeInterval;
|
||||
type GlibType = *mut gst_video_sys::GstVideoTimeCodeInterval;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> ToGlibPtr<'a, *const ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
impl<'a> ToGlibPtr<'a, *const gst_video_sys::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
type Storage = &'a Self;
|
||||
|
||||
#[inline]
|
||||
fn to_glib_none(&'a self) -> Stash<'a, *const ffi::GstVideoTimeCodeInterval, Self> {
|
||||
fn to_glib_none(&'a self) -> Stash<'a, *const gst_video_sys::GstVideoTimeCodeInterval, Self> {
|
||||
Stash(&self.0 as *const _, self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn to_glib_full(&self) -> *const ffi::GstVideoTimeCodeInterval {
|
||||
unsafe { ffi::gst_video_time_code_interval_copy(&self.0 as *const _) }
|
||||
fn to_glib_full(&self) -> *const gst_video_sys::GstVideoTimeCodeInterval {
|
||||
unsafe { gst_video_sys::gst_video_time_code_interval_copy(&self.0 as *const _) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> ToGlibPtrMut<'a, *mut ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
impl<'a> ToGlibPtrMut<'a, *mut gst_video_sys::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
type Storage = &'a mut Self;
|
||||
|
||||
#[inline]
|
||||
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ffi::GstVideoTimeCodeInterval, Self> {
|
||||
fn to_glib_none_mut(
|
||||
&'a mut self,
|
||||
) -> StashMut<'a, *mut gst_video_sys::GstVideoTimeCodeInterval, Self> {
|
||||
let ptr = &mut self.0 as *mut _;
|
||||
StashMut(ptr, self)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrNone<*mut ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
impl FromGlibPtrNone<*mut gst_video_sys::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *mut ffi::GstVideoTimeCodeInterval) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *mut gst_video_sys::GstVideoTimeCodeInterval) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
VideoTimeCodeInterval(ptr::read(ptr))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrNone<*const ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
impl FromGlibPtrNone<*const gst_video_sys::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
#[inline]
|
||||
unsafe fn from_glib_none(ptr: *const ffi::GstVideoTimeCodeInterval) -> Self {
|
||||
unsafe fn from_glib_none(ptr: *const gst_video_sys::GstVideoTimeCodeInterval) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
VideoTimeCodeInterval(ptr::read(ptr))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrFull<*mut ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
impl FromGlibPtrFull<*mut gst_video_sys::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
#[inline]
|
||||
unsafe fn from_glib_full(ptr: *mut ffi::GstVideoTimeCodeInterval) -> Self {
|
||||
unsafe fn from_glib_full(ptr: *mut gst_video_sys::GstVideoTimeCodeInterval) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
let res = VideoTimeCodeInterval(ptr::read(ptr));
|
||||
ffi::gst_video_time_code_interval_free(ptr);
|
||||
gst_video_sys::gst_video_time_code_interval_free(ptr);
|
||||
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrBorrow<*mut ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
impl FromGlibPtrBorrow<*mut gst_video_sys::GstVideoTimeCodeInterval> for VideoTimeCodeInterval {
|
||||
#[inline]
|
||||
unsafe fn from_glib_borrow(ptr: *mut ffi::GstVideoTimeCodeInterval) -> Self {
|
||||
unsafe fn from_glib_borrow(ptr: *mut gst_video_sys::GstVideoTimeCodeInterval) -> Self {
|
||||
assert!(!ptr.is_null());
|
||||
VideoTimeCodeInterval(ptr::read(ptr))
|
||||
}
|
||||
|
@ -201,27 +205,27 @@ impl FromGlibPtrBorrow<*mut ffi::GstVideoTimeCodeInterval> for VideoTimeCodeInte
|
|||
|
||||
impl StaticType for VideoTimeCodeInterval {
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_video_time_code_interval_get_type()) }
|
||||
unsafe { from_glib(gst_video_sys::gst_video_time_code_interval_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl<'a> value::FromValueOptional<'a> for VideoTimeCodeInterval {
|
||||
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
|
||||
Option::<VideoTimeCodeInterval>::from_glib_full(gobject_ffi::g_value_dup_boxed(
|
||||
Option::<VideoTimeCodeInterval>::from_glib_full(gobject_sys::g_value_dup_boxed(
|
||||
value.to_glib_none().0,
|
||||
)
|
||||
as *mut ffi::GstVideoTimeCodeInterval)
|
||||
as *mut gst_video_sys::GstVideoTimeCodeInterval)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl value::SetValue for VideoTimeCodeInterval {
|
||||
unsafe fn set_value(value: &mut glib::Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
ToGlibPtr::<*const ffi::GstVideoTimeCodeInterval>::to_glib_none(this).0
|
||||
as glib_ffi::gpointer,
|
||||
ToGlibPtr::<*const gst_video_sys::GstVideoTimeCodeInterval>::to_glib_none(this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -229,10 +233,10 @@ impl value::SetValue for VideoTimeCodeInterval {
|
|||
#[doc(hidden)]
|
||||
impl value::SetValueOptional for VideoTimeCodeInterval {
|
||||
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
|
||||
gobject_ffi::g_value_set_boxed(
|
||||
gobject_sys::g_value_set_boxed(
|
||||
value.to_glib_none_mut().0,
|
||||
ToGlibPtr::<*const ffi::GstVideoTimeCodeInterval>::to_glib_none(&this).0
|
||||
as glib_ffi::gpointer,
|
||||
ToGlibPtr::<*const gst_video_sys::GstVideoTimeCodeInterval>::to_glib_none(&this).0
|
||||
as glib_sys::gpointer,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use gst_web_rtc_sys;
|
||||
use glib::translate::*;
|
||||
|
||||
|
|
|
@ -10,16 +10,16 @@ extern crate libc;
|
|||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_sdp as gst_sdp;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
extern crate gstreamer_webrtc_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
extern crate gstreamer_webrtc_sys as gst_web_rtc_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue