gstreamer/
control_source.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{prelude::*, translate::*};
4
5use crate::{ClockTime, ControlSource};
6
7pub trait ControlSourceExtManual: IsA<ControlSource> + 'static {
8    #[doc(alias = "get_value_array")]
9    #[doc(alias = "gst_control_source_get_value_array")]
10    fn value_array(
11        &self,
12        timestamp: ClockTime,
13        interval: ClockTime,
14        values: &mut [f64],
15    ) -> Result<(), glib::error::BoolError> {
16        let n_values = values.len() as u32;
17        unsafe {
18            glib::result_from_gboolean!(
19                crate::ffi::gst_control_source_get_value_array(
20                    self.as_ref().to_glib_none().0,
21                    timestamp.into_glib(),
22                    interval.into_glib(),
23                    n_values,
24                    values.to_glib_none().0,
25                ),
26                "Failed to get value array"
27            )
28        }
29    }
30}
31
32impl<O: IsA<ControlSource>> ControlSourceExtManual for O {}