Webrtcsdp - echo cancellation

I would like to implement echo cancellation in my GStreamer project, so I was researching this element: https://gstreamer.freedesktop.org/documentation/webrtcdsp/webrtcdsp.html?gi-language=c#webrtcdsp:echo-cancel

I’m interested in what the sentence “The probe can only be used within the same top level GstPipeline” means exactly — does it mean that the DSP and the echoprobe must be inside the same pipeline, or can they be in two different pipelines that run in the same process?

They must be inside the same pipeline. Because they need to share timing information.

If they’re not inside the same pipeline, both pipelines must use the same clock and have the same base_time. In any case, they need to be inside the same process, as the data from both elements end up inside the same function call internally.

1 Like

Thank you very much for the explanation! I will try to do it that way.

Is there an example of how I can set two pipelines to use the same clock and have the same base time?

The code could look something like for each pipeline while its still in GST_STATE_NULL

GstClock *sysclock = gst_system_clock_obtain();
gst_pipeline_use_clock(GST_PIPELINE(pipeline), sysclock);
gst_object_unref (sysclock);
gst_element_set_start_time(pipeline, -1);
gst_element_set_base_time(pipeline, 0); // It could be any value <= to the value returned by gst_clock_get_time(syslock), all the timestamps in the pipeline will be relative to that value

and that should be it.