From 252abbaeda64a3fdd8ccab291297500e3cdf6499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 8 Aug 2017 11:08:16 +0300 Subject: [PATCH] Update gstreamer-player-sys GIR file for correct annotations/types And require the 1.12 API --- Gir_GstPlayer.toml | 2 +- gir-files/GstPlayer-1.0.gir | 4 ++-- gstreamer-player-sys/Cargo.toml | 3 +-- gstreamer-player-sys/build.rs | 4 +--- gstreamer-player-sys/src/lib.rs | 14 ++------------ 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/Gir_GstPlayer.toml b/Gir_GstPlayer.toml index 0d912b738..907fc1d83 100644 --- a/Gir_GstPlayer.toml +++ b/Gir_GstPlayer.toml @@ -2,7 +2,7 @@ girs_dir = "gir-files" library = "GstPlayer" version = "1.0" -min_cfg_version = "1.0" +min_cfg_version = "1.12" target_path = "gstreamer-player-sys" work_mode = "sys" diff --git a/gir-files/GstPlayer-1.0.gir b/gir-files/GstPlayer-1.0.gir index 6d70e0fff..47f6631d6 100644 --- a/gir-files/GstPlayer-1.0.gir +++ b/gir-files/GstPlayer-1.0.gir @@ -30,7 +30,7 @@ passed. See gst_player_g_main_context_signal_dispatcher_new(). Video is going to be rendered by @video_renderer, or if %NULL is provided no special video set up will be done and some default handling will be performed. - + a new #GstPlayer instance @@ -522,7 +522,7 @@ Since 1.12 nullable="1" allow-none="1"> Additional configuration - + diff --git a/gstreamer-player-sys/Cargo.toml b/gstreamer-player-sys/Cargo.toml index 5c35b6344..ca503a646 100644 --- a/gstreamer-player-sys/Cargo.toml +++ b/gstreamer-player-sys/Cargo.toml @@ -16,8 +16,7 @@ path = "../gstreamer-video-sys" version = "0.1.1" [features] -v1_10 = [] -v1_12 = ["v1_10"] +v1_12 = [] [lib] name = "gstreamer_player_sys" diff --git a/gstreamer-player-sys/build.rs b/gstreamer-player-sys/build.rs index 86b99081d..03dcf6034 100644 --- a/gstreamer-player-sys/build.rs +++ b/gstreamer-player-sys/build.rs @@ -16,10 +16,8 @@ fn main() { fn find() -> Result<(), Error> { let package_name = "gstreamer-player-1.0"; let shared_libs = ["gstplayer-1.0"]; - let version = if cfg!(feature = "v1_12") { + let version = { "1.12" - } else { - "1.0" }; if let Ok(lib_dir) = env::var("GTK_LIB_DIR") { diff --git a/gstreamer-player-sys/src/lib.rs b/gstreamer-player-sys/src/lib.rs index 7da129915..e840aa842 100644 --- a/gstreamer-player-sys/src/lib.rs +++ b/gstreamer-player-sys/src/lib.rs @@ -1,10 +1,9 @@ -// This file was generated by gir (f00d658) from gir-files (???) +// This file was generated by gir (3294959) from gir-files (???) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals)] extern crate libc; -#[macro_use] extern crate bitflags; extern crate glib_sys as glib; extern crate gobject_sys as gobject; extern crate gstreamer_sys as gst; @@ -184,7 +183,6 @@ extern "C" { pub fn gst_player_get_video_streams(info: *const GstPlayerMediaInfo) -> *mut glib::GList; pub fn gst_player_visualizations_free(viss: *mut *mut GstPlayerVisualization); pub fn gst_player_visualizations_get() -> *mut *mut GstPlayerVisualization; - #[cfg(feature = "v1_12")] pub fn gst_player_config_set_seek_accurate(player: *mut GstPlayer, accurate: gboolean); pub fn gst_player_get_audio_video_offset(player: *mut GstPlayer) -> i64; pub fn gst_player_get_color_balance(player: *mut GstPlayer, type_: GstPlayerColorBalanceType) -> c_double; @@ -195,9 +193,7 @@ extern "C" { pub fn gst_player_get_current_visualization(player: *mut GstPlayer) -> *mut c_char; pub fn gst_player_get_duration(player: *mut GstPlayer) -> gst::GstClockTime; pub fn gst_player_get_media_info(player: *mut GstPlayer) -> *mut GstPlayerMediaInfo; - #[cfg(feature = "v1_10")] pub fn gst_player_get_multiview_flags(player: *mut GstPlayer) -> gst_video::GstVideoMultiviewFlags; - #[cfg(feature = "v1_10")] pub fn gst_player_get_multiview_mode(player: *mut GstPlayer) -> gst_video::GstVideoMultiviewMode; pub fn gst_player_get_mute(player: *mut GstPlayer) -> gboolean; pub fn gst_player_get_pipeline(player: *mut GstPlayer) -> *mut gst::GstElement; @@ -205,7 +201,7 @@ extern "C" { pub fn gst_player_get_rate(player: *mut GstPlayer) -> c_double; pub fn gst_player_get_subtitle_uri(player: *mut GstPlayer) -> *mut c_char; pub fn gst_player_get_uri(player: *mut GstPlayer) -> *mut c_char; - pub fn gst_player_get_video_snapshot(player: *mut GstPlayer, format: GstPlayerSnapshotFormat, config: *mut gst::GstStructure) -> *mut gst::GstSample; + pub fn gst_player_get_video_snapshot(player: *mut GstPlayer, format: GstPlayerSnapshotFormat, config: *const gst::GstStructure) -> *mut gst::GstSample; pub fn gst_player_get_volume(player: *mut GstPlayer) -> c_double; pub fn gst_player_has_color_balance(player: *mut GstPlayer) -> gboolean; pub fn gst_player_pause(player: *mut GstPlayer); @@ -216,9 +212,7 @@ extern "C" { pub fn gst_player_set_audio_video_offset(player: *mut GstPlayer, offset: i64); pub fn gst_player_set_color_balance(player: *mut GstPlayer, type_: GstPlayerColorBalanceType, value: c_double); pub fn gst_player_set_config(player: *mut GstPlayer, config: *mut gst::GstStructure) -> gboolean; - #[cfg(feature = "v1_10")] pub fn gst_player_set_multiview_flags(player: *mut GstPlayer, flags: gst_video::GstVideoMultiviewFlags); - #[cfg(feature = "v1_10")] pub fn gst_player_set_multiview_mode(player: *mut GstPlayer, mode: gst_video::GstVideoMultiviewMode); pub fn gst_player_set_mute(player: *mut GstPlayer, val: gboolean); pub fn gst_player_set_rate(player: *mut GstPlayer, rate: c_double); @@ -257,13 +251,9 @@ extern "C" { pub fn gst_player_media_info_get_container_format(info: *const GstPlayerMediaInfo) -> *const c_char; pub fn gst_player_media_info_get_duration(info: *const GstPlayerMediaInfo) -> gst::GstClockTime; pub fn gst_player_media_info_get_image_sample(info: *const GstPlayerMediaInfo) -> *mut gst::GstSample; - #[cfg(feature = "v1_12")] pub fn gst_player_media_info_get_number_of_audio_streams(info: *const GstPlayerMediaInfo) -> c_uint; - #[cfg(feature = "v1_12")] pub fn gst_player_media_info_get_number_of_streams(info: *const GstPlayerMediaInfo) -> c_uint; - #[cfg(feature = "v1_12")] pub fn gst_player_media_info_get_number_of_subtitle_streams(info: *const GstPlayerMediaInfo) -> c_uint; - #[cfg(feature = "v1_12")] pub fn gst_player_media_info_get_number_of_video_streams(info: *const GstPlayerMediaInfo) -> c_uint; pub fn gst_player_media_info_get_stream_list(info: *const GstPlayerMediaInfo) -> *mut glib::GList; pub fn gst_player_media_info_get_subtitle_streams(info: *const GstPlayerMediaInfo) -> *mut glib::GList;