Adding absolute capture timestamp to AudioTrackSinkInterface.

Bug: webrtc:10739
Change-Id: I8c134cbe82452ac71625cd0c810c783a73f17822
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167532
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Chen Xing <chxg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30408}
This commit is contained in:
Minyue Li
2020-01-29 10:25:12 +01:00
committed by Commit Bot
parent 26b4cb3fc5
commit 99d6d8115b
8 changed files with 61 additions and 17 deletions

View File

@ -202,7 +202,25 @@ class AudioTrackSinkInterface {
int bits_per_sample,
int sample_rate,
size_t number_of_channels,
size_t number_of_frames) = 0;
size_t number_of_frames) {
RTC_NOTREACHED() << "This method must be overridden, or not used.";
}
// In this method, |absolute_capture_timestamp_ms|, when available, is
// supposed to deliver the timestamp when this audio frame was originally
// captured. This timestamp MUST be based on the same clock as
// rtc::TimeMillis().
virtual void OnData(const void* audio_data,
int bits_per_sample,
int sample_rate,
size_t number_of_channels,
size_t number_of_frames,
absl::optional<int64_t> absolute_capture_timestamp_ms) {
// TODO(bugs.webrtc.org/10739): Deprecate the old OnData and make this one
// pure virtual.
return OnData(audio_data, bits_per_sample, sample_rate, number_of_channels,
number_of_frames);
}
protected:
virtual ~AudioTrackSinkInterface() {}