From 4864a1e089c0a6a58305f3d48dbfcb211f8dabea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 15 Mar 2018 10:46:49 +0200 Subject: [PATCH] Fix build --- Gir_Gst.toml | 9 ++++++ gstreamer-audio/src/audio_info.rs | 2 +- gstreamer-audio/src/audio_stream_align.rs | 7 +++-- gstreamer-audio/src/lib.rs | 1 + gstreamer-net/src/net_client_clock.rs | 1 + gstreamer-net/src/ntp_clock.rs | 1 + gstreamer-net/src/ptp_clock.rs | 1 + .../src/r_t_s_p_media_factory.rs | 5 +++- gstreamer/src/auto/functions.rs | 8 ------ gstreamer/src/bus.rs | 2 ++ gstreamer/src/lib.rs | 2 ++ gstreamer/src/pad_template.rs | 28 +++++++++++++++++++ 12 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 gstreamer/src/pad_template.rs diff --git a/Gir_Gst.toml b/Gir_Gst.toml index c52497787..fc0de464b 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -644,6 +644,10 @@ status = "generate" name = "Gst.PadTemplate" status = "generate" trait = false + [[object.function]] + name = "new_from_static_pad_template_with_gtype" + # static pad template manual + ignore = true [[object]] name = "Gst.GhostPad" @@ -1054,6 +1058,11 @@ status = "generate" # newtype wrapper ignore = true + [[object.function]] + name = "protection_filter_systems_by_available_decryptors" + # wrong array annotations + ignore = true + [[object.function]] name = "debug_bin_to_dot_data" [object.function.return] diff --git a/gstreamer-audio/src/audio_info.rs b/gstreamer-audio/src/audio_info.rs index 9af9da232..6a03a80ac 100644 --- a/gstreamer-audio/src/audio_info.rs +++ b/gstreamer-audio/src/audio_info.rs @@ -75,7 +75,7 @@ impl<'a> AudioInfoBuilder<'a> { self.format.to_glib(), self.rate as i32, self.channels as i32, - positions_ptr, + positions_ptr as *mut _, ); if info.finfo.is_null() || info.rate <= 0 || info.channels <= 0 { diff --git a/gstreamer-audio/src/audio_stream_align.rs b/gstreamer-audio/src/audio_stream_align.rs index 69a2030c6..3307c5d23 100644 --- a/gstreamer-audio/src/audio_stream_align.rs +++ b/gstreamer-audio/src/audio_stream_align.rs @@ -7,9 +7,12 @@ // except according to those terms. use ffi; - use AudioStreamAlign; +use gst; +use glib::translate::*; +use std::mem; + impl AudioStreamAlign { #[cfg(any(feature = "v1_14", feature = "dox"))] pub fn process(&mut self, discont: bool, timestamp: gst::ClockTime, n_samples: u32) -> (bool, gst::ClockTime, gst::ClockTime, u64) { @@ -18,7 +21,7 @@ impl AudioStreamAlign { let mut out_duration = mem::uninitialized(); let mut out_sample_position = mem::uninitialized(); let ret = from_glib(ffi::gst_audio_stream_align_process(self.to_glib_none_mut().0, discont.to_glib(), timestamp.to_glib(), n_samples, &mut out_timestamp, &mut out_duration, &mut out_sample_position)); - (from_glib(ret), from_glib(out_timestamp), from_glib(out_duration), out_sample_position)) + (ret, from_glib(out_timestamp), from_glib(out_duration), out_sample_position) } } } diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index 41a5170d0..37eb54972 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -54,6 +54,7 @@ mod audio_info; pub use audio_info::*; mod audio_channel_position; pub use audio_channel_position::*; +#[cfg(any(feature = "v1_14", feature = "dox"))] mod audio_stream_align; use glib::translate::{from_glib_full, ToGlibPtr}; diff --git a/gstreamer-net/src/net_client_clock.rs b/gstreamer-net/src/net_client_clock.rs index 2423311ed..5ab56560e 100644 --- a/gstreamer-net/src/net_client_clock.rs +++ b/gstreamer-net/src/net_client_clock.rs @@ -10,6 +10,7 @@ use ffi; use NetClientClock; use gst; +use glib::object::Downcast; use glib::translate::*; impl NetClientClock { diff --git a/gstreamer-net/src/ntp_clock.rs b/gstreamer-net/src/ntp_clock.rs index 1bc0b78d9..9094ff940 100644 --- a/gstreamer-net/src/ntp_clock.rs +++ b/gstreamer-net/src/ntp_clock.rs @@ -10,6 +10,7 @@ use ffi; use NtpClock; use gst; +use glib::object::Downcast; use glib::translate::*; impl NtpClock { diff --git a/gstreamer-net/src/ptp_clock.rs b/gstreamer-net/src/ptp_clock.rs index 804636c88..1c25b8604 100644 --- a/gstreamer-net/src/ptp_clock.rs +++ b/gstreamer-net/src/ptp_clock.rs @@ -10,6 +10,7 @@ use ffi; use PtpClock; use gst; +use glib::object::Downcast; use glib::translate::*; impl PtpClock { diff --git a/gstreamer-rtsp-server/src/r_t_s_p_media_factory.rs b/gstreamer-rtsp-server/src/r_t_s_p_media_factory.rs index e0a1b62a8..ff09dd79a 100644 --- a/gstreamer-rtsp-server/src/r_t_s_p_media_factory.rs +++ b/gstreamer-rtsp-server/src/r_t_s_p_media_factory.rs @@ -8,8 +8,11 @@ use RTSPMediaFactory; -use glib::translate::*; +use glib::IsA; +#[cfg(any(feature = "v1_14", feature = "dox"))] use gst; +#[cfg(any(feature = "v1_14", feature = "dox"))] +use ffi; pub trait RTSPMediaFactoryExtManual { #[cfg(any(feature = "v1_14", feature = "dox"))] diff --git a/gstreamer/src/auto/functions.rs b/gstreamer/src/auto/functions.rs index efc8baa7c..1bb1d55a1 100644 --- a/gstreamer/src/auto/functions.rs +++ b/gstreamer/src/auto/functions.rs @@ -176,14 +176,6 @@ pub fn parse_launchv(argv: &[&str]) -> Result { } } -#[cfg(any(feature = "v1_14", feature = "dox"))] -pub fn protection_filter_systems_by_available_decryptors(system_identifiers: &str) -> Vec { - assert_initialized_main_thread!(); - unsafe { - FromGlibPtrContainer::from_glib_full(ffi::gst_protection_filter_systems_by_available_decryptors(system_identifiers.to_glib_none().0)) - } -} - pub fn update_registry() -> bool { assert_initialized_main_thread!(); unsafe { diff --git a/gstreamer/src/bus.rs b/gstreamer/src/bus.rs index 0ed6b7414..c1ba19fc6 100644 --- a/gstreamer/src/bus.rs +++ b/gstreamer/src/bus.rs @@ -15,6 +15,8 @@ use glib::source::{CallbackGuard, Continue, Priority, SourceId}; use glib_ffi; use glib_ffi::{gboolean, gpointer}; use std::ptr; +#[cfg(any(feature = "v1_14", feature = "dox"))] +use std::mem; #[cfg(any(all(unix, feature = "v1_14"), feature = "dox"))] use std::os::unix; diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 65c9ed6d7..a2d2d22d8 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -153,6 +153,8 @@ pub use clock::{ClockExtManual, ClockId}; mod buffer_pool; pub use buffer_pool::*; +mod pad_template; + pub mod functions; pub use functions::*; diff --git a/gstreamer/src/pad_template.rs b/gstreamer/src/pad_template.rs new file mode 100644 index 000000000..2fdccdefb --- /dev/null +++ b/gstreamer/src/pad_template.rs @@ -0,0 +1,28 @@ +// Copyright (C) 2018 Sebastian Dröge +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use PadTemplate; +#[cfg(any(feature = "v1_14", feature = "dox"))] +use StaticPadTemplate; +#[cfg(any(feature = "v1_14", feature = "dox"))] +use glib::translate::*; + +#[cfg(any(feature = "v1_14", feature = "dox"))] +use ffi; +#[cfg(any(feature = "v1_14", feature = "dox"))] +use glib; + +impl PadTemplate { + #[cfg(any(feature = "v1_14", feature = "dox"))] + pub fn new_from_static_pad_template_with_gtype(pad_template: &StaticPadTemplate, pad_type: glib::types::Type) -> PadTemplate { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::gst_pad_template_new_from_static_pad_template_with_gtype(mut_override(pad_template.to_glib_none().0), pad_type.to_glib())) + } + } +}