mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-09 08:45:27 +00:00
Add initial, untested version of GstPlayer bindings
This commit is contained in:
parent
440ff3d365
commit
38b97a14ad
15 changed files with 1755 additions and 0 deletions
56
Gir_GstPlayer.toml
Normal file
56
Gir_GstPlayer.toml
Normal file
|
@ -0,0 +1,56 @@
|
|||
[options]
|
||||
girs_dir = "gir-files"
|
||||
library = "GstPlayer"
|
||||
version = "1.0"
|
||||
min_cfg_version = "1.10"
|
||||
target_path = "gstreamer-player"
|
||||
work_mode = "normal"
|
||||
concurrency = "send+sync"
|
||||
generate_safety_asserts = true
|
||||
|
||||
external_libraries = [
|
||||
"GLib",
|
||||
"GObject",
|
||||
]
|
||||
|
||||
generate = [
|
||||
"GstPlayer.Player",
|
||||
"GstPlayer.PlayerAudioInfo",
|
||||
"GstPlayer.PlayerColorBalanceType",
|
||||
"GstPlayer.PlayerError",
|
||||
"GstPlayer.PlayerGMainContextSignalDispatcher",
|
||||
"GstPlayer.PlayerMediaInfo",
|
||||
"GstPlayer.PlayerSignalDispatcher",
|
||||
"GstPlayer.PlayerSnapshotFormat",
|
||||
"GstPlayer.PlayerState",
|
||||
"GstPlayer.PlayerStreamInfo",
|
||||
"GstPlayer.PlayerSubtitleInfo",
|
||||
"GstPlayer.PlayerVideoInfo",
|
||||
"GstPlayer.PlayerVideoOverlayVideoRenderer",
|
||||
"GstPlayer.PlayerVideoRenderer",
|
||||
"GstPlayer.PlayerVisualization",
|
||||
]
|
||||
|
||||
manual = [
|
||||
"GLib.Error",
|
||||
"GLib.MainContext",
|
||||
"GObject.Object",
|
||||
"Gst.ClockTime",
|
||||
"Gst.Structure",
|
||||
"Gst.Element",
|
||||
]
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Caps"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.TagList"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Sample"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
254
gstreamer-player/src/auto/enums.rs
Normal file
254
gstreamer-player/src/auto/enums.rs
Normal file
|
@ -0,0 +1,254 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib_ffi;
|
||||
use glib::error::ErrorDomain;
|
||||
use glib::Type;
|
||||
use glib::StaticType;
|
||||
use glib::value::{Value, SetValue, FromValue, FromValueOptional};
|
||||
use gobject_ffi;
|
||||
use glib::translate::*;
|
||||
use std;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||
pub enum PlayerColorBalanceType {
|
||||
Hue,
|
||||
Brightness,
|
||||
Saturation,
|
||||
Contrast,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for PlayerColorBalanceType {
|
||||
type GlibType = ffi::GstPlayerColorBalanceType;
|
||||
|
||||
fn to_glib(&self) -> ffi::GstPlayerColorBalanceType {
|
||||
match *self {
|
||||
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) => unsafe{std::mem::transmute(value)}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstPlayerColorBalanceType> for PlayerColorBalanceType {
|
||||
fn from_glib(value: ffi::GstPlayerColorBalanceType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value as i32 {
|
||||
3 => PlayerColorBalanceType::Hue,
|
||||
0 => PlayerColorBalanceType::Brightness,
|
||||
2 => PlayerColorBalanceType::Saturation,
|
||||
1 => PlayerColorBalanceType::Contrast,
|
||||
value => PlayerColorBalanceType::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for PlayerColorBalanceType {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::gst_player_color_balance_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for PlayerColorBalanceType {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for PlayerColorBalanceType {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(std::mem::transmute::<i32, ffi::GstPlayerColorBalanceType>(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_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||
pub enum PlayerError {
|
||||
Failed,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for PlayerError {
|
||||
type GlibType = ffi::GstPlayerError;
|
||||
|
||||
fn to_glib(&self) -> ffi::GstPlayerError {
|
||||
match *self {
|
||||
PlayerError::Failed => ffi::GST_PLAYER_ERROR_FAILED,
|
||||
PlayerError::__Unknown(value) => unsafe{std::mem::transmute(value)}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstPlayerError> for PlayerError {
|
||||
fn from_glib(value: ffi::GstPlayerError) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value as i32 {
|
||||
0 => PlayerError::Failed,
|
||||
value => PlayerError::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ErrorDomain for PlayerError {
|
||||
fn domain() -> glib_ffi::GQuark {
|
||||
skip_assert_initialized!();
|
||||
unsafe { ffi::gst_player_error_quark() }
|
||||
}
|
||||
|
||||
fn code(self) -> i32 {
|
||||
self.to_glib() as i32
|
||||
}
|
||||
|
||||
fn from(code: i32) -> Option<Self> {
|
||||
skip_assert_initialized!();
|
||||
match code {
|
||||
0 => Some(PlayerError::Failed),
|
||||
_ => Some(PlayerError::Failed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for PlayerError {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::gst_player_error_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for PlayerError {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for PlayerError {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(std::mem::transmute::<i32, ffi::GstPlayerError>(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_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||
pub enum PlayerSnapshotFormat {
|
||||
RawNative,
|
||||
RawXrgb,
|
||||
RawBgrx,
|
||||
Jpg,
|
||||
Png,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for PlayerSnapshotFormat {
|
||||
type GlibType = ffi::GstPlayerSnapshotFormat;
|
||||
|
||||
fn to_glib(&self) -> ffi::GstPlayerSnapshotFormat {
|
||||
match *self {
|
||||
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) => unsafe{std::mem::transmute(value)}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstPlayerSnapshotFormat> for PlayerSnapshotFormat {
|
||||
fn from_glib(value: ffi::GstPlayerSnapshotFormat) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value as i32 {
|
||||
0 => PlayerSnapshotFormat::RawNative,
|
||||
1 => PlayerSnapshotFormat::RawXrgb,
|
||||
2 => PlayerSnapshotFormat::RawBgrx,
|
||||
3 => PlayerSnapshotFormat::Jpg,
|
||||
4 => PlayerSnapshotFormat::Png,
|
||||
value => PlayerSnapshotFormat::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||
pub enum PlayerState {
|
||||
Stopped,
|
||||
Buffering,
|
||||
Paused,
|
||||
Playing,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for PlayerState {
|
||||
type GlibType = ffi::GstPlayerState;
|
||||
|
||||
fn to_glib(&self) -> ffi::GstPlayerState {
|
||||
match *self {
|
||||
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) => unsafe{std::mem::transmute(value)}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstPlayerState> for PlayerState {
|
||||
fn from_glib(value: ffi::GstPlayerState) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value as i32 {
|
||||
0 => PlayerState::Stopped,
|
||||
1 => PlayerState::Buffering,
|
||||
2 => PlayerState::Paused,
|
||||
3 => PlayerState::Playing,
|
||||
value => PlayerState::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for PlayerState {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::gst_player_state_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for PlayerState {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for PlayerState {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(std::mem::transmute::<i32, ffi::GstPlayerState>(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_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib() as i32)
|
||||
}
|
||||
}
|
||||
|
6
gstreamer-player/src/auto/flags.rs
Normal file
6
gstreamer-player/src/auto/flags.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
|
65
gstreamer-player/src/auto/mod.rs
Normal file
65
gstreamer-player/src/auto/mod.rs
Normal file
|
@ -0,0 +1,65 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod player;
|
||||
pub use self::player::Player;
|
||||
pub use self::player::PlayerExt;
|
||||
|
||||
mod player_audio_info;
|
||||
pub use self::player_audio_info::PlayerAudioInfo;
|
||||
pub use self::player_audio_info::PlayerAudioInfoExt;
|
||||
|
||||
mod player_g_main_context_signal_dispatcher;
|
||||
pub use self::player_g_main_context_signal_dispatcher::PlayerGMainContextSignalDispatcher;
|
||||
pub use self::player_g_main_context_signal_dispatcher::PlayerGMainContextSignalDispatcherExt;
|
||||
|
||||
mod player_media_info;
|
||||
pub use self::player_media_info::PlayerMediaInfo;
|
||||
pub use self::player_media_info::PlayerMediaInfoExt;
|
||||
|
||||
mod player_signal_dispatcher;
|
||||
pub use self::player_signal_dispatcher::PlayerSignalDispatcher;
|
||||
pub use self::player_signal_dispatcher::PlayerSignalDispatcherExt;
|
||||
|
||||
mod player_stream_info;
|
||||
pub use self::player_stream_info::PlayerStreamInfo;
|
||||
pub use self::player_stream_info::PlayerStreamInfoExt;
|
||||
|
||||
mod player_subtitle_info;
|
||||
pub use self::player_subtitle_info::PlayerSubtitleInfo;
|
||||
pub use self::player_subtitle_info::PlayerSubtitleInfoExt;
|
||||
|
||||
mod player_video_info;
|
||||
pub use self::player_video_info::PlayerVideoInfo;
|
||||
pub use self::player_video_info::PlayerVideoInfoExt;
|
||||
|
||||
mod player_video_overlay_video_renderer;
|
||||
pub use self::player_video_overlay_video_renderer::PlayerVideoOverlayVideoRenderer;
|
||||
pub use self::player_video_overlay_video_renderer::PlayerVideoOverlayVideoRendererExt;
|
||||
|
||||
mod player_video_renderer;
|
||||
pub use self::player_video_renderer::PlayerVideoRenderer;
|
||||
pub use self::player_video_renderer::PlayerVideoRendererExt;
|
||||
|
||||
mod player_visualization;
|
||||
pub use self::player_visualization::PlayerVisualization;
|
||||
|
||||
mod enums;
|
||||
pub use self::enums::PlayerColorBalanceType;
|
||||
pub use self::enums::PlayerError;
|
||||
pub use self::enums::PlayerSnapshotFormat;
|
||||
pub use self::enums::PlayerState;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
pub use super::PlayerExt;
|
||||
pub use super::PlayerAudioInfoExt;
|
||||
pub use super::PlayerGMainContextSignalDispatcherExt;
|
||||
pub use super::PlayerMediaInfoExt;
|
||||
pub use super::PlayerSignalDispatcherExt;
|
||||
pub use super::PlayerStreamInfoExt;
|
||||
pub use super::PlayerSubtitleInfoExt;
|
||||
pub use super::PlayerVideoInfoExt;
|
||||
pub use super::PlayerVideoOverlayVideoRendererExt;
|
||||
pub use super::PlayerVideoRendererExt;
|
||||
}
|
743
gstreamer-player/src/auto/player.rs
Normal file
743
gstreamer-player/src/auto/player.rs
Normal file
|
@ -0,0 +1,743 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use PlayerAudioInfo;
|
||||
use PlayerColorBalanceType;
|
||||
use PlayerMediaInfo;
|
||||
use PlayerSignalDispatcher;
|
||||
use PlayerSnapshotFormat;
|
||||
use PlayerState;
|
||||
use PlayerSubtitleInfo;
|
||||
use PlayerVideoInfo;
|
||||
use PlayerVideoRenderer;
|
||||
use PlayerVisualization;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use libc;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Player(Object<ffi::GstPlayer>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Player {
|
||||
pub fn new<'a, 'b, P: IsA<PlayerVideoRenderer> + 'a, Q: Into<Option<&'a P>>, R: IsA<PlayerSignalDispatcher> + 'b, S: Into<Option<&'b R>>>(video_renderer: Q, signal_dispatcher: S) -> Player {
|
||||
assert_initialized_main_thread!();
|
||||
let video_renderer = video_renderer.into();
|
||||
let video_renderer = video_renderer.to_glib_none();
|
||||
let signal_dispatcher = signal_dispatcher.into();
|
||||
let signal_dispatcher = signal_dispatcher.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_new(video_renderer.0, signal_dispatcher.0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn config_get_position_update_interval(config: &gst::Structure) -> u32 {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_player_config_get_position_update_interval(config.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn config_get_seek_accurate(config: &gst::Structure) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_config_get_seek_accurate(config.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn config_get_user_agent(config: &gst::Structure) -> Option<String> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_config_get_user_agent(config.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn config_set_position_update_interval(config: &mut gst::Structure, interval: u32) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_player_config_set_position_update_interval(config.to_glib_none_mut().0, interval);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn config_set_user_agent(config: &mut gst::Structure, agent: &str) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_player_config_set_user_agent(config.to_glib_none_mut().0, agent.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_audio_streams(info: &PlayerMediaInfo) -> Vec<PlayerAudioInfo> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_audio_streams(info.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_subtitle_streams(info: &PlayerMediaInfo) -> Vec<PlayerSubtitleInfo> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_subtitle_streams(info.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_video_streams(info: &PlayerMediaInfo) -> Vec<PlayerVideoInfo> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_video_streams(info.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn visualizations_free(viss: &mut PlayerVisualization) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_player_visualizations_free(viss.to_glib_none_mut().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn visualizations_get() -> Vec<PlayerVisualization> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_player_visualizations_get())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Player {}
|
||||
unsafe impl Sync for Player {}
|
||||
|
||||
pub trait PlayerExt {
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn config_set_seek_accurate(&self, accurate: bool);
|
||||
|
||||
fn get_audio_video_offset(&self) -> i64;
|
||||
|
||||
fn get_color_balance(&self, type_: PlayerColorBalanceType) -> f64;
|
||||
|
||||
fn get_config(&self) -> Option<gst::Structure>;
|
||||
|
||||
fn get_current_audio_track(&self) -> Option<PlayerAudioInfo>;
|
||||
|
||||
fn get_current_subtitle_track(&self) -> Option<PlayerSubtitleInfo>;
|
||||
|
||||
fn get_current_video_track(&self) -> Option<PlayerVideoInfo>;
|
||||
|
||||
fn get_current_visualization(&self) -> Option<String>;
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_media_info(&self) -> Option<PlayerMediaInfo>;
|
||||
|
||||
//fn get_multiview_flags(&self) -> /*Ignored*/gst_video::VideoMultiviewFlags;
|
||||
|
||||
//fn get_multiview_mode(&self) -> /*Ignored*/gst_video::VideoMultiviewMode;
|
||||
|
||||
fn get_mute(&self) -> bool;
|
||||
|
||||
fn get_pipeline(&self) -> Option<gst::Element>;
|
||||
|
||||
fn get_position(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_rate(&self) -> f64;
|
||||
|
||||
fn get_subtitle_uri(&self) -> Option<String>;
|
||||
|
||||
fn get_uri(&self) -> Option<String>;
|
||||
|
||||
fn get_video_snapshot<'a, P: Into<Option<&'a gst::Structure>>>(&self, format: PlayerSnapshotFormat, config: P) -> Option<gst::Sample>;
|
||||
|
||||
fn get_volume(&self) -> f64;
|
||||
|
||||
fn has_color_balance(&self) -> bool;
|
||||
|
||||
fn pause(&self);
|
||||
|
||||
fn play(&self);
|
||||
|
||||
fn seek(&self, position: gst::ClockTime);
|
||||
|
||||
fn set_audio_track(&self, stream_index: i32) -> bool;
|
||||
|
||||
fn set_audio_track_enabled(&self, enabled: bool);
|
||||
|
||||
fn set_audio_video_offset(&self, offset: i64);
|
||||
|
||||
fn set_color_balance(&self, type_: PlayerColorBalanceType, value: f64);
|
||||
|
||||
fn set_config(&self, config: &mut gst::Structure) -> bool;
|
||||
|
||||
//fn set_multiview_flags(&self, flags: /*Ignored*/gst_video::VideoMultiviewFlags);
|
||||
|
||||
//fn set_multiview_mode(&self, mode: /*Ignored*/gst_video::VideoMultiviewMode);
|
||||
|
||||
fn set_mute(&self, val: bool);
|
||||
|
||||
fn set_rate(&self, rate: f64);
|
||||
|
||||
fn set_subtitle_track(&self, stream_index: i32) -> bool;
|
||||
|
||||
fn set_subtitle_track_enabled(&self, enabled: bool);
|
||||
|
||||
fn set_subtitle_uri(&self, uri: &str);
|
||||
|
||||
fn set_uri(&self, uri: &str);
|
||||
|
||||
fn set_video_track(&self, stream_index: i32) -> bool;
|
||||
|
||||
fn set_video_track_enabled(&self, enabled: bool);
|
||||
|
||||
fn set_visualization(&self, name: &str) -> bool;
|
||||
|
||||
fn set_visualization_enabled(&self, enabled: bool);
|
||||
|
||||
fn set_volume(&self, val: f64);
|
||||
|
||||
fn stop(&self);
|
||||
|
||||
fn get_property_suburi(&self) -> Option<String>;
|
||||
|
||||
fn set_property_suburi(&self, suburi: Option<&str>);
|
||||
|
||||
//fn get_property_video_multiview_flags(&self) -> /*Ignored*/gst_video::VideoMultiviewFlags;
|
||||
|
||||
//fn set_property_video_multiview_flags(&self, video_multiview_flags: /*Ignored*/gst_video::VideoMultiviewFlags);
|
||||
|
||||
//fn get_property_video_multiview_mode(&self) -> /*Ignored*/gst_video::VideoMultiviewFramePacking;
|
||||
|
||||
//fn set_property_video_multiview_mode(&self, video_multiview_mode: /*Ignored*/gst_video::VideoMultiviewFramePacking);
|
||||
|
||||
fn connect_buffering<F: Fn(&Self, i32) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_duration_changed<F: Fn(&Self, u64) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_end_of_stream<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_error<F: Fn(&Self, &Error) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_media_info_updated<F: Fn(&Self, &PlayerMediaInfo) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_mute_changed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_position_updated<F: Fn(&Self, u64) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_seek_done<F: Fn(&Self, u64) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_state_changed<F: Fn(&Self, PlayerState) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_uri_loaded<F: Fn(&Self, &str) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_video_dimensions_changed<F: Fn(&Self, i32, i32) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_volume_changed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_warning<F: Fn(&Self, &Error) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
}
|
||||
|
||||
impl<O: IsA<Player> + IsA<glib::object::Object>> PlayerExt for O {
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn config_set_seek_accurate(&self, accurate: bool) {
|
||||
unsafe {
|
||||
ffi::gst_player_config_set_seek_accurate(self.to_glib_none().0, accurate.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn get_audio_video_offset(&self) -> i64 {
|
||||
unsafe {
|
||||
ffi::gst_player_get_audio_video_offset(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_color_balance(&self, type_: PlayerColorBalanceType) -> f64 {
|
||||
unsafe {
|
||||
ffi::gst_player_get_color_balance(self.to_glib_none().0, type_.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
fn get_config(&self) -> Option<gst::Structure> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_config(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_current_audio_track(&self) -> Option<PlayerAudioInfo> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_current_audio_track(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_current_subtitle_track(&self) -> Option<PlayerSubtitleInfo> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_get_current_subtitle_track(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_current_video_track(&self) -> Option<PlayerVideoInfo> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_current_video_track(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_current_visualization(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_current_visualization(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
ffi::gst_player_get_duration(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_media_info(&self) -> Option<PlayerMediaInfo> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_media_info(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_multiview_flags(&self) -> /*Ignored*/gst_video::VideoMultiviewFlags {
|
||||
// unsafe { TODO: call ffi::gst_player_get_multiview_flags() }
|
||||
//}
|
||||
|
||||
//fn get_multiview_mode(&self) -> /*Ignored*/gst_video::VideoMultiviewMode {
|
||||
// unsafe { TODO: call ffi::gst_player_get_multiview_mode() }
|
||||
//}
|
||||
|
||||
fn get_mute(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_get_mute(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_pipeline(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_pipeline(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_position(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
ffi::gst_player_get_position(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_rate(&self) -> f64 {
|
||||
unsafe {
|
||||
ffi::gst_player_get_rate(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_subtitle_uri(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_subtitle_uri(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uri(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_uri(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_video_snapshot<'a, P: Into<Option<&'a gst::Structure>>>(&self, format: PlayerSnapshotFormat, config: P) -> Option<gst::Sample> {
|
||||
let config = config.into();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_get_video_snapshot(self.to_glib_none().0, format.to_glib(), config.to_glib_none_mut().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_volume(&self) -> f64 {
|
||||
unsafe {
|
||||
ffi::gst_player_get_volume(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn has_color_balance(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_has_color_balance(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn pause(&self) {
|
||||
unsafe {
|
||||
ffi::gst_player_pause(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn play(&self) {
|
||||
unsafe {
|
||||
ffi::gst_player_play(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn seek(&self, position: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::gst_player_seek(self.to_glib_none().0, position);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_audio_track(&self, stream_index: i32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_set_audio_track(self.to_glib_none().0, stream_index))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_audio_track_enabled(&self, enabled: bool) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_audio_track_enabled(self.to_glib_none().0, enabled.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_audio_video_offset(&self, offset: i64) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_audio_video_offset(self.to_glib_none().0, offset);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_color_balance(&self, type_: PlayerColorBalanceType, value: f64) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_color_balance(self.to_glib_none().0, type_.to_glib(), value);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_config(&self, config: &mut gst::Structure) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_set_config(self.to_glib_none().0, config.to_glib_full()))
|
||||
}
|
||||
}
|
||||
|
||||
//fn set_multiview_flags(&self, flags: /*Ignored*/gst_video::VideoMultiviewFlags) {
|
||||
// unsafe { TODO: call ffi::gst_player_set_multiview_flags() }
|
||||
//}
|
||||
|
||||
//fn set_multiview_mode(&self, mode: /*Ignored*/gst_video::VideoMultiviewMode) {
|
||||
// unsafe { TODO: call ffi::gst_player_set_multiview_mode() }
|
||||
//}
|
||||
|
||||
fn set_mute(&self, val: bool) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_mute(self.to_glib_none().0, val.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_rate(&self, rate: f64) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_rate(self.to_glib_none().0, rate);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_subtitle_track(&self, stream_index: i32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_subtitle_track_enabled(&self, enabled: bool) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_subtitle_track_enabled(self.to_glib_none().0, enabled.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_subtitle_uri(&self, uri: &str) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_uri(&self, uri: &str) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_video_track(&self, stream_index: i32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_set_video_track(self.to_glib_none().0, stream_index))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_video_track_enabled(&self, enabled: bool) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_video_track_enabled(self.to_glib_none().0, enabled.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_visualization(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_set_visualization(self.to_glib_none().0, name.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_visualization_enabled(&self, enabled: bool) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_visualization_enabled(self.to_glib_none().0, enabled.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_volume(&self, val: f64) {
|
||||
unsafe {
|
||||
ffi::gst_player_set_volume(self.to_glib_none().0, val);
|
||||
}
|
||||
}
|
||||
|
||||
fn stop(&self) {
|
||||
unsafe {
|
||||
ffi::gst_player_stop(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_suburi(&self) -> Option<String> {
|
||||
let mut value = Value::from(None::<&str>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "suburi".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn set_property_suburi(&self, suburi: Option<&str>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "suburi".to_glib_none().0, Value::from(suburi).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_property_video_multiview_flags(&self) -> /*Ignored*/gst_video::VideoMultiviewFlags {
|
||||
// let mut value = Value::from(&0u32);
|
||||
// unsafe {
|
||||
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-multiview-flags".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
// from_glib(transmute(value.get::<u32>().unwrap()))
|
||||
// }
|
||||
//}
|
||||
|
||||
//fn set_property_video_multiview_flags(&self, video_multiview_flags: /*Ignored*/gst_video::VideoMultiviewFlags) {
|
||||
// let video_multiview_flags = video_multiview_flags.to_glib().bits() as u32;
|
||||
// unsafe {
|
||||
// gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-multiview-flags".to_glib_none().0, Value::from(&video_multiview_flags).to_glib_none().0);
|
||||
// }
|
||||
//}
|
||||
|
||||
//fn get_property_video_multiview_mode(&self) -> /*Ignored*/gst_video::VideoMultiviewFramePacking {
|
||||
// let mut value = Value::from(&0);
|
||||
// unsafe {
|
||||
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-multiview-mode".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
// from_glib(transmute(value.get::<i32>().unwrap()))
|
||||
// }
|
||||
//}
|
||||
|
||||
//fn set_property_video_multiview_mode(&self, video_multiview_mode: /*Ignored*/gst_video::VideoMultiviewFramePacking) {
|
||||
// let video_multiview_mode = video_multiview_mode.to_glib() as i32;
|
||||
// unsafe {
|
||||
// gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-multiview-mode".to_glib_none().0, Value::from(&video_multiview_mode).to_glib_none().0);
|
||||
// }
|
||||
//}
|
||||
|
||||
fn connect_buffering<F: Fn(&Self, i32) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, i32) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "buffering",
|
||||
transmute(buffering_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_duration_changed<F: Fn(&Self, u64) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, u64) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "duration-changed",
|
||||
transmute(duration_changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_end_of_stream<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "end-of-stream",
|
||||
transmute(end_of_stream_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_error<F: Fn(&Self, &Error) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Error) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "error",
|
||||
transmute(error_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_media_info_updated<F: Fn(&Self, &PlayerMediaInfo) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &PlayerMediaInfo) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "media-info-updated",
|
||||
transmute(media_info_updated_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_mute_changed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "mute-changed",
|
||||
transmute(mute_changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_position_updated<F: Fn(&Self, u64) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, u64) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "position-updated",
|
||||
transmute(position_updated_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_seek_done<F: Fn(&Self, u64) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, u64) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "seek-done",
|
||||
transmute(seek_done_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_state_changed<F: Fn(&Self, PlayerState) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, PlayerState) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "state-changed",
|
||||
transmute(state_changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_uri_loaded<F: Fn(&Self, &str) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &str) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "uri-loaded",
|
||||
transmute(uri_loaded_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_video_dimensions_changed<F: Fn(&Self, i32, i32) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, i32, i32) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "video-dimensions-changed",
|
||||
transmute(video_dimensions_changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_volume_changed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "volume-changed",
|
||||
transmute(volume_changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_warning<F: Fn(&Self, &Error) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Error) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "warning",
|
||||
transmute(warning_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn buffering_trampoline<P>(this: *mut ffi::GstPlayer, object: libc::c_int, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, i32) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), object)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn duration_changed_trampoline<P>(this: *mut ffi::GstPlayer, object: u64, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, u64) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), object)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn end_of_stream_trampoline<P>(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn error_trampoline<P>(this: *mut ffi::GstPlayer, object: *mut glib_ffi::GError, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, &Error) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), &from_glib_none(object))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn media_info_updated_trampoline<P>(this: *mut ffi::GstPlayer, object: *mut ffi::GstPlayerMediaInfo, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, &PlayerMediaInfo) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), &from_glib_none(object))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn mute_changed_trampoline<P>(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn position_updated_trampoline<P>(this: *mut ffi::GstPlayer, object: u64, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, u64) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), object)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn seek_done_trampoline<P>(this: *mut ffi::GstPlayer, object: u64, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, u64) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), object)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn state_changed_trampoline<P>(this: *mut ffi::GstPlayer, object: ffi::GstPlayerState, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, PlayerState) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), from_glib(object))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn uri_loaded_trampoline<P>(this: *mut ffi::GstPlayer, object: *mut libc::c_char, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, &str) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), &String::from_glib_none(object))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_dimensions_changed_trampoline<P>(this: *mut ffi::GstPlayer, object: libc::c_int, p0: libc::c_int, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, i32, i32) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), object, p0)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn volume_changed_trampoline<P>(this: *mut ffi::GstPlayer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn warning_trampoline<P>(this: *mut ffi::GstPlayer, object: *mut glib_ffi::GError, f: glib_ffi::gpointer)
|
||||
where P: IsA<Player> {
|
||||
callback_guard!();
|
||||
let f: &Box_<Fn(&P, &Error) + Send + Sync + 'static> = transmute(f);
|
||||
f(&Player::from_glib_none(this).downcast_unchecked(), &from_glib_none(object))
|
||||
}
|
66
gstreamer-player/src/auto/player_audio_info.rs
Normal file
66
gstreamer-player/src/auto/player_audio_info.rs
Normal file
|
@ -0,0 +1,66 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use PlayerStreamInfo;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerAudioInfo(Object<ffi::GstPlayerAudioInfo>): PlayerStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_audio_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerAudioInfo {}
|
||||
unsafe impl Sync for PlayerAudioInfo {}
|
||||
|
||||
pub trait PlayerAudioInfoExt {
|
||||
fn get_bitrate(&self) -> i32;
|
||||
|
||||
fn get_channels(&self) -> i32;
|
||||
|
||||
fn get_language(&self) -> Option<String>;
|
||||
|
||||
fn get_max_bitrate(&self) -> i32;
|
||||
|
||||
fn get_sample_rate(&self) -> i32;
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerAudioInfo>> PlayerAudioInfoExt for O {
|
||||
fn get_bitrate(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_audio_info_get_bitrate(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_channels(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_audio_info_get_channels(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_language(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_audio_info_get_language(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_max_bitrate(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_sample_rate(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_audio_info_get_sample_rate(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use PlayerSignalDispatcher;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerGMainContextSignalDispatcher(Object<ffi::GstPlayerGMainContextSignalDispatcher>): PlayerSignalDispatcher;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_g_main_context_signal_dispatcher_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl PlayerGMainContextSignalDispatcher {
|
||||
pub fn new<'a, P: Into<Option<&'a glib::MainContext>>>(application_context: P) -> Option<PlayerSignalDispatcher> {
|
||||
assert_initialized_main_thread!();
|
||||
let application_context = application_context.into();
|
||||
let application_context = application_context.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_player_g_main_context_signal_dispatcher_new(application_context.0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerGMainContextSignalDispatcher {}
|
||||
unsafe impl Sync for PlayerGMainContextSignalDispatcher {}
|
||||
|
||||
pub trait PlayerGMainContextSignalDispatcherExt {
|
||||
fn get_property_application_context(&self) -> Option<glib::MainContext>;
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerGMainContextSignalDispatcher> + IsA<glib::object::Object>> PlayerGMainContextSignalDispatcherExt for O {
|
||||
fn get_property_application_context(&self) -> Option<glib::MainContext> {
|
||||
let mut value = Value::from(None::<&glib::MainContext>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "application-context".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
}
|
166
gstreamer-player/src/auto/player_media_info.rs
Normal file
166
gstreamer-player/src/auto/player_media_info.rs
Normal file
|
@ -0,0 +1,166 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use PlayerAudioInfo;
|
||||
use PlayerStreamInfo;
|
||||
use PlayerSubtitleInfo;
|
||||
use PlayerVideoInfo;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerMediaInfo(Object<ffi::GstPlayerMediaInfo>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_media_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerMediaInfo {}
|
||||
unsafe impl Sync for PlayerMediaInfo {}
|
||||
|
||||
pub trait PlayerMediaInfoExt {
|
||||
fn get_audio_streams(&self) -> Vec<PlayerAudioInfo>;
|
||||
|
||||
fn get_container_format(&self) -> Option<String>;
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_image_sample(&self) -> Option<gst::Sample>;
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_audio_streams(&self) -> u32;
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_streams(&self) -> u32;
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_subtitle_streams(&self) -> u32;
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_video_streams(&self) -> u32;
|
||||
|
||||
fn get_stream_list(&self) -> Vec<PlayerStreamInfo>;
|
||||
|
||||
fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo>;
|
||||
|
||||
fn get_tags(&self) -> Option<gst::TagList>;
|
||||
|
||||
fn get_title(&self) -> Option<String>;
|
||||
|
||||
fn get_uri(&self) -> Option<String>;
|
||||
|
||||
fn get_video_streams(&self) -> Vec<PlayerVideoInfo>;
|
||||
|
||||
fn is_live(&self) -> bool;
|
||||
|
||||
fn is_seekable(&self) -> bool;
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerMediaInfo>> PlayerMediaInfoExt for O {
|
||||
fn get_audio_streams(&self) -> Vec<PlayerAudioInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_audio_streams(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_container_format(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_media_info_get_container_format(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
ffi::gst_player_media_info_get_duration(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_image_sample(&self) -> Option<gst::Sample> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_media_info_get_image_sample(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_audio_streams(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_streams(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::gst_player_media_info_get_number_of_streams(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_subtitle_streams(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::gst_player_media_info_get_number_of_subtitle_streams(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_12")]
|
||||
fn get_number_of_video_streams(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_list(&self) -> Vec<PlayerStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_stream_list(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_subtitle_streams(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tags(&self) -> Option<gst::TagList> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_media_info_get_tags(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_title(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_media_info_get_title(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uri(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_media_info_get_uri(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_video_streams(&self) -> Vec<PlayerVideoInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_video_streams(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_live(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_media_info_is_live(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_seekable(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_player_media_info_is_seekable(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
25
gstreamer-player/src/auto/player_signal_dispatcher.rs
Normal file
25
gstreamer-player/src/auto/player_signal_dispatcher.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerSignalDispatcher(Object<ffi::GstPlayerSignalDispatcher>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_signal_dispatcher_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerSignalDispatcher {}
|
||||
unsafe impl Sync for PlayerSignalDispatcher {}
|
||||
|
||||
pub trait PlayerSignalDispatcherExt {}
|
||||
|
||||
impl<O: IsA<PlayerSignalDispatcher>> PlayerSignalDispatcherExt for O {}
|
66
gstreamer-player/src/auto/player_stream_info.rs
Normal file
66
gstreamer-player/src/auto/player_stream_info.rs
Normal file
|
@ -0,0 +1,66 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerStreamInfo(Object<ffi::GstPlayerStreamInfo>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_stream_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerStreamInfo {}
|
||||
unsafe impl Sync for PlayerStreamInfo {}
|
||||
|
||||
pub trait PlayerStreamInfoExt {
|
||||
fn get_caps(&self) -> Option<gst::Caps>;
|
||||
|
||||
fn get_codec(&self) -> Option<String>;
|
||||
|
||||
fn get_index(&self) -> i32;
|
||||
|
||||
fn get_stream_type(&self) -> Option<String>;
|
||||
|
||||
fn get_tags(&self) -> Option<gst::TagList>;
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerStreamInfo>> PlayerStreamInfoExt for O {
|
||||
fn get_caps(&self) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_stream_info_get_caps(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_codec(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_stream_info_get_codec(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_index(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_stream_info_get_index(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_type(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_stream_info_get_stream_type(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tags(&self) -> Option<gst::TagList> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_stream_info_get_tags(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
34
gstreamer-player/src/auto/player_subtitle_info.rs
Normal file
34
gstreamer-player/src/auto/player_subtitle_info.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use PlayerStreamInfo;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerSubtitleInfo(Object<ffi::GstPlayerSubtitleInfo>): PlayerStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_subtitle_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerSubtitleInfo {}
|
||||
unsafe impl Sync for PlayerSubtitleInfo {}
|
||||
|
||||
pub trait PlayerSubtitleInfoExt {
|
||||
fn get_language(&self) -> Option<String>;
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerSubtitleInfo>> PlayerSubtitleInfoExt for O {
|
||||
fn get_language(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_player_subtitle_info_get_language(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
80
gstreamer-player/src/auto/player_video_info.rs
Normal file
80
gstreamer-player/src/auto/player_video_info.rs
Normal file
|
@ -0,0 +1,80 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use PlayerStreamInfo;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerVideoInfo(Object<ffi::GstPlayerVideoInfo>): PlayerStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_video_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerVideoInfo {}
|
||||
unsafe impl Sync for PlayerVideoInfo {}
|
||||
|
||||
pub trait PlayerVideoInfoExt {
|
||||
fn get_bitrate(&self) -> i32;
|
||||
|
||||
fn get_framerate(&self) -> (i32, i32);
|
||||
|
||||
fn get_height(&self) -> i32;
|
||||
|
||||
fn get_max_bitrate(&self) -> i32;
|
||||
|
||||
fn get_pixel_aspect_ratio(&self) -> (u32, u32);
|
||||
|
||||
fn get_width(&self) -> i32;
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerVideoInfo>> PlayerVideoInfoExt for O {
|
||||
fn get_bitrate(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_video_info_get_bitrate(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_framerate(&self) -> (i32, i32) {
|
||||
unsafe {
|
||||
let mut fps_n = mem::uninitialized();
|
||||
let mut fps_d = mem::uninitialized();
|
||||
ffi::gst_player_video_info_get_framerate(self.to_glib_none().0, &mut fps_n, &mut fps_d);
|
||||
(fps_n, fps_d)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_height(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_video_info_get_height(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_max_bitrate(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_video_info_get_max_bitrate(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_pixel_aspect_ratio(&self) -> (u32, u32) {
|
||||
unsafe {
|
||||
let mut par_n = mem::uninitialized();
|
||||
let mut par_d = mem::uninitialized();
|
||||
ffi::gst_player_video_info_get_pixel_aspect_ratio(self.to_glib_none().0, &mut par_n, &mut par_d);
|
||||
(par_n, par_d)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_width(&self) -> i32 {
|
||||
unsafe {
|
||||
ffi::gst_player_video_info_get_width(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use PlayerVideoRenderer;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerVideoOverlayVideoRenderer(Object<ffi::GstPlayerVideoOverlayVideoRenderer>): PlayerVideoRenderer;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_video_overlay_video_renderer_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl PlayerVideoOverlayVideoRenderer {
|
||||
//pub fn new<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(window_handle: P) -> Option<PlayerVideoRenderer> {
|
||||
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new() }
|
||||
//}
|
||||
|
||||
//pub fn new_with_sink<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: IsA<gst::Element>>(window_handle: P, video_sink: &Q) -> Option<PlayerVideoRenderer> {
|
||||
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new_with_sink() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerVideoOverlayVideoRenderer {}
|
||||
unsafe impl Sync for PlayerVideoOverlayVideoRenderer {}
|
||||
|
||||
pub trait PlayerVideoOverlayVideoRendererExt {
|
||||
fn expose(&self);
|
||||
|
||||
fn get_render_rectangle(&self) -> (i32, i32, i32, i32);
|
||||
|
||||
//fn get_window_handle(&self) -> /*Unimplemented*/Option<Fundamental: Pointer>;
|
||||
|
||||
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32);
|
||||
|
||||
//fn set_window_handle<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, window_handle: P);
|
||||
|
||||
fn get_property_video_sink(&self) -> Option<gst::Element>;
|
||||
|
||||
fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>);
|
||||
}
|
||||
|
||||
impl<O: IsA<PlayerVideoOverlayVideoRenderer> + IsA<glib::object::Object>> PlayerVideoOverlayVideoRendererExt for O {
|
||||
fn expose(&self) {
|
||||
unsafe {
|
||||
ffi::gst_player_video_overlay_video_renderer_expose(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_render_rectangle(&self) -> (i32, i32, i32, i32) {
|
||||
unsafe {
|
||||
let mut x = mem::uninitialized();
|
||||
let mut y = mem::uninitialized();
|
||||
let mut width = mem::uninitialized();
|
||||
let mut height = mem::uninitialized();
|
||||
ffi::gst_player_video_overlay_video_renderer_get_render_rectangle(self.to_glib_none().0, &mut x, &mut y, &mut width, &mut height);
|
||||
(x, y, width, height)
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_window_handle(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
|
||||
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_get_window_handle() }
|
||||
//}
|
||||
|
||||
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) {
|
||||
unsafe {
|
||||
ffi::gst_player_video_overlay_video_renderer_set_render_rectangle(self.to_glib_none().0, x, y, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
//fn set_window_handle<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, window_handle: P) {
|
||||
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_set_window_handle() }
|
||||
//}
|
||||
|
||||
fn get_property_video_sink(&self) -> Option<gst::Element> {
|
||||
let mut value = Value::from(None::<&gst::Element>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-sink".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-sink".to_glib_none().0, Value::from(video_sink).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
25
gstreamer-player/src/auto/player_video_renderer.rs
Normal file
25
gstreamer-player/src/auto/player_video_renderer.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerVideoRenderer(Object<ffi::GstPlayerVideoRenderer>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_player_video_renderer_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerVideoRenderer {}
|
||||
unsafe impl Sync for PlayerVideoRenderer {}
|
||||
|
||||
pub trait PlayerVideoRendererExt {}
|
||||
|
||||
impl<O: IsA<PlayerVideoRenderer>> PlayerVideoRendererExt for O {}
|
22
gstreamer-player/src/auto/player_visualization.rs
Normal file
22
gstreamer-player/src/auto/player_visualization.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
// This file was generated by gir (f00d658) from gir-files (???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PlayerVisualization(Boxed<ffi::GstPlayerVisualization>);
|
||||
|
||||
match fn {
|
||||
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(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for PlayerVisualization {}
|
||||
unsafe impl Sync for PlayerVisualization {}
|
Loading…
Reference in a new issue