static void gst_gl_stereo_mix_release_pad (GstElement * element, GstPad * pad) { GST_DEBUG_OBJECT (element, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad)); gst_child_proxy_child_removed (GST_CHILD_PROXY (element), G_OBJECT (pad), GST_OBJECT_NAME (pad)); GST_ELEMENT_CLASS (parent_class)->release_pad (element, pad); }
static void gst_deinterlace2_set_method (GstDeinterlace2 * self, GstDeinterlace2Methods method) { if (self->method) { gst_child_proxy_child_removed (GST_OBJECT (self), GST_OBJECT (self->method)); gst_object_unparent (GST_OBJECT (self->method)); self->method = NULL; } switch (method) { case GST_DEINTERLACE2_TOMSMOCOMP: self->method = g_object_new (GST_TYPE_DEINTERLACE_TOMSMOCOMP, NULL); break; case GST_DEINTERLACE2_GREEDY_H: self->method = g_object_new (GST_TYPE_DEINTERLACE_GREEDY_H, NULL); break; case GST_DEINTERLACE2_GREEDY_L: self->method = g_object_new (GST_TYPE_DEINTERLACE_GREEDY_L, NULL); break; case GST_DEINTERLACE2_VFIR: self->method = g_object_new (GST_TYPE_DEINTERLACE_VFIR, NULL); break; case GST_DEINTERLACE2_LINEAR: self->method = g_object_new (GST_TYPE_DEINTERLACE_LINEAR, NULL); break; case GST_DEINTERLACE2_LINEAR_BLEND: self->method = g_object_new (GST_TYPE_DEINTERLACE_LINEAR_BLEND, NULL); break; case GST_DEINTERLACE2_SCALER_BOB: self->method = g_object_new (GST_TYPE_DEINTERLACE_SCALER_BOB, NULL); break; case GST_DEINTERLACE2_WEAVE: self->method = g_object_new (GST_TYPE_DEINTERLACE_WEAVE, NULL); break; case GST_DEINTERLACE2_WEAVE_TFF: self->method = g_object_new (GST_TYPE_DEINTERLACE_WEAVE_TFF, NULL); break; case GST_DEINTERLACE2_WEAVE_BFF: self->method = g_object_new (GST_TYPE_DEINTERLACE_WEAVE_BFF, NULL); break; default: GST_WARNING ("Invalid Deinterlacer Method"); return; } self->method_id = method; gst_object_set_name (GST_OBJECT (self->method), "method"); gst_object_set_parent (GST_OBJECT (self->method), GST_OBJECT (self)); gst_child_proxy_child_added (GST_OBJECT (self), GST_OBJECT (self->method)); }
static void gst_audiomixer_release_pad (GstElement * element, GstPad * pad) { GstAudioMixer *audiomixer; audiomixer = GST_AUDIO_MIXER (element); GST_DEBUG_OBJECT (audiomixer, "release pad %s:%s", GST_DEBUG_PAD_NAME (pad)); gst_child_proxy_child_removed (GST_CHILD_PROXY (audiomixer), G_OBJECT (pad), GST_OBJECT_NAME (pad)); GST_ELEMENT_CLASS (parent_class)->release_pad (element, pad); }
void gst_iir_equalizer_compute_frequencies (GstIirEqualizer * equ, guint new_count) { guint old_count, i; gdouble freq0, freq1, step; gchar name[20]; if (equ->freq_band_count == new_count) return; BANDS_LOCK (equ); if (G_UNLIKELY (equ->freq_band_count == new_count)) { BANDS_UNLOCK (equ); return; } old_count = equ->freq_band_count; equ->freq_band_count = new_count; GST_DEBUG ("bands %u -> %u", old_count, new_count); if (old_count < new_count) { /* add new bands */ equ->bands = g_realloc (equ->bands, sizeof (GstObject *) * new_count); for (i = old_count; i < new_count; i++) { /* otherwise they get names like 'iirequalizerband5' */ sprintf (name, "band%u", i); equ->bands[i] = g_object_new (GST_TYPE_IIR_EQUALIZER_BAND, "name", name, NULL); GST_DEBUG ("adding band[%d]=%p", i, equ->bands[i]); gst_object_set_parent (GST_OBJECT (equ->bands[i]), GST_OBJECT (equ)); gst_child_proxy_child_added (GST_OBJECT (equ), GST_OBJECT (equ->bands[i])); } } else { /* free unused bands */ for (i = new_count; i < old_count; i++) { GST_DEBUG ("removing band[%d]=%p", i, equ->bands[i]); gst_child_proxy_child_removed (GST_OBJECT (equ), GST_OBJECT (equ->bands[i])); gst_object_unparent (GST_OBJECT (equ->bands[i])); equ->bands[i] = NULL; } } alloc_history (equ); /* set center frequencies and name band objects * FIXME: arg! we can't change the name of parented objects :( * application should read band->freq to get the name */ step = pow (HIGHEST_FREQ / LOWEST_FREQ, 1.0 / new_count); freq0 = LOWEST_FREQ; for (i = 0; i < new_count; i++) { freq1 = freq0 * step; if (i == 0) equ->bands[i]->type = BAND_TYPE_LOW_SHELF; else if (i == new_count - 1) equ->bands[i]->type = BAND_TYPE_HIGH_SHELF; else equ->bands[i]->type = BAND_TYPE_PEAK; equ->bands[i]->freq = freq0 + ((freq1 - freq0) / 2.0); equ->bands[i]->width = freq1 - freq0; GST_DEBUG ("band[%2d] = '%lf'", i, equ->bands[i]->freq); g_object_notify (G_OBJECT (equ->bands[i]), "bandwidth"); g_object_notify (G_OBJECT (equ->bands[i]), "freq"); g_object_notify (G_OBJECT (equ->bands[i]), "type"); /* if(equ->bands[i]->freq<10000.0) sprintf (name,"%dHz",(gint)equ->bands[i]->freq); else sprintf (name,"%dkHz",(gint)(equ->bands[i]->freq/1000.0)); gst_object_set_name( GST_OBJECT (equ->bands[i]), name); GST_DEBUG ("band[%2d] = '%s'",i,name); */ freq0 = freq1; } equ->need_new_coefficients = TRUE; BANDS_UNLOCK (equ); }