Remove control source after fade in?

Weber, Holger Holger.Weber at telerob.com
Mon May 13 15:09:14 UTC 2019


Hi,

I use a control source to fade in an audio stream when my pipeline is started.
The fade in works as expected (see code).

        GstControlSource* pCtrlSource = gst_interpolation_control_source_new();
        g_object_set(pCtrlSource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
        gst_object_add_control_binding(GST_OBJECT_CAST(m_pElVolume), gst_direct_control_binding_new(GST_OBJECT_CAST(m_pElVolume), "volume", pCtrlSource));
        GstTimedValueControlSource *tv_csource = (GstTimedValueControlSource *) pCtrlSource;
        gst_timed_value_control_source_set(tv_csource, 0 * GST_MSECOND, 0.0);
        gst_timed_value_control_source_set(tv_csource, iFadeInMs * GST_MSECOND, 0.0);
        gst_timed_value_control_source_set(tv_csource, (iFadeInMs + iFADE_RAMP_TIM_MS) * GST_MSECOND, 0.10);
        gst_object_unref(pCtrlSource);

There is another function which is triggered from outside some minutes later which tries to reduce the volume to 50%.
Therefore I directly set the volume property:
g_object_set(G_OBJECT(m_pElVolume), "volume", 0.5, NULL);

But nothing happens. If I remove the control source (just uncomment code above) reducing the volume works as expected.
I guess that I have to remove or destroy something after the fade in but I have no idea.

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190513/225ace02/attachment.html>


More information about the gstreamer-devel mailing list