mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
Update manual code and configuration for 1.16
This commit is contained in:
parent
bf1fb86d56
commit
5c32a0d1d3
8 changed files with 134 additions and 0 deletions
|
@ -1297,6 +1297,11 @@ status = "generate"
|
|||
# wrong array annotations
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
pattern = "clear_.*"
|
||||
# C memory management
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "debug_bin_to_dot_data"
|
||||
[object.function.return]
|
||||
|
|
|
@ -143,6 +143,11 @@ version = "1.14"
|
|||
name = "latency"
|
||||
version = "1.14"
|
||||
|
||||
[[object.property]]
|
||||
name = "min-upstream-latency"
|
||||
# clock time instead of u64
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstBase.AggregatorPad"
|
||||
status = "generate"
|
||||
|
|
|
@ -293,6 +293,10 @@ final_type = true
|
|||
# correct mutability
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "yinvert"
|
||||
version = "1.16"
|
||||
|
||||
[[object]]
|
||||
name = "GstGL.GLSLStage"
|
||||
status = "generate"
|
||||
|
|
|
@ -86,6 +86,10 @@ final_type = true
|
|||
name = "timeout"
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "use-cache"
|
||||
version = "1.16"
|
||||
|
||||
[[object]]
|
||||
name = "GstPbutils.DiscovererInfo"
|
||||
status = "generate"
|
||||
|
|
|
@ -173,6 +173,9 @@ final_type = true
|
|||
name = "warning"
|
||||
concurrency = "send"
|
||||
|
||||
[[object.property]]
|
||||
name = "subtitle-video-offset"
|
||||
version = "1.16"
|
||||
|
||||
[[object]]
|
||||
name = "GstPlayer.PlayerStreamInfo"
|
||||
|
|
|
@ -6,14 +6,35 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use glib::prelude::*;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use glib::signal::{connect_raw, SignalHandlerId};
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use glib::Value;
|
||||
use gst;
|
||||
use gst_base_sys;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use std::boxed::Box as Box_;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use std::mem::transmute;
|
||||
use Aggregator;
|
||||
|
||||
pub trait AggregatorExtManual: 'static {
|
||||
fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn get_property_min_upstream_latency(&self) -> gst::ClockTime;
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime);
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn connect_property_min_upstream_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Aggregator>> AggregatorExtManual for O {
|
||||
|
@ -26,4 +47,58 @@ impl<O: IsA<Aggregator>> AggregatorExtManual for O {
|
|||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn get_property_min_upstream_latency(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::ClockTime as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
b"min-upstream-latency\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
b"min-upstream-latency\0".as_ptr() as *const _,
|
||||
Value::from(&min_upstream_latency).to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn connect_property_min_upstream_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::min-upstream-latency\0".as_ptr() as *const _,
|
||||
Some(transmute(
|
||||
notify_min_upstream_latency_trampoline::<Self, F> as usize,
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
unsafe extern "C" fn notify_min_upstream_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_base_sys::GstAggregator,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<Aggregator>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&Aggregator::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
|
|
|
@ -73,4 +73,25 @@ impl TestClock {
|
|||
from_glib_full(id)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn timed_wait_for_multiple_pending_ids(
|
||||
&self,
|
||||
count: u32,
|
||||
timeout_ms: u32,
|
||||
) -> (bool, Vec<gst::ClockId>) {
|
||||
unsafe {
|
||||
let mut pending_list = ptr::null_mut();
|
||||
let res = gst_check_sys::gst_test_clock_timed_wait_for_multiple_pending_ids(
|
||||
self.to_glib_none().0,
|
||||
count,
|
||||
timeout_ms,
|
||||
&mut pending_list,
|
||||
);
|
||||
(
|
||||
from_glib(res),
|
||||
FromGlibPtrContainer::from_glib_full(pending_list),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
use glib;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use glib::prelude::*;
|
||||
use glib::translate::*;
|
||||
use glib::IsA;
|
||||
use glib_sys::{gboolean, gpointer};
|
||||
|
@ -109,6 +111,21 @@ impl ClockId {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn get_clock(&self) -> Option<Clock> {
|
||||
unsafe { from_glib_full(gst_sys::gst_clock_id_get_clock(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn id_uses_clock<P: IsA<Clock>>(&self, clock: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_id_uses_clock(
|
||||
self.to_glib_none().0,
|
||||
clock.as_ref().as_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for ClockId {}
|
||||
|
|
Loading…
Reference in a new issue