From 0b1dd5ecfcbb963f669c9baa92f388254e779445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 22 Nov 2020 12:29:02 +0200 Subject: [PATCH] gstreamer-player: Regenerate --- gstreamer-player/src/auto/enums.rs | 86 ++-- gstreamer-player/src/auto/player.rs | 371 ++++++++---------- .../src/auto/player_audio_info.rs | 22 +- .../player_gmain_context_signal_dispatcher.rs | 15 +- .../src/auto/player_media_info.rs | 99 ++--- .../src/auto/player_signal_dispatcher.rs | 7 +- .../src/auto/player_stream_info.rs | 45 +-- .../src/auto/player_subtitle_info.rs | 14 +- .../src/auto/player_video_info.rs | 17 +- .../player_video_overlay_video_renderer.rs | 46 +-- .../src/auto/player_video_renderer.rs | 7 +- .../src/auto/player_visualization.rs | 11 +- gstreamer-player/src/auto/versions.txt | 4 +- 13 files changed, 313 insertions(+), 431 deletions(-) diff --git a/gstreamer-player/src/auto/enums.rs b/gstreamer-player/src/auto/enums.rs index e24286bf3..d0063aa0c 100644 --- a/gstreamer-player/src/auto/enums.rs +++ b/gstreamer-player/src/auto/enums.rs @@ -11,8 +11,6 @@ use glib::value::Value; use glib::Quark; use glib::StaticType; use glib::Type; -use gobject_sys; -use gst_player_sys; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] @@ -27,26 +25,22 @@ pub enum PlayerColorBalanceType { #[doc(hidden)] impl ToGlib for PlayerColorBalanceType { - type GlibType = gst_player_sys::GstPlayerColorBalanceType; + type GlibType = ffi::GstPlayerColorBalanceType; - fn to_glib(&self) -> gst_player_sys::GstPlayerColorBalanceType { + fn to_glib(&self) -> ffi::GstPlayerColorBalanceType { match *self { - PlayerColorBalanceType::Hue => gst_player_sys::GST_PLAYER_COLOR_BALANCE_HUE, - PlayerColorBalanceType::Brightness => { - gst_player_sys::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS - } - PlayerColorBalanceType::Saturation => { - gst_player_sys::GST_PLAYER_COLOR_BALANCE_SATURATION - } - PlayerColorBalanceType::Contrast => gst_player_sys::GST_PLAYER_COLOR_BALANCE_CONTRAST, + PlayerColorBalanceType::Hue => ffi::GST_PLAYER_COLOR_BALANCE_HUE, + PlayerColorBalanceType::Brightness => ffi::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS, + PlayerColorBalanceType::Saturation => ffi::GST_PLAYER_COLOR_BALANCE_SATURATION, + PlayerColorBalanceType::Contrast => ffi::GST_PLAYER_COLOR_BALANCE_CONTRAST, PlayerColorBalanceType::__Unknown(value) => value, } } } #[doc(hidden)] -impl FromGlib for PlayerColorBalanceType { - fn from_glib(value: gst_player_sys::GstPlayerColorBalanceType) -> Self { +impl FromGlib for PlayerColorBalanceType { + fn from_glib(value: ffi::GstPlayerColorBalanceType) -> Self { skip_assert_initialized!(); match value { 3 => PlayerColorBalanceType::Hue, @@ -60,7 +54,7 @@ impl FromGlib for PlayerColorBalanceT impl StaticType for PlayerColorBalanceType { fn static_type() -> Type { - unsafe { from_glib(gst_player_sys::gst_player_color_balance_type_get_type()) } + unsafe { from_glib(ffi::gst_player_color_balance_type_get_type()) } } } @@ -72,13 +66,13 @@ impl<'a> FromValueOptional<'a> for PlayerColorBalanceType { impl<'a> FromValue<'a> for PlayerColorBalanceType { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for PlayerColorBalanceType { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } @@ -92,19 +86,19 @@ pub enum PlayerError { #[doc(hidden)] impl ToGlib for PlayerError { - type GlibType = gst_player_sys::GstPlayerError; + type GlibType = ffi::GstPlayerError; - fn to_glib(&self) -> gst_player_sys::GstPlayerError { + fn to_glib(&self) -> ffi::GstPlayerError { match *self { - PlayerError::Failed => gst_player_sys::GST_PLAYER_ERROR_FAILED, + PlayerError::Failed => ffi::GST_PLAYER_ERROR_FAILED, PlayerError::__Unknown(value) => value, } } } #[doc(hidden)] -impl FromGlib for PlayerError { - fn from_glib(value: gst_player_sys::GstPlayerError) -> Self { +impl FromGlib for PlayerError { + fn from_glib(value: ffi::GstPlayerError) -> Self { skip_assert_initialized!(); match value { 0 => PlayerError::Failed, @@ -117,7 +111,7 @@ impl ErrorDomain for PlayerError { fn domain() -> Quark { skip_assert_initialized!(); - unsafe { from_glib(gst_player_sys::gst_player_error_quark()) } + unsafe { from_glib(ffi::gst_player_error_quark()) } } fn code(self) -> i32 { @@ -135,7 +129,7 @@ impl ErrorDomain for PlayerError { impl StaticType for PlayerError { fn static_type() -> Type { - unsafe { from_glib(gst_player_sys::gst_player_error_get_type()) } + unsafe { from_glib(ffi::gst_player_error_get_type()) } } } @@ -147,13 +141,13 @@ impl<'a> FromValueOptional<'a> for PlayerError { impl<'a> FromValue<'a> for PlayerError { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for PlayerError { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } @@ -171,23 +165,23 @@ pub enum PlayerSnapshotFormat { #[doc(hidden)] impl ToGlib for PlayerSnapshotFormat { - type GlibType = gst_player_sys::GstPlayerSnapshotFormat; + type GlibType = ffi::GstPlayerSnapshotFormat; - fn to_glib(&self) -> gst_player_sys::GstPlayerSnapshotFormat { + fn to_glib(&self) -> ffi::GstPlayerSnapshotFormat { match *self { - PlayerSnapshotFormat::RawNative => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_NATIVE, - PlayerSnapshotFormat::RawXrgb => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_xRGB, - PlayerSnapshotFormat::RawBgrx => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_BGRx, - PlayerSnapshotFormat::Jpg => gst_player_sys::GST_PLAYER_THUMBNAIL_JPG, - PlayerSnapshotFormat::Png => gst_player_sys::GST_PLAYER_THUMBNAIL_PNG, + PlayerSnapshotFormat::RawNative => ffi::GST_PLAYER_THUMBNAIL_RAW_NATIVE, + PlayerSnapshotFormat::RawXrgb => ffi::GST_PLAYER_THUMBNAIL_RAW_xRGB, + PlayerSnapshotFormat::RawBgrx => ffi::GST_PLAYER_THUMBNAIL_RAW_BGRx, + PlayerSnapshotFormat::Jpg => ffi::GST_PLAYER_THUMBNAIL_JPG, + PlayerSnapshotFormat::Png => ffi::GST_PLAYER_THUMBNAIL_PNG, PlayerSnapshotFormat::__Unknown(value) => value, } } } #[doc(hidden)] -impl FromGlib for PlayerSnapshotFormat { - fn from_glib(value: gst_player_sys::GstPlayerSnapshotFormat) -> Self { +impl FromGlib for PlayerSnapshotFormat { + fn from_glib(value: ffi::GstPlayerSnapshotFormat) -> Self { skip_assert_initialized!(); match value { 0 => PlayerSnapshotFormat::RawNative, @@ -213,22 +207,22 @@ pub enum PlayerState { #[doc(hidden)] impl ToGlib for PlayerState { - type GlibType = gst_player_sys::GstPlayerState; + type GlibType = ffi::GstPlayerState; - fn to_glib(&self) -> gst_player_sys::GstPlayerState { + fn to_glib(&self) -> ffi::GstPlayerState { match *self { - PlayerState::Stopped => gst_player_sys::GST_PLAYER_STATE_STOPPED, - PlayerState::Buffering => gst_player_sys::GST_PLAYER_STATE_BUFFERING, - PlayerState::Paused => gst_player_sys::GST_PLAYER_STATE_PAUSED, - PlayerState::Playing => gst_player_sys::GST_PLAYER_STATE_PLAYING, + PlayerState::Stopped => ffi::GST_PLAYER_STATE_STOPPED, + PlayerState::Buffering => ffi::GST_PLAYER_STATE_BUFFERING, + PlayerState::Paused => ffi::GST_PLAYER_STATE_PAUSED, + PlayerState::Playing => ffi::GST_PLAYER_STATE_PLAYING, PlayerState::__Unknown(value) => value, } } } #[doc(hidden)] -impl FromGlib for PlayerState { - fn from_glib(value: gst_player_sys::GstPlayerState) -> Self { +impl FromGlib for PlayerState { + fn from_glib(value: ffi::GstPlayerState) -> Self { skip_assert_initialized!(); match value { 0 => PlayerState::Stopped, @@ -242,7 +236,7 @@ impl FromGlib for PlayerState { impl StaticType for PlayerState { fn static_type() -> Type { - unsafe { from_glib(gst_player_sys::gst_player_state_get_type()) } + unsafe { from_glib(ffi::gst_player_state_get_type()) } } } @@ -254,12 +248,12 @@ impl<'a> FromValueOptional<'a> for PlayerState { impl<'a> FromValue<'a> for PlayerState { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for PlayerState { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } diff --git a/gstreamer-player/src/auto/player.rs b/gstreamer-player/src/auto/player.rs index d1738a053..9873ff939 100644 --- a/gstreamer-player/src/auto/player.rs +++ b/gstreamer-player/src/auto/player.rs @@ -2,53 +2,43 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use glib; +use crate::PlayerAudioInfo; +use crate::PlayerColorBalanceType; +use crate::PlayerMediaInfo; +use crate::PlayerSnapshotFormat; +use crate::PlayerState; +use crate::PlayerSubtitleInfo; +use crate::PlayerVideoInfo; +use crate::PlayerVisualization; use glib::object::ObjectType as ObjectType_; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; -use glib::GString; use glib::StaticType; use glib::Value; -use glib_sys; -use gobject_sys; -use gst; -use gst_player_sys; -use gst_video; -use libc; use std::boxed::Box as Box_; use std::mem::transmute; -use PlayerAudioInfo; -use PlayerColorBalanceType; -use PlayerMediaInfo; -use PlayerSnapshotFormat; -use PlayerState; -use PlayerSubtitleInfo; -use PlayerVideoInfo; -use PlayerVisualization; -glib_wrapper! { - pub struct Player(Object) @extends gst::Object; +glib::glib_wrapper! { + pub struct Player(Object) @extends gst::Object; match fn { - get_type => || gst_player_sys::gst_player_get_type(), + get_type => || ffi::gst_player_get_type(), } } impl Player { pub fn get_audio_video_offset(&self) -> i64 { - unsafe { gst_player_sys::gst_player_get_audio_video_offset(self.to_glib_none().0) } + unsafe { ffi::gst_player_get_audio_video_offset(self.to_glib_none().0) } } pub fn get_color_balance(&self, type_: PlayerColorBalanceType) -> f64 { - unsafe { - gst_player_sys::gst_player_get_color_balance(self.to_glib_none().0, type_.to_glib()) - } + unsafe { ffi::gst_player_get_color_balance(self.to_glib_none().0, type_.to_glib()) } } pub fn get_current_audio_track(&self) -> Option { unsafe { - from_glib_full(gst_player_sys::gst_player_get_current_audio_track( + from_glib_full(ffi::gst_player_get_current_audio_track( self.to_glib_none().0, )) } @@ -56,7 +46,7 @@ impl Player { pub fn get_current_subtitle_track(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_get_current_subtitle_track( + from_glib_none(ffi::gst_player_get_current_subtitle_track( self.to_glib_none().0, )) } @@ -64,92 +54,64 @@ impl Player { pub fn get_current_video_track(&self) -> Option { unsafe { - from_glib_full(gst_player_sys::gst_player_get_current_video_track( + from_glib_full(ffi::gst_player_get_current_video_track( self.to_glib_none().0, )) } } - pub fn get_current_visualization(&self) -> Option { + pub fn get_current_visualization(&self) -> Option { unsafe { - from_glib_full(gst_player_sys::gst_player_get_current_visualization( + from_glib_full(ffi::gst_player_get_current_visualization( self.to_glib_none().0, )) } } pub fn get_duration(&self) -> gst::ClockTime { - unsafe { - from_glib(gst_player_sys::gst_player_get_duration( - self.to_glib_none().0, - )) - } + unsafe { from_glib(ffi::gst_player_get_duration(self.to_glib_none().0)) } } pub fn get_media_info(&self) -> Option { - unsafe { - from_glib_full(gst_player_sys::gst_player_get_media_info( - self.to_glib_none().0, - )) - } + unsafe { from_glib_full(ffi::gst_player_get_media_info(self.to_glib_none().0)) } } pub fn get_multiview_flags(&self) -> gst_video::VideoMultiviewFlags { - unsafe { - from_glib(gst_player_sys::gst_player_get_multiview_flags( - self.to_glib_none().0, - )) - } + unsafe { from_glib(ffi::gst_player_get_multiview_flags(self.to_glib_none().0)) } } pub fn get_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking { - unsafe { - from_glib(gst_player_sys::gst_player_get_multiview_mode( - self.to_glib_none().0, - )) - } + unsafe { from_glib(ffi::gst_player_get_multiview_mode(self.to_glib_none().0)) } } pub fn get_mute(&self) -> bool { - unsafe { from_glib(gst_player_sys::gst_player_get_mute(self.to_glib_none().0)) } + unsafe { from_glib(ffi::gst_player_get_mute(self.to_glib_none().0)) } } pub fn get_pipeline(&self) -> gst::Element { - unsafe { - from_glib_full(gst_player_sys::gst_player_get_pipeline( - self.to_glib_none().0, - )) - } + unsafe { from_glib_full(ffi::gst_player_get_pipeline(self.to_glib_none().0)) } } pub fn get_position(&self) -> gst::ClockTime { - unsafe { - from_glib(gst_player_sys::gst_player_get_position( - self.to_glib_none().0, - )) - } + unsafe { from_glib(ffi::gst_player_get_position(self.to_glib_none().0)) } } pub fn get_rate(&self) -> f64 { - unsafe { gst_player_sys::gst_player_get_rate(self.to_glib_none().0) } + unsafe { ffi::gst_player_get_rate(self.to_glib_none().0) } } - pub fn get_subtitle_uri(&self) -> Option { - unsafe { - from_glib_full(gst_player_sys::gst_player_get_subtitle_uri( - self.to_glib_none().0, - )) - } + pub fn get_subtitle_uri(&self) -> Option { + unsafe { from_glib_full(ffi::gst_player_get_subtitle_uri(self.to_glib_none().0)) } } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] pub fn get_subtitle_video_offset(&self) -> i64 { - unsafe { gst_player_sys::gst_player_get_subtitle_video_offset(self.to_glib_none().0) } + unsafe { ffi::gst_player_get_subtitle_video_offset(self.to_glib_none().0) } } - pub fn get_uri(&self) -> Option { - unsafe { from_glib_full(gst_player_sys::gst_player_get_uri(self.to_glib_none().0)) } + pub fn get_uri(&self) -> Option { + unsafe { from_glib_full(ffi::gst_player_get_uri(self.to_glib_none().0)) } } pub fn get_video_snapshot( @@ -158,7 +120,7 @@ impl Player { config: Option<&gst::Structure>, ) -> Option { unsafe { - from_glib_full(gst_player_sys::gst_player_get_video_snapshot( + from_glib_full(ffi::gst_player_get_video_snapshot( self.to_glib_none().0, format.to_glib(), config.to_glib_none().0, @@ -167,39 +129,35 @@ impl Player { } pub fn get_volume(&self) -> f64 { - unsafe { gst_player_sys::gst_player_get_volume(self.to_glib_none().0) } + unsafe { ffi::gst_player_get_volume(self.to_glib_none().0) } } pub fn has_color_balance(&self) -> bool { - unsafe { - from_glib(gst_player_sys::gst_player_has_color_balance( - self.to_glib_none().0, - )) - } + unsafe { from_glib(ffi::gst_player_has_color_balance(self.to_glib_none().0)) } } pub fn pause(&self) { unsafe { - gst_player_sys::gst_player_pause(self.to_glib_none().0); + ffi::gst_player_pause(self.to_glib_none().0); } } pub fn play(&self) { unsafe { - gst_player_sys::gst_player_play(self.to_glib_none().0); + ffi::gst_player_play(self.to_glib_none().0); } } pub fn seek(&self, position: gst::ClockTime) { unsafe { - gst_player_sys::gst_player_seek(self.to_glib_none().0, position.to_glib()); + ffi::gst_player_seek(self.to_glib_none().0, position.to_glib()); } } pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - gst_player_sys::gst_player_set_audio_track(self.to_glib_none().0, stream_index), + glib::glib_result_from_gboolean!( + ffi::gst_player_set_audio_track(self.to_glib_none().0, stream_index), "Failed to set audio track" ) } @@ -207,57 +165,50 @@ impl Player { pub fn set_audio_track_enabled(&self, enabled: bool) { unsafe { - gst_player_sys::gst_player_set_audio_track_enabled( - self.to_glib_none().0, - enabled.to_glib(), - ); + ffi::gst_player_set_audio_track_enabled(self.to_glib_none().0, enabled.to_glib()); } } pub fn set_audio_video_offset(&self, offset: i64) { unsafe { - gst_player_sys::gst_player_set_audio_video_offset(self.to_glib_none().0, offset); + ffi::gst_player_set_audio_video_offset(self.to_glib_none().0, offset); } } pub fn set_color_balance(&self, type_: PlayerColorBalanceType, value: f64) { unsafe { - gst_player_sys::gst_player_set_color_balance( - self.to_glib_none().0, - type_.to_glib(), - value, - ); + ffi::gst_player_set_color_balance(self.to_glib_none().0, type_.to_glib(), value); } } pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) { unsafe { - gst_player_sys::gst_player_set_multiview_flags(self.to_glib_none().0, flags.to_glib()); + ffi::gst_player_set_multiview_flags(self.to_glib_none().0, flags.to_glib()); } } pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) { unsafe { - gst_player_sys::gst_player_set_multiview_mode(self.to_glib_none().0, mode.to_glib()); + ffi::gst_player_set_multiview_mode(self.to_glib_none().0, mode.to_glib()); } } pub fn set_mute(&self, val: bool) { unsafe { - gst_player_sys::gst_player_set_mute(self.to_glib_none().0, val.to_glib()); + ffi::gst_player_set_mute(self.to_glib_none().0, val.to_glib()); } } pub fn set_rate(&self, rate: f64) { unsafe { - gst_player_sys::gst_player_set_rate(self.to_glib_none().0, rate); + ffi::gst_player_set_rate(self.to_glib_none().0, rate); } } pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - gst_player_sys::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index), + glib::glib_result_from_gboolean!( + ffi::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index), "Failed to set subtitle track" ) } @@ -265,19 +216,13 @@ impl Player { pub fn set_subtitle_track_enabled(&self, enabled: bool) { unsafe { - gst_player_sys::gst_player_set_subtitle_track_enabled( - self.to_glib_none().0, - enabled.to_glib(), - ); + ffi::gst_player_set_subtitle_track_enabled(self.to_glib_none().0, enabled.to_glib()); } } pub fn set_subtitle_uri(&self, uri: &str) { unsafe { - gst_player_sys::gst_player_set_subtitle_uri( - self.to_glib_none().0, - uri.to_glib_none().0, - ); + ffi::gst_player_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0); } } @@ -285,20 +230,20 @@ impl Player { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] pub fn set_subtitle_video_offset(&self, offset: i64) { unsafe { - gst_player_sys::gst_player_set_subtitle_video_offset(self.to_glib_none().0, offset); + ffi::gst_player_set_subtitle_video_offset(self.to_glib_none().0, offset); } } pub fn set_uri(&self, uri: &str) { unsafe { - gst_player_sys::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0); + ffi::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0); } } pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - gst_player_sys::gst_player_set_video_track(self.to_glib_none().0, stream_index), + glib::glib_result_from_gboolean!( + ffi::gst_player_set_video_track(self.to_glib_none().0, stream_index), "Failed to set video track" ) } @@ -306,20 +251,14 @@ impl Player { pub fn set_video_track_enabled(&self, enabled: bool) { unsafe { - gst_player_sys::gst_player_set_video_track_enabled( - self.to_glib_none().0, - enabled.to_glib(), - ); + ffi::gst_player_set_video_track_enabled(self.to_glib_none().0, enabled.to_glib()); } } pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - gst_player_sys::gst_player_set_visualization( - self.to_glib_none().0, - name.to_glib_none().0 - ), + glib::glib_result_from_gboolean!( + ffi::gst_player_set_visualization(self.to_glib_none().0, name.to_glib_none().0), "Failed to set visualization" ) } @@ -327,30 +266,27 @@ impl Player { pub fn set_visualization_enabled(&self, enabled: bool) { unsafe { - gst_player_sys::gst_player_set_visualization_enabled( - self.to_glib_none().0, - enabled.to_glib(), - ); + ffi::gst_player_set_visualization_enabled(self.to_glib_none().0, enabled.to_glib()); } } pub fn set_volume(&self, val: f64) { unsafe { - gst_player_sys::gst_player_set_volume(self.to_glib_none().0, val); + ffi::gst_player_set_volume(self.to_glib_none().0, val); } } pub fn stop(&self) { unsafe { - gst_player_sys::gst_player_stop(self.to_glib_none().0); + ffi::gst_player_stop(self.to_glib_none().0); } } - pub fn get_property_suburi(&self) -> Option { + pub fn get_property_suburi(&self) -> Option { unsafe { - let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.as_ptr() as *mut gobject_sys::GObject, + let mut value = Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"suburi\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -362,8 +298,8 @@ impl Player { pub fn set_property_suburi(&self, suburi: Option<&str>) { unsafe { - gobject_sys::g_object_set_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"suburi\0".as_ptr() as *const _, Value::from(suburi).to_glib_none().0, ); @@ -374,8 +310,8 @@ impl Player { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-multiview-flags\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -391,8 +327,8 @@ impl Player { video_multiview_flags: gst_video::VideoMultiviewFlags, ) { unsafe { - gobject_sys::g_object_set_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-multiview-flags\0".as_ptr() as *const _, Value::from(&video_multiview_flags).to_glib_none().0, ); @@ -404,8 +340,8 @@ impl Player { let mut value = Value::from_type( ::static_type(), ); - gobject_sys::g_object_get_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-multiview-mode\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -421,8 +357,8 @@ impl Player { video_multiview_mode: gst_video::VideoMultiviewFramePacking, ) { unsafe { - gobject_sys::g_object_set_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-multiview-mode\0".as_ptr() as *const _, Value::from(&video_multiview_mode).to_glib_none().0, ); @@ -432,7 +368,7 @@ impl Player { pub fn get_audio_streams(info: &PlayerMediaInfo) -> Vec { skip_assert_initialized!(); unsafe { - FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_audio_streams( + FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_audio_streams( info.to_glib_none().0, )) } @@ -441,7 +377,7 @@ impl Player { pub fn get_subtitle_streams(info: &PlayerMediaInfo) -> Vec { skip_assert_initialized!(); unsafe { - FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_subtitle_streams( + FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_subtitle_streams( info.to_glib_none().0, )) } @@ -450,7 +386,7 @@ impl Player { pub fn get_video_streams(info: &PlayerMediaInfo) -> Vec { skip_assert_initialized!(); unsafe { - FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_video_streams( + FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_video_streams( info.to_glib_none().0, )) } @@ -458,16 +394,14 @@ impl Player { pub fn visualizations_get() -> Vec { assert_initialized_main_thread!(); - unsafe { - FromGlibPtrContainer::from_glib_full(gst_player_sys::gst_player_visualizations_get()) - } + unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_player_visualizations_get()) } } pub fn connect_buffering(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn buffering_trampoline( - this: *mut gst_player_sys::GstPlayer, + this: *mut ffi::GstPlayer, object: libc::c_int, - f: glib_sys::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), object) @@ -487,8 +421,8 @@ impl Player { pub fn connect_end_of_stream(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn end_of_stream_trampoline( - this: *mut gst_player_sys::GstPlayer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -511,9 +445,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn error_trampoline( - this: *mut gst_player_sys::GstPlayer, - object: *mut glib_sys::GError, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + object: *mut glib::ffi::GError, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(object)) @@ -538,9 +472,9 @@ impl Player { unsafe extern "C" fn media_info_updated_trampoline< F: Fn(&Player, &PlayerMediaInfo) + Send + 'static, >( - this: *mut gst_player_sys::GstPlayer, - object: *mut gst_player_sys::GstPlayerMediaInfo, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + object: *mut ffi::GstPlayerMediaInfo, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(object)) @@ -560,8 +494,8 @@ impl Player { pub fn connect_mute_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn mute_changed_trampoline( - this: *mut gst_player_sys::GstPlayer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -586,9 +520,9 @@ impl Player { unsafe extern "C" fn state_changed_trampoline< F: Fn(&Player, PlayerState) + Send + 'static, >( - this: *mut gst_player_sys::GstPlayer, - object: gst_player_sys::GstPlayerState, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + object: ffi::GstPlayerState, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), from_glib(object)) @@ -611,12 +545,15 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn uri_loaded_trampoline( - this: *mut gst_player_sys::GstPlayer, + this: *mut ffi::GstPlayer, object: *mut libc::c_char, - f: glib_sys::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); - f(&from_glib_borrow(this), &GString::from_glib_borrow(object)) + f( + &from_glib_borrow(this), + &glib::GString::from_glib_borrow(object), + ) } unsafe { let f: Box_ = Box_::new(f); @@ -638,10 +575,10 @@ impl Player { unsafe extern "C" fn video_dimensions_changed_trampoline< F: Fn(&Player, i32, i32) + Send + 'static, >( - this: *mut gst_player_sys::GstPlayer, + this: *mut ffi::GstPlayer, object: libc::c_int, p0: libc::c_int, - f: glib_sys::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), object, p0) @@ -661,8 +598,8 @@ impl Player { pub fn connect_volume_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn volume_changed_trampoline( - this: *mut gst_player_sys::GstPlayer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -685,9 +622,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn warning_trampoline( - this: *mut gst_player_sys::GstPlayer, - object: *mut glib_sys::GError, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + object: *mut glib::ffi::GError, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(object)) @@ -712,9 +649,9 @@ impl Player { unsafe extern "C" fn notify_audio_video_offset_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -739,9 +676,9 @@ impl Player { unsafe extern "C" fn notify_current_audio_track_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -768,9 +705,9 @@ impl Player { unsafe extern "C" fn notify_current_subtitle_track_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -795,9 +732,9 @@ impl Player { unsafe extern "C" fn notify_current_video_track_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -820,9 +757,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -847,9 +784,9 @@ impl Player { unsafe extern "C" fn notify_media_info_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -872,9 +809,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_mute_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -897,9 +834,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_pipeline_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -922,9 +859,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_position_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -947,9 +884,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_rate_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -976,9 +913,9 @@ impl Player { unsafe extern "C" fn notify_subtitle_video_offset_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -1001,9 +938,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_suburi_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -1026,9 +963,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_uri_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -1053,9 +990,9 @@ impl Player { unsafe extern "C" fn notify_video_multiview_flags_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -1080,9 +1017,9 @@ impl Player { unsafe extern "C" fn notify_video_multiview_mode_trampoline< F: Fn(&Player) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -1105,9 +1042,9 @@ impl Player { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_volume_trampoline( - this: *mut gst_player_sys::GstPlayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) diff --git a/gstreamer-player/src/auto/player_audio_info.rs b/gstreamer-player/src/auto/player_audio_info.rs index 1cd65d46f..3f7a31d38 100644 --- a/gstreamer-player/src/auto/player_audio_info.rs +++ b/gstreamer-player/src/auto/player_audio_info.rs @@ -2,42 +2,40 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +use crate::PlayerStreamInfo; use glib::translate::*; -use glib::GString; -use gst_player_sys; -use PlayerStreamInfo; -glib_wrapper! { - pub struct PlayerAudioInfo(Object) @extends PlayerStreamInfo; +glib::glib_wrapper! { + pub struct PlayerAudioInfo(Object) @extends PlayerStreamInfo; match fn { - get_type => || gst_player_sys::gst_player_audio_info_get_type(), + get_type => || ffi::gst_player_audio_info_get_type(), } } impl PlayerAudioInfo { pub fn get_bitrate(&self) -> i32 { - unsafe { gst_player_sys::gst_player_audio_info_get_bitrate(self.to_glib_none().0) } + unsafe { ffi::gst_player_audio_info_get_bitrate(self.to_glib_none().0) } } pub fn get_channels(&self) -> i32 { - unsafe { gst_player_sys::gst_player_audio_info_get_channels(self.to_glib_none().0) } + unsafe { ffi::gst_player_audio_info_get_channels(self.to_glib_none().0) } } - pub fn get_language(&self) -> Option { + pub fn get_language(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_audio_info_get_language( + from_glib_none(ffi::gst_player_audio_info_get_language( self.to_glib_none().0, )) } } pub fn get_max_bitrate(&self) -> i32 { - unsafe { gst_player_sys::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0) } + unsafe { ffi::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0) } } pub fn get_sample_rate(&self) -> i32 { - unsafe { gst_player_sys::gst_player_audio_info_get_sample_rate(self.to_glib_none().0) } + unsafe { ffi::gst_player_audio_info_get_sample_rate(self.to_glib_none().0) } } } diff --git a/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs b/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs index aeabbe45d..8b469e12d 100644 --- a/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs +++ b/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs @@ -2,20 +2,17 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use glib; +use crate::PlayerSignalDispatcher; use glib::object::ObjectType as ObjectType_; use glib::translate::*; use glib::StaticType; use glib::Value; -use gobject_sys; -use gst_player_sys; -use PlayerSignalDispatcher; -glib_wrapper! { - pub struct PlayerGMainContextSignalDispatcher(Object) @implements PlayerSignalDispatcher; +glib::glib_wrapper! { + pub struct PlayerGMainContextSignalDispatcher(Object) @implements PlayerSignalDispatcher; match fn { - get_type => || gst_player_sys::gst_player_g_main_context_signal_dispatcher_get_type(), + get_type => || ffi::gst_player_g_main_context_signal_dispatcher_get_type(), } } @@ -23,8 +20,8 @@ impl PlayerGMainContextSignalDispatcher { pub fn get_property_application_context(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"application-context\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); diff --git a/gstreamer-player/src/auto/player_media_info.rs b/gstreamer-player/src/auto/player_media_info.rs index 5f7c11f6d..6319d740b 100644 --- a/gstreamer-player/src/auto/player_media_info.rs +++ b/gstreamer-player/src/auto/player_media_info.rs @@ -2,35 +2,32 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +use crate::PlayerAudioInfo; +use crate::PlayerStreamInfo; +use crate::PlayerSubtitleInfo; +use crate::PlayerVideoInfo; use glib::translate::*; -use glib::GString; -use gst; -use gst_player_sys; -use PlayerAudioInfo; -use PlayerStreamInfo; -use PlayerSubtitleInfo; -use PlayerVideoInfo; -glib_wrapper! { - pub struct PlayerMediaInfo(Object); +glib::glib_wrapper! { + pub struct PlayerMediaInfo(Object); match fn { - get_type => || gst_player_sys::gst_player_media_info_get_type(), + get_type => || ffi::gst_player_media_info_get_type(), } } impl PlayerMediaInfo { pub fn get_audio_streams(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none( - gst_player_sys::gst_player_media_info_get_audio_streams(self.to_glib_none().0), - ) + FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_audio_streams( + self.to_glib_none().0, + )) } } - pub fn get_container_format(&self) -> Option { + pub fn get_container_format(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_media_info_get_container_format( + from_glib_none(ffi::gst_player_media_info_get_container_format( self.to_glib_none().0, )) } @@ -38,7 +35,7 @@ impl PlayerMediaInfo { pub fn get_duration(&self) -> gst::ClockTime { unsafe { - from_glib(gst_player_sys::gst_player_media_info_get_duration( + from_glib(ffi::gst_player_media_info_get_duration( self.to_glib_none().0, )) } @@ -46,97 +43,71 @@ impl PlayerMediaInfo { pub fn get_image_sample(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_media_info_get_image_sample( + from_glib_none(ffi::gst_player_media_info_get_image_sample( self.to_glib_none().0, )) } } pub fn get_number_of_audio_streams(&self) -> u32 { - unsafe { - gst_player_sys::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0) - } + unsafe { ffi::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0) } } pub fn get_number_of_streams(&self) -> u32 { - unsafe { - gst_player_sys::gst_player_media_info_get_number_of_streams(self.to_glib_none().0) - } + unsafe { ffi::gst_player_media_info_get_number_of_streams(self.to_glib_none().0) } } pub fn get_number_of_subtitle_streams(&self) -> u32 { - unsafe { - gst_player_sys::gst_player_media_info_get_number_of_subtitle_streams( - self.to_glib_none().0, - ) - } + unsafe { ffi::gst_player_media_info_get_number_of_subtitle_streams(self.to_glib_none().0) } } pub fn get_number_of_video_streams(&self) -> u32 { - unsafe { - gst_player_sys::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0) - } + unsafe { ffi::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0) } } pub fn get_stream_list(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none( - gst_player_sys::gst_player_media_info_get_stream_list(self.to_glib_none().0), - ) + FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_stream_list( + self.to_glib_none().0, + )) } } pub fn get_subtitle_streams(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none( - gst_player_sys::gst_player_media_info_get_subtitle_streams(self.to_glib_none().0), - ) + FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_subtitle_streams( + self.to_glib_none().0, + )) } } pub fn get_tags(&self) -> Option { - unsafe { - from_glib_none(gst_player_sys::gst_player_media_info_get_tags( - self.to_glib_none().0, - )) - } + unsafe { from_glib_none(ffi::gst_player_media_info_get_tags(self.to_glib_none().0)) } } - pub fn get_title(&self) -> Option { - unsafe { - from_glib_none(gst_player_sys::gst_player_media_info_get_title( - self.to_glib_none().0, - )) - } + pub fn get_title(&self) -> Option { + unsafe { from_glib_none(ffi::gst_player_media_info_get_title(self.to_glib_none().0)) } } - pub fn get_uri(&self) -> GString { - unsafe { - from_glib_none(gst_player_sys::gst_player_media_info_get_uri( - self.to_glib_none().0, - )) - } + pub fn get_uri(&self) -> glib::GString { + unsafe { from_glib_none(ffi::gst_player_media_info_get_uri(self.to_glib_none().0)) } } pub fn get_video_streams(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none( - gst_player_sys::gst_player_media_info_get_video_streams(self.to_glib_none().0), - ) - } - } - - pub fn is_live(&self) -> bool { - unsafe { - from_glib(gst_player_sys::gst_player_media_info_is_live( + FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_video_streams( self.to_glib_none().0, )) } } + pub fn is_live(&self) -> bool { + unsafe { from_glib(ffi::gst_player_media_info_is_live(self.to_glib_none().0)) } + } + pub fn is_seekable(&self) -> bool { unsafe { - from_glib(gst_player_sys::gst_player_media_info_is_seekable( + from_glib(ffi::gst_player_media_info_is_seekable( self.to_glib_none().0, )) } diff --git a/gstreamer-player/src/auto/player_signal_dispatcher.rs b/gstreamer-player/src/auto/player_signal_dispatcher.rs index 95b08c70f..62a2aea82 100644 --- a/gstreamer-player/src/auto/player_signal_dispatcher.rs +++ b/gstreamer-player/src/auto/player_signal_dispatcher.rs @@ -4,13 +4,12 @@ use glib::object::IsA; use glib::translate::*; -use gst_player_sys; -glib_wrapper! { - pub struct PlayerSignalDispatcher(Interface); +glib::glib_wrapper! { + pub struct PlayerSignalDispatcher(Interface); match fn { - get_type => || gst_player_sys::gst_player_signal_dispatcher_get_type(), + get_type => || ffi::gst_player_signal_dispatcher_get_type(), } } diff --git a/gstreamer-player/src/auto/player_stream_info.rs b/gstreamer-player/src/auto/player_stream_info.rs index e30c95639..ed38c45cf 100644 --- a/gstreamer-player/src/auto/player_stream_info.rs +++ b/gstreamer-player/src/auto/player_stream_info.rs @@ -4,15 +4,12 @@ use glib::object::IsA; use glib::translate::*; -use glib::GString; -use gst; -use gst_player_sys; -glib_wrapper! { - pub struct PlayerStreamInfo(Object); +glib::glib_wrapper! { + pub struct PlayerStreamInfo(Object); match fn { - get_type => || gst_player_sys::gst_player_stream_info_get_type(), + get_type => || ffi::gst_player_stream_info_get_type(), } } @@ -24,11 +21,11 @@ pub const NONE_PLAYER_STREAM_INFO: Option<&PlayerStreamInfo> = None; pub trait PlayerStreamInfoExt: 'static { fn get_caps(&self) -> Option; - fn get_codec(&self) -> Option; + fn get_codec(&self) -> Option; fn get_index(&self) -> i32; - fn get_stream_type(&self) -> GString; + fn get_stream_type(&self) -> glib::GString; fn get_tags(&self) -> Option; } @@ -36,41 +33,39 @@ pub trait PlayerStreamInfoExt: 'static { impl> PlayerStreamInfoExt for O { fn get_caps(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_stream_info_get_caps( - const_override(self.as_ref().to_glib_none().0), - )) + from_glib_none(ffi::gst_player_stream_info_get_caps(const_override( + self.as_ref().to_glib_none().0, + ))) } } - fn get_codec(&self) -> Option { + fn get_codec(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_stream_info_get_codec( - const_override(self.as_ref().to_glib_none().0), - )) + from_glib_none(ffi::gst_player_stream_info_get_codec(const_override( + self.as_ref().to_glib_none().0, + ))) } } fn get_index(&self) -> i32 { unsafe { - gst_player_sys::gst_player_stream_info_get_index(const_override( - self.as_ref().to_glib_none().0, - )) + ffi::gst_player_stream_info_get_index(const_override(self.as_ref().to_glib_none().0)) } } - fn get_stream_type(&self) -> GString { + fn get_stream_type(&self) -> glib::GString { unsafe { - from_glib_none(gst_player_sys::gst_player_stream_info_get_stream_type( - const_override(self.as_ref().to_glib_none().0), - )) + from_glib_none(ffi::gst_player_stream_info_get_stream_type(const_override( + self.as_ref().to_glib_none().0, + ))) } } fn get_tags(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_stream_info_get_tags( - const_override(self.as_ref().to_glib_none().0), - )) + from_glib_none(ffi::gst_player_stream_info_get_tags(const_override( + self.as_ref().to_glib_none().0, + ))) } } } diff --git a/gstreamer-player/src/auto/player_subtitle_info.rs b/gstreamer-player/src/auto/player_subtitle_info.rs index a584b40bb..9afb2787a 100644 --- a/gstreamer-player/src/auto/player_subtitle_info.rs +++ b/gstreamer-player/src/auto/player_subtitle_info.rs @@ -2,23 +2,21 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +use crate::PlayerStreamInfo; use glib::translate::*; -use glib::GString; -use gst_player_sys; -use PlayerStreamInfo; -glib_wrapper! { - pub struct PlayerSubtitleInfo(Object) @extends PlayerStreamInfo; +glib::glib_wrapper! { + pub struct PlayerSubtitleInfo(Object) @extends PlayerStreamInfo; match fn { - get_type => || gst_player_sys::gst_player_subtitle_info_get_type(), + get_type => || ffi::gst_player_subtitle_info_get_type(), } } impl PlayerSubtitleInfo { - pub fn get_language(&self) -> Option { + pub fn get_language(&self) -> Option { unsafe { - from_glib_none(gst_player_sys::gst_player_subtitle_info_get_language( + from_glib_none(ffi::gst_player_subtitle_info_get_language( self.to_glib_none().0, )) } diff --git a/gstreamer-player/src/auto/player_video_info.rs b/gstreamer-player/src/auto/player_video_info.rs index 43faef577..1fde24145 100644 --- a/gstreamer-player/src/auto/player_video_info.rs +++ b/gstreamer-player/src/auto/player_video_info.rs @@ -2,33 +2,32 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +use crate::PlayerStreamInfo; use glib::translate::*; -use gst_player_sys; -use PlayerStreamInfo; -glib_wrapper! { - pub struct PlayerVideoInfo(Object) @extends PlayerStreamInfo; +glib::glib_wrapper! { + pub struct PlayerVideoInfo(Object) @extends PlayerStreamInfo; match fn { - get_type => || gst_player_sys::gst_player_video_info_get_type(), + get_type => || ffi::gst_player_video_info_get_type(), } } impl PlayerVideoInfo { pub fn get_bitrate(&self) -> i32 { - unsafe { gst_player_sys::gst_player_video_info_get_bitrate(self.to_glib_none().0) } + unsafe { ffi::gst_player_video_info_get_bitrate(self.to_glib_none().0) } } pub fn get_height(&self) -> i32 { - unsafe { gst_player_sys::gst_player_video_info_get_height(self.to_glib_none().0) } + unsafe { ffi::gst_player_video_info_get_height(self.to_glib_none().0) } } pub fn get_max_bitrate(&self) -> i32 { - unsafe { gst_player_sys::gst_player_video_info_get_max_bitrate(self.to_glib_none().0) } + unsafe { ffi::gst_player_video_info_get_max_bitrate(self.to_glib_none().0) } } pub fn get_width(&self) -> i32 { - unsafe { gst_player_sys::gst_player_video_info_get_width(self.to_glib_none().0) } + unsafe { ffi::gst_player_video_info_get_width(self.to_glib_none().0) } } } diff --git a/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs b/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs index 9eb2417cd..8b71b494c 100644 --- a/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs +++ b/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs @@ -2,6 +2,7 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +use crate::PlayerVideoRenderer; use glib::object::IsA; use glib::object::ObjectType as ObjectType_; use glib::signal::connect_raw; @@ -9,27 +10,22 @@ use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; use glib::Value; -use glib_sys; -use gobject_sys; -use gst; -use gst_player_sys; use std::boxed::Box as Box_; use std::mem; use std::mem::transmute; -use PlayerVideoRenderer; -glib_wrapper! { - pub struct PlayerVideoOverlayVideoRenderer(Object) @implements PlayerVideoRenderer; +glib::glib_wrapper! { + pub struct PlayerVideoOverlayVideoRenderer(Object) @implements PlayerVideoRenderer; match fn { - get_type => || gst_player_sys::gst_player_video_overlay_video_renderer_get_type(), + get_type => || ffi::gst_player_video_overlay_video_renderer_get_type(), } } impl PlayerVideoOverlayVideoRenderer { pub fn expose(&self) { unsafe { - gst_player_sys::gst_player_video_overlay_video_renderer_expose(self.to_glib_none().0); + ffi::gst_player_video_overlay_video_renderer_expose(self.to_glib_none().0); } } @@ -39,7 +35,7 @@ impl PlayerVideoOverlayVideoRenderer { let mut y = mem::MaybeUninit::uninit(); let mut width = mem::MaybeUninit::uninit(); let mut height = mem::MaybeUninit::uninit(); - gst_player_sys::gst_player_video_overlay_video_renderer_get_render_rectangle( + ffi::gst_player_video_overlay_video_renderer_get_render_rectangle( self.to_glib_none().0, x.as_mut_ptr(), y.as_mut_ptr(), @@ -55,12 +51,12 @@ impl PlayerVideoOverlayVideoRenderer { } //pub fn get_window_handle(&self) -> /*Unimplemented*/Option { - // unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_get_window_handle() } + // unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_get_window_handle() } //} pub fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) { unsafe { - gst_player_sys::gst_player_video_overlay_video_renderer_set_render_rectangle( + ffi::gst_player_video_overlay_video_renderer_set_render_rectangle( self.to_glib_none().0, x, y, @@ -71,14 +67,14 @@ impl PlayerVideoOverlayVideoRenderer { } //pub fn set_window_handle(&self, window_handle: /*Unimplemented*/Option) { - // unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_set_window_handle() } + // unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_set_window_handle() } //} pub fn get_property_video_sink(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-sink\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -90,8 +86,8 @@ impl PlayerVideoOverlayVideoRenderer { pub fn set_property_video_sink>(&self, video_sink: Option<&P>) { unsafe { - gobject_sys::g_object_set_property( - self.as_ptr() as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-sink\0".as_ptr() as *const _, Value::from(video_sink).to_glib_none().0, ); @@ -99,11 +95,11 @@ impl PlayerVideoOverlayVideoRenderer { } //pub fn new(window_handle: /*Unimplemented*/Option) -> Option { - // unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_new() } + // unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_new() } //} //pub fn new_with_sink>(window_handle: /*Unimplemented*/Option, video_sink: &P) -> Option { - // unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_new_with_sink() } + // unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_new_with_sink() } //} pub fn connect_property_video_sink_notify< @@ -115,9 +111,9 @@ impl PlayerVideoOverlayVideoRenderer { unsafe extern "C" fn notify_video_sink_trampoline< F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayerVideoOverlayVideoRenderer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) @@ -144,9 +140,9 @@ impl PlayerVideoOverlayVideoRenderer { unsafe extern "C" fn notify_window_handle_trampoline< F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static, >( - this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GstPlayerVideoOverlayVideoRenderer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) diff --git a/gstreamer-player/src/auto/player_video_renderer.rs b/gstreamer-player/src/auto/player_video_renderer.rs index 77bb456ba..e9764fac1 100644 --- a/gstreamer-player/src/auto/player_video_renderer.rs +++ b/gstreamer-player/src/auto/player_video_renderer.rs @@ -4,13 +4,12 @@ use glib::object::IsA; use glib::translate::*; -use gst_player_sys; -glib_wrapper! { - pub struct PlayerVideoRenderer(Interface); +glib::glib_wrapper! { + pub struct PlayerVideoRenderer(Interface); match fn { - get_type => || gst_player_sys::gst_player_video_renderer_get_type(), + get_type => || ffi::gst_player_video_renderer_get_type(), } } diff --git a/gstreamer-player/src/auto/player_visualization.rs b/gstreamer-player/src/auto/player_visualization.rs index 0d187f2a4..b35e64a78 100644 --- a/gstreamer-player/src/auto/player_visualization.rs +++ b/gstreamer-player/src/auto/player_visualization.rs @@ -3,16 +3,15 @@ // DO NOT EDIT use glib::translate::*; -use gst_player_sys; -glib_wrapper! { +glib::glib_wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] - pub struct PlayerVisualization(Boxed); + pub struct PlayerVisualization(Boxed); match fn { - copy => |ptr| gst_player_sys::gst_player_visualization_copy(mut_override(ptr)), - free => |ptr| gst_player_sys::gst_player_visualization_free(ptr), - get_type => || gst_player_sys::gst_player_visualization_get_type(), + copy => |ptr| ffi::gst_player_visualization_copy(mut_override(ptr)), + free => |ptr| ffi::gst_player_visualization_free(ptr), + get_type => || ffi::gst_player_visualization_get_type(), } } diff --git a/gstreamer-player/src/auto/versions.txt b/gstreamer-player/src/auto/versions.txt index bdfc6f381..6d165cbfb 100644 --- a/gstreamer-player/src/auto/versions.txt +++ b/gstreamer-player/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6) -from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5) +Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8) +from gir-files (https://github.com/gtk-rs/gir-files @ 2762b6d7)