mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
Run everything through rustfmt again
This commit is contained in:
parent
159429dd95
commit
8bdd24a840
3 changed files with 36 additions and 12 deletions
|
@ -68,7 +68,10 @@ impl AppSrcCallbacksBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn seek_data<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(self, seek_data: F) -> Self {
|
pub fn seek_data<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(
|
||||||
|
self,
|
||||||
|
seek_data: F,
|
||||||
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
seek_data: Some(Box::new(seek_data)),
|
seek_data: Some(Box::new(seek_data)),
|
||||||
..self
|
..self
|
||||||
|
@ -85,9 +88,21 @@ impl AppSrcCallbacksBuilder {
|
||||||
enough_data: self.enough_data,
|
enough_data: self.enough_data,
|
||||||
seek_data: self.seek_data,
|
seek_data: self.seek_data,
|
||||||
callbacks: ffi::GstAppSrcCallbacks {
|
callbacks: ffi::GstAppSrcCallbacks {
|
||||||
need_data: if have_need_data { Some(trampoline_need_data) } else { None },
|
need_data: if have_need_data {
|
||||||
enough_data: if have_enough_data { Some(trampoline_enough_data) } else { None },
|
Some(trampoline_need_data)
|
||||||
seek_data: if have_seek_data { Some(trampoline_seek_data) } else { None },
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
|
enough_data: if have_enough_data {
|
||||||
|
Some(trampoline_enough_data)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
|
seek_data: if have_seek_data {
|
||||||
|
Some(trampoline_seek_data)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
_gst_reserved: [
|
_gst_reserved: [
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
|
@ -107,14 +122,20 @@ unsafe extern "C" fn trampoline_need_data(
|
||||||
let _guard = CallbackGuard::new();
|
let _guard = CallbackGuard::new();
|
||||||
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
||||||
|
|
||||||
callbacks.need_data.as_ref().map(|f| f(&from_glib_borrow(appsrc), length));
|
callbacks
|
||||||
|
.need_data
|
||||||
|
.as_ref()
|
||||||
|
.map(|f| f(&from_glib_borrow(appsrc), length));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn trampoline_enough_data(appsrc: *mut ffi::GstAppSrc, callbacks: gpointer) {
|
unsafe extern "C" fn trampoline_enough_data(appsrc: *mut ffi::GstAppSrc, callbacks: gpointer) {
|
||||||
let _guard = CallbackGuard::new();
|
let _guard = CallbackGuard::new();
|
||||||
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
||||||
|
|
||||||
callbacks.enough_data.as_ref().map(|f| f(&from_glib_borrow(appsrc)));
|
callbacks
|
||||||
|
.enough_data
|
||||||
|
.as_ref()
|
||||||
|
.map(|f| f(&from_glib_borrow(appsrc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn trampoline_seek_data(
|
unsafe extern "C" fn trampoline_seek_data(
|
||||||
|
@ -125,7 +146,12 @@ unsafe extern "C" fn trampoline_seek_data(
|
||||||
let _guard = CallbackGuard::new();
|
let _guard = CallbackGuard::new();
|
||||||
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
let callbacks = &*(callbacks as *const AppSrcCallbacks);
|
||||||
|
|
||||||
callbacks.seek_data.as_ref().map(|f| f(&from_glib_borrow(appsrc), offset)).unwrap_or(false).to_glib()
|
callbacks
|
||||||
|
.seek_data
|
||||||
|
.as_ref()
|
||||||
|
.map(|f| f(&from_glib_borrow(appsrc), offset))
|
||||||
|
.unwrap_or(false)
|
||||||
|
.to_glib()
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn destroy_callbacks(ptr: gpointer) {
|
unsafe extern "C" fn destroy_callbacks(ptr: gpointer) {
|
||||||
|
|
|
@ -145,9 +145,7 @@ impl AudioInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_caps(&self) -> Option<gst::Caps> {
|
pub fn to_caps(&self) -> Option<gst::Caps> {
|
||||||
unsafe {
|
unsafe { from_glib_full(ffi::gst_audio_info_to_caps(&self.0)) }
|
||||||
from_glib_full(ffi::gst_audio_info_to_caps(&self.0))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn convert<V: Into<gst::GenericFormattedValue>, U: gst::SpecificFormattedValue>(
|
pub fn convert<V: Into<gst::GenericFormattedValue>, U: gst::SpecificFormattedValue>(
|
||||||
|
|
|
@ -10,10 +10,10 @@ extern crate libc;
|
||||||
|
|
||||||
extern crate glib_sys as glib_ffi;
|
extern crate glib_sys as glib_ffi;
|
||||||
extern crate gobject_sys as gobject_ffi;
|
extern crate gobject_sys as gobject_ffi;
|
||||||
extern crate gstreamer_sys as gst_ffi;
|
|
||||||
extern crate gstreamer as gst;
|
extern crate gstreamer as gst;
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
extern crate gstreamer_player_sys as ffi;
|
extern crate gstreamer_player_sys as ffi;
|
||||||
|
extern crate gstreamer_sys as gst_ffi;
|
||||||
|
extern crate gstreamer_video as gst_video;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate glib;
|
extern crate glib;
|
||||||
|
|
Loading…
Reference in a new issue