2019-05-11 12:58:39 +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)
|
2019-05-11 12:58:39 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
use crate::VideoDecoderRequestSyncPointFlags;
|
2024-06-01 13:14:58 +00:00
|
|
|
use crate::{ffi, VideoCodecFrame};
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::signal::{connect_raw, SignalHandlerId};
|
|
|
|
use glib::{prelude::*, translate::*};
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-08-28 16:52:26 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2019-05-11 12:58:39 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstVideoDecoder")]
|
2020-11-22 09:50:37 +00:00
|
|
|
pub struct VideoDecoder(Object<ffi::GstVideoDecoder, ffi::GstVideoDecoderClass>) @extends gst::Element, gst::Object;
|
2019-05-11 12:58:39 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_video_decoder_get_type(),
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-03 17:28:46 +00:00
|
|
|
impl VideoDecoder {
|
|
|
|
pub const NONE: Option<&'static VideoDecoder> = None;
|
|
|
|
}
|
2019-05-11 12:58:39 +00:00
|
|
|
|
2021-11-16 14:02:58 +00:00
|
|
|
unsafe impl Send for VideoDecoder {}
|
|
|
|
unsafe impl Sync for VideoDecoder {}
|
|
|
|
|
2024-10-19 14:53:23 +00:00
|
|
|
pub trait VideoDecoderExt: IsA<VideoDecoder> + 'static {
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_add_to_frame")]
|
2019-05-11 12:58:39 +00:00
|
|
|
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);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_allocate_output_buffer")]
|
2019-12-17 19:00:42 +00:00
|
|
|
fn allocate_output_buffer(&self) -> Result<gst::Buffer, glib::BoolError> {
|
2019-05-11 12:58:39 +00:00
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
Option::<_>::from_glib_full(ffi::gst_video_decoder_allocate_output_buffer(
|
2019-06-18 10:12:00 +00:00
|
|
|
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"))
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_drop_frame")]
|
2023-01-03 19:08:39 +00:00
|
|
|
fn drop_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_video_decoder_drop_frame(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.into_glib_ptr(),
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_drop_subframe")]
|
2023-01-04 15:45:33 +00:00
|
|
|
fn drop_subframe(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_video_decoder_drop_subframe(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.into_glib_ptr(),
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_finish_frame")]
|
2023-01-03 19:08:39 +00:00
|
|
|
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_video_decoder_finish_frame(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.into_glib_ptr(),
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_finish_subframe")]
|
2023-01-04 15:45:33 +00:00
|
|
|
fn finish_subframe(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_video_decoder_finish_subframe(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.into_glib_ptr(),
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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> {
|
2019-05-11 12:58:39 +00:00
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
from_glib_full(ffi::gst_video_decoder_get_buffer_pool(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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-11-22 09:50:37 +00:00
|
|
|
unsafe { ffi::gst_video_decoder_get_estimate_rate(self.as_ref().to_glib_none().0) }
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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 {
|
2019-05-11 12:58:39 +00:00
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
ffi::gst_video_decoder_get_max_decode_time(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.to_glib_none().0,
|
|
|
|
)
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_get_max_errors")]
|
|
|
|
#[doc(alias = "get_max_errors")]
|
2024-06-02 14:20:42 +00:00
|
|
|
#[doc(alias = "max-errors")]
|
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) }
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_get_needs_format")]
|
|
|
|
#[doc(alias = "get_needs_format")]
|
2021-04-19 19:55:01 +00:00
|
|
|
fn needs_format(&self) -> bool {
|
2019-05-11 12:58:39 +00:00
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
from_glib(ffi::gst_video_decoder_get_needs_format(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_get_needs_sync_point")]
|
|
|
|
#[doc(alias = "get_needs_sync_point")]
|
2021-04-17 10:11:52 +00:00
|
|
|
fn needs_sync_point(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_video_decoder_get_needs_sync_point(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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 {
|
2019-05-11 12:58:39 +00:00
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
from_glib(ffi::gst_video_decoder_get_packetized(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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-11-22 09:50:37 +00:00
|
|
|
unsafe { ffi::gst_video_decoder_get_pending_frame_size(self.as_ref().to_glib_none().0) }
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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 {
|
2020-11-22 09:50:37 +00:00
|
|
|
unsafe { ffi::gst_video_decoder_get_qos_proportion(self.as_ref().to_glib_none().0) }
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_get_subframe_mode")]
|
|
|
|
#[doc(alias = "get_subframe_mode")]
|
2021-09-19 08:04:08 +00:00
|
|
|
fn is_subframe_mode(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_video_decoder_get_subframe_mode(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_have_frame")]
|
2023-01-03 19:08:39 +00:00
|
|
|
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
2021-04-28 12:32:14 +00:00
|
|
|
unsafe {
|
2023-01-03 19:08:39 +00:00
|
|
|
try_from_glib(ffi::gst_video_decoder_have_frame(
|
2021-04-28 12:32:14 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_have_last_subframe")]
|
2023-01-04 15:45:33 +00:00
|
|
|
fn have_last_subframe(
|
|
|
|
&self,
|
|
|
|
frame: &VideoCodecFrame,
|
|
|
|
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
|
|
|
try_from_glib(ffi::gst_video_decoder_have_last_subframe(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_merge_tags")]
|
2019-05-11 12:58:39 +00:00
|
|
|
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(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
tags.to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
mode.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_proxy_getcaps")]
|
2019-09-14 08:05:55 +00:00
|
|
|
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps {
|
2019-05-11 12:58:39 +00:00
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
from_glib_full(ffi::gst_video_decoder_proxy_getcaps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
filter.to_glib_none().0,
|
|
|
|
))
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_release_frame")]
|
2023-01-03 19:08:39 +00:00
|
|
|
fn release_frame(&self, frame: VideoCodecFrame) {
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_video_decoder_release_frame(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame.into_glib_ptr(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_request_sync_point")]
|
2021-04-17 10:11:52 +00:00
|
|
|
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(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_estimate_rate")]
|
2019-05-11 12:58:39 +00:00
|
|
|
fn set_estimate_rate(&self, enabled: bool) {
|
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
ffi::gst_video_decoder_set_estimate_rate(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
enabled.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_max_errors")]
|
2024-06-02 14:20:42 +00:00
|
|
|
#[doc(alias = "max-errors")]
|
2019-05-11 12:58:39 +00:00
|
|
|
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);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_needs_format")]
|
2019-05-11 12:58:39 +00:00
|
|
|
fn set_needs_format(&self, enabled: bool) {
|
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
ffi::gst_video_decoder_set_needs_format(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
enabled.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_needs_sync_point")]
|
2021-04-17 10:11:52 +00:00
|
|
|
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(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_packetized")]
|
2019-05-11 12:58:39 +00:00
|
|
|
fn set_packetized(&self, packetized: bool) {
|
|
|
|
unsafe {
|
2020-11-22 09:50:37 +00:00
|
|
|
ffi::gst_video_decoder_set_packetized(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
packetized.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_subframe_mode")]
|
2021-09-19 08:04:08 +00:00
|
|
|
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(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_video_decoder_set_use_default_pad_acceptcaps")]
|
2019-05-11 12:58:39 +00:00
|
|
|
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(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
use_.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-30 16:51:41 +00:00
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "automatic-request-sync-point-flags")]
|
2021-10-08 16:44:38 +00:00
|
|
|
fn automatic_request_sync_point_flags(&self) -> VideoDecoderRequestSyncPointFlags {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "automatic-request-sync-point-flags")
|
2021-10-08 16:44:38 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "automatic-request-sync-point-flags")]
|
2021-10-08 16:44:38 +00:00
|
|
|
fn set_automatic_request_sync_point_flags(
|
|
|
|
&self,
|
|
|
|
automatic_request_sync_point_flags: VideoDecoderRequestSyncPointFlags,
|
|
|
|
) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(
|
2021-11-06 17:31:52 +00:00
|
|
|
self.as_ref(),
|
|
|
|
"automatic-request-sync-point-flags",
|
2023-04-06 12:19:03 +00:00
|
|
|
automatic_request_sync_point_flags,
|
2021-11-06 17:31:52 +00:00
|
|
|
)
|
2021-10-08 16:44:38 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "automatic-request-sync-points")]
|
2021-10-08 16:44:38 +00:00
|
|
|
fn is_automatic_request_sync_points(&self) -> bool {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "automatic-request-sync-points")
|
2021-10-08 16:44:38 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "automatic-request-sync-points")]
|
2021-10-08 16:44:38 +00:00
|
|
|
fn set_automatic_request_sync_points(&self, automatic_request_sync_points: bool) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(
|
2021-11-06 17:31:52 +00:00
|
|
|
self.as_ref(),
|
|
|
|
"automatic-request-sync-points",
|
2023-04-06 12:19:03 +00:00
|
|
|
automatic_request_sync_points,
|
2021-11-06 17:31:52 +00:00
|
|
|
)
|
2021-10-08 16:44:38 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "discard-corrupted-frames")]
|
2021-04-17 10:11:52 +00:00
|
|
|
fn is_discard_corrupted_frames(&self) -> bool {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "discard-corrupted-frames")
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "discard-corrupted-frames")]
|
2021-04-17 10:11:52 +00:00
|
|
|
fn set_discard_corrupted_frames(&self, discard_corrupted_frames: bool) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(
|
2021-11-06 17:31:52 +00:00
|
|
|
self.as_ref(),
|
|
|
|
"discard-corrupted-frames",
|
2023-04-06 12:19:03 +00:00
|
|
|
discard_corrupted_frames,
|
2021-11-06 17:31:52 +00:00
|
|
|
)
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "min-force-key-unit-interval")]
|
2021-04-17 10:11:52 +00:00
|
|
|
fn min_force_key_unit_interval(&self) -> u64 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "min-force-key-unit-interval")
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "min-force-key-unit-interval")]
|
2021-04-17 10:11:52 +00:00
|
|
|
fn set_min_force_key_unit_interval(&self, min_force_key_unit_interval: u64) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(
|
2021-11-06 17:31:52 +00:00
|
|
|
self.as_ref(),
|
|
|
|
"min-force-key-unit-interval",
|
2023-04-06 12:19:03 +00:00
|
|
|
min_force_key_unit_interval,
|
2021-11-06 17:31:52 +00:00
|
|
|
)
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn is_qos(&self) -> bool {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "qos")
|
2020-04-30 16:51:41 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_qos(&self, qos: bool) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self.as_ref(), "qos", qos)
|
2020-04-30 16:51:41 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "automatic-request-sync-point-flags")]
|
2021-10-08 16:44:38 +00:00
|
|
|
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 _,
|
2024-06-01 13:14:58 +00:00
|
|
|
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
2021-10-08 16:44:38 +00:00
|
|
|
notify_automatic_request_sync_point_flags_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "automatic-request-sync-points")]
|
2021-10-08 16:44:38 +00:00
|
|
|
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 _,
|
2024-06-01 13:14:58 +00:00
|
|
|
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
2021-10-08 16:44:38 +00:00
|
|
|
notify_automatic_request_sync_points_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "discard-corrupted-frames")]
|
2021-04-17 10:11:52 +00:00
|
|
|
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 _,
|
2024-06-01 13:14:58 +00:00
|
|
|
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
2021-04-17 10:11:52 +00:00
|
|
|
notify_discard_corrupted_frames_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "max-errors")]
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_max_errors_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2020-07-06 08:37:14 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
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,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
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 _,
|
2024-06-01 13:14:58 +00:00
|
|
|
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
2020-07-06 08:37:14 +00:00
|
|
|
notify_max_errors_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "min-force-key-unit-interval")]
|
2021-04-17 10:11:52 +00:00
|
|
|
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 _,
|
2024-06-01 13:14:58 +00:00
|
|
|
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
2021-04-17 10:11:52 +00:00
|
|
|
notify_min_force_key_unit_interval_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "qos")]
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
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,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
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 _,
|
2024-06-01 13:14:58 +00:00
|
|
|
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
2020-04-30 16:51:41 +00:00
|
|
|
notify_qos_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2019-05-11 12:58:39 +00:00
|
|
|
}
|
2023-07-05 18:20:29 +00:00
|
|
|
|
|
|
|
impl<O: IsA<VideoDecoder>> VideoDecoderExt for O {}
|