From 1b683d5a7677d395f76a134fa39a496b4fde9f44 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Thu, 12 Mar 2020 07:46:47 +0100 Subject: [PATCH] audiomixer: Use G_DECLARE_FINAL_TYPE --- gst/audiomixer/gstaudiointerleave.h | 36 +++++----------------------- gst/audiomixer/gstaudiomixer.h | 37 +++++------------------------ 2 files changed, 12 insertions(+), 61 deletions(-) diff --git a/gst/audiomixer/gstaudiointerleave.h b/gst/audiomixer/gstaudiointerleave.h index bf46f4a505..5bb8e23e45 100644 --- a/gst/audiomixer/gstaudiointerleave.h +++ b/gst/audiomixer/gstaudiointerleave.h @@ -31,18 +31,9 @@ G_BEGIN_DECLS -#define GST_TYPE_AUDIO_INTERLEAVE (gst_audio_interleave_get_type()) -#define GST_AUDIO_INTERLEAVE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_INTERLEAVE,GstAudioInterleave)) -#define GST_IS_AUDIO_INTERLEAVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_INTERLEAVE)) -#define GST_AUDIO_INTERLEAVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_INTERLEAVE,GstAudioInterleaveClass)) -#define GST_IS_AUDIO_INTERLEAVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_INTERLEAVE)) -#define GST_AUDIO_INTERLEAVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_INTERLEAVE,GstAudioInterleaveClass)) - -typedef struct _GstAudioInterleave GstAudioInterleave; -typedef struct _GstAudioInterleaveClass GstAudioInterleaveClass; - -typedef struct _GstAudioInterleavePad GstAudioInterleavePad; -typedef struct _GstAudioInterleavePadClass GstAudioInterleavePadClass; +#define GST_TYPE_AUDIO_INTERLEAVE (gst_audio_interleave_get_type()) +G_DECLARE_FINAL_TYPE (GstAudioInterleave, gst_audio_interleave, + GST, AUDIO_INTERLEAVE, GstAudioAggregator) typedef void (*GstInterleaveFunc) (gpointer out, gpointer in, guint stride, guint nframes); @@ -69,18 +60,10 @@ struct _GstAudioInterleave { GstInterleaveFunc func; }; -struct _GstAudioInterleaveClass { - GstAudioAggregatorClass parent_class; -}; -GType gst_audio_interleave_get_type (void); - -#define GST_TYPE_AUDIO_INTERLEAVE_PAD (gst_audio_interleave_pad_get_type()) -#define GST_AUDIO_INTERLEAVE_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_INTERLEAVE_PAD,GstAudioInterleavePad)) -#define GST_IS_AUDIO_INTERLEAVE_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_INTERLEAVE_PAD)) -#define GST_AUDIO_INTERLEAVE_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_INTERLEAVE_PAD,GstAudioInterleavePadClass)) -#define GST_IS_AUDIO_INTERLEAVE_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_INTERLEAVE_PAD)) -#define GST_AUDIO_INTERLEAVE_PAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_INTERLEAVE_PAD,GstAudioInterleavePadClass)) +#define GST_TYPE_AUDIO_INTERLEAVE_PAD (gst_audio_interleave_pad_get_type()) +G_DECLARE_FINAL_TYPE (GstAudioInterleavePad, gst_audio_interleave_pad, + GST, AUDIO_INTERLEAVE_PAD, GstAudioAggregatorConvertPad) struct _GstAudioInterleavePad { GstAudioAggregatorPad parent; @@ -88,13 +71,6 @@ struct _GstAudioInterleavePad { guint channel; }; -struct _GstAudioInterleavePadClass { - GstAudioAggregatorPadClass parent_class; -}; - -GType gst_audio_interleave_pad_get_type (void); - G_END_DECLS - #endif /* __GST_AUDIO_INTERLEAVE_H__ */ diff --git a/gst/audiomixer/gstaudiomixer.h b/gst/audiomixer/gstaudiomixer.h index 67ccb27e6d..668ea3f721 100644 --- a/gst/audiomixer/gstaudiomixer.h +++ b/gst/audiomixer/gstaudiomixer.h @@ -30,18 +30,9 @@ G_BEGIN_DECLS -#define GST_TYPE_AUDIO_MIXER (gst_audiomixer_get_type()) -#define GST_AUDIO_MIXER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_MIXER,GstAudioMixer)) -#define GST_IS_AUDIO_MIXER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_MIXER)) -#define GST_AUDIO_MIXER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_MIXER,GstAudioMixerClass)) -#define GST_IS_AUDIO_MIXER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_MIXER)) -#define GST_AUDIO_MIXER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_MIXER,GstAudioMixerClass)) - -typedef struct _GstAudioMixer GstAudioMixer; -typedef struct _GstAudioMixerClass GstAudioMixerClass; - -typedef struct _GstAudioMixerPad GstAudioMixerPad; -typedef struct _GstAudioMixerPadClass GstAudioMixerPadClass; +#define GST_TYPE_AUDIO_MIXER (gst_audiomixer_get_type()) +G_DECLARE_FINAL_TYPE (GstAudioMixer, gst_audiomixer, GST, AUDIO_MIXER, + GstAudioAggregator) /** * GstAudioMixer: @@ -52,18 +43,9 @@ struct _GstAudioMixer { GstAudioAggregator element; }; -struct _GstAudioMixerClass { - GstAudioAggregatorClass parent_class; -}; - -GType gst_audiomixer_get_type (void); - -#define GST_TYPE_AUDIO_MIXER_PAD (gst_audiomixer_pad_get_type()) -#define GST_AUDIO_MIXER_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_MIXER_PAD,GstAudioMixerPad)) -#define GST_IS_AUDIO_MIXER_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_MIXER_PAD)) -#define GST_AUDIO_MIXER_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_MIXER_PAD,GstAudioMixerPadClass)) -#define GST_IS_AUDIO_MIXER_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_MIXER_PAD)) -#define GST_AUDIO_MIXER_PAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_MIXER_PAD,GstAudioMixerPadClass)) +#define GST_TYPE_AUDIO_MIXER_PAD (gst_audiomixer_pad_get_type()) +G_DECLARE_FINAL_TYPE (GstAudioMixerPad, gst_audiomixer_pad, + GST, AUDIO_MIXER_PAD, GstAudioAggregatorConvertPad) struct _GstAudioMixerPad { GstAudioAggregatorConvertPad parent; @@ -75,13 +57,6 @@ struct _GstAudioMixerPad { gboolean mute; }; -struct _GstAudioMixerPadClass { - GstAudioAggregatorConvertPadClass parent_class; -}; - -GType gst_audiomixer_pad_get_type (void); - G_END_DECLS - #endif /* __GST_AUDIO_MIXER_H__ */