gstreamer_net/auto/
ntp_clock.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ffi, NetClientClock};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "GstNtpClock")]
11    pub struct NtpClock(Object<ffi::GstNtpClock, ffi::GstNtpClockClass>) @extends NetClientClock, gst::Clock, gst::Object;
12
13    match fn {
14        type_ => || ffi::gst_ntp_clock_get_type(),
15    }
16}
17
18impl NtpClock {
19    #[doc(alias = "gst_ntp_clock_new")]
20    pub fn new(
21        name: Option<&str>,
22        remote_address: &str,
23        remote_port: i32,
24        base_time: impl Into<Option<gst::ClockTime>>,
25    ) -> NtpClock {
26        assert_initialized_main_thread!();
27        unsafe {
28            gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(
29                name.to_glib_none().0,
30                remote_address.to_glib_none().0,
31                remote_port,
32                base_time.into().into_glib(),
33            ))
34            .unsafe_cast()
35        }
36    }
37}
38
39unsafe impl Send for NtpClock {}
40unsafe impl Sync for NtpClock {}