gstreamer-player: Regenerate

This commit is contained in:
Sebastian Dröge 2020-11-22 12:29:02 +02:00
parent e7d6167409
commit 0b1dd5ecfc
13 changed files with 313 additions and 431 deletions

View file

@ -11,8 +11,6 @@ use glib::value::Value;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_player_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
@ -27,26 +25,22 @@ pub enum PlayerColorBalanceType {
#[doc(hidden)]
impl ToGlib for PlayerColorBalanceType {
type GlibType = gst_player_sys::GstPlayerColorBalanceType;
type GlibType = ffi::GstPlayerColorBalanceType;
fn to_glib(&self) -> gst_player_sys::GstPlayerColorBalanceType {
fn to_glib(&self) -> ffi::GstPlayerColorBalanceType {
match *self {
PlayerColorBalanceType::Hue => gst_player_sys::GST_PLAYER_COLOR_BALANCE_HUE,
PlayerColorBalanceType::Brightness => {
gst_player_sys::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS
}
PlayerColorBalanceType::Saturation => {
gst_player_sys::GST_PLAYER_COLOR_BALANCE_SATURATION
}
PlayerColorBalanceType::Contrast => gst_player_sys::GST_PLAYER_COLOR_BALANCE_CONTRAST,
PlayerColorBalanceType::Hue => ffi::GST_PLAYER_COLOR_BALANCE_HUE,
PlayerColorBalanceType::Brightness => ffi::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS,
PlayerColorBalanceType::Saturation => ffi::GST_PLAYER_COLOR_BALANCE_SATURATION,
PlayerColorBalanceType::Contrast => ffi::GST_PLAYER_COLOR_BALANCE_CONTRAST,
PlayerColorBalanceType::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_player_sys::GstPlayerColorBalanceType> for PlayerColorBalanceType {
fn from_glib(value: gst_player_sys::GstPlayerColorBalanceType) -> Self {
impl FromGlib<ffi::GstPlayerColorBalanceType> for PlayerColorBalanceType {
fn from_glib(value: ffi::GstPlayerColorBalanceType) -> Self {
skip_assert_initialized!();
match value {
3 => PlayerColorBalanceType::Hue,
@ -60,7 +54,7 @@ impl FromGlib<gst_player_sys::GstPlayerColorBalanceType> for PlayerColorBalanceT
impl StaticType for PlayerColorBalanceType {
fn static_type() -> Type {
unsafe { from_glib(gst_player_sys::gst_player_color_balance_type_get_type()) }
unsafe { from_glib(ffi::gst_player_color_balance_type_get_type()) }
}
}
@ -72,13 +66,13 @@ impl<'a> FromValueOptional<'a> for PlayerColorBalanceType {
impl<'a> FromValue<'a> for PlayerColorBalanceType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for PlayerColorBalanceType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -92,19 +86,19 @@ pub enum PlayerError {
#[doc(hidden)]
impl ToGlib for PlayerError {
type GlibType = gst_player_sys::GstPlayerError;
type GlibType = ffi::GstPlayerError;
fn to_glib(&self) -> gst_player_sys::GstPlayerError {
fn to_glib(&self) -> ffi::GstPlayerError {
match *self {
PlayerError::Failed => gst_player_sys::GST_PLAYER_ERROR_FAILED,
PlayerError::Failed => ffi::GST_PLAYER_ERROR_FAILED,
PlayerError::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_player_sys::GstPlayerError> for PlayerError {
fn from_glib(value: gst_player_sys::GstPlayerError) -> Self {
impl FromGlib<ffi::GstPlayerError> for PlayerError {
fn from_glib(value: ffi::GstPlayerError) -> Self {
skip_assert_initialized!();
match value {
0 => PlayerError::Failed,
@ -117,7 +111,7 @@ impl ErrorDomain for PlayerError {
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(gst_player_sys::gst_player_error_quark()) }
unsafe { from_glib(ffi::gst_player_error_quark()) }
}
fn code(self) -> i32 {
@ -135,7 +129,7 @@ impl ErrorDomain for PlayerError {
impl StaticType for PlayerError {
fn static_type() -> Type {
unsafe { from_glib(gst_player_sys::gst_player_error_get_type()) }
unsafe { from_glib(ffi::gst_player_error_get_type()) }
}
}
@ -147,13 +141,13 @@ impl<'a> FromValueOptional<'a> for PlayerError {
impl<'a> FromValue<'a> for PlayerError {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for PlayerError {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
@ -171,23 +165,23 @@ pub enum PlayerSnapshotFormat {
#[doc(hidden)]
impl ToGlib for PlayerSnapshotFormat {
type GlibType = gst_player_sys::GstPlayerSnapshotFormat;
type GlibType = ffi::GstPlayerSnapshotFormat;
fn to_glib(&self) -> gst_player_sys::GstPlayerSnapshotFormat {
fn to_glib(&self) -> ffi::GstPlayerSnapshotFormat {
match *self {
PlayerSnapshotFormat::RawNative => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_NATIVE,
PlayerSnapshotFormat::RawXrgb => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_xRGB,
PlayerSnapshotFormat::RawBgrx => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_BGRx,
PlayerSnapshotFormat::Jpg => gst_player_sys::GST_PLAYER_THUMBNAIL_JPG,
PlayerSnapshotFormat::Png => gst_player_sys::GST_PLAYER_THUMBNAIL_PNG,
PlayerSnapshotFormat::RawNative => ffi::GST_PLAYER_THUMBNAIL_RAW_NATIVE,
PlayerSnapshotFormat::RawXrgb => ffi::GST_PLAYER_THUMBNAIL_RAW_xRGB,
PlayerSnapshotFormat::RawBgrx => ffi::GST_PLAYER_THUMBNAIL_RAW_BGRx,
PlayerSnapshotFormat::Jpg => ffi::GST_PLAYER_THUMBNAIL_JPG,
PlayerSnapshotFormat::Png => ffi::GST_PLAYER_THUMBNAIL_PNG,
PlayerSnapshotFormat::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_player_sys::GstPlayerSnapshotFormat> for PlayerSnapshotFormat {
fn from_glib(value: gst_player_sys::GstPlayerSnapshotFormat) -> Self {
impl FromGlib<ffi::GstPlayerSnapshotFormat> for PlayerSnapshotFormat {
fn from_glib(value: ffi::GstPlayerSnapshotFormat) -> Self {
skip_assert_initialized!();
match value {
0 => PlayerSnapshotFormat::RawNative,
@ -213,22 +207,22 @@ pub enum PlayerState {
#[doc(hidden)]
impl ToGlib for PlayerState {
type GlibType = gst_player_sys::GstPlayerState;
type GlibType = ffi::GstPlayerState;
fn to_glib(&self) -> gst_player_sys::GstPlayerState {
fn to_glib(&self) -> ffi::GstPlayerState {
match *self {
PlayerState::Stopped => gst_player_sys::GST_PLAYER_STATE_STOPPED,
PlayerState::Buffering => gst_player_sys::GST_PLAYER_STATE_BUFFERING,
PlayerState::Paused => gst_player_sys::GST_PLAYER_STATE_PAUSED,
PlayerState::Playing => gst_player_sys::GST_PLAYER_STATE_PLAYING,
PlayerState::Stopped => ffi::GST_PLAYER_STATE_STOPPED,
PlayerState::Buffering => ffi::GST_PLAYER_STATE_BUFFERING,
PlayerState::Paused => ffi::GST_PLAYER_STATE_PAUSED,
PlayerState::Playing => ffi::GST_PLAYER_STATE_PLAYING,
PlayerState::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_player_sys::GstPlayerState> for PlayerState {
fn from_glib(value: gst_player_sys::GstPlayerState) -> Self {
impl FromGlib<ffi::GstPlayerState> for PlayerState {
fn from_glib(value: ffi::GstPlayerState) -> Self {
skip_assert_initialized!();
match value {
0 => PlayerState::Stopped,
@ -242,7 +236,7 @@ impl FromGlib<gst_player_sys::GstPlayerState> for PlayerState {
impl StaticType for PlayerState {
fn static_type() -> Type {
unsafe { from_glib(gst_player_sys::gst_player_state_get_type()) }
unsafe { from_glib(ffi::gst_player_state_get_type()) }
}
}
@ -254,12 +248,12 @@ impl<'a> FromValueOptional<'a> for PlayerState {
impl<'a> FromValue<'a> for PlayerState {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl SetValue for PlayerState {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,53 +2,43 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::PlayerAudioInfo;
use crate::PlayerColorBalanceType;
use crate::PlayerMediaInfo;
use crate::PlayerSnapshotFormat;
use crate::PlayerState;
use crate::PlayerSubtitleInfo;
use crate::PlayerVideoInfo;
use crate::PlayerVisualization;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_player_sys;
use gst_video;
use libc;
use std::boxed::Box as Box_;
use std::mem::transmute;
use PlayerAudioInfo;
use PlayerColorBalanceType;
use PlayerMediaInfo;
use PlayerSnapshotFormat;
use PlayerState;
use PlayerSubtitleInfo;
use PlayerVideoInfo;
use PlayerVisualization;
glib_wrapper! {
pub struct Player(Object<gst_player_sys::GstPlayer, gst_player_sys::GstPlayerClass>) @extends gst::Object;
glib::glib_wrapper! {
pub struct Player(Object<ffi::GstPlayer, ffi::GstPlayerClass>) @extends gst::Object;
match fn {
get_type => || gst_player_sys::gst_player_get_type(),
get_type => || ffi::gst_player_get_type(),
}
}
impl Player {
pub fn get_audio_video_offset(&self) -> i64 {
unsafe { gst_player_sys::gst_player_get_audio_video_offset(self.to_glib_none().0) }
unsafe { ffi::gst_player_get_audio_video_offset(self.to_glib_none().0) }
}
pub fn get_color_balance(&self, type_: PlayerColorBalanceType) -> f64 {
unsafe {
gst_player_sys::gst_player_get_color_balance(self.to_glib_none().0, type_.to_glib())
}
unsafe { ffi::gst_player_get_color_balance(self.to_glib_none().0, type_.to_glib()) }
}
pub fn get_current_audio_track(&self) -> Option<PlayerAudioInfo> {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_current_audio_track(
from_glib_full(ffi::gst_player_get_current_audio_track(
self.to_glib_none().0,
))
}
@ -56,7 +46,7 @@ impl Player {
pub fn get_current_subtitle_track(&self) -> Option<PlayerSubtitleInfo> {
unsafe {
from_glib_none(gst_player_sys::gst_player_get_current_subtitle_track(
from_glib_none(ffi::gst_player_get_current_subtitle_track(
self.to_glib_none().0,
))
}
@ -64,92 +54,64 @@ impl Player {
pub fn get_current_video_track(&self) -> Option<PlayerVideoInfo> {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_current_video_track(
from_glib_full(ffi::gst_player_get_current_video_track(
self.to_glib_none().0,
))
}
}
pub fn get_current_visualization(&self) -> Option<GString> {
pub fn get_current_visualization(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_current_visualization(
from_glib_full(ffi::gst_player_get_current_visualization(
self.to_glib_none().0,
))
}
}
pub fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_player_sys::gst_player_get_duration(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_player_get_duration(self.to_glib_none().0)) }
}
pub fn get_media_info(&self) -> Option<PlayerMediaInfo> {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_media_info(
self.to_glib_none().0,
))
}
unsafe { from_glib_full(ffi::gst_player_get_media_info(self.to_glib_none().0)) }
}
pub fn get_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
unsafe {
from_glib(gst_player_sys::gst_player_get_multiview_flags(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_player_get_multiview_flags(self.to_glib_none().0)) }
}
pub fn get_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
unsafe {
from_glib(gst_player_sys::gst_player_get_multiview_mode(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_player_get_multiview_mode(self.to_glib_none().0)) }
}
pub fn get_mute(&self) -> bool {
unsafe { from_glib(gst_player_sys::gst_player_get_mute(self.to_glib_none().0)) }
unsafe { from_glib(ffi::gst_player_get_mute(self.to_glib_none().0)) }
}
pub fn get_pipeline(&self) -> gst::Element {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_pipeline(
self.to_glib_none().0,
))
}
unsafe { from_glib_full(ffi::gst_player_get_pipeline(self.to_glib_none().0)) }
}
pub fn get_position(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_player_sys::gst_player_get_position(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_player_get_position(self.to_glib_none().0)) }
}
pub fn get_rate(&self) -> f64 {
unsafe { gst_player_sys::gst_player_get_rate(self.to_glib_none().0) }
unsafe { ffi::gst_player_get_rate(self.to_glib_none().0) }
}
pub fn get_subtitle_uri(&self) -> Option<GString> {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_subtitle_uri(
self.to_glib_none().0,
))
}
pub fn get_subtitle_uri(&self) -> Option<glib::GString> {
unsafe { from_glib_full(ffi::gst_player_get_subtitle_uri(self.to_glib_none().0)) }
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
pub fn get_subtitle_video_offset(&self) -> i64 {
unsafe { gst_player_sys::gst_player_get_subtitle_video_offset(self.to_glib_none().0) }
unsafe { ffi::gst_player_get_subtitle_video_offset(self.to_glib_none().0) }
}
pub fn get_uri(&self) -> Option<GString> {
unsafe { from_glib_full(gst_player_sys::gst_player_get_uri(self.to_glib_none().0)) }
pub fn get_uri(&self) -> Option<glib::GString> {
unsafe { from_glib_full(ffi::gst_player_get_uri(self.to_glib_none().0)) }
}
pub fn get_video_snapshot(
@ -158,7 +120,7 @@ impl Player {
config: Option<&gst::Structure>,
) -> Option<gst::Sample> {
unsafe {
from_glib_full(gst_player_sys::gst_player_get_video_snapshot(
from_glib_full(ffi::gst_player_get_video_snapshot(
self.to_glib_none().0,
format.to_glib(),
config.to_glib_none().0,
@ -167,39 +129,35 @@ impl Player {
}
pub fn get_volume(&self) -> f64 {
unsafe { gst_player_sys::gst_player_get_volume(self.to_glib_none().0) }
unsafe { ffi::gst_player_get_volume(self.to_glib_none().0) }
}
pub fn has_color_balance(&self) -> bool {
unsafe {
from_glib(gst_player_sys::gst_player_has_color_balance(
self.to_glib_none().0,
))
}
unsafe { from_glib(ffi::gst_player_has_color_balance(self.to_glib_none().0)) }
}
pub fn pause(&self) {
unsafe {
gst_player_sys::gst_player_pause(self.to_glib_none().0);
ffi::gst_player_pause(self.to_glib_none().0);
}
}
pub fn play(&self) {
unsafe {
gst_player_sys::gst_player_play(self.to_glib_none().0);
ffi::gst_player_play(self.to_glib_none().0);
}
}
pub fn seek(&self, position: gst::ClockTime) {
unsafe {
gst_player_sys::gst_player_seek(self.to_glib_none().0, position.to_glib());
ffi::gst_player_seek(self.to_glib_none().0, position.to_glib());
}
}
pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_player_sys::gst_player_set_audio_track(self.to_glib_none().0, stream_index),
glib::glib_result_from_gboolean!(
ffi::gst_player_set_audio_track(self.to_glib_none().0, stream_index),
"Failed to set audio track"
)
}
@ -207,57 +165,50 @@ impl Player {
pub fn set_audio_track_enabled(&self, enabled: bool) {
unsafe {
gst_player_sys::gst_player_set_audio_track_enabled(
self.to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_player_set_audio_track_enabled(self.to_glib_none().0, enabled.to_glib());
}
}
pub fn set_audio_video_offset(&self, offset: i64) {
unsafe {
gst_player_sys::gst_player_set_audio_video_offset(self.to_glib_none().0, offset);
ffi::gst_player_set_audio_video_offset(self.to_glib_none().0, offset);
}
}
pub fn set_color_balance(&self, type_: PlayerColorBalanceType, value: f64) {
unsafe {
gst_player_sys::gst_player_set_color_balance(
self.to_glib_none().0,
type_.to_glib(),
value,
);
ffi::gst_player_set_color_balance(self.to_glib_none().0, type_.to_glib(), value);
}
}
pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
unsafe {
gst_player_sys::gst_player_set_multiview_flags(self.to_glib_none().0, flags.to_glib());
ffi::gst_player_set_multiview_flags(self.to_glib_none().0, flags.to_glib());
}
}
pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
unsafe {
gst_player_sys::gst_player_set_multiview_mode(self.to_glib_none().0, mode.to_glib());
ffi::gst_player_set_multiview_mode(self.to_glib_none().0, mode.to_glib());
}
}
pub fn set_mute(&self, val: bool) {
unsafe {
gst_player_sys::gst_player_set_mute(self.to_glib_none().0, val.to_glib());
ffi::gst_player_set_mute(self.to_glib_none().0, val.to_glib());
}
}
pub fn set_rate(&self, rate: f64) {
unsafe {
gst_player_sys::gst_player_set_rate(self.to_glib_none().0, rate);
ffi::gst_player_set_rate(self.to_glib_none().0, rate);
}
}
pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_player_sys::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index),
glib::glib_result_from_gboolean!(
ffi::gst_player_set_subtitle_track(self.to_glib_none().0, stream_index),
"Failed to set subtitle track"
)
}
@ -265,19 +216,13 @@ impl Player {
pub fn set_subtitle_track_enabled(&self, enabled: bool) {
unsafe {
gst_player_sys::gst_player_set_subtitle_track_enabled(
self.to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_player_set_subtitle_track_enabled(self.to_glib_none().0, enabled.to_glib());
}
}
pub fn set_subtitle_uri(&self, uri: &str) {
unsafe {
gst_player_sys::gst_player_set_subtitle_uri(
self.to_glib_none().0,
uri.to_glib_none().0,
);
ffi::gst_player_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
}
}
@ -285,20 +230,20 @@ impl Player {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
pub fn set_subtitle_video_offset(&self, offset: i64) {
unsafe {
gst_player_sys::gst_player_set_subtitle_video_offset(self.to_glib_none().0, offset);
ffi::gst_player_set_subtitle_video_offset(self.to_glib_none().0, offset);
}
}
pub fn set_uri(&self, uri: &str) {
unsafe {
gst_player_sys::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
ffi::gst_player_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
}
}
pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_player_sys::gst_player_set_video_track(self.to_glib_none().0, stream_index),
glib::glib_result_from_gboolean!(
ffi::gst_player_set_video_track(self.to_glib_none().0, stream_index),
"Failed to set video track"
)
}
@ -306,20 +251,14 @@ impl Player {
pub fn set_video_track_enabled(&self, enabled: bool) {
unsafe {
gst_player_sys::gst_player_set_video_track_enabled(
self.to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_player_set_video_track_enabled(self.to_glib_none().0, enabled.to_glib());
}
}
pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
gst_player_sys::gst_player_set_visualization(
self.to_glib_none().0,
name.to_glib_none().0
),
glib::glib_result_from_gboolean!(
ffi::gst_player_set_visualization(self.to_glib_none().0, name.to_glib_none().0),
"Failed to set visualization"
)
}
@ -327,30 +266,27 @@ impl Player {
pub fn set_visualization_enabled(&self, enabled: bool) {
unsafe {
gst_player_sys::gst_player_set_visualization_enabled(
self.to_glib_none().0,
enabled.to_glib(),
);
ffi::gst_player_set_visualization_enabled(self.to_glib_none().0, enabled.to_glib());
}
}
pub fn set_volume(&self, val: f64) {
unsafe {
gst_player_sys::gst_player_set_volume(self.to_glib_none().0, val);
ffi::gst_player_set_volume(self.to_glib_none().0, val);
}
}
pub fn stop(&self) {
unsafe {
gst_player_sys::gst_player_stop(self.to_glib_none().0);
ffi::gst_player_stop(self.to_glib_none().0);
}
}
pub fn get_property_suburi(&self) -> Option<GString> {
pub fn get_property_suburi(&self) -> Option<glib::GString> {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
let mut value = Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"suburi\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -362,8 +298,8 @@ impl Player {
pub fn set_property_suburi(&self, suburi: Option<&str>) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"suburi\0".as_ptr() as *const _,
Value::from(suburi).to_glib_none().0,
);
@ -374,8 +310,8 @@ impl Player {
unsafe {
let mut value =
Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"video-multiview-flags\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -391,8 +327,8 @@ impl Player {
video_multiview_flags: gst_video::VideoMultiviewFlags,
) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"video-multiview-flags\0".as_ptr() as *const _,
Value::from(&video_multiview_flags).to_glib_none().0,
);
@ -404,8 +340,8 @@ impl Player {
let mut value = Value::from_type(
<gst_video::VideoMultiviewFramePacking as StaticType>::static_type(),
);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"video-multiview-mode\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -421,8 +357,8 @@ impl Player {
video_multiview_mode: gst_video::VideoMultiviewFramePacking,
) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"video-multiview-mode\0".as_ptr() as *const _,
Value::from(&video_multiview_mode).to_glib_none().0,
);
@ -432,7 +368,7 @@ impl Player {
pub fn get_audio_streams(info: &PlayerMediaInfo) -> Vec<PlayerAudioInfo> {
skip_assert_initialized!();
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_audio_streams(
FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_audio_streams(
info.to_glib_none().0,
))
}
@ -441,7 +377,7 @@ impl Player {
pub fn get_subtitle_streams(info: &PlayerMediaInfo) -> Vec<PlayerSubtitleInfo> {
skip_assert_initialized!();
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_subtitle_streams(
FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_subtitle_streams(
info.to_glib_none().0,
))
}
@ -450,7 +386,7 @@ impl Player {
pub fn get_video_streams(info: &PlayerMediaInfo) -> Vec<PlayerVideoInfo> {
skip_assert_initialized!();
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_get_video_streams(
FromGlibPtrContainer::from_glib_none(ffi::gst_player_get_video_streams(
info.to_glib_none().0,
))
}
@ -458,16 +394,14 @@ impl Player {
pub fn visualizations_get() -> Vec<PlayerVisualization> {
assert_initialized_main_thread!();
unsafe {
FromGlibPtrContainer::from_glib_full(gst_player_sys::gst_player_visualizations_get())
}
unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_player_visualizations_get()) }
}
pub fn connect_buffering<F: Fn(&Player, i32) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn buffering_trampoline<F: Fn(&Player, i32) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
this: *mut ffi::GstPlayer,
object: libc::c_int,
f: glib_sys::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), object)
@ -487,8 +421,8 @@ impl Player {
pub fn connect_end_of_stream<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn end_of_stream_trampoline<F: Fn(&Player) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -511,9 +445,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn error_trampoline<F: Fn(&Player, &glib::Error) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
object: *mut glib_sys::GError,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
object: *mut glib::ffi::GError,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(object))
@ -538,9 +472,9 @@ impl Player {
unsafe extern "C" fn media_info_updated_trampoline<
F: Fn(&Player, &PlayerMediaInfo) + Send + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
object: *mut gst_player_sys::GstPlayerMediaInfo,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
object: *mut ffi::GstPlayerMediaInfo,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(object))
@ -560,8 +494,8 @@ impl Player {
pub fn connect_mute_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn mute_changed_trampoline<F: Fn(&Player) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -586,9 +520,9 @@ impl Player {
unsafe extern "C" fn state_changed_trampoline<
F: Fn(&Player, PlayerState) + Send + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
object: gst_player_sys::GstPlayerState,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
object: ffi::GstPlayerState,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), from_glib(object))
@ -611,12 +545,15 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn uri_loaded_trampoline<F: Fn(&Player, &str) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
this: *mut ffi::GstPlayer,
object: *mut libc::c_char,
f: glib_sys::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &GString::from_glib_borrow(object))
f(
&from_glib_borrow(this),
&glib::GString::from_glib_borrow(object),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
@ -638,10 +575,10 @@ impl Player {
unsafe extern "C" fn video_dimensions_changed_trampoline<
F: Fn(&Player, i32, i32) + Send + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
this: *mut ffi::GstPlayer,
object: libc::c_int,
p0: libc::c_int,
f: glib_sys::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), object, p0)
@ -661,8 +598,8 @@ impl Player {
pub fn connect_volume_changed<F: Fn(&Player) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn volume_changed_trampoline<F: Fn(&Player) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -685,9 +622,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn warning_trampoline<F: Fn(&Player, &glib::Error) + Send + 'static>(
this: *mut gst_player_sys::GstPlayer,
object: *mut glib_sys::GError,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
object: *mut glib::ffi::GError,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(object))
@ -712,9 +649,9 @@ impl Player {
unsafe extern "C" fn notify_audio_video_offset_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -739,9 +676,9 @@ impl Player {
unsafe extern "C" fn notify_current_audio_track_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -768,9 +705,9 @@ impl Player {
unsafe extern "C" fn notify_current_subtitle_track_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -795,9 +732,9 @@ impl Player {
unsafe extern "C" fn notify_current_video_track_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -820,9 +757,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -847,9 +784,9 @@ impl Player {
unsafe extern "C" fn notify_media_info_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -872,9 +809,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -897,9 +834,9 @@ impl Player {
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,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -922,9 +859,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_position_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -947,9 +884,9 @@ impl Player {
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,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -976,9 +913,9 @@ impl Player {
unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -1001,9 +938,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -1026,9 +963,9 @@ impl Player {
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,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -1053,9 +990,9 @@ impl Player {
unsafe extern "C" fn notify_video_multiview_flags_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -1080,9 +1017,9 @@ impl Player {
unsafe extern "C" fn notify_video_multiview_mode_trampoline<
F: Fn(&Player) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -1105,9 +1042,9 @@ impl Player {
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Player) + Send + Sync + 'static>(
this: *mut gst_player_sys::GstPlayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))

View file

@ -2,42 +2,40 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::PlayerStreamInfo;
use glib::translate::*;
use glib::GString;
use gst_player_sys;
use PlayerStreamInfo;
glib_wrapper! {
pub struct PlayerAudioInfo(Object<gst_player_sys::GstPlayerAudioInfo, gst_player_sys::GstPlayerAudioInfoClass>) @extends PlayerStreamInfo;
glib::glib_wrapper! {
pub struct PlayerAudioInfo(Object<ffi::GstPlayerAudioInfo, ffi::GstPlayerAudioInfoClass>) @extends PlayerStreamInfo;
match fn {
get_type => || gst_player_sys::gst_player_audio_info_get_type(),
get_type => || ffi::gst_player_audio_info_get_type(),
}
}
impl PlayerAudioInfo {
pub fn get_bitrate(&self) -> i32 {
unsafe { gst_player_sys::gst_player_audio_info_get_bitrate(self.to_glib_none().0) }
unsafe { ffi::gst_player_audio_info_get_bitrate(self.to_glib_none().0) }
}
pub fn get_channels(&self) -> i32 {
unsafe { gst_player_sys::gst_player_audio_info_get_channels(self.to_glib_none().0) }
unsafe { ffi::gst_player_audio_info_get_channels(self.to_glib_none().0) }
}
pub fn get_language(&self) -> Option<GString> {
pub fn get_language(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_audio_info_get_language(
from_glib_none(ffi::gst_player_audio_info_get_language(
self.to_glib_none().0,
))
}
}
pub fn get_max_bitrate(&self) -> i32 {
unsafe { gst_player_sys::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0) }
unsafe { ffi::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0) }
}
pub fn get_sample_rate(&self) -> i32 {
unsafe { gst_player_sys::gst_player_audio_info_get_sample_rate(self.to_glib_none().0) }
unsafe { ffi::gst_player_audio_info_get_sample_rate(self.to_glib_none().0) }
}
}

View file

@ -2,20 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use crate::PlayerSignalDispatcher;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use gobject_sys;
use gst_player_sys;
use PlayerSignalDispatcher;
glib_wrapper! {
pub struct PlayerGMainContextSignalDispatcher(Object<gst_player_sys::GstPlayerGMainContextSignalDispatcher, gst_player_sys::GstPlayerGMainContextSignalDispatcherClass>) @implements PlayerSignalDispatcher;
glib::glib_wrapper! {
pub struct PlayerGMainContextSignalDispatcher(Object<ffi::GstPlayerGMainContextSignalDispatcher, ffi::GstPlayerGMainContextSignalDispatcherClass>) @implements PlayerSignalDispatcher;
match fn {
get_type => || gst_player_sys::gst_player_g_main_context_signal_dispatcher_get_type(),
get_type => || ffi::gst_player_g_main_context_signal_dispatcher_get_type(),
}
}
@ -23,8 +20,8 @@ impl PlayerGMainContextSignalDispatcher {
pub fn get_property_application_context(&self) -> Option<glib::MainContext> {
unsafe {
let mut value = Value::from_type(<glib::MainContext as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"application-context\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);

View file

@ -2,35 +2,32 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::PlayerAudioInfo;
use crate::PlayerStreamInfo;
use crate::PlayerSubtitleInfo;
use crate::PlayerVideoInfo;
use glib::translate::*;
use glib::GString;
use gst;
use gst_player_sys;
use PlayerAudioInfo;
use PlayerStreamInfo;
use PlayerSubtitleInfo;
use PlayerVideoInfo;
glib_wrapper! {
pub struct PlayerMediaInfo(Object<gst_player_sys::GstPlayerMediaInfo, gst_player_sys::GstPlayerMediaInfoClass>);
glib::glib_wrapper! {
pub struct PlayerMediaInfo(Object<ffi::GstPlayerMediaInfo, ffi::GstPlayerMediaInfoClass>);
match fn {
get_type => || gst_player_sys::gst_player_media_info_get_type(),
get_type => || ffi::gst_player_media_info_get_type(),
}
}
impl PlayerMediaInfo {
pub fn get_audio_streams(&self) -> Vec<PlayerAudioInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_audio_streams(self.to_glib_none().0),
)
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_audio_streams(
self.to_glib_none().0,
))
}
}
pub fn get_container_format(&self) -> Option<GString> {
pub fn get_container_format(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_container_format(
from_glib_none(ffi::gst_player_media_info_get_container_format(
self.to_glib_none().0,
))
}
@ -38,7 +35,7 @@ impl PlayerMediaInfo {
pub fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_player_sys::gst_player_media_info_get_duration(
from_glib(ffi::gst_player_media_info_get_duration(
self.to_glib_none().0,
))
}
@ -46,97 +43,71 @@ impl PlayerMediaInfo {
pub fn get_image_sample(&self) -> Option<gst::Sample> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_image_sample(
from_glib_none(ffi::gst_player_media_info_get_image_sample(
self.to_glib_none().0,
))
}
}
pub fn get_number_of_audio_streams(&self) -> u32 {
unsafe {
gst_player_sys::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0)
}
unsafe { ffi::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0) }
}
pub fn get_number_of_streams(&self) -> u32 {
unsafe {
gst_player_sys::gst_player_media_info_get_number_of_streams(self.to_glib_none().0)
}
unsafe { ffi::gst_player_media_info_get_number_of_streams(self.to_glib_none().0) }
}
pub fn get_number_of_subtitle_streams(&self) -> u32 {
unsafe {
gst_player_sys::gst_player_media_info_get_number_of_subtitle_streams(
self.to_glib_none().0,
)
}
unsafe { ffi::gst_player_media_info_get_number_of_subtitle_streams(self.to_glib_none().0) }
}
pub fn get_number_of_video_streams(&self) -> u32 {
unsafe {
gst_player_sys::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0)
}
unsafe { ffi::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0) }
}
pub fn get_stream_list(&self) -> Vec<PlayerStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_stream_list(self.to_glib_none().0),
)
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_stream_list(
self.to_glib_none().0,
))
}
}
pub fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_subtitle_streams(self.to_glib_none().0),
)
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_subtitle_streams(
self.to_glib_none().0,
))
}
}
pub fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_tags(
self.to_glib_none().0,
))
}
unsafe { from_glib_none(ffi::gst_player_media_info_get_tags(self.to_glib_none().0)) }
}
pub fn get_title(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_title(
self.to_glib_none().0,
))
}
pub fn get_title(&self) -> Option<glib::GString> {
unsafe { from_glib_none(ffi::gst_player_media_info_get_title(self.to_glib_none().0)) }
}
pub fn get_uri(&self) -> GString {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_uri(
self.to_glib_none().0,
))
}
pub fn get_uri(&self) -> glib::GString {
unsafe { from_glib_none(ffi::gst_player_media_info_get_uri(self.to_glib_none().0)) }
}
pub fn get_video_streams(&self) -> Vec<PlayerVideoInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_video_streams(self.to_glib_none().0),
)
}
}
pub fn is_live(&self) -> bool {
unsafe {
from_glib(gst_player_sys::gst_player_media_info_is_live(
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_video_streams(
self.to_glib_none().0,
))
}
}
pub fn is_live(&self) -> bool {
unsafe { from_glib(ffi::gst_player_media_info_is_live(self.to_glib_none().0)) }
}
pub fn is_seekable(&self) -> bool {
unsafe {
from_glib(gst_player_sys::gst_player_media_info_is_seekable(
from_glib(ffi::gst_player_media_info_is_seekable(
self.to_glib_none().0,
))
}

View file

@ -4,13 +4,12 @@
use glib::object::IsA;
use glib::translate::*;
use gst_player_sys;
glib_wrapper! {
pub struct PlayerSignalDispatcher(Interface<gst_player_sys::GstPlayerSignalDispatcher>);
glib::glib_wrapper! {
pub struct PlayerSignalDispatcher(Interface<ffi::GstPlayerSignalDispatcher>);
match fn {
get_type => || gst_player_sys::gst_player_signal_dispatcher_get_type(),
get_type => || ffi::gst_player_signal_dispatcher_get_type(),
}
}

View file

@ -4,15 +4,12 @@
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst;
use gst_player_sys;
glib_wrapper! {
pub struct PlayerStreamInfo(Object<gst_player_sys::GstPlayerStreamInfo, gst_player_sys::GstPlayerStreamInfoClass>);
glib::glib_wrapper! {
pub struct PlayerStreamInfo(Object<ffi::GstPlayerStreamInfo, ffi::GstPlayerStreamInfoClass>);
match fn {
get_type => || gst_player_sys::gst_player_stream_info_get_type(),
get_type => || ffi::gst_player_stream_info_get_type(),
}
}
@ -24,11 +21,11 @@ pub const NONE_PLAYER_STREAM_INFO: Option<&PlayerStreamInfo> = None;
pub trait PlayerStreamInfoExt: 'static {
fn get_caps(&self) -> Option<gst::Caps>;
fn get_codec(&self) -> Option<GString>;
fn get_codec(&self) -> Option<glib::GString>;
fn get_index(&self) -> i32;
fn get_stream_type(&self) -> GString;
fn get_stream_type(&self) -> glib::GString;
fn get_tags(&self) -> Option<gst::TagList>;
}
@ -36,41 +33,39 @@ pub trait PlayerStreamInfoExt: 'static {
impl<O: IsA<PlayerStreamInfo>> PlayerStreamInfoExt for O {
fn get_caps(&self) -> Option<gst::Caps> {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_caps(
const_override(self.as_ref().to_glib_none().0),
))
from_glib_none(ffi::gst_player_stream_info_get_caps(const_override(
self.as_ref().to_glib_none().0,
)))
}
}
fn get_codec(&self) -> Option<GString> {
fn get_codec(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_codec(
const_override(self.as_ref().to_glib_none().0),
))
from_glib_none(ffi::gst_player_stream_info_get_codec(const_override(
self.as_ref().to_glib_none().0,
)))
}
}
fn get_index(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_stream_info_get_index(const_override(
self.as_ref().to_glib_none().0,
))
ffi::gst_player_stream_info_get_index(const_override(self.as_ref().to_glib_none().0))
}
}
fn get_stream_type(&self) -> GString {
fn get_stream_type(&self) -> glib::GString {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_stream_type(
const_override(self.as_ref().to_glib_none().0),
))
from_glib_none(ffi::gst_player_stream_info_get_stream_type(const_override(
self.as_ref().to_glib_none().0,
)))
}
}
fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_tags(
const_override(self.as_ref().to_glib_none().0),
))
from_glib_none(ffi::gst_player_stream_info_get_tags(const_override(
self.as_ref().to_glib_none().0,
)))
}
}
}

View file

@ -2,23 +2,21 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::PlayerStreamInfo;
use glib::translate::*;
use glib::GString;
use gst_player_sys;
use PlayerStreamInfo;
glib_wrapper! {
pub struct PlayerSubtitleInfo(Object<gst_player_sys::GstPlayerSubtitleInfo, gst_player_sys::GstPlayerSubtitleInfoClass>) @extends PlayerStreamInfo;
glib::glib_wrapper! {
pub struct PlayerSubtitleInfo(Object<ffi::GstPlayerSubtitleInfo, ffi::GstPlayerSubtitleInfoClass>) @extends PlayerStreamInfo;
match fn {
get_type => || gst_player_sys::gst_player_subtitle_info_get_type(),
get_type => || ffi::gst_player_subtitle_info_get_type(),
}
}
impl PlayerSubtitleInfo {
pub fn get_language(&self) -> Option<GString> {
pub fn get_language(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_subtitle_info_get_language(
from_glib_none(ffi::gst_player_subtitle_info_get_language(
self.to_glib_none().0,
))
}

View file

@ -2,33 +2,32 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::PlayerStreamInfo;
use glib::translate::*;
use gst_player_sys;
use PlayerStreamInfo;
glib_wrapper! {
pub struct PlayerVideoInfo(Object<gst_player_sys::GstPlayerVideoInfo, gst_player_sys::GstPlayerVideoInfoClass>) @extends PlayerStreamInfo;
glib::glib_wrapper! {
pub struct PlayerVideoInfo(Object<ffi::GstPlayerVideoInfo, ffi::GstPlayerVideoInfoClass>) @extends PlayerStreamInfo;
match fn {
get_type => || gst_player_sys::gst_player_video_info_get_type(),
get_type => || ffi::gst_player_video_info_get_type(),
}
}
impl PlayerVideoInfo {
pub fn get_bitrate(&self) -> i32 {
unsafe { gst_player_sys::gst_player_video_info_get_bitrate(self.to_glib_none().0) }
unsafe { ffi::gst_player_video_info_get_bitrate(self.to_glib_none().0) }
}
pub fn get_height(&self) -> i32 {
unsafe { gst_player_sys::gst_player_video_info_get_height(self.to_glib_none().0) }
unsafe { ffi::gst_player_video_info_get_height(self.to_glib_none().0) }
}
pub fn get_max_bitrate(&self) -> i32 {
unsafe { gst_player_sys::gst_player_video_info_get_max_bitrate(self.to_glib_none().0) }
unsafe { ffi::gst_player_video_info_get_max_bitrate(self.to_glib_none().0) }
}
pub fn get_width(&self) -> i32 {
unsafe { gst_player_sys::gst_player_video_info_get_width(self.to_glib_none().0) }
unsafe { ffi::gst_player_video_info_get_width(self.to_glib_none().0) }
}
}

View file

@ -2,6 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::PlayerVideoRenderer;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
@ -9,27 +10,22 @@ use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_player_sys;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use PlayerVideoRenderer;
glib_wrapper! {
pub struct PlayerVideoOverlayVideoRenderer(Object<gst_player_sys::GstPlayerVideoOverlayVideoRenderer, gst_player_sys::GstPlayerVideoOverlayVideoRendererClass>) @implements PlayerVideoRenderer;
glib::glib_wrapper! {
pub struct PlayerVideoOverlayVideoRenderer(Object<ffi::GstPlayerVideoOverlayVideoRenderer, ffi::GstPlayerVideoOverlayVideoRendererClass>) @implements PlayerVideoRenderer;
match fn {
get_type => || gst_player_sys::gst_player_video_overlay_video_renderer_get_type(),
get_type => || ffi::gst_player_video_overlay_video_renderer_get_type(),
}
}
impl PlayerVideoOverlayVideoRenderer {
pub fn expose(&self) {
unsafe {
gst_player_sys::gst_player_video_overlay_video_renderer_expose(self.to_glib_none().0);
ffi::gst_player_video_overlay_video_renderer_expose(self.to_glib_none().0);
}
}
@ -39,7 +35,7 @@ impl PlayerVideoOverlayVideoRenderer {
let mut y = mem::MaybeUninit::uninit();
let mut width = mem::MaybeUninit::uninit();
let mut height = mem::MaybeUninit::uninit();
gst_player_sys::gst_player_video_overlay_video_renderer_get_render_rectangle(
ffi::gst_player_video_overlay_video_renderer_get_render_rectangle(
self.to_glib_none().0,
x.as_mut_ptr(),
y.as_mut_ptr(),
@ -55,12 +51,12 @@ impl PlayerVideoOverlayVideoRenderer {
}
//pub fn get_window_handle(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_get_window_handle() }
// unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_get_window_handle() }
//}
pub fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) {
unsafe {
gst_player_sys::gst_player_video_overlay_video_renderer_set_render_rectangle(
ffi::gst_player_video_overlay_video_renderer_set_render_rectangle(
self.to_glib_none().0,
x,
y,
@ -71,14 +67,14 @@ impl PlayerVideoOverlayVideoRenderer {
}
//pub fn set_window_handle(&self, window_handle: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_set_window_handle() }
// unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_set_window_handle() }
//}
pub fn get_property_video_sink(&self) -> Option<gst::Element> {
unsafe {
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"video-sink\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
@ -90,8 +86,8 @@ impl PlayerVideoOverlayVideoRenderer {
pub fn set_property_video_sink<P: IsA<gst::Element>>(&self, video_sink: Option<&P>) {
unsafe {
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"video-sink\0".as_ptr() as *const _,
Value::from(video_sink).to_glib_none().0,
);
@ -99,11 +95,11 @@ impl PlayerVideoOverlayVideoRenderer {
}
//pub fn new(window_handle: /*Unimplemented*/Option<Fundamental: Pointer>) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_new() }
// unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_new() }
//}
//pub fn new_with_sink<P: IsA<gst::Element>>(window_handle: /*Unimplemented*/Option<Fundamental: Pointer>, video_sink: &P) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_new_with_sink() }
// unsafe { TODO: call ffi:gst_player_video_overlay_video_renderer_new_with_sink() }
//}
pub fn connect_property_video_sink_notify<
@ -115,9 +111,9 @@ impl PlayerVideoOverlayVideoRenderer {
unsafe extern "C" fn notify_video_sink_trampoline<
F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayerVideoOverlayVideoRenderer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
@ -144,9 +140,9 @@ impl PlayerVideoOverlayVideoRenderer {
unsafe extern "C" fn notify_window_handle_trampoline<
F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
this: *mut ffi::GstPlayerVideoOverlayVideoRenderer,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))

View file

@ -4,13 +4,12 @@
use glib::object::IsA;
use glib::translate::*;
use gst_player_sys;
glib_wrapper! {
pub struct PlayerVideoRenderer(Interface<gst_player_sys::GstPlayerVideoRenderer>);
glib::glib_wrapper! {
pub struct PlayerVideoRenderer(Interface<ffi::GstPlayerVideoRenderer>);
match fn {
get_type => || gst_player_sys::gst_player_video_renderer_get_type(),
get_type => || ffi::gst_player_video_renderer_get_type(),
}
}

View file

@ -3,16 +3,15 @@
// DO NOT EDIT
use glib::translate::*;
use gst_player_sys;
glib_wrapper! {
glib::glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PlayerVisualization(Boxed<gst_player_sys::GstPlayerVisualization>);
pub struct PlayerVisualization(Boxed<ffi::GstPlayerVisualization>);
match fn {
copy => |ptr| gst_player_sys::gst_player_visualization_copy(mut_override(ptr)),
free => |ptr| gst_player_sys::gst_player_visualization_free(ptr),
get_type => || gst_player_sys::gst_player_visualization_get_type(),
copy => |ptr| ffi::gst_player_visualization_copy(mut_override(ptr)),
free => |ptr| ffi::gst_player_visualization_free(ptr),
get_type => || ffi::gst_player_visualization_get_type(),
}
}

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6)
from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5)
Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8)
from gir-files (https://github.com/gtk-rs/gir-files @ 2762b6d7)