Propagate base minimum delay from video jitter buffer to webrtc/api.
On api level two methods were added to api/media_stream_interface.cc on VideoSourceInterface,
GetLatency and SetLatency. Latency is measured in seconds, delay in milliseconds but both describes
the same concept.
Bug: webrtc:10287
Change-Id: Ib8dc62a4d73f63fab7e10b82c716096ee6199957
Reviewed-on: https://webrtc-review.googlesource.com/c/123482
Commit-Queue: Ruslan Burakov <kuddai@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26877}
diff --git a/api/media_stream_interface.cc b/api/media_stream_interface.cc
index b55a840..cf994cb 100644
--- a/api/media_stream_interface.cc
+++ b/api/media_stream_interface.cc
@@ -32,7 +32,7 @@
return {};
}
-double AudioSourceInterface::GetLatency() const {
+double MediaSourceInterface::GetLatency() const {
return 0.0;
}
diff --git a/api/media_stream_interface.h b/api/media_stream_interface.h
index e520361..1249b85 100644
--- a/api/media_stream_interface.h
+++ b/api/media_stream_interface.h
@@ -61,6 +61,13 @@
virtual bool remote() const = 0;
+ // Sets the minimum latency of the remote source until audio playout. Actual
+ // observered latency may differ depending on the source. |latency| is in the
+ // range of [0.0, 10.0] seconds.
+ // TODO(kuddai) make pure virtual once not only remote tracks support latency.
+ virtual void SetLatency(double latency) {}
+ virtual double GetLatency() const;
+
protected:
~MediaSourceInterface() override = default;
};
@@ -201,12 +208,6 @@
// be applied in the track in a way that does not affect clones of the track.
virtual void SetVolume(double volume) {}
- // Sets the minimum latency of the remote source until audio playout. Actual
- // observered latency may differ depending on the source. |latency| is in the
- // range of [0.0, 10.0] seconds.
- virtual void SetLatency(double latency) {}
- virtual double GetLatency() const;
-
// Registers/unregisters observers to the audio source.
virtual void RegisterAudioObserver(AudioObserver* observer) {}
virtual void UnregisterAudioObserver(AudioObserver* observer) {}
diff --git a/api/video_track_source_proxy.h b/api/video_track_source_proxy.h
index 820cdcb..eb11bef 100644
--- a/api/video_track_source_proxy.h
+++ b/api/video_track_source_proxy.h
@@ -32,6 +32,8 @@
rtc::VideoSinkInterface<VideoFrame>*,
const rtc::VideoSinkWants&)
PROXY_WORKER_METHOD1(void, RemoveSink, rtc::VideoSinkInterface<VideoFrame>*)
+PROXY_WORKER_METHOD1(void, SetLatency, double)
+PROXY_WORKER_CONSTMETHOD0(double, GetLatency)
PROXY_METHOD1(void, RegisterObserver, ObserverInterface*)
PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*)
END_PROXY_MAP()