summaryrefslogtreecommitdiff
path: root/ext/webrtcdsp/gstwebrtcechoprobe.h
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2016-06-29 15:56:47 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2016-06-30 09:27:03 -0400
commit71c9cdeff4b2994616dc6c54f5f5cf3233c8e166 (patch)
treeb09ed97832a8eb4f8ca75f9a1422f721a341892f /ext/webrtcdsp/gstwebrtcechoprobe.h
parente35e23b734be3887546173aaba86e8d746bb255d (diff)
downloadgstreamer-plugins-bad-71c9cdeff4b2994616dc6c54f5f5cf3233c8e166.tar.gz
webrtcdsp: Rewrite echo data synchronization
The previous code would run out of sync if there was packet lost or clock skews. When that happened, the echo cancellation feature would completely stop working. As this is crucial for audio calls, this patch re-implement synchronization completely. Instead of letting it drift until next discont, we now synchronize against the record data at every iteration. This way we simply never let the stream drift for longer then 10ms period. We also shorter the delay by using the latency up the probe (basically excluding the sink latency. This is a decent delay to avoid starving in the probe queue. https://bugzilla.gnome.org/show_bug.cgi?id=768009
Diffstat (limited to 'ext/webrtcdsp/gstwebrtcechoprobe.h')
-rw-r--r--ext/webrtcdsp/gstwebrtcechoprobe.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/webrtcdsp/gstwebrtcechoprobe.h b/ext/webrtcdsp/gstwebrtcechoprobe.h
index a18547d47..7c8a24022 100644
--- a/ext/webrtcdsp/gstwebrtcechoprobe.h
+++ b/ext/webrtcdsp/gstwebrtcechoprobe.h
@@ -62,8 +62,8 @@ struct _GstWebrtcEchoProbe
/* Protected by the lock */
GstAudioInfo info;
guint period_size;
- gint latency;
- gboolean synchronized;
+ GstClockTime latency;
+ gint delay;
GstSegment segment;
GstAdapter *adapter;
@@ -81,6 +81,8 @@ GType gst_webrtc_echo_probe_get_type (void);
GstWebrtcEchoProbe *gst_webrtc_acquire_echo_probe (const gchar * name);
void gst_webrtc_release_echo_probe (GstWebrtcEchoProbe * probe);
+gint gst_webrtc_echo_probe_read (GstWebrtcEchoProbe * self,
+ GstClockTime rec_time, gpointer frame);
G_END_DECLS
#endif /* __GST_WEBRTC_ECHO_PROBE_H__ */