Make WebRtcAudioRecord save timestamps

Add timestamps to audio_record_jni DataIsRecorded() function, and make
WebRtcAudioRecord find and send the time stamp to that function.

This CL is an continuation of
https://webrtc-review.googlesource.com/c/src/+/249085

Bug: webrtc:13609
Change-Id: I63ab89f1215893cbe1d11d9d8948f5639fc5cdfe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249951
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
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@{#35933}
This commit is contained in:
Olov Brändström
2022-02-07 12:21:32 +01:00
committed by WebRTC LUCI CQ
parent 98d26df5b7
commit 092d776b7b
5 changed files with 37 additions and 8 deletions

View File

@ -23,6 +23,7 @@
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/task_queue.h"
#include "rtc_base/thread_annotations.h"
#include "rtc_base/timestamp_aligner.h"
namespace webrtc {
@ -227,6 +228,10 @@ class AudioDeviceBuffer {
// being printed in the LogStats() task.
bool log_stats_ RTC_GUARDED_BY(task_queue_);
// Used for converting capture timestaps (recieved from AudioRecordThread
// via AudioRecordJni::DataIsRecorded) to RTC clock.
rtc::TimestampAligner timestamp_aligner_;
// Should *never* be defined in production builds. Only used for testing.
// When defined, the output signal will be replaced by a sinus tone at 440Hz.
#ifdef AUDIO_DEVICE_PLAYS_SINUS_TONE