Move smoothing filter to common audio and exp_filter to base/analytics.
An earlier attempt of this work can be found here https://codereview.webrtc.org/2520003005/#ps100001, but was reverted. PS4 in that CL was not valid since separation of BUILD.gn can cause internal bot to fail. This is a new attempt, which is the same as https://codereview.webrtc.org/2520003005/#ps100001 but PS4 reverted. BUG=webrtc:6443 TBR=tommi@webrtc.org, solenberg@webrtc.org Review-Url: https://codereview.webrtc.org/2532523002 Cr-Commit-Position: refs/heads/master@{#15233}
This commit is contained in:
parent
b881254dc8
commit
69b627d89d
@ -363,6 +363,7 @@ if (rtc_include_tests) {
|
||||
testonly = true
|
||||
sources = [
|
||||
"api/fakemetricsobserver.cc",
|
||||
"base/analytics/exp_filter_unittest.cc",
|
||||
"base/array_view_unittest.cc",
|
||||
"base/atomicops_unittest.cc",
|
||||
"base/autodetectproxy_unittest.cc",
|
||||
@ -380,7 +381,6 @@ if (rtc_include_tests) {
|
||||
"base/criticalsection_unittest.cc",
|
||||
"base/event_tracer_unittest.cc",
|
||||
"base/event_unittest.cc",
|
||||
"base/exp_filter_unittest.cc",
|
||||
"base/file_unittest.cc",
|
||||
"base/filerotatingstream_unittest.cc",
|
||||
"base/fileutils_unittest.cc",
|
||||
@ -508,6 +508,7 @@ if (rtc_include_tests) {
|
||||
}
|
||||
|
||||
deps = [
|
||||
"base:rtc_analytics",
|
||||
"base:rtc_base",
|
||||
"base:rtc_base_tests_utils",
|
||||
"base:rtc_task_queue",
|
||||
|
||||
@ -124,8 +124,6 @@ rtc_static_library("rtc_base_approved") {
|
||||
"event.h",
|
||||
"event_tracer.cc",
|
||||
"event_tracer.h",
|
||||
"exp_filter.cc",
|
||||
"exp_filter.h",
|
||||
"file.cc",
|
||||
"file.h",
|
||||
"format_macros.h",
|
||||
@ -338,6 +336,13 @@ rtc_static_library("rtc_task_queue") {
|
||||
}
|
||||
}
|
||||
|
||||
rtc_static_library("rtc_analytics") {
|
||||
sources = [
|
||||
"analytics/exp_filter.cc",
|
||||
"analytics/exp_filter.h",
|
||||
]
|
||||
}
|
||||
|
||||
config("rtc_base_warnings_config") {
|
||||
if (is_win && is_clang) {
|
||||
cflags = [
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_BASE_EXP_FILTER_H_
|
||||
#define WEBRTC_BASE_EXP_FILTER_H_
|
||||
#ifndef WEBRTC_BASE_ANALYTICS_EXP_FILTER_H_
|
||||
#define WEBRTC_BASE_ANALYTICS_EXP_FILTER_H_
|
||||
|
||||
namespace rtc {
|
||||
|
||||
@ -46,4 +46,4 @@ class ExpFilter {
|
||||
};
|
||||
} // namespace rtc
|
||||
|
||||
#endif // WEBRTC_BASE_EXP_FILTER_H_
|
||||
#endif // WEBRTC_BASE_ANALYTICS_EXP_FILTER_H_
|
||||
@ -10,8 +10,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "webrtc/base/gunit.h"
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/test/gtest.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
@ -86,6 +86,8 @@ rtc_static_library("common_audio") {
|
||||
"signal_processing/splitting_filter.c",
|
||||
"signal_processing/sqrt_of_one_minus_x_squared.c",
|
||||
"signal_processing/vector_scaling_operations.c",
|
||||
"smoothing_filter.cc",
|
||||
"smoothing_filter.h",
|
||||
"sparse_fir_filter.cc",
|
||||
"sparse_fir_filter.h",
|
||||
"vad/include/vad.h",
|
||||
@ -109,6 +111,7 @@ rtc_static_library("common_audio") {
|
||||
]
|
||||
|
||||
deps = [
|
||||
"../base:rtc_analytics",
|
||||
"../system_wrappers",
|
||||
]
|
||||
|
||||
@ -257,6 +260,7 @@ if (rtc_include_tests) {
|
||||
"ring_buffer_unittest.cc",
|
||||
"signal_processing/real_fft_unittest.cc",
|
||||
"signal_processing/signal_processing_unittest.cc",
|
||||
"smoothing_filter_unittest.cc",
|
||||
"sparse_fir_filter_unittest.cc",
|
||||
"vad/vad_core_unittest.cc",
|
||||
"vad/vad_filterbank_unittest.cc",
|
||||
|
||||
@ -8,22 +8,20 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_MOCK_MOCK_SMOOTHING_FILTER_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_MOCK_MOCK_SMOOTHING_FILTER_H_
|
||||
#ifndef WEBRTC_COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
|
||||
#define WEBRTC_COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
|
||||
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
|
||||
#include "webrtc/common_audio/smoothing_filter.h"
|
||||
#include "webrtc/test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockSmoothingFilter : public SmoothingFilter {
|
||||
public:
|
||||
virtual ~MockSmoothingFilter() { Die(); }
|
||||
MOCK_METHOD0(Die, void());
|
||||
MOCK_METHOD1(AddSample, void(float));
|
||||
MOCK_CONST_METHOD0(GetAverage, rtc::Optional<float>());
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_MOCK_MOCK_SMOOTHING_FILTER_H_
|
||||
#endif // WEBRTC_COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
|
||||
#include "webrtc/common_audio/smoothing_filter.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -8,11 +8,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_SMOOTHING_FILTER_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_SMOOTHING_FILTER_H_
|
||||
#ifndef WEBRTC_COMMON_AUDIO_SMOOTHING_FILTER_H_
|
||||
#define WEBRTC_COMMON_AUDIO_SMOOTHING_FILTER_H_
|
||||
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
|
||||
@ -46,9 +46,9 @@ class SmoothingFilterImpl final : public SmoothingFilter {
|
||||
int64_t last_sample_time_ms_;
|
||||
rtc::ExpFilter filter_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SmoothingFilterImpl);
|
||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SmoothingFilterImpl);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_SMOOTHING_FILTER_H_
|
||||
#endif // WEBRTC_COMMON_AUDIO_SMOOTHING_FILTER_H_
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
|
||||
#include "webrtc/common_audio/smoothing_filter.h"
|
||||
#include "webrtc/test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -264,7 +264,6 @@ if (rtc_include_tests) {
|
||||
"audio_coding/audio_network_adaptor/frame_length_controller_unittest.cc",
|
||||
"audio_coding/audio_network_adaptor/mock/mock_controller.h",
|
||||
"audio_coding/audio_network_adaptor/mock/mock_controller_manager.h",
|
||||
"audio_coding/audio_network_adaptor/smoothing_filter_unittest.cc",
|
||||
]
|
||||
deps = [
|
||||
"audio_coding:audio_network_adaptor",
|
||||
|
||||
@ -708,6 +708,7 @@ rtc_static_library("webrtc_opus") {
|
||||
":audio_decoder_interface",
|
||||
":audio_encoder_interface",
|
||||
":audio_network_adaptor",
|
||||
"../../base:rtc_analytics",
|
||||
"../../base:rtc_base_approved",
|
||||
]
|
||||
|
||||
@ -764,8 +765,6 @@ rtc_static_library("audio_network_adaptor") {
|
||||
"audio_network_adaptor/frame_length_controller.cc",
|
||||
"audio_network_adaptor/frame_length_controller.h",
|
||||
"audio_network_adaptor/include/audio_network_adaptor.h",
|
||||
"audio_network_adaptor/smoothing_filter.cc",
|
||||
"audio_network_adaptor/smoothing_filter.h",
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/common_audio/smoothing_filter.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "webrtc/common_audio/mocks/mock_smoothing_filter.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_smoothing_filter.h"
|
||||
#include "webrtc/test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -55,7 +55,6 @@ FecControllerStates CreateFecController(bool initial_fec_enabled) {
|
||||
std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
|
||||
new NiceMock<MockSmoothingFilter>());
|
||||
states.packet_loss_smoothed = mock_smoothing_filter.get();
|
||||
EXPECT_CALL(*states.packet_loss_smoothed, Die());
|
||||
using Threshold = FecController::Config::Threshold;
|
||||
states.controller.reset(new FecController(
|
||||
FecController::Config(
|
||||
@ -262,7 +261,6 @@ TEST(FecControllerTest, CheckBehaviorOnSpecialCurves) {
|
||||
std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
|
||||
new NiceMock<MockSmoothingFilter>());
|
||||
states.packet_loss_smoothed = mock_smoothing_filter.get();
|
||||
EXPECT_CALL(*states.packet_loss_smoothed, Die());
|
||||
using Threshold = FecController::Config::Threshold;
|
||||
states.controller.reset(new FecController(
|
||||
FecController::Config(
|
||||
@ -293,7 +291,6 @@ TEST(FecControllerDeathTest, InvalidConfig) {
|
||||
std::unique_ptr<MockSmoothingFilter> mock_smoothing_filter(
|
||||
new NiceMock<MockSmoothingFilter>());
|
||||
states.packet_loss_smoothed = mock_smoothing_filter.get();
|
||||
EXPECT_CALL(*states.packet_loss_smoothed, Die());
|
||||
using Threshold = FecController::Config::Threshold;
|
||||
EXPECT_DEATH(
|
||||
states.controller.reset(new FecController(
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/safe_conversions.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl.h"
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
*/
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/modules/audio_coding/audio_network_adaptor/smoothing_filter.h"
|
||||
#include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
#include "webrtc/test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -93,6 +93,7 @@ rtc_static_library("video_coding") {
|
||||
":webrtc_vp8",
|
||||
":webrtc_vp9",
|
||||
"../..:webrtc_common",
|
||||
"../../base:rtc_analytics",
|
||||
"../../common_video",
|
||||
"../../system_wrappers",
|
||||
]
|
||||
@ -124,6 +125,7 @@ rtc_static_library("video_coding_utility") {
|
||||
}
|
||||
|
||||
deps = [
|
||||
"../../base:rtc_analytics",
|
||||
"../../common_video",
|
||||
"../../system_wrappers",
|
||||
]
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/modules/video_coding/internal_defines.h"
|
||||
#include "webrtc/system_wrappers/include/trace.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -56,6 +56,7 @@ rtc_static_library("video") {
|
||||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../base:rtc_analytics",
|
||||
"../base:rtc_base_approved",
|
||||
"../base:rtc_task_queue",
|
||||
"../common_video",
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/common_video/include/frame_callback.h"
|
||||
#include "webrtc/system_wrappers/include/clock.h"
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/optional.h"
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/sequenced_task_checker.h"
|
||||
#include "webrtc/base/task_queue.h"
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/analytics/exp_filter.h"
|
||||
#include "webrtc/base/criticalsection.h"
|
||||
#include "webrtc/base/exp_filter.h"
|
||||
#include "webrtc/base/ratetracker.h"
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
#include "webrtc/common_types.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user