Remove control source after fade in?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove control source after fade in?

Weber, Holger

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?


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remove control source after fade in?

Olivier Crête-3
Hi,

Yes, the control source will always override manually set properties before they are used. If you want to set it manually, you have to remove the control binding with gst_object_remove_control_binding(), you can retrive it with gst_object_get_control_binding()

Olivier

On Mon, 2019-05-13 at 15:09 +0000, Weber, Holger wrote:

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?

_______________________________________________
gstreamer-devel mailing list
[hidden email]

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-- 
Olivier Crête [hidden email]

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel