2018-10-31 16:10:30 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-10-31 16:10:30 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-22 10:12:36 +00:00
|
|
|
use crate::PipelineFlags;
|
|
|
|
use crate::Timeline;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib::object::IsA;
|
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;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib::translate::*;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::StaticType;
|
2018-10-31 16:10:30 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2018-10-31 16:10:30 +00:00
|
|
|
use std::ptr;
|
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2020-11-22 10:12:36 +00:00
|
|
|
pub struct Pipeline(Object<ffi::GESPipeline, ffi::GESPipelineClass>) @extends gst::Pipeline, gst::Element, gst::Object;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2020-11-22 10:12:36 +00:00
|
|
|
get_type => || ffi::ges_pipeline_get_type(),
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Pipeline {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_new")]
|
2018-10-31 16:10:30 +00:00
|
|
|
pub fn new() -> Pipeline {
|
|
|
|
assert_initialized_main_thread!();
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_pipeline_new()) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for Pipeline {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_PIPELINE: Option<&Pipeline> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait GESPipelineExt: 'static {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_get_mode")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn mode(&self) -> PipelineFlags;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_get_thumbnail")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn get_thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample>;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_get_thumbnail_rgb24")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample>;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_preview_get_audio_sink")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn preview_get_audio_sink(&self) -> Option<gst::Element>;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_preview_get_video_sink")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn preview_get_video_sink(&self) -> Option<gst::Element>;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_preview_set_audio_sink")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn preview_set_audio_sink<P: IsA<gst::Element>>(&self, sink: &P);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_preview_set_video_sink")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn preview_set_video_sink<P: IsA<gst::Element>>(&self, sink: &P);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_save_thumbnail")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn save_thumbnail(
|
|
|
|
&self,
|
|
|
|
width: i32,
|
|
|
|
height: i32,
|
|
|
|
format: &str,
|
|
|
|
location: &str,
|
2019-11-10 16:55:02 +00:00
|
|
|
) -> Result<(), glib::Error>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_set_mode")]
|
2018-11-04 18:30:58 +00:00
|
|
|
fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_set_render_settings")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(
|
|
|
|
&self,
|
|
|
|
output_uri: &str,
|
|
|
|
profile: &P,
|
|
|
|
) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_pipeline_set_timeline")]
|
2019-02-07 10:03:01 +00:00
|
|
|
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_audio_filter")]
|
|
|
|
fn audio_filter(&self) -> Option<gst::Element>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "set_property_audio_filter")]
|
|
|
|
fn set_audio_filter<P: IsA<gst::Element>>(&self, audio_filter: Option<&P>);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_audio_sink")]
|
|
|
|
fn audio_sink(&self) -> Option<gst::Element>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "set_property_audio_sink")]
|
|
|
|
fn set_audio_sink<P: IsA<gst::Element>>(&self, audio_sink: Option<&P>);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_timeline")]
|
|
|
|
fn timeline(&self) -> Option<Timeline>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_video_filter")]
|
|
|
|
fn video_filter(&self) -> Option<gst::Element>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "set_property_video_filter")]
|
|
|
|
fn set_video_filter<P: IsA<gst::Element>>(&self, video_filter: Option<&P>);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_video_sink")]
|
|
|
|
fn video_sink(&self) -> Option<gst::Element>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "set_property_video_sink")]
|
|
|
|
fn set_video_sink<P: IsA<gst::Element>>(&self, video_sink: Option<&P>);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F)
|
|
|
|
-> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F)
|
|
|
|
-> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<Pipeline>> GESPipelineExt for O {
|
2021-04-11 19:38:18 +00:00
|
|
|
fn mode(&self) -> PipelineFlags {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib(ffi::ges_pipeline_get_mode(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn get_thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample> {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_pipeline_get_thumbnail(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample> {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_pipeline_get_thumbnail_rgb24(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn preview_get_audio_sink(&self) -> Option<gst::Element> {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_pipeline_preview_get_audio_sink(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn preview_get_video_sink(&self) -> Option<gst::Element> {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_pipeline_preview_get_video_sink(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn preview_set_audio_sink<P: IsA<gst::Element>>(&self, sink: &P) {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_pipeline_preview_set_audio_sink(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
sink.as_ref().to_glib_none().0,
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn preview_set_video_sink<P: IsA<gst::Element>>(&self, sink: &P) {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_pipeline_preview_set_video_sink(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
sink.as_ref().to_glib_none().0,
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn save_thumbnail(
|
|
|
|
&self,
|
|
|
|
width: i32,
|
|
|
|
height: i32,
|
|
|
|
format: &str,
|
|
|
|
location: &str,
|
2019-11-10 16:55:02 +00:00
|
|
|
) -> Result<(), glib::Error> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2020-11-22 10:12:36 +00:00
|
|
|
let _ = ffi::ges_pipeline_save_thumbnail(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
format.to_glib_none().0,
|
|
|
|
location.to_glib_none().0,
|
|
|
|
&mut error,
|
|
|
|
);
|
|
|
|
if error.is_null() {
|
|
|
|
Ok(())
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-04 18:30:58 +00:00
|
|
|
fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.to_glib()),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Failed to set mode"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(
|
|
|
|
&self,
|
|
|
|
output_uri: &str,
|
|
|
|
profile: &P,
|
|
|
|
) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_pipeline_set_render_settings(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
output_uri.to_glib_none().0,
|
|
|
|
profile.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to set render settings"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-07 10:03:01 +00:00
|
|
|
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_pipeline_set_timeline(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
timeline.as_ref().to_glib_full()
|
|
|
|
),
|
|
|
|
"Failed to set timeline"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn audio_filter(&self) -> Option<gst::Element> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<gst::Element as StaticType>::static_type());
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"audio-filter\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 `audio-filter` getter")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_audio_filter<P: IsA<gst::Element>>(&self, audio_filter: Option<&P>) {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_set_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"audio-filter\0".as_ptr() as *const _,
|
2020-11-27 13:37:24 +00:00
|
|
|
glib::Value::from(audio_filter).to_glib_none().0,
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn audio_sink(&self) -> Option<gst::Element> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<gst::Element as StaticType>::static_type());
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"audio-sink\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 `audio-sink` getter")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_audio_sink<P: IsA<gst::Element>>(&self, audio_sink: Option<&P>) {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_set_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"audio-sink\0".as_ptr() as *const _,
|
2020-11-27 13:37:24 +00:00
|
|
|
glib::Value::from(audio_sink).to_glib_none().0,
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn timeline(&self) -> Option<Timeline> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<Timeline as StaticType>::static_type());
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"timeline\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 `timeline` getter")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn video_filter(&self) -> Option<gst::Element> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<gst::Element as StaticType>::static_type());
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"video-filter\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-filter` getter")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_video_filter<P: IsA<gst::Element>>(&self, video_filter: Option<&P>) {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_set_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"video-filter\0".as_ptr() as *const _,
|
2020-11-27 13:37:24 +00:00
|
|
|
glib::Value::from(video_filter).to_glib_none().0,
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn video_sink(&self) -> Option<gst::Element> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<gst::Element as StaticType>::static_type());
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"video-sink\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-sink` getter")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_video_sink<P: IsA<gst::Element>>(&self, video_sink: Option<&P>) {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
glib::gobject_ffi::g_object_set_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"video-sink\0".as_ptr() as *const _,
|
2020-11-27 13:37:24 +00:00
|
|
|
glib::Value::from(video_sink).to_glib_none().0,
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_audio_filter_trampoline<P, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESPipeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pipeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pipeline::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +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-filter\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_audio_filter_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_audio_sink_trampoline<P, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESPipeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pipeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pipeline::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +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-sink\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_audio_sink_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_mode_trampoline<P, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESPipeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pipeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pipeline::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +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::mode\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_mode_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESPipeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pipeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pipeline::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +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::timeline\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_timeline_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_video_filter_trampoline<P, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESPipeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pipeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pipeline::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +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-filter\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_video_filter_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_video_sink_trampoline<P, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESPipeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pipeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pipeline::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +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-sink\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_video_sink_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|