2018-04-23 17:34:22 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2017-08-01 12:36:39 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
use glib;
|
2019-06-18 10:10:46 +00:00
|
|
|
use glib::object::ObjectType as ObjectType_;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2017-08-01 12:36:39 +00:00
|
|
|
use glib::translate::*;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::GString;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
2019-03-19 07:40:05 +00:00
|
|
|
use glib_sys;
|
|
|
|
use gobject_sys;
|
2017-08-01 12:36:39 +00:00
|
|
|
use gst;
|
2019-03-19 07:40:05 +00:00
|
|
|
use gst_player_sys;
|
2017-12-16 09:18:00 +00:00
|
|
|
use gst_video;
|
2017-08-01 12:36:39 +00:00
|
|
|
use libc;
|
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2019-06-18 10:12:00 +00:00
|
|
|
use PlayerAudioInfo;
|
|
|
|
use PlayerColorBalanceType;
|
|
|
|
use PlayerMediaInfo;
|
|
|
|
use PlayerSnapshotFormat;
|
|
|
|
use PlayerState;
|
|
|
|
use PlayerSubtitleInfo;
|
|
|
|
use PlayerVideoInfo;
|
|
|
|
use PlayerVisualization;
|
2017-08-01 12:36:39 +00:00
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-03-19 07:40:05 +00:00
|
|
|
pub struct Player(Object<gst_player_sys::GstPlayer, gst_player_sys::GstPlayerClass, PlayerClass>) @extends gst::Object;
|
2017-08-01 12:36:39 +00:00
|
|
|
|
|
|
|
match fn {
|
2019-03-19 07:40:05 +00:00
|
|
|
get_type => || gst_player_sys::gst_player_get_type(),
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Player {
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_audio_video_offset(&self) -> i64 {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { gst_player_sys::gst_player_get_audio_video_offset(self.to_glib_none().0) }
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_color_balance(&self, type_: PlayerColorBalanceType) -> f64 {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_get_color_balance(self.to_glib_none().0, type_.to_glib())
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_current_audio_track(&self) -> Option<PlayerAudioInfo> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_current_audio_track(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_current_subtitle_track(&self) -> Option<PlayerSubtitleInfo> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_none(gst_player_sys::gst_player_get_current_subtitle_track(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_current_video_track(&self) -> Option<PlayerVideoInfo> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_current_video_track(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
pub fn get_current_visualization(&self) -> Option<GString> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_current_visualization(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_duration(&self) -> gst::ClockTime {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(gst_player_sys::gst_player_get_duration(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_media_info(&self) -> Option<PlayerMediaInfo> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_media_info(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn get_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(gst_player_sys::gst_player_get_multiview_flags(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-12-16 09:18:00 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn get_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(gst_player_sys::gst_player_get_multiview_mode(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-12-16 09:18:00 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_mute(&self) -> bool {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { from_glib(gst_player_sys::gst_player_get_mute(self.to_glib_none().0)) }
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn get_pipeline(&self) -> gst::Element {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_pipeline(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_position(&self) -> gst::ClockTime {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(gst_player_sys::gst_player_get_position(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_rate(&self) -> f64 {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { gst_player_sys::gst_player_get_rate(self.to_glib_none().0) }
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
pub fn get_subtitle_uri(&self) -> Option<GString> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_subtitle_uri(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
pub fn get_subtitle_video_offset(&self) -> i64 {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { gst_player_sys::gst_player_get_subtitle_video_offset(self.to_glib_none().0) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
pub fn get_uri(&self) -> Option<GString> {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { from_glib_full(gst_player_sys::gst_player_get_uri(self.to_glib_none().0)) }
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn get_video_snapshot(
|
|
|
|
&self,
|
|
|
|
format: PlayerSnapshotFormat,
|
|
|
|
config: Option<&gst::Structure>,
|
|
|
|
) -> Option<gst::Sample> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_player_sys::gst_player_get_video_snapshot(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
format.to_glib(),
|
|
|
|
config.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn get_volume(&self) -> f64 {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { gst_player_sys::gst_player_get_volume(self.to_glib_none().0) }
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn has_color_balance(&self) -> bool {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(gst_player_sys::gst_player_has_color_balance(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn pause(&self) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_pause(self.to_glib_none().0);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn play(&self) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_play(self.to_glib_none().0);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn seek(&self, position: gst::ClockTime) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_seek(self.to_glib_none().0, position.to_glib());
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
gst_player_sys::gst_player_set_audio_track(self.to_glib_none().0, stream_index),
|
|
|
|
"Failed to set audio track"
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_audio_track_enabled(&self, enabled: bool) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_player_sys::gst_player_set_audio_track_enabled(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
enabled.to_glib(),
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_audio_video_offset(&self, offset: i64) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_audio_video_offset(self.to_glib_none().0, offset);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_color_balance(&self, type_: PlayerColorBalanceType, value: f64) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_player_sys::gst_player_set_color_balance(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
type_.to_glib(),
|
|
|
|
value,
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_multiview_flags(self.to_glib_none().0, flags.to_glib());
|
2017-12-16 09:18:00 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_multiview_mode(self.to_glib_none().0, mode.to_glib());
|
2017-12-16 09:18:00 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_mute(&self, val: bool) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_mute(self.to_glib_none().0, val.to_glib());
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_rate(&self, rate: f64) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_rate(self.to_glib_none().0, rate);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
gst_player_sys::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index),
|
|
|
|
"Failed to set subtitle track"
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_subtitle_track_enabled(&self, enabled: bool) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_player_sys::gst_player_set_subtitle_track_enabled(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
enabled.to_glib(),
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_subtitle_uri(&self, uri: &str) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_player_sys::gst_player_set_subtitle_uri(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
uri.to_glib_none().0,
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
pub fn set_subtitle_video_offset(&self, offset: i64) {
|
|
|
|
unsafe {
|
|
|
|
gst_player_sys::gst_player_set_subtitle_video_offset(self.to_glib_none().0, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_uri(&self, uri: &str) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
gst_player_sys::gst_player_set_video_track(self.to_glib_none().0, stream_index),
|
|
|
|
"Failed to set video track"
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_video_track_enabled(&self, enabled: bool) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_player_sys::gst_player_set_video_track_enabled(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
enabled.to_glib(),
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
gst_player_sys::gst_player_set_visualization(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
name.to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to set visualization"
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_visualization_enabled(&self, enabled: bool) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_player_sys::gst_player_set_visualization_enabled(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
enabled.to_glib(),
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn set_volume(&self, val: f64) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_set_volume(self.to_glib_none().0, val);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
pub fn stop(&self) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_player_sys::gst_player_stop(self.to_glib_none().0);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
pub fn get_property_suburi(&self) -> Option<GString> {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2018-12-09 16:06:12 +00:00
|
|
|
let mut value = Value::from_type(<GString as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"suburi\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `suburi` getter")
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
pub fn set_property_suburi(&self, suburi: Option<&str>) {
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_set_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"suburi\0".as_ptr() as *const _,
|
|
|
|
Value::from(suburi).to_glib_none().0,
|
|
|
|
);
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn get_property_video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
|
2017-08-07 14:35:57 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
let mut value =
|
|
|
|
Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
|
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"video-multiview-flags\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `video-multiview-flags` getter")
|
|
|
|
.unwrap()
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn set_property_video_multiview_flags(
|
|
|
|
&self,
|
|
|
|
video_multiview_flags: gst_video::VideoMultiviewFlags,
|
|
|
|
) {
|
2017-08-07 14:35:57 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_set_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"video-multiview-flags\0".as_ptr() as *const _,
|
|
|
|
Value::from(&video_multiview_flags).to_glib_none().0,
|
|
|
|
);
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub fn get_property_video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
|
2017-08-07 14:35:57 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
let mut value = Value::from_type(
|
|
|
|
<gst_video::VideoMultiviewFramePacking as StaticType>::static_type(),
|
|
|
|
);
|
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"video-multiview-mode\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `video-multiview-mode` getter")
|
|
|
|
.unwrap()
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn set_property_video_multiview_mode(
|
|
|
|
&self,
|
|
|
|
video_multiview_mode: gst_video::VideoMultiviewFramePacking,
|
|
|
|
) {
|
2017-08-07 14:35:57 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_set_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"video-multiview-mode\0".as_ptr() as *const _,
|
|
|
|
Value::from(&video_multiview_mode).to_glib_none().0,
|
|
|
|
);
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_audio_streams(info: &PlayerMediaInfo) -> Vec<PlayerAudioInfo> {
|
2017-08-07 14:35:57 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_audio_streams(
|
|
|
|
info.to_glib_none().0,
|
|
|
|
))
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_subtitle_streams(info: &PlayerMediaInfo) -> Vec<PlayerSubtitleInfo> {
|
2017-08-07 14:35:57 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_subtitle_streams(
|
|
|
|
info.to_glib_none().0,
|
|
|
|
))
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_video_streams(info: &PlayerMediaInfo) -> Vec<PlayerVideoInfo> {
|
2017-08-07 14:35:57 +00:00
|
|
|
skip_assert_initialized!();
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_video_streams(
|
|
|
|
info.to_glib_none().0,
|
|
|
|
))
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn visualizations_get() -> Vec<PlayerVisualization> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(gst_player_sys::gst_player_visualizations_get())
|
2017-08-07 14:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
pub fn connect_buffering<F: Fn(&Player, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn buffering_trampoline<F: Fn(&Player, i32) + Send + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: libc::c_int,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), object)
|
|
|
|
}
|
2017-08-07 14:35:57 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"buffering\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
buffering_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
pub fn connect_end_of_stream<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn end_of_stream_trampoline<F: Fn(&Player) + Send + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"end-of-stream\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
end_of_stream_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-10 16:55:02 +00:00
|
|
|
pub fn connect_error<F: Fn(&Player, &glib::Error) + Send + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn error_trampoline<F: Fn(&Player, &glib::Error) + Send + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: *mut glib_sys::GError,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), &from_glib_borrow(object))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"error\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
error_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_media_info_updated<F: Fn(&Player, &PlayerMediaInfo) + Send + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn media_info_updated_trampoline<
|
|
|
|
F: Fn(&Player, &PlayerMediaInfo) + Send + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: *mut gst_player_sys::GstPlayerMediaInfo,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), &from_glib_borrow(object))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"media-info-updated\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
media_info_updated_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
pub fn connect_mute_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn mute_changed_trampoline<F: Fn(&Player) + Send + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"mute-changed\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
mute_changed_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_state_changed<F: Fn(&Player, PlayerState) + Send + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn state_changed_trampoline<
|
|
|
|
F: Fn(&Player, PlayerState) + Send + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: gst_player_sys::GstPlayerState,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), from_glib(object))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"state-changed\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
state_changed_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_uri_loaded<F: Fn(&Player, &str) + Send + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn uri_loaded_trampoline<F: Fn(&Player, &str) + Send + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: *mut libc::c_char,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), &GString::from_glib_borrow(object))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"uri-loaded\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
uri_loaded_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_video_dimensions_changed<F: Fn(&Player, i32, i32) + Send + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn video_dimensions_changed_trampoline<
|
|
|
|
F: Fn(&Player, i32, i32) + Send + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: libc::c_int,
|
|
|
|
p0: libc::c_int,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), object, p0)
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"video-dimensions-changed\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
video_dimensions_changed_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
pub fn connect_volume_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn volume_changed_trampoline<F: Fn(&Player) + Send + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"volume-changed\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
volume_changed_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-10 16:55:02 +00:00
|
|
|
pub fn connect_warning<F: Fn(&Player, &glib::Error) + Send + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
2019-11-10 16:55:02 +00:00
|
|
|
unsafe extern "C" fn warning_trampoline<F: Fn(&Player, &glib::Error) + Send + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
object: *mut glib_sys::GError,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this), &from_glib_borrow(object))
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"warning\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
warning_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_audio_video_offset_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_audio_video_offset_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::audio-video-offset\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_audio_video_offset_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_current_audio_track_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_current_audio_track_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::current-audio-track\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_current_audio_track_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_current_subtitle_track_notify<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_current_subtitle_track_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::current-subtitle-track\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_current_subtitle_track_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_current_video_track_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_current_video_track_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::current-video-track\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_current_video_track_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_duration_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::duration\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_duration_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_media_info_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_media_info_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::media-info\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_media_info_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_mute_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::mute\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_mute_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_pipeline_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::pipeline\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_pipeline_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_position_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_position_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::position\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_position_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_rate_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::rate\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_rate_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-30 11:45:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-23 14:32:09 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn connect_property_subtitle_video_offset_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2019-04-23 14:32:09 +00:00
|
|
|
unsafe {
|
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::subtitle-video-offset\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_subtitle_video_offset_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_suburi_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::suburi\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_suburi_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_uri_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::uri\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_uri_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_video_multiview_flags_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_video_multiview_flags_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::video-multiview-flags\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_video_multiview_flags_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_video_multiview_mode_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_video_multiview_mode_trampoline<
|
|
|
|
F: Fn(&Player) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::video-multiview-mode\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_video_multiview_mode_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_volume_notify<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_player_sys::GstPlayer,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-08-30 11:45:25 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::volume\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_volume_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-30 11:45:25 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-01 12:36:39 +00:00
|
|
|
}
|
|
|
|
|
2017-08-07 14:35:57 +00:00
|
|
|
unsafe impl Send for Player {}
|
|
|
|
unsafe impl Sync for Player {}
|