soundtouch: Update for g_type_class_add_private() deprecation in recent GLib

This commit is contained in:
Tim-Philipp Müller 2018-06-24 00:17:26 +02:00
parent 3c6f642fa6
commit bde76a7dd0
2 changed files with 5 additions and 11 deletions

View file

@ -78,7 +78,7 @@ struct _GstBPMDetectPrivate
#endif
#define gst_bpm_detect_parent_class parent_class
G_DEFINE_TYPE (GstBPMDetect, gst_bpm_detect, GST_TYPE_AUDIO_FILTER);
G_DEFINE_TYPE_WITH_PRIVATE (GstBPMDetect, gst_bpm_detect, GST_TYPE_AUDIO_FILTER);
static void gst_bpm_detect_finalize (GObject * object);
static gboolean gst_bpm_detect_stop (GstBaseTransform * trans);
@ -118,16 +118,13 @@ gst_bpm_detect_class_init (GstBPMDetectClass * klass)
trans_class->passthrough_on_same_caps = TRUE;
filter_class->setup = GST_DEBUG_FUNCPTR (gst_bpm_detect_setup);
g_type_class_add_private (gobject_class, sizeof (GstBPMDetectPrivate));
}
static void
gst_bpm_detect_init (GstBPMDetect * bpm_detect)
{
bpm_detect->priv = G_TYPE_INSTANCE_GET_PRIVATE ((bpm_detect),
GST_TYPE_BPM_DETECT, GstBPMDetectPrivate);
bpm_detect->priv =
(GstBPMDetectPrivate *) gst_bpm_detect_get_instance_private (bpm_detect);
bpm_detect->priv->detect = NULL;
bpm_detect->bpm = 0.0;
}

View file

@ -117,7 +117,7 @@ static gboolean gst_pitch_src_query (GstPad * pad, GstObject * parent,
GstQuery * query);
#define gst_pitch_parent_class parent_class
G_DEFINE_TYPE (GstPitch, gst_pitch, GST_TYPE_ELEMENT);
G_DEFINE_TYPE_WITH_PRIVATE (GstPitch, gst_pitch, GST_TYPE_ELEMENT);
static void
gst_pitch_class_init (GstPitchClass * klass)
@ -131,8 +131,6 @@ gst_pitch_class_init (GstPitchClass * klass)
GST_DEBUG_CATEGORY_INIT (pitch_debug, "pitch", 0,
"audio pitch control element");
g_type_class_add_private (gobject_class, sizeof (GstPitchPrivate));
gobject_class->set_property = gst_pitch_set_property;
gobject_class->get_property = gst_pitch_get_property;
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_pitch_dispose);
@ -174,8 +172,7 @@ gst_pitch_class_init (GstPitchClass * klass)
static void
gst_pitch_init (GstPitch * pitch)
{
pitch->priv =
G_TYPE_INSTANCE_GET_PRIVATE ((pitch), GST_TYPE_PITCH, GstPitchPrivate);
pitch->priv = (GstPitchPrivate *) gst_pitch_get_instance_private (pitch);
pitch->sinkpad =
gst_pad_new_from_static_template (&gst_pitch_sink_template, "sink");