forked from mirrors/gstreamer-rs
Simplify IsSubclassable trait impls
This commit is contained in:
parent
cc76442601
commit
12fec484c7
33 changed files with 35 additions and 185 deletions
|
@ -522,7 +522,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
|||
|
||||
unsafe impl<T: AudioDecoderImpl> IsSubclassable<T> for AudioDecoder {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.open = Some(audio_decoder_open::<T>);
|
||||
klass.close = Some(audio_decoder_close::<T>);
|
||||
|
@ -542,10 +542,6 @@ unsafe impl<T: AudioDecoderImpl> IsSubclassable<T> for AudioDecoder {
|
|||
klass.propose_allocation = Some(audio_decoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(audio_decoder_decide_allocation::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_open<T: AudioDecoderImpl>(
|
||||
|
|
|
@ -472,7 +472,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
|||
|
||||
unsafe impl<T: AudioEncoderImpl> IsSubclassable<T> for AudioEncoder {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.open = Some(audio_encoder_open::<T>);
|
||||
klass.close = Some(audio_encoder_close::<T>);
|
||||
|
@ -491,10 +491,6 @@ unsafe impl<T: AudioEncoderImpl> IsSubclassable<T> for AudioEncoder {
|
|||
klass.propose_allocation = Some(audio_encoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(audio_encoder_decide_allocation::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_open<T: AudioEncoderImpl>(
|
||||
|
|
|
@ -184,7 +184,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
|||
|
||||
unsafe impl<T: AudioSinkImpl> IsSubclassable<T> for AudioSink {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst_base::BaseSink as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.close = Some(audiosink_close::<T>);
|
||||
klass.delay = Some(audiosink_delay::<T>);
|
||||
|
@ -194,10 +194,6 @@ unsafe impl<T: AudioSinkImpl> IsSubclassable<T> for AudioSink {
|
|||
klass.write = Some(audiosink_write::<T>);
|
||||
klass.reset = Some(audiosink_reset::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst_base::BaseSink as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audiosink_close<T: AudioSinkImpl>(
|
||||
|
|
|
@ -200,7 +200,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
|||
|
||||
unsafe impl<T: AudioSrcImpl> IsSubclassable<T> for AudioSrc {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst_base::BaseSrc as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.close = Some(audiosrc_close::<T>);
|
||||
klass.delay = Some(audiosrc_delay::<T>);
|
||||
|
@ -210,10 +210,6 @@ unsafe impl<T: AudioSrcImpl> IsSubclassable<T> for AudioSrc {
|
|||
klass.read = Some(audiosrc_read::<T>);
|
||||
klass.reset = Some(audiosrc_reset::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst_base::BaseSrc as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audiosrc_close<T: AudioSrcImpl>(
|
||||
|
|
|
@ -792,7 +792,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
|||
|
||||
unsafe impl<T: AggregatorImpl> IsSubclassable<T> for Aggregator {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.flush = Some(aggregator_flush::<T>);
|
||||
klass.clip = Some(aggregator_clip::<T>);
|
||||
|
@ -821,10 +821,6 @@ unsafe impl<T: AggregatorImpl> IsSubclassable<T> for Aggregator {
|
|||
klass.finish_buffer_list = Some(aggregator_finish_buffer_list::<T>);
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(
|
||||
|
|
|
@ -93,15 +93,11 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
|
|||
}
|
||||
unsafe impl<T: AggregatorPadImpl> IsSubclassable<T> for AggregatorPad {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Pad as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.flush = Some(aggregator_pad_flush::<T>);
|
||||
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Pad as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>(
|
||||
|
|
|
@ -199,7 +199,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
|
|||
|
||||
unsafe impl<T: BaseParseImpl> IsSubclassable<T> for BaseParse {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.start = Some(base_parse_start::<T>);
|
||||
klass.stop = Some(base_parse_stop::<T>);
|
||||
|
@ -207,10 +207,6 @@ unsafe impl<T: BaseParseImpl> IsSubclassable<T> for BaseParse {
|
|||
klass.handle_frame = Some(base_parse_handle_frame::<T>);
|
||||
klass.convert = Some(base_parse_convert::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn base_parse_start<T: BaseParseImpl>(
|
||||
|
|
|
@ -430,7 +430,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
|||
|
||||
unsafe impl<T: BaseSinkImpl> IsSubclassable<T> for BaseSink {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.start = Some(base_sink_start::<T>);
|
||||
klass.stop = Some(base_sink_stop::<T>);
|
||||
|
@ -447,10 +447,6 @@ unsafe impl<T: BaseSinkImpl> IsSubclassable<T> for BaseSink {
|
|||
klass.unlock_stop = Some(base_sink_unlock_stop::<T>);
|
||||
klass.propose_allocation = Some(base_sink_propose_allocation::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn base_sink_start<T: BaseSinkImpl>(
|
||||
|
|
|
@ -614,7 +614,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
|||
|
||||
unsafe impl<T: BaseSrcImpl> IsSubclassable<T> for BaseSrc {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.start = Some(base_src_start::<T>);
|
||||
klass.stop = Some(base_src_stop::<T>);
|
||||
|
@ -635,10 +635,6 @@ unsafe impl<T: BaseSrcImpl> IsSubclassable<T> for BaseSrc {
|
|||
klass.unlock_stop = Some(base_src_unlock_stop::<T>);
|
||||
klass.decide_allocation = Some(base_src_decide_allocation::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn base_src_start<T: BaseSrcImpl>(
|
||||
|
|
|
@ -920,7 +920,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
|||
|
||||
unsafe impl<T: BaseTransformImpl> IsSubclassable<T> for BaseTransform {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.start = Some(base_transform_start::<T>);
|
||||
klass.stop = Some(base_transform_stop::<T>);
|
||||
|
@ -960,10 +960,6 @@ unsafe impl<T: BaseTransformImpl> IsSubclassable<T> for BaseTransform {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -176,16 +176,12 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
|
|||
|
||||
unsafe impl<T: PushSrcImpl> IsSubclassable<T> for PushSrc {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<crate::BaseSrc as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.fill = Some(push_src_fill::<T>);
|
||||
klass.alloc = Some(push_src_alloc::<T>);
|
||||
klass.create = Some(push_src_create::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<crate::BaseSrc as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn push_src_fill<T: PushSrcImpl>(
|
||||
|
|
|
@ -102,16 +102,12 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
|
|||
|
||||
unsafe impl<T: GLBaseFilterImpl> IsSubclassable<T> for GLBaseFilter {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst_base::BaseTransform as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.gl_set_caps = Some(gl_set_caps::<T>);
|
||||
klass.gl_start = Some(gl_start::<T>);
|
||||
klass.gl_stop = Some(gl_stop::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst_base::BaseTransform as IsSubclassable<T>>::instance_init(instance)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn gl_set_caps<T: GLBaseFilterImpl>(
|
||||
|
|
|
@ -95,17 +95,13 @@ impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
|
|||
|
||||
unsafe impl<T: GLBaseSrcImpl> IsSubclassable<T> for GLBaseSrc {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst_base::PushSrc as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.supported_gl_api = T::SUPPORTED_GL_API.into_glib();
|
||||
klass.gl_start = Some(gl_start::<T>);
|
||||
klass.gl_stop = Some(gl_stop::<T>);
|
||||
klass.fill_gl_memory = Some(fill_gl_memory::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst_base::PushSrc as IsSubclassable<T>>::instance_init(instance)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn gl_start<T: GLBaseSrcImpl>(ptr: *mut GstGLBaseSrc) -> glib::ffi::gboolean {
|
||||
|
|
|
@ -226,7 +226,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
|
|||
|
||||
unsafe impl<T: GLFilterImpl> IsSubclassable<T> for GLFilter {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<GLBaseFilter as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.set_caps = Some(set_caps::<T>);
|
||||
klass.init_fbo = Some(init_fbo::<T>);
|
||||
|
@ -247,10 +247,6 @@ unsafe impl<T: GLFilterImpl> IsSubclassable<T> for GLFilter {
|
|||
unsafe { ffi::gst_gl_filter_add_rgba_pad_templates(klass) }
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<GLBaseFilter as IsSubclassable<T>>::instance_init(instance)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn filter<T: GLFilterImpl>(
|
||||
|
|
|
@ -855,7 +855,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
|
|||
}
|
||||
unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.create_sdp = Some(client_create_sdp::<T>);
|
||||
klass.configure_client_media = Some(client_configure_client_media::<T>);
|
||||
|
@ -888,10 +888,6 @@ unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient {
|
|||
klass.pre_announce_request = Some(client_pre_announce_request::<T>);
|
||||
klass.pre_record_request = Some(client_pre_record_request::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn client_create_sdp<T: RTSPClientImpl>(
|
||||
|
|
|
@ -452,7 +452,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
|
|||
}
|
||||
unsafe impl<T: RTSPMediaImpl> IsSubclassable<T> for RTSPMedia {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.handle_message = Some(media_handle_message::<T>);
|
||||
klass.prepare = Some(media_prepare::<T>);
|
||||
|
@ -472,10 +472,6 @@ unsafe impl<T: RTSPMediaImpl> IsSubclassable<T> for RTSPMedia {
|
|||
klass.new_state = Some(media_new_state::<T>);
|
||||
klass.handle_sdp = Some(media_handle_sdp::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn media_handle_message<T: RTSPMediaImpl>(
|
||||
|
|
|
@ -226,7 +226,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
|
|||
}
|
||||
unsafe impl<T: RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactory {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.gen_key = Some(factory_gen_key::<T>);
|
||||
klass.create_element = Some(factory_create_element::<T>);
|
||||
|
@ -236,10 +236,6 @@ unsafe impl<T: RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactory {
|
|||
klass.media_constructed = Some(factory_media_constructed::<T>);
|
||||
klass.media_configure = Some(factory_media_configure::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn factory_gen_key<T: RTSPMediaFactoryImpl>(
|
||||
|
|
|
@ -50,14 +50,10 @@ impl<T: RTSPMountPointsImpl> RTSPMountPointsImplExt for T {
|
|||
|
||||
unsafe impl<T: RTSPMountPointsImpl> IsSubclassable<T> for RTSPMountPoints {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.make_path = Some(mount_points_make_path::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn mount_points_make_path<T: RTSPMountPointsImpl>(
|
||||
|
|
|
@ -49,15 +49,11 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
|
|||
}
|
||||
unsafe impl<T: RTSPServerImpl> IsSubclassable<T> for RTSPServer {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.create_client = Some(server_create_client::<T>);
|
||||
klass.client_connected = Some(server_client_connected::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn server_create_client<T: RTSPServerImpl>(
|
||||
|
|
|
@ -572,7 +572,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
|
|||
|
||||
unsafe impl<T: VideoDecoderImpl> IsSubclassable<T> for VideoDecoder {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.open = Some(video_decoder_open::<T>);
|
||||
klass.close = Some(video_decoder_close::<T>);
|
||||
|
@ -597,10 +597,6 @@ unsafe impl<T: VideoDecoderImpl> IsSubclassable<T> for VideoDecoder {
|
|||
klass.handle_missing_data = Some(video_decoder_handle_missing_data::<T>);
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_open<T: VideoDecoderImpl>(
|
||||
|
|
|
@ -464,7 +464,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
|
|||
|
||||
unsafe impl<T: VideoEncoderImpl> IsSubclassable<T> for VideoEncoder {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.open = Some(video_encoder_open::<T>);
|
||||
klass.close = Some(video_encoder_close::<T>);
|
||||
|
@ -483,10 +483,6 @@ unsafe impl<T: VideoEncoderImpl> IsSubclassable<T> for VideoEncoder {
|
|||
klass.propose_allocation = Some(video_encoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(video_encoder_decide_allocation::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_open<T: VideoEncoderImpl>(
|
||||
|
|
|
@ -211,7 +211,8 @@ unsafe impl<T: VideoFilterImpl> IsSubclassable<T> for VideoFilter {
|
|||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
use gst_base::subclass::base_transform::BaseTransformMode;
|
||||
|
||||
<gst_base::BaseTransform as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
|
||||
let klass = klass.as_mut();
|
||||
klass.set_info = Some(video_filter_set_info::<T>);
|
||||
|
||||
|
@ -230,10 +231,6 @@ unsafe impl<T: VideoFilterImpl> IsSubclassable<T> for VideoFilter {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst_base::BaseTransform as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_filter_set_info<T: VideoFilterImpl>(
|
||||
|
|
|
@ -49,14 +49,10 @@ impl<T: VideoSinkImpl> VideoSinkImplExt for T {
|
|||
|
||||
unsafe impl<T: VideoSinkImpl> IsSubclassable<T> for VideoSink {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst_base::BaseSink as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.show_frame = Some(video_sink_show_frame::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst_base::BaseSink as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_sink_show_frame<T: VideoSinkImpl>(
|
||||
|
|
|
@ -100,16 +100,12 @@ impl<T: BinImpl> BinImplExt for T {
|
|||
|
||||
unsafe impl<T: BinImpl> IsSubclassable<T> for Bin {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<crate::Element as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.add_element = Some(bin_add_element::<T>);
|
||||
klass.remove_element = Some(bin_remove_element::<T>);
|
||||
klass.handle_message = Some(bin_handle_message::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<crate::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn bin_add_element<T: BinImpl>(
|
||||
|
|
|
@ -233,7 +233,7 @@ impl<T: ClockImpl> ClockImplExt for T {
|
|||
|
||||
unsafe impl<T: ClockImpl> IsSubclassable<T> for Clock {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.change_resolution = Some(clock_change_resolution::<T>);
|
||||
klass.get_resolution = Some(clock_get_resolution::<T>);
|
||||
|
@ -242,10 +242,6 @@ unsafe impl<T: ClockImpl> IsSubclassable<T> for Clock {
|
|||
klass.wait_async = Some(clock_wait_async::<T>);
|
||||
klass.unschedule = Some(clock_unschedule::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn clock_change_resolution<T: ClockImpl>(
|
||||
|
|
|
@ -101,15 +101,11 @@ impl<T: DeviceImpl> DeviceImplExt for T {
|
|||
|
||||
unsafe impl<T: DeviceImpl> IsSubclassable<T> for Device {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.create_element = Some(device_create_element::<T>);
|
||||
klass.reconfigure_element = Some(device_reconfigure_element::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn device_create_element<T: DeviceImpl>(
|
||||
|
|
|
@ -143,7 +143,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
|
|||
|
||||
unsafe impl<T: DeviceProviderImpl> IsSubclassable<T> for DeviceProvider {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.probe = Some(device_provider_probe::<T>);
|
||||
klass.start = Some(device_provider_start::<T>);
|
||||
|
@ -169,10 +169,6 @@ unsafe impl<T: DeviceProviderImpl> IsSubclassable<T> for DeviceProvider {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn device_provider_probe<T: DeviceProviderImpl>(
|
||||
|
|
|
@ -374,8 +374,7 @@ impl<T: ElementImpl> ElementImplExt for T {
|
|||
|
||||
unsafe impl<T: ElementImpl> IsSubclassable<T> for Element {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.change_state = Some(element_change_state::<T>);
|
||||
klass.request_new_pad = Some(element_request_new_pad::<T>);
|
||||
|
@ -413,7 +412,7 @@ unsafe impl<T: ElementImpl> IsSubclassable<T> for Element {
|
|||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
Self::parent_instance_init::<T>(instance);
|
||||
|
||||
instance.set_instance_data(Self::static_type(), atomic::AtomicBool::new(false));
|
||||
}
|
||||
|
|
|
@ -7,14 +7,4 @@ use crate::GhostPad;
|
|||
|
||||
pub trait GhostPadImpl: PadImpl {}
|
||||
|
||||
unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPad {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<crate::Pad as IsSubclassable<T>>::class_init(klass);
|
||||
let _klass = klass.as_mut();
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<crate::Pad as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPad {}
|
||||
|
|
|
@ -60,15 +60,11 @@ impl<T: PadImpl> PadImplExt for T {
|
|||
|
||||
unsafe impl<T: PadImpl> IsSubclassable<T> for Pad {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
Self::parent_class_init::<T>(klass);
|
||||
let klass = klass.as_mut();
|
||||
klass.linked = Some(pad_linked::<T>);
|
||||
klass.unlinked = Some(pad_unlinked::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn pad_linked<T: PadImpl>(ptr: *mut ffi::GstPad, peer: *mut ffi::GstPad) {
|
||||
|
|
|
@ -7,14 +7,4 @@ use crate::Pipeline;
|
|||
|
||||
pub trait PipelineImpl: BinImpl {}
|
||||
|
||||
unsafe impl<T: PipelineImpl> IsSubclassable<T> for Pipeline {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<crate::Bin as IsSubclassable<T>>::class_init(klass);
|
||||
let _klass = klass.as_mut();
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<crate::Bin as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
unsafe impl<T: PipelineImpl> IsSubclassable<T> for Pipeline {}
|
||||
|
|
|
@ -7,14 +7,4 @@ use crate::SystemClock;
|
|||
|
||||
pub trait SystemClockImpl: ClockImpl {}
|
||||
|
||||
unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClock {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<crate::Clock as IsSubclassable<T>>::class_init(klass);
|
||||
let _klass = klass.as_mut();
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<crate::Clock as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClock {}
|
||||
|
|
|
@ -59,15 +59,7 @@ pub trait TracerImpl: TracerImplExt + ObjectImpl + Send + Sync {
|
|||
fn pad_unlink_pre(&self, ts: u64, src: &Pad, sink: &Pad) {}
|
||||
}
|
||||
|
||||
unsafe impl<T: TracerImpl> IsSubclassable<T> for Tracer {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<glib::Object as IsSubclassable<T>>::class_init(klass);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<glib::Object as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
unsafe impl<T: TracerImpl> IsSubclassable<T> for Tracer {}
|
||||
|
||||
pub trait TracerImplExt: ObjectSubclass {
|
||||
// rustdoc-stripper-ignore-next
|
||||
|
|
Loading…
Reference in a new issue