Commit 50505d19 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Update gstreamer-net

parent 99d4fe09
......@@ -37,9 +37,8 @@ trait = false
[[object.function]]
name = "new"
[[object.function.parameter]]
name = "name"
nullable = true
# Floating reference handling
ignore = true
[[object]]
name = "GstNet.PtpClock"
......@@ -48,9 +47,8 @@ trait = false
[[object.function]]
name = "new"
[[object.function.parameter]]
name = "name"
nullable = true
# Floating reference handling
ignore = true
[[object]]
name = "GstNet.NetClientClock"
......@@ -59,9 +57,8 @@ trait = false
[[object.function]]
name = "new"
[[object.function.parameter]]
name = "name"
nullable = true
# Floating reference handling
ignore = true
[[object]]
name = "GstNet.NetTimeProvider"
......
......@@ -27,6 +27,7 @@ optional = true
[features]
v1_10 = ["gstreamer-sys/v1_10", "gstreamer-net-sys/v1_10"]
v1_12 = ["gstreamer-sys/v1_12", "gstreamer-net-sys/v1_12", "v1_10"]
v1_14 = ["gstreamer-sys/v1_14", "gstreamer-net-sys/v1_14", "v1_12"]
embed-lgpl-docs = ["rustdoc-stripper"]
purge-lgpl-docs = ["rustdoc-stripper"]
dox = ["gstreamer-net-sys/dox", "glib/dox", "gstreamer/dox"]
......
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
......
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
......
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
......
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
......@@ -30,15 +29,6 @@ glib_wrapper! {
}
impl NetClientClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NetClientClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
unsafe {
gst::Clock::from_glib_none(ffi::gst_net_client_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
}
pub fn get_property_address(&self) -> Option<String> {
unsafe {
let mut value = Value::from_type(<String as StaticType>::static_type());
......@@ -111,6 +101,20 @@ impl NetClientClock {
}
}
pub fn get_property_qos_dscp(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "qos-dscp".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
pub fn set_property_qos_dscp(&self, qos_dscp: i32) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "qos-dscp".to_glib_none().0, Value::from(&qos_dscp).to_glib_none().0);
}
}
pub fn get_property_round_trip_limit(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
......@@ -173,6 +177,14 @@ impl NetClientClock {
}
}
pub fn connect_property_qos_dscp_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::qos-dscp",
transmute(notify_qos_dscp_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
pub fn connect_property_round_trip_limit_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
......@@ -221,6 +233,12 @@ unsafe extern "C" fn notify_port_trampoline(this: *mut ffi::GstNetClientClock, _
f(&from_glib_borrow(this))
}
unsafe extern "C" fn notify_qos_dscp_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
callback_guard!();
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
f(&from_glib_borrow(this))
}
unsafe extern "C" fn notify_round_trip_limit_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
callback_guard!();
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
......
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
......@@ -34,7 +34,7 @@ impl NetTimeProvider {
let address = address.into();
let address = address.to_glib_none();
unsafe {
from_glib_none(ffi::gst_net_time_provider_new(clock.to_glib_none().0, address.0, port))
from_glib_full(ffi::gst_net_time_provider_new(clock.to_glib_none().0, address.0, port))
}
}
......@@ -76,6 +76,20 @@ impl NetTimeProvider {
}
}
pub fn get_property_qos_dscp(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "qos-dscp".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
pub fn set_property_qos_dscp(&self, qos_dscp: i32) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "qos-dscp".to_glib_none().0, Value::from(&qos_dscp).to_glib_none().0);
}
}
pub fn connect_property_active_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&NetTimeProvider) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
......@@ -107,6 +121,14 @@ impl NetTimeProvider {
transmute(notify_port_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
pub fn connect_property_qos_dscp_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&NetTimeProvider) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::qos-dscp",
transmute(notify_qos_dscp_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
}
unsafe impl Send for NetTimeProvider {}
......@@ -135,3 +157,9 @@ unsafe extern "C" fn notify_port_trampoline(this: *mut ffi::GstNetTimeProvider,
let f: &&(Fn(&NetTimeProvider) + Send + Sync + 'static) = transmute(f);
f(&from_glib_borrow(this))
}
unsafe extern "C" fn notify_qos_dscp_trampoline(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
callback_guard!();
let f: &&(Fn(&NetTimeProvider) + Send + Sync + 'static) = transmute(f);
f(&from_glib_borrow(this))
}
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
use NetClientClock;
use ffi;
use glib::object::Downcast;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
......@@ -25,16 +24,7 @@ glib_wrapper! {
}
}
impl NtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NtpClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
unsafe {
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
}
}
impl NtpClock {}
unsafe impl Send for NtpClock {}
unsafe impl Sync for NtpClock {}
// This file was generated by gir (https://github.com/gtk-rs/gir @ fbb95f4)
// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
......@@ -30,15 +29,6 @@ glib_wrapper! {
}
impl PtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, domain: u32) -> PtpClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
unsafe {
gst::Clock::from_glib_none(ffi::gst_ptp_clock_new(name.0, domain)).downcast_unchecked()
}
}
pub fn get_property_domain(&self) -> u32 {
unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type());
......
......@@ -37,6 +37,9 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
mod auto;
pub use auto::*;
mod net_client_clock;
mod ntp_clock;
mod ptp_clock;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts
......
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use NetClientClock;
use gst;
use glib::translate::*;
impl NetClientClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NetClientClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
gst::Clock::from_glib_full(ffi::gst_net_client_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
gst::Clock::from_glib_none(ffi::gst_net_client_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
}
}
}
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use NtpClock;
use gst;
use glib::translate::*;
impl NtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NtpClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
}
}
}
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use PtpClock;
use gst;
use glib::translate::*;
impl PtpClock {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> PtpClock {
assert_initialized_main_thread!();
let name = name.into();
let name = name.to_glib_none();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
unsafe {
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
unsafe {
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment