gstreamer-play-sys-0.22.0/.cargo_vcs_info.json0000644000000001600000000000100146620ustar { "git": { "sha1": "bc3bdebf96b8cc8ebaf5dc705471d46cce997943" }, "path_in_vcs": "gstreamer-play/sys" }gstreamer-play-sys-0.22.0/CHANGELOG.md000064400000000000000000000000341046102023000152630ustar 00000000000000../../gstreamer/CHANGELOG.mdgstreamer-play-sys-0.22.0/COPYRIGHT000064400000000000000000000000171046102023000147460ustar 00000000000000../../COPYRIGHTgstreamer-play-sys-0.22.0/Cargo.toml0000644000000036240000000000100126700ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "gstreamer-play-sys" version = "0.22.0" authors = ["Sebastian Dröge "] build = "build.rs" description = "FFI bindings to libgstplay-1.0" homepage = "https://gstreamer.freedesktop.org" documentation = "https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer_play_sys/" readme = "README.md" keywords = [ "ffi", "gstreamer", "gnome", "multimedia", ] categories = [ "api-bindings", "multimedia", ] license = "MIT" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [package.metadata.system-deps.gstreamer_play_1_0] name = "gstreamer-play-1.0" version = "1.20" [package.metadata.system-deps.gstreamer_play_1_0.v1_22] version = "1.22" [package.metadata.system-deps.gstreamer_play_1_0.v1_24] version = "1.23" [lib] name = "gstreamer_play_sys" [dependencies.glib-sys] version = "0.19" [dependencies.gobject-sys] version = "0.19" [dependencies.gstreamer-sys] version = "0.22" [dependencies.gstreamer-video-sys] version = "0.22" [dependencies.libc] version = "0.2" [dev-dependencies.shell-words] version = "1.0.0" [dev-dependencies.tempfile] version = "3" [build-dependencies.system-deps] version = "6" [features] v1_22 = [] v1_24 = ["v1_22"] gstreamer-play-sys-0.22.0/Cargo.toml.orig000064400000000000000000000025371046102023000163530ustar 00000000000000[build-dependencies] system-deps = "6" [dependencies] libc = "0.2" [dependencies.glib-sys] workspace = true [dependencies.gobject-sys] workspace = true [dependencies.gstreamer-sys] workspace = true [dependencies.gstreamer-video-sys] workspace = true [dev-dependencies] shell-words = "1.0.0" tempfile = "3" [features] v1_22 = [] v1_24 = ["v1_22"] [lib] name = "gstreamer_play_sys" [package] authors = ["Sebastian Dröge "] build = "build.rs" description = "FFI bindings to libgstplay-1.0" documentation = "https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer_play_sys/" keywords = ["ffi", "gstreamer", "gnome", "multimedia"] license = "MIT" name = "gstreamer-play-sys" readme = "README.md" [package.version] workspace = true [package.categories] workspace = true [package.repository] workspace = true [package.homepage] workspace = true [package.edition] workspace = true [package.rust-version] workspace = true [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [package.metadata.system-deps.gstreamer_play_1_0] name = "gstreamer-play-1.0" version = "1.20" [package.metadata.system-deps.gstreamer_play_1_0.v1_22] version = "1.22" [package.metadata.system-deps.gstreamer_play_1_0.v1_24] version = "1.23" gstreamer-play-sys-0.22.0/Gir.toml000064400000000000000000000005251046102023000150750ustar 00000000000000[options] girs_directories = ["../../gir-files", "../../gst-gir-files"] library = "GstPlay" version = "1.0" min_cfg_version = "1.20" work_mode = "sys" single_version_file = true extra_versions = [ "1.24", "1.22" ] external_libraries = [ "GLib", "GObject", ] [external_libraries] gstreamer="Gst" gstreamer_video="GstVideo" gstreamer-play-sys-0.22.0/LICENSE000064400000000000000000000000211046102023000144530ustar 00000000000000../../LICENSE-MITgstreamer-play-sys-0.22.0/README.md000064400000000000000000000031031046102023000147310ustar 00000000000000# gstreamer-sys [![crates.io](https://img.shields.io/crates/v/gstreamer-play-sys.svg)](https://crates.io/crates/gstreamer-play-sys) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/main/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/main) [GStreamer](https://gstreamer.freedesktop.org/) (Play library) FFI bindings for Rust. These bindings are providing unsafe FFI API that can be used to interface with GStreamer. Generally they are meant to be used as the building block for higher-level abstractions like: * Bindings for GStreamer applications and plugins: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs * Various GStreamer plugins written in Rust: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs The bindings are autogenerated with [gir](https://github.com/gtk-rs/gir/) based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/) API metadata provided by the GStreamer project. ## LICENSE gstreamer-sys and all crates contained here are licensed under the MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT). GStreamer itself is licensed under the Lesser General Public License version 2.1 or (at your option) any later version: https://www.gnu.org/licenses/lgpl-2.1.html ## Contribution Any kinds of contributions are welcome as a pull request. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in gstreamer-rs by you shall be licensed under the MIT license as above, without any additional terms or conditions. gstreamer-play-sys-0.22.0/build.rs000064400000000000000000000007761046102023000151340ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #[cfg(not(docsrs))] use std::process; #[cfg(docsrs)] fn main() {} // prevent linking libraries to avoid documentation failure #[cfg(not(docsrs))] fn main() { if let Err(s) = system_deps::Config::new().probe() { println!("cargo:warning={s}"); process::exit(1); } } gstreamer-play-sys-0.22.0/src/auto/versions.txt000064400000000000000000000003421046102023000176240ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de) from gir-files (https://github.com/gtk-rs/gir-files @ cfc0305f903b) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 63e90a30193b) gstreamer-play-sys-0.22.0/src/lib.rs000064400000000000000000000576731046102023000154020ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow( clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms )] #![cfg_attr(docsrs, feature(doc_cfg))] use glib_sys as glib; use gobject_sys as gobject; use gstreamer_sys as gst; use gstreamer_video_sys as gst_video; #[allow(unused_imports)] use libc::{ c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, intptr_t, size_t, ssize_t, uintptr_t, FILE, }; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; // Enums pub type GstPlayColorBalanceType = c_int; pub const GST_PLAY_COLOR_BALANCE_HUE: GstPlayColorBalanceType = 3; pub const GST_PLAY_COLOR_BALANCE_BRIGHTNESS: GstPlayColorBalanceType = 0; pub const GST_PLAY_COLOR_BALANCE_SATURATION: GstPlayColorBalanceType = 2; pub const GST_PLAY_COLOR_BALANCE_CONTRAST: GstPlayColorBalanceType = 1; pub type GstPlayError = c_int; pub const GST_PLAY_ERROR_FAILED: GstPlayError = 0; pub type GstPlayMessage = c_int; pub const GST_PLAY_MESSAGE_URI_LOADED: GstPlayMessage = 0; pub const GST_PLAY_MESSAGE_POSITION_UPDATED: GstPlayMessage = 1; pub const GST_PLAY_MESSAGE_DURATION_CHANGED: GstPlayMessage = 2; pub const GST_PLAY_MESSAGE_STATE_CHANGED: GstPlayMessage = 3; pub const GST_PLAY_MESSAGE_BUFFERING: GstPlayMessage = 4; pub const GST_PLAY_MESSAGE_END_OF_STREAM: GstPlayMessage = 5; pub const GST_PLAY_MESSAGE_ERROR: GstPlayMessage = 6; pub const GST_PLAY_MESSAGE_WARNING: GstPlayMessage = 7; pub const GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED: GstPlayMessage = 8; pub const GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED: GstPlayMessage = 9; pub const GST_PLAY_MESSAGE_VOLUME_CHANGED: GstPlayMessage = 10; pub const GST_PLAY_MESSAGE_MUTE_CHANGED: GstPlayMessage = 11; pub const GST_PLAY_MESSAGE_SEEK_DONE: GstPlayMessage = 12; pub type GstPlaySnapshotFormat = c_int; pub const GST_PLAY_THUMBNAIL_RAW_NATIVE: GstPlaySnapshotFormat = 0; pub const GST_PLAY_THUMBNAIL_RAW_xRGB: GstPlaySnapshotFormat = 1; pub const GST_PLAY_THUMBNAIL_RAW_BGRx: GstPlaySnapshotFormat = 2; pub const GST_PLAY_THUMBNAIL_JPG: GstPlaySnapshotFormat = 3; pub const GST_PLAY_THUMBNAIL_PNG: GstPlaySnapshotFormat = 4; pub type GstPlayState = c_int; pub const GST_PLAY_STATE_STOPPED: GstPlayState = 0; pub const GST_PLAY_STATE_BUFFERING: GstPlayState = 1; pub const GST_PLAY_STATE_PAUSED: GstPlayState = 2; pub const GST_PLAY_STATE_PLAYING: GstPlayState = 3; // Records #[repr(C)] pub struct _GstPlayAudioInfoClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlayAudioInfoClass = _GstPlayAudioInfoClass; #[repr(C)] pub struct _GstPlayClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlayClass = _GstPlayClass; #[repr(C)] pub struct _GstPlayMediaInfoClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlayMediaInfoClass = _GstPlayMediaInfoClass; #[repr(C)] pub struct _GstPlaySignalAdapterClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlaySignalAdapterClass = _GstPlaySignalAdapterClass; #[repr(C)] pub struct _GstPlayStreamInfoClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlayStreamInfoClass = _GstPlayStreamInfoClass; #[repr(C)] pub struct _GstPlaySubtitleInfoClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlaySubtitleInfoClass = _GstPlaySubtitleInfoClass; #[repr(C)] pub struct _GstPlayVideoInfoClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlayVideoInfoClass = _GstPlayVideoInfoClass; #[repr(C)] pub struct _GstPlayVideoOverlayVideoRendererClass { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } pub type GstPlayVideoOverlayVideoRendererClass = _GstPlayVideoOverlayVideoRendererClass; #[derive(Copy, Clone)] #[repr(C)] pub struct GstPlayVideoRendererInterface { pub parent_iface: gobject::GTypeInterface, pub create_video_sink: Option< unsafe extern "C" fn(*mut GstPlayVideoRenderer, *mut GstPlay) -> *mut gst::GstElement, >, } impl ::std::fmt::Debug for GstPlayVideoRendererInterface { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayVideoRendererInterface @ {self:p}")) .field("parent_iface", &self.parent_iface) .field("create_video_sink", &self.create_video_sink) .finish() } } #[derive(Copy, Clone)] #[repr(C)] pub struct GstPlayVisualization { pub name: *mut c_char, pub description: *mut c_char, } impl ::std::fmt::Debug for GstPlayVisualization { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayVisualization @ {self:p}")) .field("name", &self.name) .field("description", &self.description) .finish() } } // Classes #[repr(C)] pub struct GstPlay { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlay { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlay @ {self:p}")).finish() } } #[repr(C)] pub struct GstPlayAudioInfo { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlayAudioInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayAudioInfo @ {self:p}")) .finish() } } #[repr(C)] pub struct GstPlayMediaInfo { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlayMediaInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayMediaInfo @ {self:p}")) .finish() } } #[repr(C)] pub struct GstPlaySignalAdapter { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlaySignalAdapter { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlaySignalAdapter @ {self:p}")) .finish() } } #[repr(C)] pub struct GstPlayStreamInfo { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlayStreamInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayStreamInfo @ {self:p}")) .finish() } } #[repr(C)] pub struct GstPlaySubtitleInfo { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlaySubtitleInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlaySubtitleInfo @ {self:p}")) .finish() } } #[repr(C)] pub struct GstPlayVideoInfo { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlayVideoInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayVideoInfo @ {self:p}")) .finish() } } #[repr(C)] pub struct GstPlayVideoOverlayVideoRenderer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlayVideoOverlayVideoRenderer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPlayVideoOverlayVideoRenderer @ {self:p}")) .finish() } } // Interfaces #[repr(C)] pub struct GstPlayVideoRenderer { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } impl ::std::fmt::Debug for GstPlayVideoRenderer { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write!(f, "GstPlayVideoRenderer @ {self:p}") } } #[link(name = "gstplay-1.0")] extern "C" { //========================================================================= // GstPlayColorBalanceType //========================================================================= pub fn gst_play_color_balance_type_get_type() -> GType; pub fn gst_play_color_balance_type_get_name(type_: GstPlayColorBalanceType) -> *const c_char; //========================================================================= // GstPlayError //========================================================================= pub fn gst_play_error_get_type() -> GType; pub fn gst_play_error_get_name(error: GstPlayError) -> *const c_char; pub fn gst_play_error_quark() -> glib::GQuark; //========================================================================= // GstPlayMessage //========================================================================= pub fn gst_play_message_get_type() -> GType; pub fn gst_play_message_get_name(message_type: GstPlayMessage) -> *const c_char; pub fn gst_play_message_parse_buffering_percent( msg: *mut gst::GstMessage, percent: *mut c_uint, ); pub fn gst_play_message_parse_duration_updated( msg: *mut gst::GstMessage, duration: *mut gst::GstClockTime, ); pub fn gst_play_message_parse_error( msg: *mut gst::GstMessage, error: *mut *mut glib::GError, details: *mut *mut gst::GstStructure, ); pub fn gst_play_message_parse_media_info_updated( msg: *mut gst::GstMessage, info: *mut *mut GstPlayMediaInfo, ); pub fn gst_play_message_parse_muted_changed(msg: *mut gst::GstMessage, muted: *mut gboolean); pub fn gst_play_message_parse_position_updated( msg: *mut gst::GstMessage, position: *mut gst::GstClockTime, ); pub fn gst_play_message_parse_state_changed( msg: *mut gst::GstMessage, state: *mut GstPlayState, ); pub fn gst_play_message_parse_type(msg: *mut gst::GstMessage, type_: *mut GstPlayMessage); pub fn gst_play_message_parse_video_dimensions_changed( msg: *mut gst::GstMessage, width: *mut c_uint, height: *mut c_uint, ); pub fn gst_play_message_parse_volume_changed(msg: *mut gst::GstMessage, volume: *mut c_double); pub fn gst_play_message_parse_warning( msg: *mut gst::GstMessage, error: *mut *mut glib::GError, details: *mut *mut gst::GstStructure, ); //========================================================================= // GstPlayState //========================================================================= pub fn gst_play_state_get_type() -> GType; pub fn gst_play_state_get_name(state: GstPlayState) -> *const c_char; //========================================================================= // GstPlayVisualization //========================================================================= pub fn gst_play_visualization_get_type() -> GType; pub fn gst_play_visualization_copy( vis: *const GstPlayVisualization, ) -> *mut GstPlayVisualization; pub fn gst_play_visualization_free(vis: *mut GstPlayVisualization); //========================================================================= // GstPlay //========================================================================= pub fn gst_play_get_type() -> GType; pub fn gst_play_new(video_renderer: *mut GstPlayVideoRenderer) -> *mut GstPlay; #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] pub fn gst_play_config_get_pipeline_dump_in_error_details( config: *const gst::GstStructure, ) -> gboolean; pub fn gst_play_config_get_position_update_interval(config: *const gst::GstStructure) -> c_uint; pub fn gst_play_config_get_seek_accurate(config: *const gst::GstStructure) -> gboolean; pub fn gst_play_config_get_user_agent(config: *const gst::GstStructure) -> *mut c_char; #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] pub fn gst_play_config_set_pipeline_dump_in_error_details( config: *mut gst::GstStructure, value: gboolean, ); pub fn gst_play_config_set_position_update_interval( config: *mut gst::GstStructure, interval: c_uint, ); pub fn gst_play_config_set_seek_accurate(config: *mut gst::GstStructure, accurate: gboolean); pub fn gst_play_config_set_user_agent(config: *mut gst::GstStructure, agent: *const c_char); pub fn gst_play_get_audio_streams(info: *const GstPlayMediaInfo) -> *mut glib::GList; pub fn gst_play_get_subtitle_streams(info: *const GstPlayMediaInfo) -> *mut glib::GList; pub fn gst_play_get_video_streams(info: *const GstPlayMediaInfo) -> *mut glib::GList; pub fn gst_play_is_play_message(msg: *mut gst::GstMessage) -> gboolean; pub fn gst_play_visualizations_free(viss: *mut *mut GstPlayVisualization); pub fn gst_play_visualizations_get() -> *mut *mut GstPlayVisualization; pub fn gst_play_get_audio_video_offset(play: *mut GstPlay) -> i64; pub fn gst_play_get_color_balance( play: *mut GstPlay, type_: GstPlayColorBalanceType, ) -> c_double; pub fn gst_play_get_config(play: *mut GstPlay) -> *mut gst::GstStructure; pub fn gst_play_get_current_audio_track(play: *mut GstPlay) -> *mut GstPlayAudioInfo; pub fn gst_play_get_current_subtitle_track(play: *mut GstPlay) -> *mut GstPlaySubtitleInfo; pub fn gst_play_get_current_video_track(play: *mut GstPlay) -> *mut GstPlayVideoInfo; pub fn gst_play_get_current_visualization(play: *mut GstPlay) -> *mut c_char; pub fn gst_play_get_duration(play: *mut GstPlay) -> gst::GstClockTime; pub fn gst_play_get_media_info(play: *mut GstPlay) -> *mut GstPlayMediaInfo; pub fn gst_play_get_message_bus(play: *mut GstPlay) -> *mut gst::GstBus; pub fn gst_play_get_multiview_flags(play: *mut GstPlay) -> gst_video::GstVideoMultiviewFlags; pub fn gst_play_get_multiview_mode( play: *mut GstPlay, ) -> gst_video::GstVideoMultiviewFramePacking; pub fn gst_play_get_mute(play: *mut GstPlay) -> gboolean; pub fn gst_play_get_pipeline(play: *mut GstPlay) -> *mut gst::GstElement; pub fn gst_play_get_position(play: *mut GstPlay) -> gst::GstClockTime; pub fn gst_play_get_rate(play: *mut GstPlay) -> c_double; pub fn gst_play_get_subtitle_uri(play: *mut GstPlay) -> *mut c_char; pub fn gst_play_get_subtitle_video_offset(play: *mut GstPlay) -> i64; pub fn gst_play_get_uri(play: *mut GstPlay) -> *mut c_char; pub fn gst_play_get_video_snapshot( play: *mut GstPlay, format: GstPlaySnapshotFormat, config: *const gst::GstStructure, ) -> *mut gst::GstSample; pub fn gst_play_get_volume(play: *mut GstPlay) -> c_double; pub fn gst_play_has_color_balance(play: *mut GstPlay) -> gboolean; pub fn gst_play_pause(play: *mut GstPlay); pub fn gst_play_play(play: *mut GstPlay); pub fn gst_play_seek(play: *mut GstPlay, position: gst::GstClockTime); pub fn gst_play_set_audio_track(play: *mut GstPlay, stream_index: c_int) -> gboolean; pub fn gst_play_set_audio_track_enabled(play: *mut GstPlay, enabled: gboolean); pub fn gst_play_set_audio_video_offset(play: *mut GstPlay, offset: i64); pub fn gst_play_set_color_balance( play: *mut GstPlay, type_: GstPlayColorBalanceType, value: c_double, ); pub fn gst_play_set_config(play: *mut GstPlay, config: *mut gst::GstStructure) -> gboolean; pub fn gst_play_set_multiview_flags( play: *mut GstPlay, flags: gst_video::GstVideoMultiviewFlags, ); pub fn gst_play_set_multiview_mode( play: *mut GstPlay, mode: gst_video::GstVideoMultiviewFramePacking, ); pub fn gst_play_set_mute(play: *mut GstPlay, val: gboolean); pub fn gst_play_set_rate(play: *mut GstPlay, rate: c_double); pub fn gst_play_set_subtitle_track(play: *mut GstPlay, stream_index: c_int) -> gboolean; pub fn gst_play_set_subtitle_track_enabled(play: *mut GstPlay, enabled: gboolean); pub fn gst_play_set_subtitle_uri(play: *mut GstPlay, uri: *const c_char); pub fn gst_play_set_subtitle_video_offset(play: *mut GstPlay, offset: i64); pub fn gst_play_set_uri(play: *mut GstPlay, uri: *const c_char); pub fn gst_play_set_video_track(play: *mut GstPlay, stream_index: c_int) -> gboolean; pub fn gst_play_set_video_track_enabled(play: *mut GstPlay, enabled: gboolean); pub fn gst_play_set_visualization(play: *mut GstPlay, name: *const c_char) -> gboolean; pub fn gst_play_set_visualization_enabled(play: *mut GstPlay, enabled: gboolean); pub fn gst_play_set_volume(play: *mut GstPlay, val: c_double); pub fn gst_play_stop(play: *mut GstPlay); //========================================================================= // GstPlayAudioInfo //========================================================================= pub fn gst_play_audio_info_get_type() -> GType; pub fn gst_play_audio_info_get_bitrate(info: *const GstPlayAudioInfo) -> c_int; pub fn gst_play_audio_info_get_channels(info: *const GstPlayAudioInfo) -> c_int; pub fn gst_play_audio_info_get_language(info: *const GstPlayAudioInfo) -> *const c_char; pub fn gst_play_audio_info_get_max_bitrate(info: *const GstPlayAudioInfo) -> c_int; pub fn gst_play_audio_info_get_sample_rate(info: *const GstPlayAudioInfo) -> c_int; //========================================================================= // GstPlayMediaInfo //========================================================================= pub fn gst_play_media_info_get_type() -> GType; pub fn gst_play_media_info_get_audio_streams(info: *const GstPlayMediaInfo) -> *mut glib::GList; pub fn gst_play_media_info_get_container_format(info: *const GstPlayMediaInfo) -> *const c_char; pub fn gst_play_media_info_get_duration(info: *const GstPlayMediaInfo) -> gst::GstClockTime; pub fn gst_play_media_info_get_image_sample( info: *const GstPlayMediaInfo, ) -> *mut gst::GstSample; pub fn gst_play_media_info_get_number_of_audio_streams(info: *const GstPlayMediaInfo) -> c_uint; pub fn gst_play_media_info_get_number_of_streams(info: *const GstPlayMediaInfo) -> c_uint; pub fn gst_play_media_info_get_number_of_subtitle_streams( info: *const GstPlayMediaInfo, ) -> c_uint; pub fn gst_play_media_info_get_number_of_video_streams(info: *const GstPlayMediaInfo) -> c_uint; pub fn gst_play_media_info_get_stream_list(info: *const GstPlayMediaInfo) -> *mut glib::GList; pub fn gst_play_media_info_get_subtitle_streams( info: *const GstPlayMediaInfo, ) -> *mut glib::GList; pub fn gst_play_media_info_get_tags(info: *const GstPlayMediaInfo) -> *mut gst::GstTagList; pub fn gst_play_media_info_get_title(info: *const GstPlayMediaInfo) -> *const c_char; pub fn gst_play_media_info_get_uri(info: *const GstPlayMediaInfo) -> *const c_char; pub fn gst_play_media_info_get_video_streams(info: *const GstPlayMediaInfo) -> *mut glib::GList; pub fn gst_play_media_info_is_live(info: *const GstPlayMediaInfo) -> gboolean; pub fn gst_play_media_info_is_seekable(info: *const GstPlayMediaInfo) -> gboolean; //========================================================================= // GstPlaySignalAdapter //========================================================================= pub fn gst_play_signal_adapter_get_type() -> GType; pub fn gst_play_signal_adapter_new(play: *mut GstPlay) -> *mut GstPlaySignalAdapter; pub fn gst_play_signal_adapter_new_sync_emit(play: *mut GstPlay) -> *mut GstPlaySignalAdapter; pub fn gst_play_signal_adapter_new_with_main_context( play: *mut GstPlay, context: *mut glib::GMainContext, ) -> *mut GstPlaySignalAdapter; pub fn gst_play_signal_adapter_get_play(adapter: *mut GstPlaySignalAdapter) -> *mut GstPlay; //========================================================================= // GstPlayStreamInfo //========================================================================= pub fn gst_play_stream_info_get_type() -> GType; pub fn gst_play_stream_info_get_caps(info: *const GstPlayStreamInfo) -> *mut gst::GstCaps; pub fn gst_play_stream_info_get_codec(info: *const GstPlayStreamInfo) -> *const c_char; pub fn gst_play_stream_info_get_index(info: *const GstPlayStreamInfo) -> c_int; pub fn gst_play_stream_info_get_stream_type(info: *const GstPlayStreamInfo) -> *const c_char; pub fn gst_play_stream_info_get_tags(info: *const GstPlayStreamInfo) -> *mut gst::GstTagList; //========================================================================= // GstPlaySubtitleInfo //========================================================================= pub fn gst_play_subtitle_info_get_type() -> GType; pub fn gst_play_subtitle_info_get_language(info: *const GstPlaySubtitleInfo) -> *const c_char; //========================================================================= // GstPlayVideoInfo //========================================================================= pub fn gst_play_video_info_get_type() -> GType; pub fn gst_play_video_info_get_bitrate(info: *const GstPlayVideoInfo) -> c_int; pub fn gst_play_video_info_get_framerate( info: *const GstPlayVideoInfo, fps_n: *mut c_int, fps_d: *mut c_int, ); pub fn gst_play_video_info_get_height(info: *const GstPlayVideoInfo) -> c_int; pub fn gst_play_video_info_get_max_bitrate(info: *const GstPlayVideoInfo) -> c_int; pub fn gst_play_video_info_get_pixel_aspect_ratio( info: *const GstPlayVideoInfo, par_n: *mut c_uint, par_d: *mut c_uint, ); pub fn gst_play_video_info_get_width(info: *const GstPlayVideoInfo) -> c_int; //========================================================================= // GstPlayVideoOverlayVideoRenderer //========================================================================= pub fn gst_play_video_overlay_video_renderer_get_type() -> GType; pub fn gst_play_video_overlay_video_renderer_new( window_handle: gpointer, ) -> *mut GstPlayVideoRenderer; pub fn gst_play_video_overlay_video_renderer_new_with_sink( window_handle: gpointer, video_sink: *mut gst::GstElement, ) -> *mut GstPlayVideoRenderer; pub fn gst_play_video_overlay_video_renderer_expose( self_: *mut GstPlayVideoOverlayVideoRenderer, ); pub fn gst_play_video_overlay_video_renderer_get_render_rectangle( self_: *mut GstPlayVideoOverlayVideoRenderer, x: *mut c_int, y: *mut c_int, width: *mut c_int, height: *mut c_int, ); pub fn gst_play_video_overlay_video_renderer_get_window_handle( self_: *mut GstPlayVideoOverlayVideoRenderer, ) -> gpointer; pub fn gst_play_video_overlay_video_renderer_set_render_rectangle( self_: *mut GstPlayVideoOverlayVideoRenderer, x: c_int, y: c_int, width: c_int, height: c_int, ); pub fn gst_play_video_overlay_video_renderer_set_window_handle( self_: *mut GstPlayVideoOverlayVideoRenderer, window_handle: gpointer, ); //========================================================================= // GstPlayVideoRenderer //========================================================================= pub fn gst_play_video_renderer_get_type() -> GType; } gstreamer-play-sys-0.22.0/tests/abi.rs000064400000000000000000000213751046102023000157300ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #![cfg(unix)] use gstreamer_play_sys::*; use std::env; use std::error::Error; use std::ffi::OsString; use std::mem::{align_of, size_of}; use std::path::Path; use std::process::{Command, Stdio}; use std::str; use tempfile::Builder; static PACKAGES: &[&str] = &["gstreamer-play-1.0"]; #[derive(Clone, Debug)] struct Compiler { pub args: Vec, } impl Compiler { pub fn new() -> Result> { let mut args = get_var("CC", "cc")?; args.push("-Wno-deprecated-declarations".to_owned()); // For _Generic args.push("-std=c11".to_owned()); // For %z support in printf when using MinGW. args.push("-D__USE_MINGW_ANSI_STDIO".to_owned()); args.extend(get_var("CFLAGS", "")?); args.extend(get_var("CPPFLAGS", "")?); args.extend(pkg_config_cflags(PACKAGES)?); Ok(Self { args }) } pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box> { let mut cmd = self.to_command(); cmd.arg(src); cmd.arg("-o"); cmd.arg(out); let status = cmd.spawn()?.wait()?; if !status.success() { return Err(format!("compilation command {cmd:?} failed, {status}").into()); } Ok(()) } fn to_command(&self) -> Command { let mut cmd = Command::new(&self.args[0]); cmd.args(&self.args[1..]); cmd } } fn get_var(name: &str, default: &str) -> Result, Box> { match env::var(name) { Ok(value) => Ok(shell_words::split(&value)?), Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?), Err(err) => Err(format!("{name} {err}").into()), } } fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config")); let mut cmd = Command::new(pkg_config); cmd.arg("--cflags"); cmd.args(packages); cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } let stdout = str::from_utf8(&out.stdout)?; Ok(shell_words::split(stdout.trim())?) } #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, alignment: usize, } #[derive(Copy, Clone, Debug, Default, Eq, PartialEq)] struct Results { /// Number of successfully completed tests. passed: usize, /// Total number of failed tests (including those that failed to compile). failed: usize, } impl Results { fn record_passed(&mut self) { self.passed += 1; } fn record_failed(&mut self) { self.failed += 1; } fn summary(&self) -> String { format!("{} passed; {} failed", self.passed, self.failed) } fn expect_total_success(&self) { if self.failed == 0 { println!("OK: {}", self.summary()); } else { panic!("FAILED: {}", self.summary()); }; } } #[test] fn cross_validate_constants_with_c() { let mut c_constants: Vec<(String, String)> = Vec::new(); for l in get_c_output("constant").unwrap().lines() { let (name, value) = l.split_once(';').expect("Missing ';' separator"); c_constants.push((name.to_owned(), value.to_owned())); } let mut results = Results::default(); for ((rust_name, rust_value), (c_name, c_value)) in RUST_CONSTANTS.iter().zip(c_constants.iter()) { if rust_name != c_name { results.record_failed(); eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); continue; } if rust_value != c_value { results.record_failed(); eprintln!( "Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}", ); continue; } results.record_passed(); } results.expect_total_success(); } #[test] fn cross_validate_layout_with_c() { let mut c_layouts = Vec::new(); for l in get_c_output("layout").unwrap().lines() { let (name, value) = l.split_once(';').expect("Missing first ';' separator"); let (size, alignment) = value.split_once(';').expect("Missing second ';' separator"); let size = size.parse().expect("Failed to parse size"); let alignment = alignment.parse().expect("Failed to parse alignment"); c_layouts.push((name.to_owned(), Layout { size, alignment })); } let mut results = Results::default(); for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter()) { if rust_name != c_name { results.record_failed(); eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); continue; } if rust_layout != c_layout { results.record_failed(); eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",); continue; } results.record_passed(); } results.expect_total_success(); } fn get_c_output(name: &str) -> Result> { let tmpdir = Builder::new().prefix("abi").tempdir()?; let exe = tmpdir.path().join(name); let c_file = Path::new("tests").join(name).with_extension("c"); let cc = Compiler::new().expect("configured compiler"); cc.compile(&c_file, &exe)?; let mut cmd = Command::new(exe); cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } Ok(String::from_utf8(out.stdout)?) } const RUST_LAYOUTS: &[(&str, Layout)] = &[ ( "GstPlayColorBalanceType", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GstPlayError", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GstPlayMessage", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GstPlaySnapshotFormat", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GstPlayState", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GstPlayVideoRendererInterface", Layout { size: size_of::(), alignment: align_of::(), }, ), ( "GstPlayVisualization", Layout { size: size_of::(), alignment: align_of::(), }, ), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) GST_PLAY_COLOR_BALANCE_BRIGHTNESS", "0"), ("(gint) GST_PLAY_COLOR_BALANCE_CONTRAST", "1"), ("(gint) GST_PLAY_COLOR_BALANCE_HUE", "3"), ("(gint) GST_PLAY_COLOR_BALANCE_SATURATION", "2"), ("(gint) GST_PLAY_ERROR_FAILED", "0"), ("(gint) GST_PLAY_MESSAGE_BUFFERING", "4"), ("(gint) GST_PLAY_MESSAGE_DURATION_CHANGED", "2"), ("(gint) GST_PLAY_MESSAGE_END_OF_STREAM", "5"), ("(gint) GST_PLAY_MESSAGE_ERROR", "6"), ("(gint) GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED", "9"), ("(gint) GST_PLAY_MESSAGE_MUTE_CHANGED", "11"), ("(gint) GST_PLAY_MESSAGE_POSITION_UPDATED", "1"), ("(gint) GST_PLAY_MESSAGE_SEEK_DONE", "12"), ("(gint) GST_PLAY_MESSAGE_STATE_CHANGED", "3"), ("(gint) GST_PLAY_MESSAGE_URI_LOADED", "0"), ("(gint) GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED", "8"), ("(gint) GST_PLAY_MESSAGE_VOLUME_CHANGED", "10"), ("(gint) GST_PLAY_MESSAGE_WARNING", "7"), ("(gint) GST_PLAY_STATE_BUFFERING", "1"), ("(gint) GST_PLAY_STATE_PAUSED", "2"), ("(gint) GST_PLAY_STATE_PLAYING", "3"), ("(gint) GST_PLAY_STATE_STOPPED", "0"), ("(gint) GST_PLAY_THUMBNAIL_JPG", "3"), ("(gint) GST_PLAY_THUMBNAIL_PNG", "4"), ("(gint) GST_PLAY_THUMBNAIL_RAW_BGRx", "2"), ("(gint) GST_PLAY_THUMBNAIL_RAW_NATIVE", "0"), ("(gint) GST_PLAY_THUMBNAIL_RAW_xRGB", "1"), ]; gstreamer-play-sys-0.22.0/tests/constant.c000064400000000000000000000051071046102023000166170ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #include "manual.h" #include #define PRINT_CONSTANT(CONSTANT_NAME) \ printf("%s;", #CONSTANT_NAME); \ printf(_Generic((CONSTANT_NAME), \ char *: "%s", \ const char *: "%s", \ char: "%c", \ signed char: "%hhd", \ unsigned char: "%hhu", \ short int: "%hd", \ unsigned short int: "%hu", \ int: "%d", \ unsigned int: "%u", \ long: "%ld", \ unsigned long: "%lu", \ long long: "%lld", \ unsigned long long: "%llu", \ float: "%f", \ double: "%f", \ long double: "%ld"), \ CONSTANT_NAME); \ printf("\n"); int main() { PRINT_CONSTANT((gint) GST_PLAY_COLOR_BALANCE_BRIGHTNESS); PRINT_CONSTANT((gint) GST_PLAY_COLOR_BALANCE_CONTRAST); PRINT_CONSTANT((gint) GST_PLAY_COLOR_BALANCE_HUE); PRINT_CONSTANT((gint) GST_PLAY_COLOR_BALANCE_SATURATION); PRINT_CONSTANT((gint) GST_PLAY_ERROR_FAILED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_BUFFERING); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_DURATION_CHANGED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_END_OF_STREAM); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_ERROR); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_MUTE_CHANGED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_POSITION_UPDATED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_SEEK_DONE); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_STATE_CHANGED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_URI_LOADED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_VOLUME_CHANGED); PRINT_CONSTANT((gint) GST_PLAY_MESSAGE_WARNING); PRINT_CONSTANT((gint) GST_PLAY_STATE_BUFFERING); PRINT_CONSTANT((gint) GST_PLAY_STATE_PAUSED); PRINT_CONSTANT((gint) GST_PLAY_STATE_PLAYING); PRINT_CONSTANT((gint) GST_PLAY_STATE_STOPPED); PRINT_CONSTANT((gint) GST_PLAY_THUMBNAIL_JPG); PRINT_CONSTANT((gint) GST_PLAY_THUMBNAIL_PNG); PRINT_CONSTANT((gint) GST_PLAY_THUMBNAIL_RAW_BGRx); PRINT_CONSTANT((gint) GST_PLAY_THUMBNAIL_RAW_NATIVE); PRINT_CONSTANT((gint) GST_PLAY_THUMBNAIL_RAW_xRGB); return 0; } gstreamer-play-sys-0.22.0/tests/layout.c000064400000000000000000000020631046102023000163010ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #include "manual.h" #include #include int main() { printf("%s;%zu;%zu\n", "GstPlayColorBalanceType", sizeof(GstPlayColorBalanceType), alignof(GstPlayColorBalanceType)); printf("%s;%zu;%zu\n", "GstPlayError", sizeof(GstPlayError), alignof(GstPlayError)); printf("%s;%zu;%zu\n", "GstPlayMessage", sizeof(GstPlayMessage), alignof(GstPlayMessage)); printf("%s;%zu;%zu\n", "GstPlaySnapshotFormat", sizeof(GstPlaySnapshotFormat), alignof(GstPlaySnapshotFormat)); printf("%s;%zu;%zu\n", "GstPlayState", sizeof(GstPlayState), alignof(GstPlayState)); printf("%s;%zu;%zu\n", "GstPlayVideoRendererInterface", sizeof(GstPlayVideoRendererInterface), alignof(GstPlayVideoRendererInterface)); printf("%s;%zu;%zu\n", "GstPlayVisualization", sizeof(GstPlayVisualization), alignof(GstPlayVisualization)); return 0; } gstreamer-play-sys-0.22.0/tests/manual.h000064400000000000000000000001651046102023000162470ustar 00000000000000// Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include