OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AEC_DUMP_H_ | |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AEC_DUMP_H_ | |
13 | |
14 #include <memory> | |
15 #include <string> | |
16 #include <vector> | |
17 | |
18 #include "webrtc/base/array_view.h" | |
19 | |
20 namespace audioproc { | |
21 class Event; | |
22 } // namespace audioproc | |
23 | |
24 namespace webrtc { | |
25 | |
26 class AudioFrame; | |
27 | |
28 // Struct for passing current config from APM without having to | |
29 // include protobuf headers. | |
30 struct InternalAPMConfig { | |
31 InternalAPMConfig(); | |
32 | |
33 InternalAPMConfig(const InternalAPMConfig&) = delete; | |
peah-webrtc
2017/04/19 12:30:29
Is it not possible to use the functionality in con
aleloi
2017/04/20 15:26:24
RTC_DISABLE only works for the non-move versions.
| |
34 InternalAPMConfig(const InternalAPMConfig&&) = delete; | |
35 InternalAPMConfig& operator=(const InternalAPMConfig&) = delete; | |
36 InternalAPMConfig& operator=(const InternalAPMConfig&&) = delete; | |
37 | |
38 bool aec_enabled = false; | |
39 bool aec_delay_agnostic_enabled = false; | |
40 bool aec_drift_compensation_enabled = false; | |
41 bool aec_extended_filter_enabled = false; | |
42 int aec_suppression_level = 0; | |
43 bool aecm_enabled = false; | |
44 bool aecm_comfort_noise_enabled = false; | |
45 int aecm_routing_mode = 0; | |
46 bool agc_enabled = false; | |
47 int agc_mode = 0; | |
48 bool agc_limiter_enabled = false; | |
49 bool hpf_enabled = false; | |
50 bool ns_enabled = false; | |
51 int ns_level = 0; | |
52 bool transient_suppression_enabled = false; | |
53 bool intelligibility_enhancer_enabled = false; | |
54 bool noise_robust_agc_enabled = false; | |
55 std::string experiments_description = ""; | |
56 }; | |
57 | |
58 struct InternalAPMStreamsConfig { | |
59 int input_sample_rate = 0; | |
60 int output_sample_rate = 0; | |
61 int render_input_sample_rate = 0; | |
62 int render_output_sample_rate = 0; | |
63 | |
64 size_t input_num_channels = 0; | |
65 size_t output_num_channels = 0; | |
66 size_t render_input_num_channels = 0; | |
67 size_t render_output_num_channels = 0; | |
68 }; | |
69 | |
70 class AecDump { | |
71 public: | |
72 // A capture stream frame is logged before and after processing in | |
73 // the same protobuf message. To facilitate that, a CaptureStreamInfo | |
74 // instance is first filled with Input, then Output. | |
75 // | |
76 // To log an input/output pair, first call | |
77 // AecDump::GetCaptureStreamInfo. Add the input and output to | |
78 // it. Then call AecDump::WriteCaptureStreamMessage. | |
79 class CaptureStreamInfo { | |
80 public: | |
81 virtual ~CaptureStreamInfo() = default; | |
82 virtual void AddInput( | |
83 const std::vector<rtc::ArrayView<const float>>& src) = 0; | |
84 virtual void AddOutput( | |
85 const std::vector<rtc::ArrayView<const float>>& src) = 0; | |
86 | |
87 virtual void AddInput(const AudioFrame& frame) = 0; | |
88 virtual void AddOutput(const AudioFrame& frame) = 0; | |
89 | |
90 virtual void set_delay(int delay) = 0; | |
91 virtual void set_drift(int drift) = 0; | |
92 virtual void set_level(int level) = 0; | |
93 virtual void set_keypress(bool keypress) = 0; | |
94 }; | |
95 | |
96 virtual ~AecDump() = default; | |
97 | |
98 static std::unique_ptr<AecDump> CreateNullDump(); | |
peah-webrtc
2017/04/19 12:30:29
Is this still needed?
aleloi
2017/04/20 15:26:24
No. Now removed, thank you.
| |
99 | |
100 virtual std::unique_ptr<CaptureStreamInfo> GetCaptureStreamInfo() = 0; | |
101 | |
102 // The Write* methods are always safe to call concurrently or | |
103 // otherwise for all implementing subclasses. The intended mode of | |
104 // operation is to create a protobuf object from the input, and send | |
105 // it away to be written to file asynchronously. | |
106 virtual void WriteInitMessage( | |
107 const InternalAPMStreamsConfig& streams_config) = 0; | |
108 | |
109 virtual void WriteRenderStreamMessage(const AudioFrame& frame) = 0; | |
110 | |
111 virtual void WriteRenderStreamMessage( | |
112 const std::vector<rtc::ArrayView<const float>>& src) = 0; | |
113 | |
114 virtual void WriteCaptureStreamMessage( | |
115 std::unique_ptr<CaptureStreamInfo> stream_info) = 0; | |
116 | |
117 // If not |forced|, only writes the current config if it is | |
118 // different from the last saved one; if |forced|, writes the config | |
119 // regardless of the last saved. | |
120 virtual void WriteConfig(const InternalAPMConfig& config, bool forced) = 0; | |
121 }; | |
122 } // namespace webrtc | |
123 | |
124 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AEC_DUMP_H_ | |
OLD | NEW |