Commit 33fb38ef authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Remove traits for things that are not subclassed

parent 41e812d0
......@@ -24,7 +24,6 @@ generate = [
"Gst.SeekType",
"Gst.FlowReturn",
"Gst.PadDirection",
"Gst.PadTemplate",
"Gst.PadPresence",
"Gst.URIHandler",
"Gst.URIType",
......@@ -41,7 +40,6 @@ generate = [
"Gst.StructureChangeType",
"Gst.StreamStatusType",
"Gst.DeviceProvider",
"Gst.DeviceProviderFactory",
"Gst.StreamType",
"Gst.StreamFlags",
"Gst.PadLinkReturn",
......@@ -280,6 +278,11 @@ name = "Gst.ElementFactory"
status = "generate"
trait = false
[[object]]
name = "Gst.DeviceProviderFactory"
status = "generate"
trait = false
[[object]]
name = "Gst.Device"
status = "generate"
......@@ -450,6 +453,11 @@ status = "generate"
# Pass by value
ignore = true
[[object]]
name = "Gst.PadTemplate"
status = "generate"
trait = false
[[object]]
name = "Gst.GhostPad"
status = "generate"
......@@ -487,6 +495,7 @@ status = "generate"
[[object]]
name = "Gst.Stream"
status = "generate"
trait = false
[[object.property]]
name = "caps"
......@@ -516,6 +525,7 @@ status = "generate"
[[object]]
name = "Gst.StreamCollection"
status = "generate"
trait = false
[[object.property]]
name = "upstream-id"
......
......@@ -14,18 +14,12 @@ external_libraries = [
]
generate = [
"GstPlayer.PlayerAudioInfo",
"GstPlayer.PlayerColorBalanceType",
"GstPlayer.PlayerError",
"GstPlayer.PlayerGMainContextSignalDispatcher",
"GstPlayer.PlayerMediaInfo",
"GstPlayer.PlayerSignalDispatcher",
"GstPlayer.PlayerSnapshotFormat",
"GstPlayer.PlayerState",
"GstPlayer.PlayerStreamInfo",
"GstPlayer.PlayerSubtitleInfo",
"GstPlayer.PlayerVideoInfo",
"GstPlayer.PlayerVideoOverlayVideoRenderer",
"GstPlayer.PlayerVideoRenderer",
"GstPlayer.PlayerVisualization",
]
......@@ -59,7 +53,6 @@ name = "Gst.Structure"
status = "manual"
ref_mode = "ref-mut"
[[object]]
name = "GstPlayer.Player"
status = "generate"
......@@ -130,3 +123,33 @@ trait = false
[[object.signal]]
name = "warning"
concurrency = "send"
[[object]]
name = "GstPlayer.PlayerAudioInfo"
status = "generate"
trait = false
[[object]]
name = "GstPlayer.PlayerVideoInfo"
status = "generate"
trait = false
[[object]]
name = "GstPlayer.PlayerSubtitleInfo"
status = "generate"
trait = false
[[object]]
name = "GstPlayer.PlayerMediaInfo"
status = "generate"
trait = false
[[object]]
name = "GstPlayer.PlayerVideoOverlayVideoRenderer"
status = "generate"
trait = false
[[object]]
name = "GstPlayer.PlayerGMainContextSignalDispatcher"
status = "generate"
trait = false
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
mod player;
......@@ -6,15 +6,12 @@ pub use self::player::Player;
mod player_audio_info;
pub use self::player_audio_info::PlayerAudioInfo;
pub use self::player_audio_info::PlayerAudioInfoExt;
mod player_g_main_context_signal_dispatcher;
pub use self::player_g_main_context_signal_dispatcher::PlayerGMainContextSignalDispatcher;
pub use self::player_g_main_context_signal_dispatcher::PlayerGMainContextSignalDispatcherExt;
mod player_media_info;
pub use self::player_media_info::PlayerMediaInfo;
pub use self::player_media_info::PlayerMediaInfoExt;
mod player_signal_dispatcher;
pub use self::player_signal_dispatcher::PlayerSignalDispatcher;
......@@ -26,15 +23,12 @@ pub use self::player_stream_info::PlayerStreamInfoExt;
mod player_subtitle_info;
pub use self::player_subtitle_info::PlayerSubtitleInfo;
pub use self::player_subtitle_info::PlayerSubtitleInfoExt;
mod player_video_info;
pub use self::player_video_info::PlayerVideoInfo;
pub use self::player_video_info::PlayerVideoInfoExt;
mod player_video_overlay_video_renderer;
pub use self::player_video_overlay_video_renderer::PlayerVideoOverlayVideoRenderer;
pub use self::player_video_overlay_video_renderer::PlayerVideoOverlayVideoRendererExt;
mod player_video_renderer;
pub use self::player_video_renderer::PlayerVideoRenderer;
......@@ -51,13 +45,7 @@ pub use self::enums::PlayerState;
#[doc(hidden)]
pub mod traits {
pub use super::PlayerAudioInfoExt;
pub use super::PlayerGMainContextSignalDispatcherExt;
pub use super::PlayerMediaInfoExt;
pub use super::PlayerSignalDispatcherExt;
pub use super::PlayerStreamInfoExt;
pub use super::PlayerSubtitleInfoExt;
pub use super::PlayerVideoInfoExt;
pub use super::PlayerVideoOverlayVideoRendererExt;
pub use super::PlayerVideoRendererExt;
}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use Error;
......
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use PlayerStreamInfo;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
......@@ -18,49 +17,37 @@ glib_wrapper! {
}
}
unsafe impl Send for PlayerAudioInfo {}
unsafe impl Sync for PlayerAudioInfo {}
pub trait PlayerAudioInfoExt {
fn get_bitrate(&self) -> i32;
fn get_channels(&self) -> i32;
fn get_language(&self) -> Option<String>;
fn get_max_bitrate(&self) -> i32;
fn get_sample_rate(&self) -> i32;
}
impl<O: IsA<PlayerAudioInfo>> PlayerAudioInfoExt for O {
fn get_bitrate(&self) -> i32 {
impl PlayerAudioInfo {
pub fn get_bitrate(&self) -> i32 {
unsafe {
ffi::gst_player_audio_info_get_bitrate(self.to_glib_none().0)
}
}
fn get_channels(&self) -> i32 {
pub fn get_channels(&self) -> i32 {
unsafe {
ffi::gst_player_audio_info_get_channels(self.to_glib_none().0)
}
}
fn get_language(&self) -> Option<String> {
pub fn get_language(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_player_audio_info_get_language(self.to_glib_none().0))
}
}
fn get_max_bitrate(&self) -> i32 {
pub fn get_max_bitrate(&self) -> i32 {
unsafe {
ffi::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0)
}
}
fn get_sample_rate(&self) -> i32 {
pub fn get_sample_rate(&self) -> i32 {
unsafe {
ffi::gst_player_audio_info_get_sample_rate(self.to_glib_none().0)
}
}
}
unsafe impl Send for PlayerAudioInfo {}
unsafe impl Sync for PlayerAudioInfo {}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use PlayerSignalDispatcher;
use ffi;
use glib;
use glib::Value;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
......@@ -21,6 +20,14 @@ glib_wrapper! {
}
impl PlayerGMainContextSignalDispatcher {
pub fn get_property_application_context(&self) -> Option<glib::MainContext> {
let mut value = Value::from(None::<&glib::MainContext>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "application-context".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}
pub fn new<'a, P: Into<Option<&'a glib::MainContext>>>(application_context: P) -> Option<PlayerSignalDispatcher> {
assert_initialized_main_thread!();
let application_context = application_context.into();
......@@ -33,17 +40,3 @@ impl PlayerGMainContextSignalDispatcher {
unsafe impl Send for PlayerGMainContextSignalDispatcher {}
unsafe impl Sync for PlayerGMainContextSignalDispatcher {}
pub trait PlayerGMainContextSignalDispatcherExt {
fn get_property_application_context(&self) -> Option<glib::MainContext>;
}
impl<O: IsA<PlayerGMainContextSignalDispatcher> + IsA<glib::object::Object>> PlayerGMainContextSignalDispatcherExt for O {
fn get_property_application_context(&self) -> Option<glib::MainContext> {
let mut value = Value::from(None::<&glib::MainContext>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "application-context".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}
}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use PlayerAudioInfo;
......@@ -6,7 +6,6 @@ use PlayerStreamInfo;
use PlayerSubtitleInfo;
use PlayerVideoInfo;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
......@@ -22,137 +21,103 @@ glib_wrapper! {
}
}
unsafe impl Send for PlayerMediaInfo {}
unsafe impl Sync for PlayerMediaInfo {}
pub trait PlayerMediaInfoExt {
fn get_audio_streams(&self) -> Vec<PlayerAudioInfo>;
fn get_container_format(&self) -> Option<String>;
fn get_duration(&self) -> gst::ClockTime;
fn get_image_sample(&self) -> Option<gst::Sample>;
fn get_number_of_audio_streams(&self) -> u32;
fn get_number_of_streams(&self) -> u32;
fn get_number_of_subtitle_streams(&self) -> u32;
fn get_number_of_video_streams(&self) -> u32;
fn get_stream_list(&self) -> Vec<PlayerStreamInfo>;
fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo>;
fn get_tags(&self) -> Option<gst::TagList>;
fn get_title(&self) -> Option<String>;
fn get_uri(&self) -> Option<String>;
fn get_video_streams(&self) -> Vec<PlayerVideoInfo>;
fn is_live(&self) -> bool;
fn is_seekable(&self) -> bool;
}
impl<O: IsA<PlayerMediaInfo>> PlayerMediaInfoExt for O {
fn get_audio_streams(&self) -> Vec<PlayerAudioInfo> {
impl PlayerMediaInfo {
pub fn get_audio_streams(&self) -> Vec<PlayerAudioInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_audio_streams(self.to_glib_none().0))
}
}
fn get_container_format(&self) -> Option<String> {
pub fn get_container_format(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_player_media_info_get_container_format(self.to_glib_none().0))
}
}
fn get_duration(&self) -> gst::ClockTime {
pub fn get_duration(&self) -> gst::ClockTime {
unsafe {
ffi::gst_player_media_info_get_duration(self.to_glib_none().0)
}
}
fn get_image_sample(&self) -> Option<gst::Sample> {
pub fn get_image_sample(&self) -> Option<gst::Sample> {
unsafe {
from_glib_none(ffi::gst_player_media_info_get_image_sample(self.to_glib_none().0))
}
}
fn get_number_of_audio_streams(&self) -> u32 {
pub fn get_number_of_audio_streams(&self) -> u32 {
unsafe {
ffi::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0)
}
}
fn get_number_of_streams(&self) -> u32 {
pub fn get_number_of_streams(&self) -> u32 {
unsafe {
ffi::gst_player_media_info_get_number_of_streams(self.to_glib_none().0)
}
}
fn get_number_of_subtitle_streams(&self) -> u32 {
pub fn get_number_of_subtitle_streams(&self) -> u32 {
unsafe {
ffi::gst_player_media_info_get_number_of_subtitle_streams(self.to_glib_none().0)
}
}
fn get_number_of_video_streams(&self) -> u32 {
pub fn get_number_of_video_streams(&self) -> u32 {
unsafe {
ffi::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0)
}
}
fn get_stream_list(&self) -> Vec<PlayerStreamInfo> {
pub fn get_stream_list(&self) -> Vec<PlayerStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_stream_list(self.to_glib_none().0))
}
}
fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo> {
pub fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_subtitle_streams(self.to_glib_none().0))
}
}
fn get_tags(&self) -> Option<gst::TagList> {
pub fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(ffi::gst_player_media_info_get_tags(self.to_glib_none().0))
}
}
fn get_title(&self) -> Option<String> {
pub fn get_title(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_player_media_info_get_title(self.to_glib_none().0))
}
}
fn get_uri(&self) -> Option<String> {
pub fn get_uri(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_player_media_info_get_uri(self.to_glib_none().0))
}
}
fn get_video_streams(&self) -> Vec<PlayerVideoInfo> {
pub fn get_video_streams(&self) -> Vec<PlayerVideoInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_video_streams(self.to_glib_none().0))
}
}
fn is_live(&self) -> bool {
pub fn is_live(&self) -> bool {
unsafe {
from_glib(ffi::gst_player_media_info_is_live(self.to_glib_none().0))
}
}
fn is_seekable(&self) -> bool {
pub fn is_seekable(&self) -> bool {
unsafe {
from_glib(ffi::gst_player_media_info_is_seekable(self.to_glib_none().0))
}
}
}
unsafe impl Send for PlayerMediaInfo {}
unsafe impl Sync for PlayerMediaInfo {}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use PlayerStreamInfo;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
......@@ -18,17 +17,13 @@ glib_wrapper! {
}
}
unsafe impl Send for PlayerSubtitleInfo {}
unsafe impl Sync for PlayerSubtitleInfo {}
pub trait PlayerSubtitleInfoExt {
fn get_language(&self) -> Option<String>;
}
impl<O: IsA<PlayerSubtitleInfo>> PlayerSubtitleInfoExt for O {
fn get_language(&self) -> Option<String> {
impl PlayerSubtitleInfo {
pub fn get_language(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_player_subtitle_info_get_language(self.to_glib_none().0))
}
}
}
unsafe impl Send for PlayerSubtitleInfo {}
unsafe impl Sync for PlayerSubtitleInfo {}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use PlayerStreamInfo;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
......@@ -18,31 +17,14 @@ glib_wrapper! {
}
}
unsafe impl Send for PlayerVideoInfo {}
unsafe impl Sync for PlayerVideoInfo {}
pub trait PlayerVideoInfoExt {
fn get_bitrate(&self) -> i32;
fn get_framerate(&self) -> (i32, i32);
fn get_height(&self) -> i32;
fn get_max_bitrate(&self) -> i32;
fn get_pixel_aspect_ratio(&self) -> (u32, u32);
fn get_width(&self) -> i32;
}
impl<O: IsA<PlayerVideoInfo>> PlayerVideoInfoExt for O {
fn get_bitrate(&self) -> i32 {
impl PlayerVideoInfo {
pub fn get_bitrate(&self) -> i32 {
unsafe {
ffi::gst_player_video_info_get_bitrate(self.to_glib_none().0)
}
}
fn get_framerate(&self) -> (i32, i32) {
pub fn get_framerate(&self) -> (i32, i32) {
unsafe {
let mut fps_n = mem::uninitialized();
let mut fps_d = mem::uninitialized();
......@@ -51,19 +33,19 @@ impl<O: IsA<PlayerVideoInfo>> PlayerVideoInfoExt for O {
}
}
fn get_height(&self) -> i32 {
pub fn get_height(&self) -> i32 {
unsafe {
ffi::gst_player_video_info_get_height(self.to_glib_none().0)
}
}
fn get_max_bitrate(&self) -> i32 {
pub fn get_max_bitrate(&self) -> i32 {
unsafe {
ffi::gst_player_video_info_get_max_bitrate(self.to_glib_none().0)
}
}
fn get_pixel_aspect_ratio(&self) -> (u32, u32) {
pub fn get_pixel_aspect_ratio(&self) -> (u32, u32) {
unsafe {
let mut par_n = mem::uninitialized();
let mut par_d = mem::uninitialized();
......@@ -72,9 +54,12 @@ impl<O: IsA<PlayerVideoInfo>> PlayerVideoInfoExt for O {
}
}
fn get_width(&self) -> i32 {
pub fn get_width(&self) -> i32 {
unsafe {
ffi::gst_player_video_info_get_width(self.to_glib_none().0)
}
}
}
unsafe impl Send for PlayerVideoInfo {}
unsafe impl Sync for PlayerVideoInfo {}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use PlayerVideoRenderer;
......@@ -22,42 +22,13 @@ glib_wrapper! {
}
impl PlayerVideoOverlayVideoRenderer {
//pub fn new<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(window_handle: P) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new() }
//}
//pub fn new_with_sink<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: IsA<gst::Element>>(window_handle: P, video_sink: &Q) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new_with_sink() }
//}
}
unsafe impl Send for PlayerVideoOverlayVideoRenderer {}
unsafe impl Sync for PlayerVideoOverlayVideoRenderer {}
pub trait PlayerVideoOverlayVideoRendererExt {
fn expose(&self);
fn get_render_rectangle(&self) -> (i32, i32, i32, i32);
//fn get_window_handle(&self) -> /*Unimplemented*/Option<Fundamental: Pointer>;
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32);
//fn set_window_handle<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, window_handle: P);
fn get_property_video_sink(&self) -> Option<gst::Element>;
fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>);
}
impl<O: IsA<PlayerVideoOverlayVideoRenderer> + IsA<glib::object::Object>> PlayerVideoOverlayVideoRendererExt for O {
fn expose(&self) {
pub fn expose(&self) {
unsafe {
ffi::gst_player_video_overlay_video_renderer_expose(self.to_glib_none().0);
}
}
fn get_render_rectangle(&self) -> (i32, i32, i32, i32) {
pub fn get_render_rectangle(&self) -> (i32, i32, i32, i32) {
unsafe {
let mut x = mem::uninitialized();
let mut y = mem::uninitialized();
......@@ -68,21 +39,21 @@ impl<O: IsA<PlayerVideoOverlayVideoRenderer> + IsA<glib::object::Object>> Player
}
}
//fn get_window_handle(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
//pub fn get_window_handle(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_get_window_handle() }
//}
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) {
pub fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) {
unsafe {
ffi::gst_player_video_overlay_video_renderer_set_render_rectangle(self.to_glib_none().0, x, y, width, height);
}
}
//fn set_window_handle<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, window_handle: P) {
//pub fn set_window_handle<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, window_handle: P) {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_set_window_handle() }
//}
fn get_property_video_sink(&self) -> Option<gst::Element> {
pub fn get_property_video_sink(&self) -> Option<gst::Element> {
let mut value = Value::from(None::<&gst::Element>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-sink".to_glib_none().0, value.to_glib_none_mut().0);
......@@ -90,9 +61,20 @@ impl<O: IsA<PlayerVideoOverlayVideoRenderer> + IsA<glib::object::Object>> Player
value.get()
}
fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) {
pub fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-sink".to_glib_none().0, Value::from(video_sink).to_glib_none().0);
}
}
//pub fn new<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(window_handle: P) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new() }
//}
//pub fn new_with_sink<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: IsA<gst::Element>>(window_handle: P, video_sink: &Q) -> Option<PlayerVideoRenderer> {
// unsafe { TODO: call ffi::gst_player_video_overlay_video_renderer_new_with_sink() }
//}
}
unsafe impl Send for PlayerVideoOverlayVideoRenderer {}
unsafe impl Sync for PlayerVideoOverlayVideoRenderer {}
// This file was generated by gir (3294959) from gir-files (???)
// This file was generated by gir (651da6e) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (3294959) from gir-files (???)