Add timestamps to AudioDeviceBuffer::SetRecordedBuffer

Add timestamps to the function AudioDeviceBuffer::SetRecordedBuffer. This will
be used to store audio timestaps in future changes.

This is a part of the A/V sync metric metric feature for mobile. The metric
have already launched for web clients.

Bug: webrtc:13609
Change-Id: I0031843476ff1b573b262308fca52d587fae30b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249085
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Minyue Li <minyue@google.com>
Commit-Queue: Olov Brändström <brandstrom@google.com>
Cr-Commit-Position: refs/heads/main@{#35851}
This commit is contained in:
Olov Brändström
2022-01-28 15:07:39 +01:00
committed by WebRTC LUCI CQ
parent 9897649336
commit b732bd5fb5
9 changed files with 121 additions and 17 deletions

View File

@ -97,8 +97,13 @@ class AudioDeviceBuffer {
size_t RecordingChannels() const;
size_t PlayoutChannels() const;
// TODO(bugs.webrtc.org/13621) Deprecate this function
virtual int32_t SetRecordedBuffer(const void* audio_buffer,
size_t samples_per_channel);
virtual int32_t SetRecordedBuffer(const void* audio_buffer,
size_t samples_per_channel,
int64_t capture_timestamp_ns);
virtual void SetVQEData(int play_delay_ms, int rec_delay_ms);
virtual int32_t DeliverRecordedData();
uint32_t NewMicLevel() const;
@ -187,6 +192,9 @@ class AudioDeviceBuffer {
int play_delay_ms_;
int rec_delay_ms_;
// Capture timestamp.
int64_t capture_timestamp_ns_;
// Counts number of times LogStats() has been called.
size_t num_stat_reports_ RTC_GUARDED_BY(task_queue_);