mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
Remove unnecessary trait sealing
For all these traits only the implementation that already exists is possible. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1563>
This commit is contained in:
parent
887bffbb2c
commit
abbc85c3d0
59 changed files with 78 additions and 368 deletions
|
@ -10,12 +10,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, AudioAggregator, AudioAggregatorPad};
|
use crate::{ffi, AudioAggregator, AudioAggregatorPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioAggregatorExtManual: IsA<AudioAggregator> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioAggregator>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioAggregatorExtManual: sealed::Sealed + IsA<AudioAggregator> + 'static {
|
|
||||||
#[doc(alias = "gst_audio_aggregator_set_sink_caps")]
|
#[doc(alias = "gst_audio_aggregator_set_sink_caps")]
|
||||||
fn set_sink_caps(&self, pad: &impl IsA<AudioAggregatorPad>, caps: &gst::CapsRef) {
|
fn set_sink_caps(&self, pad: &impl IsA<AudioAggregatorPad>, caps: &gst::CapsRef) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -8,14 +8,7 @@ use glib::{
|
||||||
|
|
||||||
use crate::{ffi, AudioAggregatorConvertPad};
|
use crate::{ffi, AudioAggregatorConvertPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioAggregatorConvertPadExtManual: IsA<AudioAggregatorConvertPad> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioAggregatorConvertPad>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioAggregatorConvertPadExtManual:
|
|
||||||
sealed::Sealed + IsA<AudioAggregatorConvertPad> + 'static
|
|
||||||
{
|
|
||||||
#[doc(alias = "converter-config")]
|
#[doc(alias = "converter-config")]
|
||||||
fn converter_config(&self) -> Option<crate::AudioConverterConfig> {
|
fn converter_config(&self) -> Option<crate::AudioConverterConfig> {
|
||||||
ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
||||||
|
|
|
@ -3,12 +3,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, AudioAggregatorPad};
|
use crate::{ffi, AudioAggregatorPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioAggregatorPadExtManual: IsA<AudioAggregatorPad> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioAggregatorPad>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioAggregatorPadExtManual: sealed::Sealed + IsA<AudioAggregatorPad> + 'static {
|
|
||||||
fn audio_info(&self) -> Option<crate::AudioInfo> {
|
fn audio_info(&self) -> Option<crate::AudioInfo> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstAudioAggregatorPad;
|
let ptr = self.as_ptr() as *mut ffi::GstAudioAggregatorPad;
|
||||||
|
|
|
@ -20,12 +20,7 @@ extern "C" {
|
||||||
) -> gst::ffi::GstFlowReturn;
|
) -> gst::ffi::GstFlowReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioDecoderExtManual: IsA<AudioDecoder> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioDecoder>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioDecoderExtManual: sealed::Sealed + IsA<AudioDecoder> + 'static {
|
|
||||||
#[doc(alias = "gst_audio_decoder_negotiate")]
|
#[doc(alias = "gst_audio_decoder_negotiate")]
|
||||||
fn negotiate(&self) -> Result<(), gst::FlowError> {
|
fn negotiate(&self) -> Result<(), gst::FlowError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -6,12 +6,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, AudioEncoder};
|
use crate::{ffi, AudioEncoder};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioEncoderExtManual: IsA<AudioEncoder> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioEncoder>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioEncoderExtManual: sealed::Sealed + IsA<AudioEncoder> + 'static {
|
|
||||||
#[doc(alias = "gst_audio_encoder_negotiate")]
|
#[doc(alias = "gst_audio_encoder_negotiate")]
|
||||||
fn negotiate(&self) -> Result<(), gst::FlowError> {
|
fn negotiate(&self) -> Result<(), gst::FlowError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -5,12 +5,7 @@ use gst_base::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, AudioFilter, AudioInfo};
|
use crate::{ffi, AudioFilter, AudioInfo};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioFilterExtManual: IsA<AudioFilter> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioFilter>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioFilterExtManual: sealed::Sealed + IsA<AudioFilter> + 'static {
|
|
||||||
fn audio_info(&self) -> Option<AudioInfo> {
|
fn audio_info(&self) -> Option<AudioInfo> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr: &ffi::GstAudioFilter = &*(self.as_ptr() as *const _);
|
let ptr: &ffi::GstAudioFilter = &*(self.as_ptr() as *const _);
|
||||||
|
|
|
@ -16,12 +16,7 @@ use gst::{format::FormattedValue, prelude::*};
|
||||||
|
|
||||||
use crate::{ffi, Aggregator, AggregatorPad};
|
use crate::{ffi, Aggregator, AggregatorPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AggregatorExtManual: IsA<Aggregator> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Aggregator>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AggregatorExtManual: sealed::Sealed + IsA<Aggregator> + 'static {
|
|
||||||
#[doc(alias = "get_allocator")]
|
#[doc(alias = "get_allocator")]
|
||||||
#[doc(alias = "gst_aggregator_get_allocator")]
|
#[doc(alias = "gst_aggregator_get_allocator")]
|
||||||
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
|
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
|
||||||
|
|
|
@ -5,12 +5,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, AggregatorPad};
|
use crate::{ffi, AggregatorPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AggregatorPadExtManual: IsA<AggregatorPad> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AggregatorPad>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AggregatorPadExtManual: sealed::Sealed + IsA<AggregatorPad> + 'static {
|
|
||||||
#[doc(alias = "get_segment")]
|
#[doc(alias = "get_segment")]
|
||||||
fn segment(&self) -> gst::Segment {
|
fn segment(&self) -> gst::Segment {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -10,12 +10,7 @@ use gst::{
|
||||||
|
|
||||||
use crate::{ffi, BaseParse, BaseParseFrame};
|
use crate::{ffi, BaseParse, BaseParseFrame};
|
||||||
|
|
||||||
mod sealed {
|
pub trait BaseParseExtManual: IsA<BaseParse> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::BaseParse>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait BaseParseExtManual: sealed::Sealed + IsA<BaseParse> + 'static {
|
|
||||||
#[doc(alias = "get_sink_pad")]
|
#[doc(alias = "get_sink_pad")]
|
||||||
fn sink_pad(&self) -> &gst::Pad {
|
fn sink_pad(&self) -> &gst::Pad {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -7,12 +7,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, BaseSink};
|
use crate::{ffi, BaseSink};
|
||||||
|
|
||||||
mod sealed {
|
pub trait BaseSinkExtManual: IsA<BaseSink> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::BaseSink>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait BaseSinkExtManual: sealed::Sealed + IsA<BaseSink> + 'static {
|
|
||||||
#[doc(alias = "get_segment")]
|
#[doc(alias = "get_segment")]
|
||||||
fn segment(&self) -> gst::Segment {
|
fn segment(&self) -> gst::Segment {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -7,12 +7,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, BaseSrc};
|
use crate::{ffi, BaseSrc};
|
||||||
|
|
||||||
mod sealed {
|
pub trait BaseSrcExtManual: IsA<BaseSrc> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::BaseSrc>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait BaseSrcExtManual: sealed::Sealed + IsA<BaseSrc> + 'static {
|
|
||||||
#[doc(alias = "get_allocator")]
|
#[doc(alias = "get_allocator")]
|
||||||
#[doc(alias = "gst_base_src_get_allocator")]
|
#[doc(alias = "gst_base_src_get_allocator")]
|
||||||
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
|
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
|
||||||
|
|
|
@ -7,12 +7,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, BaseTransform};
|
use crate::{ffi, BaseTransform};
|
||||||
|
|
||||||
mod sealed {
|
pub trait BaseTransformExtManual: IsA<BaseTransform> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::BaseTransform>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait BaseTransformExtManual: sealed::Sealed + IsA<BaseTransform> + 'static {
|
|
||||||
#[doc(alias = "get_allocator")]
|
#[doc(alias = "get_allocator")]
|
||||||
#[doc(alias = "gst_base_transform_get_allocator")]
|
#[doc(alias = "gst_base_transform_get_allocator")]
|
||||||
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
|
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams) {
|
||||||
|
|
|
@ -2,12 +2,7 @@
|
||||||
use crate::{ffi, prelude::*, Formatter};
|
use crate::{ffi, prelude::*, Formatter};
|
||||||
use gst::glib::translate::*;
|
use gst::glib::translate::*;
|
||||||
|
|
||||||
mod sealed {
|
pub trait FormatterExtManual: IsA<Formatter> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Formatter>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait FormatterExtManual: sealed::Sealed + IsA<Formatter> + 'static {
|
|
||||||
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
|
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = self.class_of::<crate::Formatter>().unwrap();
|
let klass = self.class_of::<crate::Formatter>().unwrap();
|
||||||
|
|
|
@ -45,12 +45,7 @@ impl GLContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait GLContextExtManual: IsA<GLContext> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::GLContext>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GLContextExtManual: sealed::Sealed + IsA<GLContext> + 'static {
|
|
||||||
#[doc(alias = "get_gl_context")]
|
#[doc(alias = "get_gl_context")]
|
||||||
#[doc(alias = "gst_gl_context_get_gl_context")]
|
#[doc(alias = "gst_gl_context_get_gl_context")]
|
||||||
fn gl_context(&self) -> uintptr_t {
|
fn gl_context(&self) -> uintptr_t {
|
||||||
|
|
|
@ -3,12 +3,7 @@ use crate::{ffi, GLContext, GLDisplay};
|
||||||
use glib::prelude::*;
|
use glib::prelude::*;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
|
||||||
mod sealed {
|
pub trait GLDisplayExtManual: IsA<GLDisplay> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::GLDisplay>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GLDisplayExtManual: sealed::Sealed + IsA<GLDisplay> + 'static {
|
|
||||||
#[doc(alias = "gst_gl_display_get_handle")]
|
#[doc(alias = "gst_gl_display_get_handle")]
|
||||||
#[doc(alias = "get_handle")]
|
#[doc(alias = "get_handle")]
|
||||||
fn handle(&self) -> usize {
|
fn handle(&self) -> usize {
|
||||||
|
|
|
@ -2,12 +2,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, GLFramebuffer, GLMemoryRef};
|
use crate::{ffi, GLFramebuffer, GLMemoryRef};
|
||||||
|
|
||||||
mod sealed {
|
pub trait GLFramebufferExtManual: IsA<GLFramebuffer> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::GLFramebuffer>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GLFramebufferExtManual: sealed::Sealed + IsA<GLFramebuffer> + 'static {
|
|
||||||
#[doc(alias = "gst_gl_framebuffer_draw_to_texture")]
|
#[doc(alias = "gst_gl_framebuffer_draw_to_texture")]
|
||||||
fn draw_to_texture<F: FnOnce()>(&self, mem: &mut GLMemoryRef, func: F) {
|
fn draw_to_texture<F: FnOnce()>(&self, mem: &mut GLMemoryRef, func: F) {
|
||||||
let mut func = std::mem::ManuallyDrop::new(func);
|
let mut func = std::mem::ManuallyDrop::new(func);
|
||||||
|
|
|
@ -12,14 +12,9 @@ pub enum Writable {}
|
||||||
// TODO: implement copy for videoframes. This would need to go through all the individual memories
|
// TODO: implement copy for videoframes. This would need to go through all the individual memories
|
||||||
// and copy them. Some GL textures can be copied, others cannot.
|
// and copy them. Some GL textures can be copied, others cannot.
|
||||||
|
|
||||||
pub trait IsGLVideoFrame: IsVideoFrame + Sized {}
|
pub unsafe trait IsGLVideoFrame: IsVideoFrame {}
|
||||||
|
|
||||||
mod sealed {
|
pub trait GLVideoFrameExt: IsGLVideoFrame + VideoFrameExt {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsGLVideoFrame> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GLVideoFrameExt: sealed::Sealed + IsGLVideoFrame {
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn memory(&self, idx: u32) -> Result<&GLMemoryRef, glib::BoolError> {
|
fn memory(&self, idx: u32) -> Result<&GLMemoryRef, glib::BoolError> {
|
||||||
if idx >= self.info().n_planes() {
|
if idx >= self.info().n_planes() {
|
||||||
|
@ -80,14 +75,14 @@ pub struct GLVideoFrame<T> {
|
||||||
unsafe impl<T> Send for GLVideoFrame<T> {}
|
unsafe impl<T> Send for GLVideoFrame<T> {}
|
||||||
unsafe impl<T> Sync for GLVideoFrame<T> {}
|
unsafe impl<T> Sync for GLVideoFrame<T> {}
|
||||||
|
|
||||||
impl<T> IsVideoFrame for GLVideoFrame<T> {
|
unsafe impl<T> IsVideoFrame for GLVideoFrame<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn as_raw(&self) -> &gst_video::ffi::GstVideoFrame {
|
fn as_raw(&self) -> &gst_video::ffi::GstVideoFrame {
|
||||||
&self.frame
|
&self.frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> IsGLVideoFrame for GLVideoFrame<T> {}
|
unsafe impl<T> IsGLVideoFrame for GLVideoFrame<T> {}
|
||||||
|
|
||||||
impl<T> Debug for GLVideoFrame<T> {
|
impl<T> Debug for GLVideoFrame<T> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
@ -272,14 +267,14 @@ pub struct GLVideoFrameRef<T> {
|
||||||
unsafe impl<T> Send for GLVideoFrameRef<T> {}
|
unsafe impl<T> Send for GLVideoFrameRef<T> {}
|
||||||
unsafe impl<T> Sync for GLVideoFrameRef<T> {}
|
unsafe impl<T> Sync for GLVideoFrameRef<T> {}
|
||||||
|
|
||||||
impl<T> IsVideoFrame for GLVideoFrameRef<T> {
|
unsafe impl<T> IsVideoFrame for GLVideoFrameRef<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn as_raw(&self) -> &gst_video::ffi::GstVideoFrame {
|
fn as_raw(&self) -> &gst_video::ffi::GstVideoFrame {
|
||||||
&self.frame
|
&self.frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> IsGLVideoFrame for GLVideoFrameRef<T> {}
|
unsafe impl<T> IsGLVideoFrame for GLVideoFrameRef<T> {}
|
||||||
|
|
||||||
impl<T> Debug for GLVideoFrameRef<T> {
|
impl<T> Debug for GLVideoFrameRef<T> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
|
|
@ -4,18 +4,11 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, subclass::AudioVisualizerSetupToken, AudioVisualizer};
|
use crate::{ffi, subclass::AudioVisualizerSetupToken, AudioVisualizer};
|
||||||
|
|
||||||
mod sealed {
|
pub trait AudioVisualizerExtManual: IsA<AudioVisualizer> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::AudioVisualizer>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait AudioVisualizerExtManual:
|
|
||||||
sealed::Sealed + IsA<AudioVisualizer> + IsA<gst::Element> + 'static
|
|
||||||
{
|
|
||||||
// rustdoc-stripper-ignore-next
|
// rustdoc-stripper-ignore-next
|
||||||
/// Returns the number of samples per frame required before calling the render method
|
/// Returns the number of samples per frame required before calling the render method
|
||||||
fn req_spf(&self) -> u32 {
|
fn req_spf(&self) -> u32 {
|
||||||
let sinkpad = self.static_pad("sink").expect("sink pad presence");
|
let sinkpad = self.as_ref().static_pad("sink").expect("sink pad presence");
|
||||||
let _stream_lock = sinkpad.stream_lock();
|
let _stream_lock = sinkpad.stream_lock();
|
||||||
|
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
||||||
|
@ -31,7 +24,7 @@ pub trait AudioVisualizerExtManual:
|
||||||
token.0.as_ptr()
|
token.0.as_ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
let sinkpad = self.static_pad("sink").expect("sink pad presence");
|
let sinkpad = self.as_ref().static_pad("sink").expect("sink pad presence");
|
||||||
let _stream_lock = sinkpad.stream_lock();
|
let _stream_lock = sinkpad.stream_lock();
|
||||||
|
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
||||||
|
@ -41,7 +34,7 @@ pub trait AudioVisualizerExtManual:
|
||||||
}
|
}
|
||||||
|
|
||||||
fn audio_info(&self) -> gst_audio::AudioInfo {
|
fn audio_info(&self) -> gst_audio::AudioInfo {
|
||||||
let sinkpad = self.static_pad("sink").expect("sink pad presence");
|
let sinkpad = self.as_ref().static_pad("sink").expect("sink pad presence");
|
||||||
let _stream_lock = sinkpad.stream_lock();
|
let _stream_lock = sinkpad.stream_lock();
|
||||||
|
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
||||||
|
@ -54,7 +47,7 @@ pub trait AudioVisualizerExtManual:
|
||||||
}
|
}
|
||||||
|
|
||||||
fn video_info(&self) -> gst_video::VideoInfo {
|
fn video_info(&self) -> gst_video::VideoInfo {
|
||||||
let srcpad = self.static_pad("src").expect("src pad presence");
|
let srcpad = self.as_ref().static_pad("src").expect("src pad presence");
|
||||||
let _stream_lock = srcpad.stream_lock();
|
let _stream_lock = srcpad.stream_lock();
|
||||||
|
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
let ptr = self.as_ptr() as *mut ffi::GstAudioVisualizer;
|
||||||
|
@ -67,4 +60,4 @@ pub trait AudioVisualizerExtManual:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O: IsA<AudioVisualizer> + IsA<gst::Element>> AudioVisualizerExtManual for O {}
|
impl<O: IsA<AudioVisualizer>> AudioVisualizerExtManual for O {}
|
||||||
|
|
|
@ -31,14 +31,7 @@ impl Iterator for Iter {
|
||||||
|
|
||||||
impl std::iter::FusedIterator for Iter {}
|
impl std::iter::FusedIterator for Iter {}
|
||||||
|
|
||||||
mod sealed {
|
pub trait DiscovererStreamInfoExtManual: IsA<DiscovererStreamInfo> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::DiscovererStreamInfo>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait DiscovererStreamInfoExtManual:
|
|
||||||
sealed::Sealed + IsA<DiscovererStreamInfo> + 'static
|
|
||||||
{
|
|
||||||
fn next_iter(&self) -> Iter {
|
fn next_iter(&self) -> Iter {
|
||||||
Iter {
|
Iter {
|
||||||
stream_info: self.next(),
|
stream_info: self.next(),
|
||||||
|
|
|
@ -8,12 +8,7 @@ use crate::{
|
||||||
ffi, EncodingAudioProfile, EncodingContainerProfile, EncodingProfile, EncodingVideoProfile,
|
ffi, EncodingAudioProfile, EncodingContainerProfile, EncodingProfile, EncodingVideoProfile,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod sealed {
|
pub trait EncodingProfileExtManual: IsA<EncodingProfile> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::EncodingProfile>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait EncodingProfileExtManual: sealed::Sealed + IsA<EncodingProfile> + 'static {
|
|
||||||
#[cfg(feature = "v1_20")]
|
#[cfg(feature = "v1_20")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
||||||
#[doc(alias = "gst_encoding_profile_get_element_properties")]
|
#[doc(alias = "gst_encoding_profile_get_element_properties")]
|
||||||
|
|
|
@ -5,12 +5,7 @@ use glib::translate::*;
|
||||||
|
|
||||||
use crate::{ffi, RTPBaseDepayload};
|
use crate::{ffi, RTPBaseDepayload};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTPBaseDepayloadExtManual: IsA<RTPBaseDepayload> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTPBaseDepayload>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTPBaseDepayloadExtManual: sealed::Sealed + IsA<RTPBaseDepayload> + 'static {
|
|
||||||
#[cfg(feature = "v1_24")]
|
#[cfg(feature = "v1_24")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||||
fn extensions(&self) -> Vec<crate::RTPHeaderExtension> {
|
fn extensions(&self) -> Vec<crate::RTPHeaderExtension> {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTPBasePayload};
|
use crate::{ffi, RTPBasePayload};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTPBasePayloadExtManual: IsA<RTPBasePayload> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTPBasePayload>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTPBasePayloadExtManual: sealed::Sealed + IsA<RTPBasePayload> + 'static {
|
|
||||||
#[cfg(feature = "v1_20")]
|
#[cfg(feature = "v1_20")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
||||||
#[doc(alias = "gst_rtp_base_payload_set_outcaps_structure")]
|
#[doc(alias = "gst_rtp_base_payload_set_outcaps_structure")]
|
||||||
|
|
|
@ -2,12 +2,7 @@ use glib::{object::IsA, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTPHeaderExtension, RTPHeaderExtensionFlags};
|
use crate::{ffi, RTPHeaderExtension, RTPHeaderExtensionFlags};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTPHeaderExtensionExtManual: IsA<RTPHeaderExtension> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTPHeaderExtension>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTPHeaderExtensionExtManual: sealed::Sealed + IsA<RTPHeaderExtension> + 'static {
|
|
||||||
#[doc(alias = "gst_rtp_header_extension_read")]
|
#[doc(alias = "gst_rtp_header_extension_read")]
|
||||||
fn read(
|
fn read(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -6,12 +6,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTSPAddress, RTSPAddressPool, RTSPAddressPoolResult};
|
use crate::{ffi, RTSPAddress, RTSPAddressPool, RTSPAddressPoolResult};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPAddressPoolExtManual: IsA<RTSPAddressPool> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPAddressPool>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPAddressPoolExtManual: sealed::Sealed + IsA<RTSPAddressPool> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_address_pool_reserve_address")]
|
#[doc(alias = "gst_rtsp_address_pool_reserve_address")]
|
||||||
fn reserve_address(
|
fn reserve_address(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -10,12 +10,7 @@ use glib::{
|
||||||
|
|
||||||
use crate::{ffi, RTSPAuth, RTSPToken};
|
use crate::{ffi, RTSPAuth, RTSPToken};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPAuthExtManual: IsA<RTSPAuth> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPAuth>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPAuthExtManual: sealed::Sealed + IsA<RTSPAuth> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_auth_set_default_token")]
|
#[doc(alias = "gst_rtsp_auth_set_default_token")]
|
||||||
fn set_default_token(&self, mut token: Option<&mut RTSPToken>) {
|
fn set_default_token(&self, mut token: Option<&mut RTSPToken>) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use crate::{ffi, RTSPClient, RTSPSession};
|
||||||
use glib::{prelude::*, source::SourceId, translate::*};
|
use glib::{prelude::*, source::SourceId, translate::*};
|
||||||
use gst_rtsp::rtsp_message::RTSPMessage;
|
use gst_rtsp::rtsp_message::RTSPMessage;
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPClientExtManual: IsA<RTSPClient> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPClient>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPClientExtManual: sealed::Sealed + IsA<RTSPClient> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_client_attach")]
|
#[doc(alias = "gst_rtsp_client_attach")]
|
||||||
fn attach(&self, context: Option<&glib::MainContext>) -> SourceId {
|
fn attach(&self, context: Option<&glib::MainContext>) -> SourceId {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTSPMedia};
|
use crate::{ffi, RTSPMedia};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPMediaExtManual: IsA<RTSPMedia> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPMedia>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPMediaExtManual: sealed::Sealed + IsA<RTSPMedia> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_media_take_pipeline")]
|
#[doc(alias = "gst_rtsp_media_take_pipeline")]
|
||||||
fn take_pipeline(&self, pipeline: &impl IsA<gst::Pipeline>) {
|
fn take_pipeline(&self, pipeline: &impl IsA<gst::Pipeline>) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTSPMediaFactory};
|
use crate::{ffi, RTSPMediaFactory};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPMediaFactoryExtManual: IsA<RTSPMediaFactory> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPMediaFactory>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPMediaFactoryExtManual: sealed::Sealed + IsA<RTSPMediaFactory> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_media_factory_add_role_from_structure")]
|
#[doc(alias = "gst_rtsp_media_factory_add_role_from_structure")]
|
||||||
fn add_role_from_structure(&self, structure: &gst::StructureRef) {
|
fn add_role_from_structure(&self, structure: &gst::StructureRef) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -4,14 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTSPContext, RTSPOnvifMediaFactory};
|
use crate::{ffi, RTSPContext, RTSPOnvifMediaFactory};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPOnvifMediaFactoryExtManual: IsA<RTSPOnvifMediaFactory> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPOnvifMediaFactory>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPOnvifMediaFactoryExtManual:
|
|
||||||
sealed::Sealed + IsA<RTSPOnvifMediaFactory> + 'static
|
|
||||||
{
|
|
||||||
#[doc(alias = "gst_rtsp_onvif_media_factory_requires_backchannel")]
|
#[doc(alias = "gst_rtsp_onvif_media_factory_requires_backchannel")]
|
||||||
fn requires_backchannel(&self, ctx: &RTSPContext) -> bool {
|
fn requires_backchannel(&self, ctx: &RTSPContext) -> bool {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, source::SourceId, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTSPServer};
|
use crate::{ffi, RTSPServer};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPServerExtManual: IsA<RTSPServer> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPServer>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPServerExtManual: sealed::Sealed + IsA<RTSPServer> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_server_attach")]
|
#[doc(alias = "gst_rtsp_server_attach")]
|
||||||
fn attach(
|
fn attach(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -6,12 +6,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, RTSPSession, RTSPSessionMedia};
|
use crate::{ffi, RTSPSession, RTSPSessionMedia};
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPSessionExtManual: IsA<super::RTSPSession> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPSession>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPSessionExtManual: sealed::Sealed + IsA<super::RTSPSession> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_session_dup_media")]
|
#[doc(alias = "gst_rtsp_session_dup_media")]
|
||||||
#[doc(alias = "gst_rtsp_session_get_media")]
|
#[doc(alias = "gst_rtsp_session_get_media")]
|
||||||
fn media(&self, path: &str) -> (Option<RTSPSessionMedia>, i32) {
|
fn media(&self, path: &str) -> (Option<RTSPSessionMedia>, i32) {
|
||||||
|
|
|
@ -36,12 +36,7 @@ fn into_raw_watch<F: FnMut(&RTSPSessionPool) -> ControlFlow + Send + 'static>(fu
|
||||||
Box::into_raw(func) as gpointer
|
Box::into_raw(func) as gpointer
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait RTSPSessionPoolExtManual: IsA<RTSPSessionPool> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::RTSPSessionPool>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RTSPSessionPoolExtManual: sealed::Sealed + IsA<RTSPSessionPool> + 'static {
|
|
||||||
#[doc(alias = "gst_rtsp_session_pool_create_watch")]
|
#[doc(alias = "gst_rtsp_session_pool_create_watch")]
|
||||||
fn create_watch<F>(&self, name: Option<&str>, priority: Priority, func: F) -> glib::Source
|
fn create_watch<F>(&self, name: Option<&str>, priority: Priority, func: F) -> glib::Source
|
||||||
where
|
where
|
||||||
|
|
|
@ -3,12 +3,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, VideoAggregator};
|
use crate::{ffi, VideoAggregator};
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoAggregatorExtManual: IsA<VideoAggregator> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoAggregator>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoAggregatorExtManual: sealed::Sealed + IsA<VideoAggregator> + 'static {
|
|
||||||
fn video_info(&self) -> Option<crate::VideoInfo> {
|
fn video_info(&self) -> Option<crate::VideoInfo> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstVideoAggregator;
|
let ptr = self.as_ptr() as *mut ffi::GstVideoAggregator;
|
||||||
|
|
|
@ -8,14 +8,7 @@ use glib::{
|
||||||
|
|
||||||
use crate::{ffi, VideoAggregatorConvertPad};
|
use crate::{ffi, VideoAggregatorConvertPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoAggregatorConvertPadExtManual: IsA<VideoAggregatorConvertPad> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoAggregatorConvertPad>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoAggregatorConvertPadExtManual:
|
|
||||||
sealed::Sealed + IsA<VideoAggregatorConvertPad> + 'static
|
|
||||||
{
|
|
||||||
#[doc(alias = "converter-config")]
|
#[doc(alias = "converter-config")]
|
||||||
fn converter_config(&self) -> Option<crate::VideoConverterConfig> {
|
fn converter_config(&self) -> Option<crate::VideoConverterConfig> {
|
||||||
ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
||||||
|
|
|
@ -3,12 +3,7 @@ use gst::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, subclass::AggregateFramesToken, VideoAggregatorPad};
|
use crate::{ffi, subclass::AggregateFramesToken, VideoAggregatorPad};
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoAggregatorPadExtManual: IsA<VideoAggregatorPad> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoAggregatorPad>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoAggregatorPadExtManual: sealed::Sealed + IsA<VideoAggregatorPad> + 'static {
|
|
||||||
#[doc(alias = "gst_video_aggregator_pad_has_current_buffer")]
|
#[doc(alias = "gst_video_aggregator_pad_has_current_buffer")]
|
||||||
fn has_current_buffer(&self, _token: &AggregateFramesToken) -> bool {
|
fn has_current_buffer(&self, _token: &AggregateFramesToken) -> bool {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -28,12 +28,7 @@ extern "C" {
|
||||||
) -> gst::ffi::GstFlowReturn;
|
) -> gst::ffi::GstFlowReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoDecoderExtManual: IsA<VideoDecoder> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoDecoder>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoDecoderExtManual: sealed::Sealed + IsA<VideoDecoder> + 'static {
|
|
||||||
#[doc(alias = "gst_video_decoder_allocate_output_frame")]
|
#[doc(alias = "gst_video_decoder_allocate_output_frame")]
|
||||||
fn allocate_output_frame(
|
fn allocate_output_frame(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -10,12 +10,8 @@ use crate::{
|
||||||
video_codec_state::{InNegotiation, Readable, VideoCodecState, VideoCodecStateContext},
|
video_codec_state::{InNegotiation, Readable, VideoCodecState, VideoCodecStateContext},
|
||||||
VideoCodecFrame, VideoEncoder,
|
VideoCodecFrame, VideoEncoder,
|
||||||
};
|
};
|
||||||
mod sealed {
|
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoEncoder>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoEncoderExtManual: sealed::Sealed + IsA<VideoEncoder> + 'static {
|
pub trait VideoEncoderExtManual: IsA<VideoEncoder> + 'static {
|
||||||
#[doc(alias = "gst_video_encoder_allocate_output_frame")]
|
#[doc(alias = "gst_video_encoder_allocate_output_frame")]
|
||||||
fn allocate_output_frame(
|
fn allocate_output_frame(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -6,12 +6,7 @@ use gst_base::prelude::*;
|
||||||
|
|
||||||
use crate::{ffi, VideoFilter};
|
use crate::{ffi, VideoFilter};
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoFilterExtManual: IsA<VideoFilter> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoFilter>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoFilterExtManual: sealed::Sealed + IsA<VideoFilter> + 'static {
|
|
||||||
fn input_video_info(&self) -> Option<crate::VideoInfo> {
|
fn input_video_info(&self) -> Option<crate::VideoInfo> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr = self.as_ptr() as *mut ffi::GstVideoFilter;
|
let ptr = self.as_ptr() as *mut ffi::GstVideoFilter;
|
||||||
|
|
|
@ -8,11 +8,11 @@ use glib::translate::{from_glib, from_glib_none, Borrowed, ToGlibPtr};
|
||||||
pub enum Readable {}
|
pub enum Readable {}
|
||||||
pub enum Writable {}
|
pub enum Writable {}
|
||||||
|
|
||||||
pub trait IsVideoFrame {
|
pub unsafe trait IsVideoFrame {
|
||||||
fn as_raw(&self) -> &ffi::GstVideoFrame;
|
fn as_raw(&self) -> &ffi::GstVideoFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> IsVideoFrame for VideoFrame<T> {
|
unsafe impl<T> IsVideoFrame for VideoFrame<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn as_raw(&self) -> &ffi::GstVideoFrame {
|
fn as_raw(&self) -> &ffi::GstVideoFrame {
|
||||||
&self.frame
|
&self.frame
|
||||||
|
@ -39,12 +39,7 @@ impl<T> fmt::Debug for VideoFrame<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoFrameExt: IsVideoFrame {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsVideoFrame> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoFrameExt: sealed::Sealed + IsVideoFrame {
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn as_ptr(&self) -> *const ffi::GstVideoFrame {
|
fn as_ptr(&self) -> *const ffi::GstVideoFrame {
|
||||||
self.as_raw() as _
|
self.as_raw() as _
|
||||||
|
@ -556,7 +551,7 @@ pub struct VideoFrameRef<T> {
|
||||||
phantom: PhantomData<T>,
|
phantom: PhantomData<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> IsVideoFrame for VideoFrameRef<T> {
|
unsafe impl<T> IsVideoFrame for VideoFrameRef<T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn as_raw(&self) -> &ffi::GstVideoFrame {
|
fn as_raw(&self) -> &ffi::GstVideoFrame {
|
||||||
&self.frame
|
&self.frame
|
||||||
|
|
|
@ -5,12 +5,7 @@ use libc::uintptr_t;
|
||||||
|
|
||||||
use crate::{ffi, VideoOverlay};
|
use crate::{ffi, VideoOverlay};
|
||||||
|
|
||||||
mod sealed {
|
pub trait VideoOverlayExtManual: IsA<VideoOverlay> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::VideoOverlay>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait VideoOverlayExtManual: sealed::Sealed + IsA<VideoOverlay> + 'static {
|
|
||||||
unsafe fn set_window_handle(&self, handle: uintptr_t) {
|
unsafe fn set_window_handle(&self, handle: uintptr_t) {
|
||||||
ffi::gst_video_overlay_set_window_handle(self.as_ref().to_glib_none().0, handle)
|
ffi::gst_video_overlay_set_window_handle(self.as_ref().to_glib_none().0, handle)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, WebRTCICE, WebRTCICEStream};
|
use crate::{ffi, WebRTCICE, WebRTCICEStream};
|
||||||
|
|
||||||
mod sealed {
|
pub trait WebRTCICEExtManual: IsA<WebRTCICE> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::WebRTCICE>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait WebRTCICEExtManual: sealed::Sealed + IsA<WebRTCICE> + 'static {
|
|
||||||
#[doc(alias = "gst_webrtc_ice_add_candidate")]
|
#[doc(alias = "gst_webrtc_ice_add_candidate")]
|
||||||
fn add_candidate(&self, stream: &impl IsA<WebRTCICEStream>, candidate: &str) {
|
fn add_candidate(&self, stream: &impl IsA<WebRTCICEStream>, candidate: &str) {
|
||||||
#[cfg(not(feature = "v1_24"))]
|
#[cfg(not(feature = "v1_24"))]
|
||||||
|
|
|
@ -42,12 +42,7 @@ impl Bin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait GstBinExtManual: IsA<Bin> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Bin>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GstBinExtManual: sealed::Sealed + IsA<Bin> + 'static {
|
|
||||||
#[doc(alias = "gst_bin_add_many")]
|
#[doc(alias = "gst_bin_add_many")]
|
||||||
fn add_many(
|
fn add_many(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -345,12 +345,7 @@ impl FromGlibPtrNone<*mut ffi::GstBufferPoolAcquireParams> for BufferPoolAcquire
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait BufferPoolExtManual: IsA<BufferPool> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::BufferPool>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait BufferPoolExtManual: sealed::Sealed + IsA<BufferPool> + 'static {
|
|
||||||
#[doc(alias = "get_config")]
|
#[doc(alias = "get_config")]
|
||||||
#[doc(alias = "gst_buffer_pool_get_config")]
|
#[doc(alias = "gst_buffer_pool_get_config")]
|
||||||
fn config(&self) -> BufferPoolConfig {
|
fn config(&self) -> BufferPoolConfig {
|
||||||
|
|
|
@ -17,19 +17,20 @@ cfg_if::cfg_if! {
|
||||||
}
|
}
|
||||||
|
|
||||||
use super::Bus;
|
use super::Bus;
|
||||||
|
use glib::prelude::*;
|
||||||
|
|
||||||
pub trait UnixBusExtManual: 'static {
|
pub trait UnixBusExtManual: IsA<Bus> + 'static {
|
||||||
#[doc(alias = "get_pollfd")]
|
#[doc(alias = "get_pollfd")]
|
||||||
#[doc(alias = "gst_bus_get_pollfd")]
|
#[doc(alias = "gst_bus_get_pollfd")]
|
||||||
fn pollfd(&self) -> unix::io::RawFd;
|
fn pollfd(&self) -> unix::io::RawFd;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UnixBusExtManual for Bus {
|
impl<T: IsA<Bus>> UnixBusExtManual for T {
|
||||||
fn pollfd(&self) -> unix::io::RawFd {
|
fn pollfd(&self) -> unix::io::RawFd {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut pollfd = mem::MaybeUninit::uninit();
|
let mut pollfd = mem::MaybeUninit::uninit();
|
||||||
crate::ffi::gst_bus_get_pollfd(self.to_glib_none().0, pollfd.as_mut_ptr());
|
crate::ffi::gst_bus_get_pollfd(self.as_ref().to_glib_none().0, pollfd.as_mut_ptr());
|
||||||
let pollfd = pollfd.assume_init();
|
let pollfd = pollfd.assume_init();
|
||||||
pollfd.fd
|
pollfd.fd
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,20 +16,21 @@ cfg_if::cfg_if! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use glib::prelude::*;
|
||||||
use super::Bus;
|
use super::Bus;
|
||||||
|
|
||||||
pub trait WindowsBusExtManual: 'static {
|
pub trait WindowsBusExtManual: IsA<Bus> + 'static {
|
||||||
#[doc(alias = "get_pollfd")]
|
#[doc(alias = "get_pollfd")]
|
||||||
#[doc(alias = "gst_bus_get_pollfd")]
|
#[doc(alias = "gst_bus_get_pollfd")]
|
||||||
fn pollfd(&self) -> windows::io::RawHandle;
|
fn pollfd(&self) -> windows::io::RawHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WindowsBusExtManual for Bus {
|
impl<T: IsA<Bus>> WindowsBusExtManual for T {
|
||||||
fn pollfd(&self) -> windows::io::RawHandle {
|
fn pollfd(&self) -> windows::io::RawHandle {
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut pollfd = mem::MaybeUninit::uninit();
|
let mut pollfd = mem::MaybeUninit::uninit();
|
||||||
crate::ffi::gst_bus_get_pollfd(self.to_glib_none().0, pollfd.as_mut_ptr());
|
crate::ffi::gst_bus_get_pollfd(self.as_ref().to_glib_none().0, pollfd.as_mut_ptr());
|
||||||
let pollfd = pollfd.assume_init();
|
let pollfd = pollfd.assume_init();
|
||||||
pollfd.fd as *mut _
|
pollfd.fd as *mut _
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::ChildProxy;
|
use crate::ChildProxy;
|
||||||
|
|
||||||
mod sealed {
|
pub trait ChildProxyExtManual: IsA<ChildProxy> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::ChildProxy>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait ChildProxyExtManual: sealed::Sealed + IsA<ChildProxy> + 'static {
|
|
||||||
#[doc(alias = "gst_child_proxy_lookup")]
|
#[doc(alias = "gst_child_proxy_lookup")]
|
||||||
fn lookup(&self, name: &str) -> Result<(glib::Object, glib::ParamSpec), glib::BoolError> {
|
fn lookup(&self, name: &str) -> Result<(glib::Object, glib::ParamSpec), glib::BoolError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -420,12 +420,7 @@ impl Clock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait ClockExtManual: IsA<Clock> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Clock>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait ClockExtManual: sealed::Sealed + IsA<Clock> + 'static {
|
|
||||||
#[doc(alias = "gst_clock_new_periodic_id")]
|
#[doc(alias = "gst_clock_new_periodic_id")]
|
||||||
fn new_periodic_id(&self, start_time: ClockTime, interval: ClockTime) -> PeriodicClockId {
|
fn new_periodic_id(&self, start_time: ClockTime, interval: ClockTime) -> PeriodicClockId {
|
||||||
assert_ne!(interval, ClockTime::ZERO);
|
assert_ne!(interval, ClockTime::ZERO);
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ClockTime, ControlBinding};
|
use crate::{ClockTime, ControlBinding};
|
||||||
|
|
||||||
mod sealed {
|
pub trait ControlBindingExtManual: IsA<ControlBinding> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::ControlBinding>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait ControlBindingExtManual: sealed::Sealed + IsA<ControlBinding> + 'static {
|
|
||||||
#[doc(alias = "get_g_value_array")]
|
#[doc(alias = "get_g_value_array")]
|
||||||
#[doc(alias = "gst_control_binding_get_g_value_array")]
|
#[doc(alias = "gst_control_binding_get_g_value_array")]
|
||||||
fn g_value_array(
|
fn g_value_array(
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ClockTime, ControlSource};
|
use crate::{ClockTime, ControlSource};
|
||||||
|
|
||||||
mod sealed {
|
pub trait ControlSourceExtManual: IsA<ControlSource> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::ControlSource>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait ControlSourceExtManual: sealed::Sealed + IsA<ControlSource> + 'static {
|
|
||||||
#[doc(alias = "get_value_array")]
|
#[doc(alias = "get_value_array")]
|
||||||
#[doc(alias = "gst_control_source_get_value_array")]
|
#[doc(alias = "gst_control_source_get_value_array")]
|
||||||
fn value_array(
|
fn value_array(
|
||||||
|
|
|
@ -26,12 +26,8 @@ impl FromGlib<libc::c_uint> for DeviceMonitorFilterId {
|
||||||
DeviceMonitorFilterId(NonZeroU32::new_unchecked(val))
|
DeviceMonitorFilterId(NonZeroU32::new_unchecked(val))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mod sealed {
|
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::DeviceMonitor>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait DeviceMonitorExtManual: sealed::Sealed + IsA<DeviceMonitor> + 'static {
|
pub trait DeviceMonitorExtManual: IsA<DeviceMonitor> + 'static {
|
||||||
#[doc(alias = "gst_device_monitor_add_filter")]
|
#[doc(alias = "gst_device_monitor_add_filter")]
|
||||||
fn add_filter(
|
fn add_filter(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -29,12 +29,7 @@ impl DeviceProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait DeviceProviderExtManual: IsA<DeviceProvider> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::DeviceProvider>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait DeviceProviderExtManual: sealed::Sealed + IsA<DeviceProvider> + 'static {
|
|
||||||
#[doc(alias = "get_metadata")]
|
#[doc(alias = "get_metadata")]
|
||||||
#[doc(alias = "gst_device_provider_class_get_metadata")]
|
#[doc(alias = "gst_device_provider_class_get_metadata")]
|
||||||
fn metadata<'a>(&self, key: &str) -> Option<&'a str> {
|
fn metadata<'a>(&self, key: &str) -> Option<&'a str> {
|
||||||
|
|
|
@ -102,12 +102,7 @@ impl FromGlib<libc::c_ulong> for NotifyWatchId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait ElementExtManual: IsA<Element> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Element>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait ElementExtManual: sealed::Sealed + IsA<Element> + 'static {
|
|
||||||
#[doc(alias = "get_element_class")]
|
#[doc(alias = "get_element_class")]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn element_class(&self) -> &glib::Class<Element> {
|
fn element_class(&self) -> &glib::Class<Element> {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::prelude::*;
|
||||||
|
|
||||||
use crate::value::GstValueExt;
|
use crate::value::GstValueExt;
|
||||||
|
|
||||||
mod sealed {
|
pub trait GObjectExtManualGst: IsA<glib::Object> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<glib::Object>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GObjectExtManualGst: sealed::Sealed + IsA<glib::Object> + 'static {
|
|
||||||
#[doc(alias = "gst_util_set_object_arg")]
|
#[doc(alias = "gst_util_set_object_arg")]
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
fn set_property_from_str(&self, name: &str, value: &str) {
|
fn set_property_from_str(&self, name: &str, value: &str) {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, signal::SignalHandlerId, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, ClockTime, Object, ObjectFlags};
|
use crate::{ffi, ClockTime, Object, ObjectFlags};
|
||||||
|
|
||||||
mod sealed {
|
pub trait GstObjectExtManual: IsA<Object> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Object>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GstObjectExtManual: sealed::Sealed + IsA<Object> + 'static {
|
|
||||||
#[doc(alias = "deep-notify")]
|
#[doc(alias = "deep-notify")]
|
||||||
fn connect_deep_notify<
|
fn connect_deep_notify<
|
||||||
F: Fn(&Self, &crate::Object, &glib::ParamSpec) + Send + Sync + 'static,
|
F: Fn(&Self, &crate::Object, &glib::ParamSpec) + Send + Sync + 'static,
|
||||||
|
|
|
@ -195,12 +195,7 @@ pub enum EventForeachAction {
|
||||||
Replace(Event),
|
Replace(Event),
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait PadExtManual: IsA<Pad> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Pad>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait PadExtManual: sealed::Sealed + IsA<Pad> + 'static {
|
|
||||||
#[doc(alias = "gst_pad_add_probe")]
|
#[doc(alias = "gst_pad_add_probe")]
|
||||||
fn add_probe<F>(&self, mask: PadProbeType, func: F) -> Option<PadProbeId>
|
fn add_probe<F>(&self, mask: PadProbeType, func: F) -> Option<PadProbeId>
|
||||||
where
|
where
|
||||||
|
|
|
@ -40,12 +40,7 @@ impl Pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod sealed {
|
pub trait GstPipelineExtManual: IsA<Pipeline> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::Pipeline>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait GstPipelineExtManual: sealed::Sealed + IsA<Pipeline> + 'static {
|
|
||||||
fn set_pipeline_flags(&self, flags: PipelineFlags) {
|
fn set_pipeline_flags(&self, flags: PipelineFlags) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr: *mut ffi::GstObject = self.as_ptr() as *mut _;
|
let ptr: *mut ffi::GstObject = self.as_ptr() as *mut _;
|
||||||
|
|
|
@ -7,12 +7,7 @@ use glib::{
|
||||||
|
|
||||||
use crate::{ffi, PluginFeature, Rank};
|
use crate::{ffi, PluginFeature, Rank};
|
||||||
|
|
||||||
mod sealed {
|
pub trait PluginFeatureExtManual: IsA<PluginFeature> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::PluginFeature>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait PluginFeatureExtManual: sealed::Sealed + IsA<PluginFeature> + Sized + 'static {
|
|
||||||
#[doc(alias = "get_rank")]
|
#[doc(alias = "get_rank")]
|
||||||
#[doc(alias = "gst_plugin_feature_get_rank")]
|
#[doc(alias = "gst_plugin_feature_get_rank")]
|
||||||
fn rank(&self) -> Rank {
|
fn rank(&self) -> Rank {
|
||||||
|
|
|
@ -4,12 +4,7 @@ use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::{ffi, tags::*, TagMergeMode, TagSetter};
|
use crate::{ffi, tags::*, TagMergeMode, TagSetter};
|
||||||
|
|
||||||
mod sealed {
|
pub trait TagSetterExtManual: IsA<TagSetter> + 'static {
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::TagSetter>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait TagSetterExtManual: sealed::Sealed + IsA<TagSetter> + 'static {
|
|
||||||
#[doc(alias = "gst_tag_setter_add_tag_value")]
|
#[doc(alias = "gst_tag_setter_add_tag_value")]
|
||||||
fn add_tag<'a, T: Tag<'a>>(&self, value: &T::TagType, mode: TagMergeMode) {
|
fn add_tag<'a, T: Tag<'a>>(&self, value: &T::TagType, mode: TagMergeMode) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -10,12 +10,8 @@ unsafe extern "C" fn task_pool_trampoline<P: FnOnce() + Send + 'static>(data: gp
|
||||||
let func = Box::from_raw(data as *mut P);
|
let func = Box::from_raw(data as *mut P);
|
||||||
func()
|
func()
|
||||||
}
|
}
|
||||||
mod sealed {
|
|
||||||
pub trait Sealed {}
|
|
||||||
impl<T: super::IsA<super::TaskPool>> Sealed for T {}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait TaskPoolExtManual: sealed::Sealed + IsA<TaskPool> + 'static {
|
pub trait TaskPoolExtManual: IsA<TaskPool> + 'static {
|
||||||
#[doc(alias = "gst_task_pool_push")]
|
#[doc(alias = "gst_task_pool_push")]
|
||||||
fn push<P: FnOnce() + Send + 'static>(
|
fn push<P: FnOnce() + Send + 'static>(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Reference in a new issue