gstreamer-rs/gstreamer-video/src/auto/video_decoder.rs

753 lines
27 KiB
Rust
Raw Normal View History

// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
2020-11-22 09:50:37 +00:00
use crate::VideoCodecFrame;
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
use crate::VideoDecoderRequestSyncPointFlags;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2020-04-30 16:51:41 +00:00
use glib::object::Cast;
use glib::object::IsA;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2020-04-30 16:51:41 +00:00
use glib::signal::connect_raw;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2020-04-30 16:51:41 +00:00
use glib::signal::SignalHandlerId;
use glib::translate::*;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2020-04-30 16:51:41 +00:00
use glib::StaticType;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2021-04-19 16:24:43 +00:00
use glib::ToValue;
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2020-04-30 16:51:41 +00:00
use std::boxed::Box as Box_;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2020-04-30 16:51:41 +00:00
use std::mem::transmute;
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstVideoDecoder")]
2020-11-22 09:50:37 +00:00
pub struct VideoDecoder(Object<ffi::GstVideoDecoder, ffi::GstVideoDecoderClass>) @extends gst::Element, gst::Object;
match fn {
type_ => || ffi::gst_video_decoder_get_type(),
}
}
unsafe impl Send for VideoDecoder {}
unsafe impl Sync for VideoDecoder {}
2021-11-03 17:28:46 +00:00
impl VideoDecoder {
pub const NONE: Option<&'static VideoDecoder> = None;
}
pub trait VideoDecoderExt: 'static {
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_add_to_frame")]
fn add_to_frame(&self, n_bytes: i32);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_allocate_output_buffer")]
fn allocate_output_buffer(&self) -> Result<gst::Buffer, glib::BoolError>;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_buffer_pool")]
#[doc(alias = "get_buffer_pool")]
2021-04-11 19:38:18 +00:00
fn buffer_pool(&self) -> Option<gst::BufferPool>;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_estimate_rate")]
#[doc(alias = "get_estimate_rate")]
2021-04-11 19:38:18 +00:00
fn estimate_rate(&self) -> i32;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_max_decode_time")]
#[doc(alias = "get_max_decode_time")]
2021-04-19 20:13:58 +00:00
fn max_decode_time(&self, frame: &VideoCodecFrame) -> gst::ClockTimeDiff;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_max_errors")]
#[doc(alias = "get_max_errors")]
2021-04-11 19:38:18 +00:00
fn max_errors(&self) -> i32;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_needs_format")]
#[doc(alias = "get_needs_format")]
fn needs_format(&self) -> bool;
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_get_needs_sync_point")]
#[doc(alias = "get_needs_sync_point")]
fn needs_sync_point(&self) -> bool;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_packetized")]
#[doc(alias = "get_packetized")]
2021-04-11 19:38:18 +00:00
fn is_packetized(&self) -> bool;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_pending_frame_size")]
#[doc(alias = "get_pending_frame_size")]
2021-04-11 19:38:18 +00:00
fn pending_frame_size(&self) -> usize;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_get_qos_proportion")]
#[doc(alias = "get_qos_proportion")]
2021-04-11 19:38:18 +00:00
fn qos_proportion(&self) -> f64;
2021-09-19 08:04:08 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_get_subframe_mode")]
#[doc(alias = "get_subframe_mode")]
fn is_subframe_mode(&self) -> bool;
#[doc(alias = "gst_video_decoder_have_frame")]
fn have_frame(&self) -> gst::FlowReturn;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_merge_tags")]
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_proxy_getcaps")]
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps;
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_request_sync_point")]
fn request_sync_point(&self, frame: &VideoCodecFrame, flags: VideoDecoderRequestSyncPointFlags);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_set_estimate_rate")]
fn set_estimate_rate(&self, enabled: bool);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_set_max_errors")]
fn set_max_errors(&self, num: i32);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_set_needs_format")]
fn set_needs_format(&self, enabled: bool);
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_set_needs_sync_point")]
fn set_needs_sync_point(&self, enabled: bool);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_set_packetized")]
fn set_packetized(&self, packetized: bool);
2021-09-19 08:04:08 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_set_subframe_mode")]
fn set_subframe_mode(&self, subframe_mode: bool);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_video_decoder_set_use_default_pad_acceptcaps")]
fn set_use_default_pad_acceptcaps(&self, use_: bool);
2020-04-30 16:51:41 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "automatic-request-sync-point-flags")]
fn automatic_request_sync_point_flags(&self) -> VideoDecoderRequestSyncPointFlags;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "automatic-request-sync-point-flags")]
fn set_automatic_request_sync_point_flags(
&self,
automatic_request_sync_point_flags: VideoDecoderRequestSyncPointFlags,
);
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "automatic-request-sync-points")]
fn is_automatic_request_sync_points(&self) -> bool;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "automatic-request-sync-points")]
fn set_automatic_request_sync_points(&self, automatic_request_sync_points: bool);
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "discard-corrupted-frames")]
fn is_discard_corrupted_frames(&self) -> bool;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "discard-corrupted-frames")]
fn set_discard_corrupted_frames(&self, discard_corrupted_frames: bool);
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "min-force-key-unit-interval")]
fn min_force_key_unit_interval(&self) -> u64;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "min-force-key-unit-interval")]
fn set_min_force_key_unit_interval(&self, min_force_key_unit_interval: u64);
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2021-04-11 19:38:18 +00:00
fn is_qos(&self) -> bool;
2020-04-30 16:51:41 +00:00
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2021-04-11 19:38:18 +00:00
fn set_qos(&self, qos: bool);
2020-04-30 16:51:41 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "automatic-request-sync-point-flags")]
fn connect_automatic_request_sync_point_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "automatic-request-sync-points")]
fn connect_automatic_request_sync_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "discard-corrupted-frames")]
fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "max-errors")]
fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
2020-07-06 08:37:14 +00:00
&self,
f: F,
) -> SignalHandlerId;
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "min-force-key-unit-interval")]
fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "qos")]
fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<VideoDecoder>> VideoDecoderExt for O {
fn add_to_frame(&self, n_bytes: i32) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_add_to_frame(self.as_ref().to_glib_none().0, n_bytes);
}
}
fn allocate_output_buffer(&self) -> Result<gst::Buffer, glib::BoolError> {
unsafe {
2020-11-22 09:50:37 +00:00
Option::<_>::from_glib_full(ffi::gst_video_decoder_allocate_output_buffer(
self.as_ref().to_glib_none().0,
))
2020-12-17 22:34:53 +00:00
.ok_or_else(|| glib::bool_error!("Failed to allocate output buffer"))
}
}
2021-04-11 19:38:18 +00:00
fn buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
2020-11-22 09:50:37 +00:00
from_glib_full(ffi::gst_video_decoder_get_buffer_pool(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-11 19:38:18 +00:00
fn estimate_rate(&self) -> i32 {
2020-11-22 09:50:37 +00:00
unsafe { ffi::gst_video_decoder_get_estimate_rate(self.as_ref().to_glib_none().0) }
}
2021-04-19 20:13:58 +00:00
fn max_decode_time(&self, frame: &VideoCodecFrame) -> gst::ClockTimeDiff {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_get_max_decode_time(
self.as_ref().to_glib_none().0,
frame.to_glib_none().0,
)
}
}
2021-04-11 19:38:18 +00:00
fn max_errors(&self) -> i32 {
2020-11-22 09:50:37 +00:00
unsafe { ffi::gst_video_decoder_get_max_errors(self.as_ref().to_glib_none().0) }
}
fn needs_format(&self) -> bool {
unsafe {
2020-11-22 09:50:37 +00:00
from_glib(ffi::gst_video_decoder_get_needs_format(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn needs_sync_point(&self) -> bool {
unsafe {
from_glib(ffi::gst_video_decoder_get_needs_sync_point(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-11 19:38:18 +00:00
fn is_packetized(&self) -> bool {
unsafe {
2020-11-22 09:50:37 +00:00
from_glib(ffi::gst_video_decoder_get_packetized(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-11 19:38:18 +00:00
fn pending_frame_size(&self) -> usize {
2020-11-22 09:50:37 +00:00
unsafe { ffi::gst_video_decoder_get_pending_frame_size(self.as_ref().to_glib_none().0) }
}
2021-04-11 19:38:18 +00:00
fn qos_proportion(&self) -> f64 {
2020-11-22 09:50:37 +00:00
unsafe { ffi::gst_video_decoder_get_qos_proportion(self.as_ref().to_glib_none().0) }
}
2021-09-19 08:04:08 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn is_subframe_mode(&self) -> bool {
unsafe {
from_glib(ffi::gst_video_decoder_get_subframe_mode(
self.as_ref().to_glib_none().0,
))
}
}
fn have_frame(&self) -> gst::FlowReturn {
unsafe {
from_glib(ffi::gst_video_decoder_have_frame(
self.as_ref().to_glib_none().0,
))
}
}
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_merge_tags(
self.as_ref().to_glib_none().0,
tags.to_glib_none().0,
mode.into_glib(),
);
}
}
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe {
2020-11-22 09:50:37 +00:00
from_glib_full(ffi::gst_video_decoder_proxy_getcaps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
filter.to_glib_none().0,
))
}
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn request_sync_point(
&self,
frame: &VideoCodecFrame,
flags: VideoDecoderRequestSyncPointFlags,
) {
unsafe {
ffi::gst_video_decoder_request_sync_point(
self.as_ref().to_glib_none().0,
frame.to_glib_none().0,
flags.into_glib(),
);
}
}
fn set_estimate_rate(&self, enabled: bool) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_set_estimate_rate(
self.as_ref().to_glib_none().0,
enabled.into_glib(),
);
}
}
fn set_max_errors(&self, num: i32) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_set_max_errors(self.as_ref().to_glib_none().0, num);
}
}
fn set_needs_format(&self, enabled: bool) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_set_needs_format(
self.as_ref().to_glib_none().0,
enabled.into_glib(),
);
}
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn set_needs_sync_point(&self, enabled: bool) {
unsafe {
ffi::gst_video_decoder_set_needs_sync_point(
self.as_ref().to_glib_none().0,
enabled.into_glib(),
);
}
}
fn set_packetized(&self, packetized: bool) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_set_packetized(
self.as_ref().to_glib_none().0,
packetized.into_glib(),
);
}
}
2021-09-19 08:04:08 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn set_subframe_mode(&self, subframe_mode: bool) {
unsafe {
ffi::gst_video_decoder_set_subframe_mode(
self.as_ref().to_glib_none().0,
subframe_mode.into_glib(),
);
}
}
fn set_use_default_pad_acceptcaps(&self, use_: bool) {
unsafe {
2020-11-22 09:50:37 +00:00
ffi::gst_video_decoder_set_use_default_pad_acceptcaps(
self.as_ref().to_glib_none().0,
use_.into_glib(),
);
}
}
2020-04-30 16:51:41 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn automatic_request_sync_point_flags(&self) -> VideoDecoderRequestSyncPointFlags {
unsafe {
let mut value = glib::Value::from_type(
<VideoDecoderRequestSyncPointFlags as StaticType>::static_type(),
);
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"automatic-request-sync-point-flags\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `automatic-request-sync-point-flags` getter")
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn set_automatic_request_sync_point_flags(
&self,
automatic_request_sync_point_flags: VideoDecoderRequestSyncPointFlags,
) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"automatic-request-sync-point-flags\0".as_ptr() as *const _,
automatic_request_sync_point_flags
.to_value()
.to_glib_none()
.0,
);
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn is_automatic_request_sync_points(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"automatic-request-sync-points\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `automatic-request-sync-points` getter")
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn set_automatic_request_sync_points(&self, automatic_request_sync_points: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"automatic-request-sync-points\0".as_ptr() as *const _,
automatic_request_sync_points.to_value().to_glib_none().0,
);
}
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn is_discard_corrupted_frames(&self) -> bool {
unsafe {
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"discard-corrupted-frames\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `discard-corrupted-frames` getter")
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn set_discard_corrupted_frames(&self, discard_corrupted_frames: bool) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"discard-corrupted-frames\0".as_ptr() as *const _,
discard_corrupted_frames.to_value().to_glib_none().0,
);
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn min_force_key_unit_interval(&self) -> u64 {
unsafe {
let mut value = glib::Value::from_type(<u64 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"min-force-key-unit-interval\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `min-force-key-unit-interval` getter")
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn set_min_force_key_unit_interval(&self, min_force_key_unit_interval: u64) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"min-force-key-unit-interval\0".as_ptr() as *const _,
min_force_key_unit_interval.to_value().to_glib_none().0,
);
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2021-04-11 19:38:18 +00:00
fn is_qos(&self) -> bool {
2020-04-30 16:51:41 +00:00
unsafe {
2020-11-27 13:37:24 +00:00
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
2020-11-22 09:50:37 +00:00
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
2020-04-30 16:51:41 +00:00
b"qos\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
2021-04-19 16:24:43 +00:00
value.get().expect("Return Value for property `qos` getter")
2020-04-30 16:51:41 +00:00
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
2021-04-11 19:38:18 +00:00
fn set_qos(&self, qos: bool) {
2020-04-30 16:51:41 +00:00
unsafe {
2020-11-22 09:50:37 +00:00
glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
2020-04-30 16:51:41 +00:00
b"qos\0".as_ptr() as *const _,
2021-04-19 16:24:43 +00:00
qos.to_value().to_glib_none().0,
2020-04-30 16:51:41 +00:00
);
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn connect_automatic_request_sync_point_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_automatic_request_sync_point_flags_trampoline<
P: IsA<VideoDecoder>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstVideoDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(VideoDecoder::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::automatic-request-sync-point-flags\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_automatic_request_sync_point_flags_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn connect_automatic_request_sync_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_automatic_request_sync_points_trampoline<
P: IsA<VideoDecoder>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstVideoDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(VideoDecoder::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::automatic-request-sync-points\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_automatic_request_sync_points_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn connect_discard_corrupted_frames_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_discard_corrupted_frames_trampoline<
P: IsA<VideoDecoder>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstVideoDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(VideoDecoder::from_glib_borrow(this).unsafe_cast_ref())
2021-04-17 10:11:52 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::discard-corrupted-frames\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_discard_corrupted_frames_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
2020-07-06 08:37:14 +00:00
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_errors_trampoline<
P: IsA<VideoDecoder>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-22 09:50:37 +00:00
this: *mut ffi::GstVideoDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2020-07-06 08:37:14 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(VideoDecoder::from_glib_borrow(this).unsafe_cast_ref())
2020-07-06 08:37:14 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-errors\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_max_errors_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn connect_min_force_key_unit_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_min_force_key_unit_interval_trampoline<
P: IsA<VideoDecoder>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstVideoDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(VideoDecoder::from_glib_borrow(this).unsafe_cast_ref())
2021-04-17 10:11:52 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::min-force-key-unit-interval\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_min_force_key_unit_interval_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_trampoline<
P: IsA<VideoDecoder>,
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-22 09:50:37 +00:00
this: *mut ffi::GstVideoDecoder,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2020-04-30 16:51:41 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(VideoDecoder::from_glib_borrow(this).unsafe_cast_ref())
2020-04-30 16:51:41 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::qos\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_qos_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}