Remove unnecessary sealing of ImplExt traits and enforce type hierarchy more strictly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1563>
This commit is contained in:
Sebastian Dröge 2024-10-19 22:18:53 +03:00 committed by GStreamer Marge Bot
parent abbc85c3d0
commit 445a4122d5
67 changed files with 183 additions and 381 deletions

View file

@ -27,7 +27,7 @@ pub trait IirFilterExt: IsA<IirFilter> {
impl<O: IsA<IirFilter>> IirFilterExt for O {}
/// Trait to implement in `IirFilter` subclasses.
pub trait IirFilterImpl: AudioFilterImpl {
pub trait IirFilterImpl: AudioFilterImpl + ObjectSubclass<Type: IsA<IirFilter>> {
/// Called whenever the sample rate is changing.
fn set_rate(&self, rate: u32) {
self.parent_set_rate(rate);

View file

@ -1,6 +1,9 @@
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use crate::{subclass::fd_allocator::FdAllocatorImpl, DmaBufAllocator};
pub trait DmaBufAllocatorImpl: FdAllocatorImpl {}
pub trait DmaBufAllocatorImpl:
FdAllocatorImpl + ObjectSubclass<Type: IsA<DmaBufAllocator>>
{
}
unsafe impl<T: DmaBufAllocatorImpl> IsSubclassable<T> for DmaBufAllocator {}

View file

@ -1,7 +1,7 @@
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use crate::FdAllocator;
use gst::subclass::prelude::AllocatorImpl;
pub trait FdAllocatorImpl: AllocatorImpl {}
pub trait FdAllocatorImpl: AllocatorImpl + ObjectSubclass<Type: IsA<FdAllocator>> {}
unsafe impl<T: FdAllocatorImpl> IsSubclassable<T> for FdAllocator {}

View file

@ -7,7 +7,7 @@ use gst_base::{prelude::*, subclass::prelude::*};
use crate::{ffi, AudioAggregator, AudioAggregatorPad};
pub trait AudioAggregatorImpl: AudioAggregatorImplExt + AggregatorImpl {
pub trait AudioAggregatorImpl: AggregatorImpl + ObjectSubclass<Type: IsA<AudioAggregator>> {
fn create_output_buffer(&self, num_frames: u32) -> Option<gst::Buffer> {
self.parent_create_output_buffer(num_frames)
}
@ -26,12 +26,7 @@ pub trait AudioAggregatorImpl: AudioAggregatorImplExt + AggregatorImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioAggregatorImplExt> Sealed for T {}
}
pub trait AudioAggregatorImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioAggregatorImplExt: AudioAggregatorImpl {
fn parent_create_output_buffer(&self, num_frames: u32) -> Option<gst::Buffer> {
unsafe {
let data = Self::type_data();

View file

@ -1,10 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use gst_base::subclass::prelude::*;
use gst_base::{prelude::*, subclass::prelude::*};
use super::prelude::AudioAggregatorPadImpl;
use crate::AudioAggregatorConvertPad;
pub trait AudioAggregatorConvertPadImpl: AudioAggregatorPadImpl {}
pub trait AudioAggregatorConvertPadImpl:
AudioAggregatorPadImpl + ObjectSubclass<Type: IsA<AudioAggregatorConvertPad>>
{
}
unsafe impl<T: AudioAggregatorConvertPadImpl> IsSubclassable<T> for AudioAggregatorConvertPad {}

View file

@ -7,7 +7,9 @@ use gst_base::{prelude::*, subclass::prelude::*};
use crate::{ffi, AudioAggregatorPad};
pub trait AudioAggregatorPadImpl: AudioAggregatorPadImplExt + AggregatorPadImpl {
pub trait AudioAggregatorPadImpl:
AggregatorPadImpl + ObjectSubclass<Type: IsA<AudioAggregatorPad>>
{
const HANDLE_CONVERSION: bool = false;
fn update_conversion_info(&self) {
@ -24,12 +26,7 @@ pub trait AudioAggregatorPadImpl: AudioAggregatorPadImplExt + AggregatorPadImpl
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioAggregatorPadImplExt> Sealed for T {}
}
pub trait AudioAggregatorPadImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioAggregatorPadImplExt: AudioAggregatorPadImpl {
fn parent_update_conversion_info(&self) {
unsafe {
let data = Self::type_data();

View file

@ -1,9 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use gst_base::subclass::prelude::*;
use gst_base::{prelude::*, subclass::prelude::*};
use crate::AudioBaseSink;
pub trait AudioBaseSinkImpl: BaseSinkImpl {}
pub trait AudioBaseSinkImpl: BaseSinkImpl + ObjectSubclass<Type: IsA<AudioBaseSink>> {}
unsafe impl<T: AudioBaseSinkImpl> IsSubclassable<T> for AudioBaseSink {}

View file

@ -1,9 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use gst_base::subclass::prelude::*;
use gst_base::{prelude::*, subclass::prelude::*};
use crate::AudioBaseSrc;
pub trait AudioBaseSrcImpl: BaseSrcImpl {}
pub trait AudioBaseSrcImpl: BaseSrcImpl + ObjectSubclass<Type: IsA<AudioBaseSrc>> {}
unsafe impl<T: AudioBaseSrcImpl> IsSubclassable<T> for AudioBaseSrc {}

View file

@ -7,7 +7,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, prelude::*, AudioDecoder};
pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl {
pub trait AudioDecoderImpl: ElementImpl + ObjectSubclass<Type: IsA<AudioDecoder>> {
fn open(&self) -> Result<(), gst::ErrorMessage> {
self.parent_open()
}
@ -86,12 +86,7 @@ pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioDecoderImplExt> Sealed for T {}
}
pub trait AudioDecoderImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioDecoderImplExt: AudioDecoderImpl {
fn parent_open(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, prelude::*, AudioEncoder, AudioInfo};
pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl {
pub trait AudioEncoderImpl: ElementImpl + ObjectSubclass<Type: IsA<AudioEncoder>> {
fn open(&self) -> Result<(), gst::ErrorMessage> {
self.parent_open()
}
@ -82,12 +82,7 @@ pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioEncoderImplExt> Sealed for T {}
}
pub trait AudioEncoderImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioEncoderImplExt: AudioEncoderImpl {
fn parent_open(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -5,7 +5,7 @@ use gst_base::{prelude::*, subclass::prelude::*};
use crate::{ffi, AudioFilter, AudioInfo};
pub trait AudioFilterImpl: AudioFilterImplExt + BaseTransformImpl {
pub trait AudioFilterImpl: BaseTransformImpl + ObjectSubclass<Type: IsA<AudioFilter>> {
fn allowed_caps() -> &'static gst::Caps {
Self::parent_allowed_caps()
}
@ -15,12 +15,7 @@ pub trait AudioFilterImpl: AudioFilterImplExt + BaseTransformImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioFilterImplExt> Sealed for T {}
}
pub trait AudioFilterImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioFilterImplExt: AudioFilterImpl {
fn parent_setup(&self, info: &AudioInfo) -> Result<(), gst::LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use gst_base::subclass::prelude::*;
use super::prelude::*;
use crate::{ffi, AudioRingBufferSpec, AudioSink};
pub trait AudioSinkImpl: AudioSinkImplExt + AudioBaseSinkImpl {
pub trait AudioSinkImpl: AudioBaseSinkImpl + ObjectSubclass<Type: IsA<AudioSink>> {
fn close(&self) -> Result<(), LoggableError> {
self.parent_close()
}
@ -37,12 +37,7 @@ pub trait AudioSinkImpl: AudioSinkImplExt + AudioBaseSinkImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioSinkImplExt> Sealed for T {}
}
pub trait AudioSinkImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioSinkImplExt: AudioSinkImpl {
fn parent_close(&self) -> Result<(), LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -9,7 +9,7 @@ use gst_base::subclass::prelude::*;
use super::prelude::*;
use crate::{ffi, AudioRingBufferSpec, AudioSrc};
pub trait AudioSrcImpl: AudioSrcImplExt + AudioBaseSrcImpl {
pub trait AudioSrcImpl: AudioBaseSrcImpl + ObjectSubclass<Type: IsA<AudioSrc>> {
fn close(&self) -> Result<(), LoggableError> {
self.parent_close()
}
@ -39,12 +39,7 @@ pub trait AudioSrcImpl: AudioSrcImplExt + AudioBaseSrcImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioSrcImplExt> Sealed for T {}
}
pub trait AudioSrcImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioSrcImplExt: AudioSrcImpl {
fn parent_close(&self) -> Result<(), LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, Aggregator, AggregatorPad};
pub trait AggregatorImpl: AggregatorImplExt + ElementImpl {
pub trait AggregatorImpl: ElementImpl + ObjectSubclass<Type: IsA<Aggregator>> {
fn flush(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_flush()
}
@ -135,12 +135,7 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AggregatorImplExt> Sealed for T {}
}
pub trait AggregatorImplExt: sealed::Sealed + ObjectSubclass {
pub trait AggregatorImplExt: AggregatorImpl {
fn parent_flush(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = Self::type_data();

View file

@ -5,7 +5,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, Aggregator, AggregatorPad};
pub trait AggregatorPadImpl: AggregatorPadImplExt + PadImpl {
pub trait AggregatorPadImpl: PadImpl + ObjectSubclass<Type: IsA<AggregatorPad>> {
fn flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_flush(aggregator)
}
@ -15,12 +15,7 @@ pub trait AggregatorPadImpl: AggregatorPadImplExt + PadImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AggregatorPadImplExt> Sealed for T {}
}
pub trait AggregatorPadImplExt: sealed::Sealed + ObjectSubclass {
pub trait AggregatorPadImplExt: AggregatorPadImpl {
fn parent_flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, prelude::*, BaseParse, BaseParseFrame};
pub trait BaseParseImpl: BaseParseImplExt + ElementImpl {
pub trait BaseParseImpl: ElementImpl + ObjectSubclass<Type: IsA<BaseParse>> {
fn start(&self) -> Result<(), gst::ErrorMessage> {
self.parent_start()
}
@ -36,12 +36,7 @@ pub trait BaseParseImpl: BaseParseImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::BaseParseImplExt> Sealed for T {}
}
pub trait BaseParseImplExt: sealed::Sealed + ObjectSubclass {
pub trait BaseParseImplExt: BaseParseImpl {
fn parent_start(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, BaseSink};
pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl {
pub trait BaseSinkImpl: ElementImpl + ObjectSubclass<Type: IsA<BaseSink>> {
fn start(&self) -> Result<(), gst::ErrorMessage> {
self.parent_start()
}
@ -68,12 +68,7 @@ pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::BaseSinkImplExt> Sealed for T {}
}
pub trait BaseSinkImplExt: sealed::Sealed + ObjectSubclass {
pub trait BaseSinkImplExt: BaseSinkImpl {
fn parent_start(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -20,7 +20,7 @@ pub enum CreateSuccess {
NewBufferList(gst::BufferList),
}
pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl {
pub trait BaseSrcImpl: ElementImpl + ObjectSubclass<Type: IsA<BaseSrc>> {
fn start(&self) -> Result<(), gst::ErrorMessage> {
self.parent_start()
}
@ -108,12 +108,7 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::BaseSrcImplExt> Sealed for T {}
}
pub trait BaseSrcImplExt: sealed::Sealed + ObjectSubclass {
pub trait BaseSrcImplExt: BaseSrcImpl {
fn parent_start(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -14,7 +14,7 @@ pub enum BaseTransformMode {
Both,
}
pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl {
pub trait BaseTransformImpl: ElementImpl + ObjectSubclass<Type: IsA<BaseTransform>> {
const MODE: BaseTransformMode;
const PASSTHROUGH_ON_SAME_CAPS: bool;
const TRANSFORM_IP_ON_PASSTHROUGH: bool;
@ -154,12 +154,7 @@ pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::BaseTransformImplExt> Sealed for T {}
}
pub trait BaseTransformImplExt: sealed::Sealed + ObjectSubclass {
pub trait BaseTransformImplExt: BaseTransformImpl {
fn parent_start(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -3,12 +3,12 @@
use std::ptr;
use glib::{prelude::*, subclass::prelude::*, translate::*};
use gst::prelude::*;
use gst::{prelude::*, subclass::prelude::*};
use super::base_src::{BaseSrcImpl, CreateSuccess};
use crate::{ffi, prelude::*, PushSrc};
pub trait PushSrcImpl: PushSrcImplExt + BaseSrcImpl {
pub trait PushSrcImpl: BaseSrcImpl + ObjectSubclass<Type: IsA<PushSrc>> {
fn fill(&self, buffer: &mut gst::BufferRef) -> Result<gst::FlowSuccess, gst::FlowError> {
PushSrcImplExt::parent_fill(self, buffer)
}
@ -22,12 +22,7 @@ pub trait PushSrcImpl: PushSrcImplExt + BaseSrcImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::PushSrcImplExt> Sealed for T {}
}
pub trait PushSrcImplExt: sealed::Sealed + ObjectSubclass {
pub trait PushSrcImplExt: PushSrcImpl {
fn parent_fill(&self, buffer: &mut gst::BufferRef) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = Self::type_data();

View file

@ -3,7 +3,7 @@
use crate::{ffi, prelude::*, Formatter};
use glib::{subclass::prelude::*, translate::*};
pub trait FormatterImpl: FormatterImplExt + ObjectImpl + Send + Sync {
pub trait FormatterImpl: ObjectImpl + ObjectSubclass<Type: IsA<Formatter>> + Send + Sync {
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
self.parent_can_load_uri(uri)
}
@ -22,12 +22,7 @@ pub trait FormatterImpl: FormatterImplExt + ObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::FormatterImplExt> Sealed for T {}
}
pub trait FormatterImplExt: sealed::Sealed + ObjectSubclass {
pub trait FormatterImplExt: FormatterImpl {
fn parent_can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
unsafe {
let data = Self::type_data();

View file

@ -5,7 +5,7 @@ use gst_base::subclass::prelude::*;
use crate::{ffi, prelude::*, GLBaseFilter};
pub trait GLBaseFilterImpl: GLBaseFilterImplExt + BaseTransformImpl {
pub trait GLBaseFilterImpl: BaseTransformImpl + ObjectSubclass<Type: IsA<GLBaseFilter>> {
fn gl_set_caps(&self, incaps: &Caps, outcaps: &Caps) -> Result<(), LoggableError> {
self.parent_gl_set_caps(incaps, outcaps)
}
@ -19,12 +19,7 @@ pub trait GLBaseFilterImpl: GLBaseFilterImplExt + BaseTransformImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::GLBaseFilterImplExt> Sealed for T {}
}
pub trait GLBaseFilterImplExt: sealed::Sealed + ObjectSubclass {
pub trait GLBaseFilterImplExt: GLBaseFilterImpl {
fn parent_gl_set_caps(&self, incaps: &Caps, outcaps: &Caps) -> Result<(), LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -5,7 +5,7 @@ use gst_base::subclass::prelude::*;
use crate::{ffi, prelude::*, GLBaseSrc, GLMemory, GLAPI};
pub trait GLBaseSrcImpl: GLBaseSrcImplExt + PushSrcImpl {
pub trait GLBaseSrcImpl: PushSrcImpl + ObjectSubclass<Type: IsA<GLBaseSrc>> {
const SUPPORTED_GL_API: GLAPI;
fn gl_start(&self) -> Result<(), LoggableError> {
@ -21,12 +21,7 @@ pub trait GLBaseSrcImpl: GLBaseSrcImplExt + PushSrcImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::GLBaseSrcImplExt> Sealed for T {}
}
pub trait GLBaseSrcImplExt: sealed::Sealed + ObjectSubclass {
pub trait GLBaseSrcImplExt: GLBaseSrcImpl {
fn parent_gl_start(&self) -> Result<(), LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -13,7 +13,7 @@ pub enum GLFilterMode {
Texture,
}
pub trait GLFilterImpl: GLFilterImplExt + GLBaseFilterImpl {
pub trait GLFilterImpl: GLBaseFilterImpl + ObjectSubclass<Type: IsA<GLFilter>> {
const MODE: GLFilterMode;
// rustdoc-stripper-ignore-next
/// Calls [`add_rgba_pad_templates`](ffi::gst_gl_filter_add_rgba_pad_templates)
@ -46,12 +46,7 @@ pub trait GLFilterImpl: GLFilterImplExt + GLBaseFilterImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::GLFilterImplExt> Sealed for T {}
}
pub trait GLFilterImplExt: sealed::Sealed + ObjectSubclass {
pub trait GLFilterImplExt: GLFilterImpl {
fn parent_set_caps(&self, incaps: &Caps, outcaps: &Caps) -> Result<(), LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use crate::{ffi, AudioVisualizer};
pub struct AudioVisualizerSetupToken<'a>(pub(crate) &'a AudioVisualizer);
pub trait AudioVisualizerImpl: AudioVisualizerImplExt + ElementImpl {
pub trait AudioVisualizerImpl: ElementImpl + ObjectSubclass<Type: IsA<AudioVisualizer>> {
fn setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> {
self.parent_setup(token)
}
@ -28,12 +28,7 @@ pub trait AudioVisualizerImpl: AudioVisualizerImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AudioVisualizerImplExt> Sealed for T {}
}
pub trait AudioVisualizerImplExt: sealed::Sealed + ObjectSubclass {
pub trait AudioVisualizerImplExt: AudioVisualizerImpl {
fn parent_setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> {
assert_eq!(
self.obj().as_ptr() as *mut ffi::GstAudioVisualizer,

View file

@ -4,7 +4,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, Play, PlayVideoRenderer};
pub trait PlayVideoRendererImpl: ObjectImpl {
pub trait PlayVideoRendererImpl: ObjectImpl + ObjectSubclass<Type: IsA<PlayVideoRenderer>> {
fn create_video_sink(&self, play: &Play) -> gst::Element;
}
@ -16,12 +16,7 @@ unsafe impl<T: PlayVideoRendererImpl> IsImplementable<T> for PlayVideoRenderer {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::PlayVideoRendererImplExt> Sealed for T {}
}
pub trait PlayVideoRendererImplExt: sealed::Sealed + ObjectSubclass {
pub trait PlayVideoRendererImplExt: PlayVideoRendererImpl {
fn parent_create_video_sink(&self, play: &Play) -> gst::Element {
unsafe {
let type_data = Self::type_data();

View file

@ -4,7 +4,9 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, Player, PlayerVideoRenderer};
pub trait PlayerVideoRendererImpl: ObjectImpl {
pub trait PlayerVideoRendererImpl:
ObjectImpl + ObjectSubclass<Type: IsA<PlayerVideoRenderer>>
{
fn create_video_sink(&self, player: &Player) -> gst::Element;
}
@ -16,12 +18,7 @@ unsafe impl<T: PlayerVideoRendererImpl> IsImplementable<T> for PlayerVideoRender
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::PlayerVideoRendererImplExt> Sealed for T {}
}
pub trait PlayerVideoRendererImplExt: sealed::Sealed + ObjectSubclass {
pub trait PlayerVideoRendererImplExt: PlayerVideoRendererImpl {
fn parent_create_video_sink(&self, player: &Player) -> gst::Element {
unsafe {
let type_data = Self::type_data();

View file

@ -7,7 +7,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, prelude::*, RTPBaseDepayload};
pub trait RTPBaseDepayloadImpl: RTPBaseDepayloadImplExt + ElementImpl {
pub trait RTPBaseDepayloadImpl: ElementImpl + ObjectSubclass<Type: IsA<RTPBaseDepayload>> {
fn set_caps(&self, caps: &gst::Caps) -> Result<(), gst::LoggableError> {
self.parent_set_caps(caps)
}
@ -28,12 +28,7 @@ pub trait RTPBaseDepayloadImpl: RTPBaseDepayloadImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTPBaseDepayloadImplExt> Sealed for T {}
}
pub trait RTPBaseDepayloadImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTPBaseDepayloadImplExt: RTPBaseDepayloadImpl {
fn parent_set_caps(&self, caps: &gst::Caps) -> Result<(), gst::LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -5,7 +5,7 @@ use gst::subclass::prelude::*;
use crate::{ffi, prelude::*, RTPBasePayload};
pub trait RTPBasePayloadImpl: RTPBasePayloadImplExt + ElementImpl {
pub trait RTPBasePayloadImpl: ElementImpl + ObjectSubclass<Type: IsA<RTPBasePayload>> {
fn caps(&self, pad: &gst::Pad, filter: Option<&gst::Caps>) -> gst::Caps {
self.parent_caps(pad, filter)
}
@ -31,12 +31,7 @@ pub trait RTPBasePayloadImpl: RTPBasePayloadImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTPBasePayloadImplExt> Sealed for T {}
}
pub trait RTPBasePayloadImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTPBasePayloadImplExt: RTPBasePayloadImpl {
fn parent_caps(&self, pad: &gst::Pad, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe {
let data = Self::type_data();

View file

@ -4,8 +4,11 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::ffi;
use crate::RTPHeaderExtension;
pub trait RTPHeaderExtensionImpl: RTPHeaderExtensionImplExt + ElementImpl {
pub trait RTPHeaderExtensionImpl:
ElementImpl + ObjectSubclass<Type: IsA<RTPHeaderExtension>>
{
const URI: &'static str;
fn supported_flags(&self) -> crate::RTPHeaderExtensionFlags {
@ -56,12 +59,7 @@ pub trait RTPHeaderExtensionImpl: RTPHeaderExtensionImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTPHeaderExtensionImplExt> Sealed for T {}
}
pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTPHeaderExtensionImplExt: RTPHeaderExtensionImpl {
fn parent_supported_flags(&self) -> crate::RTPHeaderExtensionFlags {
unsafe {
let data = Self::type_data();
@ -71,7 +69,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
.expect("no parent \"get_supported_flags\" implementation");
from_glib(f(self
.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0))
}
@ -86,7 +84,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
.expect("no parent \"get_max_size\" implementation");
f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
input.as_ptr(),
@ -110,7 +108,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
let res = f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
input.as_ptr(),
@ -147,7 +145,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
gst::result_from_gboolean!(
f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
read_flags.into_glib(),
@ -169,7 +167,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
gst::result_from_gboolean!(
f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
caps.as_mut_ptr(),
@ -194,7 +192,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
gst::result_from_gboolean!(
f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
caps.as_mut_ptr(),
@ -220,7 +218,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
gst::result_from_gboolean!(
f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
direction.into_glib(),
@ -249,7 +247,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
gst::result_from_gboolean!(
f(
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.unsafe_cast_ref::<RTPHeaderExtension>()
.to_glib_none()
.0,
caps.as_mut_ptr(),
@ -263,7 +261,7 @@ pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {}
unsafe impl<T: RTPHeaderExtensionImpl> IsSubclassable<T> for crate::RTPHeaderExtension {
unsafe impl<T: RTPHeaderExtensionImpl> IsSubclassable<T> for RTPHeaderExtension {
fn class_init(klass: &mut glib::Class<Self>) {
Self::parent_class_init::<T>(klass);
let klass = klass.as_mut();

View file

@ -4,7 +4,7 @@ use crate::{ffi, RTSPAuth, RTSPContext};
use glib::{prelude::*, subclass::prelude::*, translate::*};
use libc::c_char;
pub trait RTSPAuthImpl: RTSPAuthImplExt + ObjectImpl + Send + Sync {
pub trait RTSPAuthImpl: ObjectImpl + ObjectSubclass<Type: IsA<RTSPAuth>> + Send + Sync {
fn authenticate(&self, ctx: &RTSPContext) -> bool {
self.parent_authenticate(ctx)
}
@ -18,12 +18,7 @@ pub trait RTSPAuthImpl: RTSPAuthImplExt + ObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPAuthImplExt> Sealed for T {}
}
pub trait RTSPAuthImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPAuthImplExt: RTSPAuthImpl {
fn parent_authenticate(&self, ctx: &RTSPContext) -> bool {
unsafe {
let data = Self::type_data();

View file

@ -4,7 +4,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, RTSPClient};
pub trait RTSPClientImpl: RTSPClientImplExt + ObjectImpl + Send + Sync {
pub trait RTSPClientImpl: ObjectImpl + ObjectSubclass<Type: IsA<RTSPClient>> + Send + Sync {
fn create_sdp(&self, media: &crate::RTSPMedia) -> Option<gst_sdp::SDPMessage> {
self.parent_create_sdp(media)
}
@ -155,12 +155,7 @@ pub trait RTSPClientImpl: RTSPClientImplExt + ObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPClientImplExt> Sealed for T {}
}
pub trait RTSPClientImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPClientImplExt: RTSPClientImpl {
fn parent_create_sdp(&self, media: &crate::RTSPMedia) -> Option<gst_sdp::SDPMessage> {
unsafe {
let data = Self::type_data();

View file

@ -22,7 +22,7 @@ impl SDPInfo {
}
}
pub trait RTSPMediaImpl: RTSPMediaImplExt + ObjectImpl + Send + Sync {
pub trait RTSPMediaImpl: ObjectImpl + ObjectSubclass<Type: IsA<RTSPMedia>> + Send + Sync {
fn handle_message(&self, message: &gst::MessageRef) -> bool {
self.parent_handle_message(message)
}
@ -98,12 +98,7 @@ pub trait RTSPMediaImpl: RTSPMediaImplExt + ObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPMediaImplExt> Sealed for T {}
}
pub trait RTSPMediaImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPMediaImplExt: RTSPMediaImpl {
fn parent_handle_message(&self, message: &gst::MessageRef) -> bool {
unsafe {
let data = Self::type_data();

View file

@ -6,7 +6,9 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, RTSPMediaFactory};
pub trait RTSPMediaFactoryImpl: RTSPMediaFactoryImplExt + ObjectImpl + Send + Sync {
pub trait RTSPMediaFactoryImpl:
ObjectImpl + ObjectSubclass<Type: IsA<RTSPMediaFactory>> + Send + Sync
{
fn gen_key(&self, url: &gst_rtsp::RTSPUrl) -> Option<glib::GString> {
self.parent_gen_key(url)
}
@ -36,12 +38,7 @@ pub trait RTSPMediaFactoryImpl: RTSPMediaFactoryImplExt + ObjectImpl + Send + Sy
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPMediaFactoryImplExt> Sealed for T {}
}
pub trait RTSPMediaFactoryImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPMediaFactoryImplExt: RTSPMediaFactoryImpl {
fn parent_gen_key(&self, url: &gst_rtsp::RTSPUrl) -> Option<glib::GString> {
unsafe {
let data = Self::type_data();

View file

@ -5,18 +5,15 @@ use gst_rtsp::ffi::GstRTSPUrl;
use crate::{ffi, RTSPMountPoints};
pub trait RTSPMountPointsImpl: RTSPMountPointsImplExt + ObjectImpl + Send + Sync {
pub trait RTSPMountPointsImpl:
ObjectImpl + ObjectSubclass<Type: IsA<RTSPMountPoints>> + Send + Sync
{
fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Option<glib::GString> {
self.parent_make_path(url)
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPMountPointsImplExt> Sealed for T {}
}
pub trait RTSPMountPointsImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPMountPointsImplExt: RTSPMountPointsImpl {
fn parent_make_path(&self, url: &gst_rtsp::RTSPUrl) -> Option<glib::GString> {
unsafe {
let data = Self::type_data();

View file

@ -1,10 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::RTSPOnvifClient;
pub trait RTSPOnvifClientImpl: RTSPClientImpl + Send + Sync {}
pub trait RTSPOnvifClientImpl:
RTSPClientImpl + ObjectSubclass<Type: IsA<RTSPOnvifClient>> + Send + Sync
{
}
unsafe impl<T: RTSPOnvifClientImpl> IsSubclassable<T> for RTSPOnvifClient {}

View file

@ -1,10 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::RTSPOnvifMedia;
pub trait RTSPOnvifMediaImpl: RTSPMediaImpl + Send + Sync {}
pub trait RTSPOnvifMediaImpl:
RTSPMediaImpl + ObjectSubclass<Type: IsA<RTSPOnvifMedia>> + Send + Sync
{
}
unsafe impl<T: RTSPOnvifMediaImpl> IsSubclassable<T> for RTSPOnvifMedia {}

View file

@ -6,19 +6,14 @@ use super::prelude::*;
use crate::{ffi, RTSPOnvifMediaFactory};
pub trait RTSPOnvifMediaFactoryImpl:
RTSPMediaFactoryImplExt + RTSPMediaFactoryImpl + Send + Sync
RTSPMediaFactoryImpl + ObjectSubclass<Type: IsA<RTSPOnvifMediaFactory>> + Send + Sync
{
fn has_backchannel_support(&self) -> bool {
self.parent_has_backchannel_support()
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPOnvifMediaFactoryImplExt> Sealed for T {}
}
pub trait RTSPOnvifMediaFactoryImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPOnvifMediaFactoryImplExt: RTSPOnvifMediaFactoryImpl {
fn parent_has_backchannel_support(&self) -> bool {
unsafe {
let data = Self::type_data();

View file

@ -1,10 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::RTSPOnvifServer;
pub trait RTSPOnvifServerImpl: RTSPServerImpl + Send + Sync {}
pub trait RTSPOnvifServerImpl:
RTSPServerImpl + ObjectSubclass<Type: IsA<RTSPOnvifServer>> + Send + Sync
{
}
unsafe impl<T: RTSPOnvifServerImpl> IsSubclassable<T> for RTSPOnvifServer {}

View file

@ -4,7 +4,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, RTSPServer};
pub trait RTSPServerImpl: RTSPServerImplExt + ObjectImpl + Send + Sync {
pub trait RTSPServerImpl: ObjectImpl + ObjectSubclass<Type: IsA<RTSPServer>> + Send + Sync {
fn create_client(&self) -> Option<crate::RTSPClient> {
self.parent_create_client()
}
@ -14,12 +14,7 @@ pub trait RTSPServerImpl: RTSPServerImplExt + ObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::RTSPServerImplExt> Sealed for T {}
}
pub trait RTSPServerImplExt: sealed::Sealed + ObjectSubclass {
pub trait RTSPServerImplExt: RTSPServerImpl {
fn parent_create_client(&self) -> Option<crate::RTSPClient>;
fn parent_client_connected(&self, client: &crate::RTSPClient);

View file

@ -4,7 +4,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, Navigation};
pub trait NavigationImpl: ObjectImpl {
pub trait NavigationImpl: ObjectImpl + ObjectSubclass<Type: IsA<Navigation>> {
fn send_event(&self, structure: gst::Structure);
#[cfg(feature = "v1_22")]
@ -16,12 +16,7 @@ pub trait NavigationImpl: ObjectImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::NavigationImplExt> Sealed for T {}
}
pub trait NavigationImplExt: sealed::Sealed + ObjectSubclass {
pub trait NavigationImplExt: NavigationImpl {
fn parent_send_event(&self, structure: gst::Structure) {
unsafe {
let type_data = Self::type_data();

View file

@ -9,7 +9,7 @@ use crate::{ffi, VideoAggregator};
pub struct AggregateFramesToken<'a>(pub(crate) &'a VideoAggregator);
pub trait VideoAggregatorImpl: VideoAggregatorImplExt + AggregatorImpl {
pub trait VideoAggregatorImpl: AggregatorImpl + ObjectSubclass<Type: IsA<VideoAggregator>> {
fn update_caps(&self, caps: &gst::Caps) -> Result<gst::Caps, gst::LoggableError> {
self.parent_update_caps(caps)
}
@ -30,12 +30,8 @@ pub trait VideoAggregatorImpl: VideoAggregatorImplExt + AggregatorImpl {
self.parent_find_best_format(downstream_caps)
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::VideoAggregatorImplExt> Sealed for T {}
}
pub trait VideoAggregatorImplExt: sealed::Sealed + ObjectSubclass {
pub trait VideoAggregatorImplExt: VideoAggregatorImpl {
fn parent_update_caps(&self, caps: &gst::Caps) -> Result<gst::Caps, gst::LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -1,10 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use gst_base::subclass::prelude::*;
use gst_base::{prelude::*, subclass::prelude::*};
use super::prelude::VideoAggregatorPadImpl;
use crate::VideoAggregatorConvertPad;
pub trait VideoAggregatorConvertPadImpl: VideoAggregatorPadImpl {}
pub trait VideoAggregatorConvertPadImpl:
VideoAggregatorPadImpl + ObjectSubclass<Type: IsA<VideoAggregatorConvertPad>>
{
}
unsafe impl<T: VideoAggregatorConvertPadImpl> IsSubclassable<T> for VideoAggregatorConvertPad {}

View file

@ -7,7 +7,9 @@ use gst_base::{prelude::*, subclass::prelude::*};
use crate::{ffi, subclass::AggregateFramesToken, VideoAggregator, VideoAggregatorPad};
pub trait VideoAggregatorPadImpl: VideoAggregatorPadImplExt + AggregatorPadImpl {
pub trait VideoAggregatorPadImpl:
AggregatorPadImpl + ObjectSubclass<Type: IsA<VideoAggregatorPad>>
{
fn update_conversion_info(&self) {
self.parent_update_conversion_info()
}
@ -31,12 +33,7 @@ pub trait VideoAggregatorPadImpl: VideoAggregatorPadImplExt + AggregatorPadImpl
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::VideoAggregatorPadImplExt> Sealed for T {}
}
pub trait VideoAggregatorPadImplExt: ObjectSubclass + sealed::Sealed {
pub trait VideoAggregatorPadImplExt: VideoAggregatorPadImpl {
fn parent_update_conversion_info(&self) {
unsafe {
let data = Self::type_data();

View file

@ -10,7 +10,7 @@ use crate::{
VideoCodecFrame, VideoDecoder,
};
pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl {
pub trait VideoDecoderImpl: ElementImpl + ObjectSubclass<Type: IsA<VideoDecoder>> {
fn open(&self) -> Result<(), gst::ErrorMessage> {
self.parent_open()
}
@ -107,11 +107,8 @@ pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl {
self.parent_handle_missing_data(timestamp, duration)
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::VideoDecoderImplExt> Sealed for T {}
}
pub trait VideoDecoderImplExt: sealed::Sealed + ObjectSubclass {
pub trait VideoDecoderImplExt: VideoDecoderImpl {
fn parent_open(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -10,7 +10,7 @@ use crate::{
VideoCodecFrame, VideoEncoder,
};
pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl {
pub trait VideoEncoderImpl: ElementImpl + ObjectSubclass<Type: IsA<VideoEncoder>> {
fn open(&self) -> Result<(), gst::ErrorMessage> {
self.parent_open()
}
@ -85,12 +85,7 @@ pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::VideoEncoderImplExt> Sealed for T {}
}
pub trait VideoEncoderImplExt: sealed::Sealed + ObjectSubclass {
pub trait VideoEncoderImplExt: VideoEncoderImpl {
fn parent_open(&self) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = Self::type_data();

View file

@ -5,7 +5,7 @@ use gst_base::{prelude::*, subclass::prelude::*};
use crate::{ffi, VideoFilter, VideoFrameExt, VideoFrameRef, VideoInfo};
pub trait VideoFilterImpl: VideoFilterImplExt + BaseTransformImpl {
pub trait VideoFilterImpl: BaseTransformImpl + ObjectSubclass<Type: IsA<VideoFilter>> {
fn set_info(
&self,
incaps: &gst::Caps,
@ -39,12 +39,7 @@ pub trait VideoFilterImpl: VideoFilterImplExt + BaseTransformImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::VideoFilterImplExt> Sealed for T {}
}
pub trait VideoFilterImplExt: sealed::Sealed + ObjectSubclass {
pub trait VideoFilterImplExt: VideoFilterImpl {
fn parent_set_info(
&self,
incaps: &gst::Caps,

View file

@ -5,18 +5,13 @@ use gst_base::subclass::prelude::*;
use crate::{ffi, VideoSink};
pub trait VideoSinkImpl: VideoSinkImplExt + BaseSinkImpl + ElementImpl {
pub trait VideoSinkImpl: BaseSinkImpl + ObjectSubclass<Type: IsA<VideoSink>> {
fn show_frame(&self, buffer: &gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_show_frame(buffer)
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::VideoSinkImplExt> Sealed for T {}
}
pub trait VideoSinkImplExt: sealed::Sealed + ObjectSubclass {
pub trait VideoSinkImplExt: VideoSinkImpl {
fn parent_show_frame(&self, buffer: &gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = Self::type_data();

View file

@ -7,7 +7,7 @@ use glib::{bool_error, prelude::*, subclass::prelude::*, translate::*, BoolError
use super::prelude::*;
use crate::{ffi, AllocationParams, Allocator, Memory};
pub trait AllocatorImpl: AllocatorImplExt + GstObjectImpl + Send + Sync {
pub trait AllocatorImpl: GstObjectImpl + ObjectSubclass<Type: IsA<Allocator>> {
fn alloc(&self, size: usize, params: Option<&AllocationParams>) -> Result<Memory, BoolError> {
self.parent_alloc(size, params)
}
@ -17,12 +17,7 @@ pub trait AllocatorImpl: AllocatorImplExt + GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::AllocatorImplExt> Sealed for T {}
}
pub trait AllocatorImplExt: sealed::Sealed + ObjectSubclass {
pub trait AllocatorImplExt: AllocatorImpl {
fn parent_alloc(
&self,
size: usize,

View file

@ -5,7 +5,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::{ffi, Bin, Element, LoggableError, Message};
pub trait BinImpl: BinImplExt + ElementImpl {
pub trait BinImpl: ElementImpl + ObjectSubclass<Type: IsA<Bin>> {
fn add_element(&self, element: &Element) -> Result<(), LoggableError> {
self.parent_add_element(element)
}
@ -23,12 +23,7 @@ pub trait BinImpl: BinImplExt + ElementImpl {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::BinImplExt> Sealed for T {}
}
pub trait BinImplExt: sealed::Sealed + ObjectSubclass {
pub trait BinImplExt: BinImpl {
fn parent_add_element(&self, element: &Element) -> Result<(), LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -12,7 +12,7 @@ use libc::c_char;
use super::prelude::*;
use crate::{ffi, BufferPool, BufferPoolAcquireParams, BufferPoolConfigRef};
pub trait BufferPoolImpl: BufferPoolImplExt + GstObjectImpl + Send + Sync {
pub trait BufferPoolImpl: GstObjectImpl + ObjectSubclass<Type: IsA<BufferPool>> {
fn acquire_buffer(
&self,
params: Option<&BufferPoolAcquireParams>,
@ -64,12 +64,7 @@ pub trait BufferPoolImpl: BufferPoolImplExt + GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::BufferPoolImplExt> Sealed for T {}
}
pub trait BufferPoolImplExt: sealed::Sealed + ObjectSubclass {
pub trait BufferPoolImplExt: BufferPoolImpl {
fn parent_acquire_buffer(
&self,
params: Option<&BufferPoolAcquireParams>,

View file

@ -5,7 +5,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::{ffi, ChildProxy};
pub trait ChildProxyImpl: GstObjectImpl + Send + Sync {
pub trait ChildProxyImpl: GstObjectImpl + ObjectSubclass<Type: IsA<ChildProxy>> {
fn child_by_name(&self, name: &str) -> Option<glib::Object> {
self.parent_child_by_name(name)
}
@ -21,12 +21,7 @@ pub trait ChildProxyImpl: GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::ChildProxyImplExt> Sealed for T {}
}
pub trait ChildProxyImplExt: sealed::Sealed + ObjectSubclass {
pub trait ChildProxyImplExt: ChildProxyImpl {
fn parent_child_by_name(&self, name: &str) -> Option<glib::Object> {
unsafe {
let type_data = Self::type_data();

View file

@ -5,7 +5,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::{ffi, Clock, ClockError, ClockId, ClockReturn, ClockSuccess, ClockTime, ClockTimeDiff};
pub trait ClockImpl: ClockImplExt + GstObjectImpl + Send + Sync {
pub trait ClockImpl: GstObjectImpl + ObjectSubclass<Type: IsA<Clock>> {
fn change_resolution(&self, old_resolution: ClockTime, new_resolution: ClockTime) -> ClockTime {
self.parent_change_resolution(old_resolution, new_resolution)
}
@ -31,12 +31,7 @@ pub trait ClockImpl: ClockImplExt + GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::ClockImplExt> Sealed for T {}
}
pub trait ClockImplExt: sealed::Sealed + ObjectSubclass {
pub trait ClockImplExt: ClockImpl {
fn parent_change_resolution(
&self,
old_resolution: ClockTime,

View file

@ -7,7 +7,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::{ffi, Device, Element, LoggableError};
pub trait DeviceImpl: DeviceImplExt + GstObjectImpl + Send + Sync {
pub trait DeviceImpl: GstObjectImpl + ObjectSubclass<Type: IsA<Device>> {
fn create_element(&self, name: Option<&str>) -> Result<Element, LoggableError> {
self.parent_create_element(name)
}
@ -17,12 +17,7 @@ pub trait DeviceImpl: DeviceImplExt + GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::DeviceImplExt> Sealed for T {}
}
pub trait DeviceImplExt: sealed::Sealed + ObjectSubclass {
pub trait DeviceImplExt: DeviceImpl {
fn parent_create_element(&self, name: Option<&str>) -> Result<Element, LoggableError> {
unsafe {
let data = Self::type_data();

View file

@ -64,7 +64,7 @@ impl DeviceProviderMetadata {
}
}
pub trait DeviceProviderImpl: DeviceProviderImplExt + GstObjectImpl + Send + Sync {
pub trait DeviceProviderImpl: GstObjectImpl + ObjectSubclass<Type: IsA<DeviceProvider>> {
fn metadata() -> Option<&'static DeviceProviderMetadata> {
None
}
@ -82,12 +82,7 @@ pub trait DeviceProviderImpl: DeviceProviderImplExt + GstObjectImpl + Send + Syn
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::DeviceProviderImplExt> Sealed for T {}
}
pub trait DeviceProviderImplExt: sealed::Sealed + ObjectSubclass {
pub trait DeviceProviderImplExt: DeviceProviderImpl {
fn parent_probe(&self) -> Vec<Device> {
unsafe {
let data = Self::type_data();

View file

@ -67,7 +67,7 @@ impl ElementMetadata {
}
}
pub trait ElementImpl: ElementImplExt + GstObjectImpl + Send + Sync {
pub trait ElementImpl: GstObjectImpl + ObjectSubclass<Type: IsA<Element>> {
fn metadata() -> Option<&'static ElementMetadata> {
None
}
@ -121,12 +121,7 @@ pub trait ElementImpl: ElementImplExt + GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::ElementImplExt> Sealed for T {}
}
pub trait ElementImplExt: sealed::Sealed + ObjectSubclass {
pub trait ElementImplExt: ElementImpl {
fn parent_change_state(
&self,
transition: StateChange,

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::GhostPad;
pub trait GhostPadImpl: ProxyPadImpl {}
pub trait GhostPadImpl: ProxyPadImpl + ObjectSubclass<Type: IsA<GhostPad>> {}
unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPad {}

View file

@ -1,7 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
pub trait GstObjectImpl: ObjectImpl {}
pub trait GstObjectImpl:
ObjectImpl + ObjectSubclass<Type: IsA<crate::Object>> + Send + Sync
{
}
unsafe impl<T: GstObjectImpl> IsSubclassable<T> for crate::Object {}

View file

@ -5,7 +5,7 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::{ffi, Pad};
pub trait PadImpl: PadImplExt + GstObjectImpl + Send + Sync {
pub trait PadImpl: GstObjectImpl + ObjectSubclass<Type: IsA<Pad>> {
fn linked(&self, peer: &Pad) {
self.parent_linked(peer)
}
@ -15,12 +15,7 @@ pub trait PadImpl: PadImplExt + GstObjectImpl + Send + Sync {
}
}
mod sealed {
pub trait Sealed {}
impl<T: super::PadImplExt> Sealed for T {}
}
pub trait PadImplExt: sealed::Sealed + ObjectSubclass {
pub trait PadImplExt: PadImpl {
fn parent_linked(&self, peer: &Pad) {
unsafe {
let data = Self::type_data();

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::Pipeline;
pub trait PipelineImpl: BinImpl {}
pub trait PipelineImpl: BinImpl + ObjectSubclass<Type: IsA<Pipeline>> {}
unsafe impl<T: PipelineImpl> IsSubclassable<T> for Pipeline {}

View file

@ -1,9 +1,9 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use crate::Preset;
pub trait PresetImpl: super::element::ElementImpl {}
pub trait PresetImpl: super::element::ElementImpl + ObjectSubclass<Type: IsA<Preset>> {}
unsafe impl<T: PresetImpl> IsImplementable<T> for Preset {}

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::ProxyPad;
pub trait ProxyPadImpl: PadImpl {}
pub trait ProxyPadImpl: PadImpl + ObjectSubclass<Type: IsA<ProxyPad>> {}
unsafe impl<T: ProxyPadImpl> IsSubclassable<T> for ProxyPad {}

View file

@ -1,10 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use super::prelude::*;
use crate::SystemClock;
pub trait SystemClockImpl: ClockImpl {}
pub trait SystemClockImpl: ClockImpl + ObjectSubclass<Type: IsA<SystemClock>> {}
unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClock {}

View file

@ -1,9 +1,12 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::subclass::prelude::*;
use glib::{prelude::*, subclass::prelude::*};
use crate::TagSetter;
pub trait TagSetterImpl: super::element::ElementImpl {}
pub trait TagSetterImpl:
super::element::ElementImpl + ObjectSubclass<Type: IsA<TagSetter>>
{
}
unsafe impl<T: TagSetterImpl> IsImplementable<T> for TagSetter {}

View file

@ -6,12 +6,12 @@ use std::{
sync::{Arc, Mutex},
};
use glib::{ffi::gpointer, subclass::prelude::*, translate::*};
use glib::{ffi::gpointer, prelude::*, subclass::prelude::*, translate::*};
use super::prelude::*;
use crate::{ffi, TaskHandle, TaskPool};
pub trait TaskPoolImpl: GstObjectImpl + Send + Sync {
pub trait TaskPoolImpl: GstObjectImpl + ObjectSubclass<Type: IsA<TaskPool>> {
// rustdoc-stripper-ignore-next
/// Handle to be returned from the `push` function to allow the caller to wait for the task's
/// completion.

View file

@ -10,7 +10,7 @@ use crate::{
};
#[allow(unused_variables)]
pub trait TracerImpl: TracerImplExt + GstObjectImpl + Send + Sync {
pub trait TracerImpl: GstObjectImpl + ObjectSubclass<Type: IsA<Tracer>> {
fn bin_add_post(&self, ts: u64, bin: &Bin, element: &Element, success: bool) {}
fn bin_add_pre(&self, ts: u64, bin: &Bin, element: &Element) {}
fn bin_remove_post(&self, ts: u64, bin: &Bin, success: bool) {}
@ -85,7 +85,7 @@ pub trait TracerImpl: TracerImplExt + GstObjectImpl + Send + Sync {
unsafe impl<T: TracerImpl> IsSubclassable<T> for Tracer {}
pub trait TracerImplExt: ObjectSubclass {
pub trait TracerImplExt: TracerImpl {
// rustdoc-stripper-ignore-next
/// Register a corresponding hook to be called for this tracer when certain events occur.
///

View file

@ -6,19 +6,16 @@ use glib::{prelude::*, subclass::prelude::*, translate::*};
use crate::{ffi, URIHandler, URIType};
pub trait URIHandlerImpl: super::element::ElementImpl {
pub trait URIHandlerImpl:
super::element::ElementImpl + ObjectSubclass<Type: IsA<URIHandler>>
{
const URI_TYPE: URIType;
fn protocols() -> &'static [&'static str];
fn uri(&self) -> Option<String>;
fn set_uri(&self, uri: &str) -> Result<(), glib::Error>;
}
mod sealed {
pub trait Sealed {}
impl<T: super::URIHandlerImplExt> Sealed for T {}
}
pub trait URIHandlerImplExt: sealed::Sealed + ObjectSubclass {
pub trait URIHandlerImplExt: URIHandlerImpl {
fn parent_protocols() -> Vec<String> {
unsafe {
let type_data = Self::type_data();