gstreamer-rs/gstreamer/src/control_binding.rs

39 lines
1.1 KiB
Rust
Raw Normal View History

2020-12-15 10:53:31 +00:00
// Take a look at the license at the top of the repository in the LICENSE file.
2020-06-09 01:06:49 +00:00
use crate::ClockTime;
use crate::ControlBinding;
2020-06-09 01:06:49 +00:00
use glib::object::IsA;
use glib::translate::*;
pub trait ControlBindingExtManual: 'static {
fn get_g_value_array(
&self,
timestamp: ClockTime,
interval: ClockTime,
values: &mut [glib::Value],
) -> Result<(), glib::error::BoolError>;
}
impl<O: IsA<ControlBinding>> ControlBindingExtManual for O {
fn get_g_value_array(
&self,
timestamp: ClockTime,
interval: ClockTime,
values: &mut [glib::Value],
) -> Result<(), glib::error::BoolError> {
let n_values = values.len() as u32;
unsafe {
glib::result_from_gboolean!(
ffi::gst_control_binding_get_g_value_array(
2020-06-09 01:06:49 +00:00
self.as_ref().to_glib_none().0,
timestamp.to_glib(),
interval.to_glib(),
n_values,
values.as_mut_ptr() as *mut glib::gobject_ffi::GValue,
2020-06-09 01:06:49 +00:00
),
"Failed to get value array"
)
}
}
}