gstreamer-rs/gstreamer/src/control_source.rs

41 lines
1.2 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::ControlSource;
2021-04-26 12:15:53 +00:00
use glib::prelude::*;
2020-06-09 01:06:49 +00:00
use glib::translate::*;
pub trait ControlSourceExtManual: 'static {
#[doc(alias = "get_value_array")]
#[doc(alias = "gst_control_source_get_value_array")]
2021-04-20 10:23:24 +00:00
fn value_array(
2020-06-09 01:06:49 +00:00
&self,
timestamp: ClockTime,
interval: ClockTime,
values: &mut [f64],
) -> Result<(), glib::error::BoolError>;
}
impl<O: IsA<ControlSource>> ControlSourceExtManual for O {
2021-04-20 10:23:24 +00:00
fn value_array(
2020-06-09 01:06:49 +00:00
&self,
timestamp: ClockTime,
interval: ClockTime,
values: &mut [f64],
) -> Result<(), glib::error::BoolError> {
let n_values = values.len() as u32;
unsafe {
glib::result_from_gboolean!(
ffi::gst_control_source_get_value_array(
2020-06-09 01:06:49 +00:00
self.as_ref().to_glib_none().0,
timestamp.into_glib(),
interval.into_glib(),
2020-06-09 01:06:49 +00:00
n_values,
values.to_glib_none().0,
),
"Failed to get value array"
)
}
}
}