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