Files
gstreamer
gstreamer_app
gstreamer_audio
gstreamer_base
gstreamer_check
gstreamer_controller
gstreamer_editing_services
gstreamer_gl
gstreamer_gl_egl
gstreamer_gl_wayland
gstreamer_gl_x11
gstreamer_net
gstreamer_pbutils
gstreamer_player
gstreamer_rtp
gstreamer_rtsp
gstreamer_rtsp_server
gstreamer_sdp
gstreamer_video
gstreamer_webrtc
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::translate::*;

glib::wrapper! {
    /// An internal structure for value+time and various temporary
    /// values used for interpolation. This "inherits" from
    /// GstTimedValue.
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct ControlPoint(Boxed<ffi::GstControlPoint>);

    match fn {
        copy => |ptr| ffi::gst_control_point_copy(mut_override(ptr)),
        free => |ptr| ffi::gst_control_point_free(ptr),
        type_ => || ffi::gst_control_point_get_type(),
    }
}

impl ControlPoint {
    pub fn timestamp(&self) -> gst::ClockTime {
        unsafe {
            let ptr = self.to_glib_none().0;
            from_glib((*ptr).timestamp)
        }
    }

    pub fn value(&self) -> f64 {
        unsafe {
            let ptr = self.to_glib_none().0;
            (*ptr).value
        }
    }
}

unsafe impl Send for ControlPoint {}
unsafe impl Sync for ControlPoint {}