
This CL contains major modifications of the audio output parts for WebRTC on iOS: - general code cleanup - improves thread handling (added thread checks, remove critical section, atomic ops etc.) - reduces loopback latency of iPhone 6 from ~90ms to ~60ms ;-) - improves selection of audio parameters on iOS - reduces complexity by removing complex and redundant delay estimates - now instead uses fixed delay estimates if for some reason the SW EAC must be used - adds AudioFineBuffer to compensate for differences in native output buffer size and the 10ms size used by WebRTC. Same class as is used today on Android and we have unit tests for this class (the old code was buggy and we have several issue reports of crashes related to it) Similar improvements will be done for the recording sid as well in a separate CL. I will also add support for 48kHz in an upcoming CL since that will improve Opus performance. BUG=webrtc:4796,webrtc:4817,webrtc:4954, webrtc:4212 TEST=AppRTC demo and iOS modules_unittests using --gtest_filter=AudioDevice* R=pbos@webrtc.org, tkchin@webrtc.org Review URL: https://codereview.webrtc.org/1254883002 . Cr-Commit-Position: refs/heads/master@{#9875}
35 lines
1.2 KiB
C++
35 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_DEVICE_MOCK_AUDIO_DEVICE_BUFFER_H_
|
|
#define WEBRTC_MODULES_AUDIO_DEVICE_MOCK_AUDIO_DEVICE_BUFFER_H_
|
|
|
|
#include "testing/gmock/include/gmock/gmock.h"
|
|
#include "webrtc/modules/audio_device/audio_device_buffer.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class MockAudioDeviceBuffer : public AudioDeviceBuffer {
|
|
public:
|
|
MockAudioDeviceBuffer() {}
|
|
virtual ~MockAudioDeviceBuffer() {}
|
|
MOCK_METHOD1(RequestPlayoutData, int32_t(size_t nSamples));
|
|
MOCK_METHOD1(GetPlayoutData, int32_t(void* audioBuffer));
|
|
MOCK_METHOD2(SetRecordedBuffer,
|
|
int32_t(const void* audioBuffer, size_t nSamples));
|
|
MOCK_METHOD3(SetVQEData,
|
|
void(int playDelayMS, int recDelayMS, int clockDrift));
|
|
MOCK_METHOD0(DeliverRecordedData, int32_t());
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // WEBRTC_MODULES_AUDIO_DEVICE_MOCK_AUDIO_DEVICE_BUFFER_H_
|