LeviLamina
Loading...
Searching...
No Matches
AudioProcessing.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/external/webrtc/ArrayView.h"
7#include "mc/external/webrtc/RefCountInterface.h"
8
9// auto generated forward declare list
10// clang-format off
11namespace webrtc { class AecDump; }
12namespace webrtc { class ProcessingConfig; }
13namespace webrtc { class StreamConfig; }
14namespace webrtc { class TaskQueueBase; }
15namespace webrtc { struct AudioProcessingStats; }
16// clang-format on
17
18namespace webrtc {
19
21public:
22 // AudioProcessing inner types declare
23 // clang-format off
24 struct Config;
25 class RuntimeSetting;
26 // clang-format on
27
28 // AudioProcessing inner types define
29 enum class Error : int {
30 KNoError = 0,
31 KUnspecifiedError = -1,
32 KCreationFailedError = -2,
33 KUnsupportedComponentError = -3,
34 KUnsupportedFunctionError = -4,
35 KNullPointerError = -5,
36 KBadParameterError = -6,
37 KBadSampleRateError = -7,
38 KBadDataLengthError = -8,
39 KBadNumberChannelsError = -9,
40 KFileError = -10,
41 KStreamParameterNotSetError = -11,
42 KNotEnabledError = -12,
43 KBadStreamParameterWarning = -13,
44 };
45
46 enum class NativeRate : int {
47 KSampleRate8kHz = 8000,
48 KSampleRate16kHz = 16000,
49 KSampleRate32kHz = 32000,
50 KSampleRate48kHz = 48000,
51 };
52
53 struct Config {
54 public:
55 // Config inner types declare
56 // clang-format off
58 struct EchoCanceller;
59 struct GainController1;
60 struct GainController2;
61 struct HighPassFilter;
62 struct NoiseSuppression;
63 struct Pipeline;
64 struct PreAmplifier;
66 // clang-format on
67
68 // Config inner types define
69 struct CaptureLevelAdjustment {
70 public:
71 // CaptureLevelAdjustment inner types declare
72 // clang-format off
74 // clang-format on
75
76 // CaptureLevelAdjustment inner types define
77 struct AnalogMicGainEmulation {
78 public:
79 // member variables
80 // NOLINTBEGIN
83 // NOLINTEND
84
85 public:
86 // prevent constructor by default
87 AnalogMicGainEmulation& operator=(AnalogMicGainEmulation const&);
88 AnalogMicGainEmulation(AnalogMicGainEmulation const&);
89 AnalogMicGainEmulation();
90 };
91
92 public:
93 // member variables
94 // NOLINTBEGIN
99 // NOLINTEND
100
101 public:
102 // prevent constructor by default
103 CaptureLevelAdjustment& operator=(CaptureLevelAdjustment const&);
104 CaptureLevelAdjustment(CaptureLevelAdjustment const&);
105 CaptureLevelAdjustment();
106 };
107
108 struct EchoCanceller {
109 public:
110 // member variables
111 // NOLINTBEGIN
116 // NOLINTEND
117
118 public:
119 // prevent constructor by default
120 EchoCanceller& operator=(EchoCanceller const&);
121 EchoCanceller(EchoCanceller const&);
122 EchoCanceller();
123 };
124
125 struct GainController1 {
126 public:
127 // GainController1 inner types declare
128 // clang-format off
130 // clang-format on
131
132 // GainController1 inner types define
133 enum class Mode : int {
134 KAdaptiveAnalog = 0,
135 KAdaptiveDigital = 1,
136 KFixedDigital = 2,
137 };
138
139 struct AnalogGainController {
140 public:
141 // AnalogGainController inner types declare
142 // clang-format off
143 struct ClippingPredictor;
144 // clang-format on
145
146 // AnalogGainController inner types define
147 struct ClippingPredictor {
148 public:
149 // ClippingPredictor inner types define
150 enum class Mode : int {
151 KClippingEventPrediction = 0,
152 KAdaptiveStepClippingPeakPrediction = 1,
153 KFixedStepClippingPeakPrediction = 2,
154 };
155
156 public:
157 // member variables
158 // NOLINTBEGIN
167 // NOLINTEND
168
169 public:
170 // prevent constructor by default
171 ClippingPredictor& operator=(ClippingPredictor const&);
172 ClippingPredictor(ClippingPredictor const&);
173 ClippingPredictor();
174 };
175
176 public:
177 // member variables
178 // NOLINTBEGIN
187 // NOLINTEND
188
189 public:
190 // prevent constructor by default
191 AnalogGainController& operator=(AnalogGainController const&);
192 AnalogGainController(AnalogGainController const&);
193 AnalogGainController();
194 };
195
196 public:
197 // member variables
198 // NOLINTBEGIN
205 // NOLINTEND
206
207 public:
208 // prevent constructor by default
209 GainController1& operator=(GainController1 const&);
210 GainController1(GainController1 const&);
211 GainController1();
212 };
213
214 struct GainController2 {
215 public:
216 // GainController2 inner types declare
217 // clang-format off
218 struct AdaptiveDigital;
219 struct FixedDigital;
221 // clang-format on
222
223 // GainController2 inner types define
224 struct AdaptiveDigital {
225 public:
226 // member variables
227 // NOLINTBEGIN
234 // NOLINTEND
235
236 public:
237 // prevent constructor by default
238 AdaptiveDigital& operator=(AdaptiveDigital const&);
239 AdaptiveDigital(AdaptiveDigital const&);
240 AdaptiveDigital();
241 };
242
243 struct FixedDigital {
244 public:
245 // member variables
246 // NOLINTBEGIN
248 // NOLINTEND
249
250 public:
251 // prevent constructor by default
252 FixedDigital& operator=(FixedDigital const&);
253 FixedDigital(FixedDigital const&);
254 FixedDigital();
255 };
256
257 struct InputVolumeController {
258 public:
259 // member variables
260 // NOLINTBEGIN
262 // NOLINTEND
263
264 public:
265 // prevent constructor by default
266 InputVolumeController& operator=(InputVolumeController const&);
267 InputVolumeController(InputVolumeController const&);
268 InputVolumeController();
269 };
270
271 public:
272 // member variables
273 // NOLINTBEGIN
278 // NOLINTEND
279
280 public:
281 // prevent constructor by default
282 GainController2& operator=(GainController2 const&);
283 GainController2(GainController2 const&);
284 GainController2();
285 };
286
287 struct HighPassFilter {
288 public:
289 // member variables
290 // NOLINTBEGIN
293 // NOLINTEND
294
295 public:
296 // prevent constructor by default
297 HighPassFilter& operator=(HighPassFilter const&);
298 HighPassFilter(HighPassFilter const&);
299 HighPassFilter();
300 };
301
302 struct NoiseSuppression {
303 public:
304 // NoiseSuppression inner types define
305 enum class Level : int {
306 KLow = 0,
307 KModerate = 1,
308 KHigh = 2,
309 KVeryHigh = 3,
310 };
311
312 public:
313 // member variables
314 // NOLINTBEGIN
318 // NOLINTEND
319
320 public:
321 // prevent constructor by default
322 NoiseSuppression& operator=(NoiseSuppression const&);
323 NoiseSuppression(NoiseSuppression const&);
324 NoiseSuppression();
325 };
326
327 struct Pipeline {
328 public:
329 // Pipeline inner types define
330 enum class DownmixMethod : int {
331 KAverageChannels = 0,
332 KUseFirstChannel = 1,
333 };
334
335 public:
336 // member variables
337 // NOLINTBEGIN
342 // NOLINTEND
343
344 public:
345 // prevent constructor by default
346 Pipeline& operator=(Pipeline const&);
347 Pipeline(Pipeline const&);
348 Pipeline();
349 };
350
351 struct PreAmplifier {
352 public:
353 // member variables
354 // NOLINTBEGIN
357 // NOLINTEND
358
359 public:
360 // prevent constructor by default
361 PreAmplifier& operator=(PreAmplifier const&);
362 PreAmplifier(PreAmplifier const&);
363 PreAmplifier();
364 };
365
366 struct TransientSuppression {
367 public:
368 // member variables
369 // NOLINTBEGIN
371 // NOLINTEND
372
373 public:
374 // prevent constructor by default
375 TransientSuppression& operator=(TransientSuppression const&);
376 TransientSuppression(TransientSuppression const&);
377 TransientSuppression();
378 };
379
380 public:
381 // member variables
382 // NOLINTBEGIN
392 // NOLINTEND
393
394 public:
395 // prevent constructor by default
396 Config& operator=(Config const&);
397 Config(Config const&);
398 Config();
399 };
400
401 class RuntimeSetting {
402 public:
403 // RuntimeSetting inner types declare
404 // clang-format off
406 // clang-format on
407
408 // RuntimeSetting inner types define
409 enum class Type : int {
410 KNotSpecified = 0,
411 KCapturePreGain = 1,
412 KCaptureCompressionGain = 2,
413 KCaptureFixedPostGain = 3,
414 KPlayoutVolumeChange = 4,
415 KCustomRenderProcessingRuntimeSetting = 5,
416 KPlayoutAudioDeviceChange = 6,
417 KCapturePostGain = 7,
418 KCaptureOutputUsed = 8,
419 };
420
421 struct PlayoutAudioDeviceInfo {
422 public:
423 // member variables
424 // NOLINTBEGIN
427 // NOLINTEND
428
429 public:
430 // prevent constructor by default
431 PlayoutAudioDeviceInfo& operator=(PlayoutAudioDeviceInfo const&);
432 PlayoutAudioDeviceInfo(PlayoutAudioDeviceInfo const&);
433 PlayoutAudioDeviceInfo();
434 };
435
436 union U {
437 public:
438 // member variables
439 // NOLINTBEGIN
444 // NOLINTEND
445 };
446
447 public:
448 // member variables
449 // NOLINTBEGIN
452 // NOLINTEND
453
454 public:
455 // prevent constructor by default
456 RuntimeSetting& operator=(RuntimeSetting const&);
457 RuntimeSetting(RuntimeSetting const&);
458 RuntimeSetting();
459 };
460
461public:
462 // virtual functions
463 // NOLINTBEGIN
464 virtual ~AudioProcessing() /*override*/ = default;
465
466 virtual int Initialize() = 0;
467
468 virtual int Initialize(::webrtc::ProcessingConfig const&) = 0;
469
470 virtual void ApplyConfig(::webrtc::AudioProcessing::Config const&) = 0;
471
472 virtual int proc_sample_rate_hz() const = 0;
473
474 virtual int proc_split_sample_rate_hz() const = 0;
475
476 virtual uint64 num_input_channels() const = 0;
477
478 virtual uint64 num_proc_channels() const = 0;
479
480 virtual uint64 num_output_channels() const = 0;
481
482 virtual uint64 num_reverse_channels() const = 0;
483
484 virtual void set_output_will_be_muted(bool) = 0;
485
486 virtual void SetRuntimeSetting(::webrtc::AudioProcessing::RuntimeSetting) = 0;
487
488 virtual bool PostRuntimeSetting(::webrtc::AudioProcessing::RuntimeSetting) = 0;
489
490 virtual int
491 ProcessStream(short const* const, ::webrtc::StreamConfig const&, ::webrtc::StreamConfig const&, short* const) = 0;
492
493 virtual int
494 ProcessStream(float const* const*, ::webrtc::StreamConfig const&, ::webrtc::StreamConfig const&, float* const*) = 0;
495
496 virtual int ProcessReverseStream(
497 short const* const,
500 short* const
501 ) = 0;
502
503 virtual int ProcessReverseStream(
504 float const* const*,
507 float* const*
508 ) = 0;
509
510 virtual int AnalyzeReverseStream(float const* const*, ::webrtc::StreamConfig const&) = 0;
511
512 virtual bool GetLinearAecOutput(::webrtc::ArrayView<::std::array<float, 160>>) const = 0;
513
514 virtual void set_stream_analog_level(int) = 0;
515
516 virtual int recommended_stream_analog_level() const = 0;
517
518 virtual int set_stream_delay_ms(int) = 0;
519
520 virtual int stream_delay_ms() const = 0;
521
522 virtual void set_stream_key_pressed(bool) = 0;
523
524 virtual bool CreateAndAttachAecDump(::std::string_view, int64, ::webrtc::TaskQueueBase*) = 0;
525
526 virtual bool CreateAndAttachAecDump(::_iobuf*, int64, ::webrtc::TaskQueueBase*) = 0;
527
528 virtual void AttachAecDump(::std::unique_ptr<::webrtc::AecDump>) = 0;
529
530 virtual void DetachAecDump() = 0;
531
532 virtual ::webrtc::AudioProcessingStats GetStatistics() = 0;
533
534 virtual ::webrtc::AudioProcessingStats GetStatistics(bool) = 0;
535
536 virtual ::webrtc::AudioProcessing::Config GetConfig() const = 0;
537 // NOLINTEND
538};
539
540} // namespace webrtc
Definition AecDump.h:7
Definition ArrayView.h:8
Definition AudioProcessing.h:401
Definition AudioProcessing.h:20
Definition ProcessingConfig.h:7
Definition RefCountInterface.h:10
Definition StreamConfig.h:7
Definition TaskQueueBase.h:16
Definition Alias.h:14
Definition AudioProcessingStats.h:7
Definition AudioProcessing.h:108
Definition AudioProcessing.h:125
Definition AudioProcessing.h:214
Definition AudioProcessing.h:287
Definition AudioProcessing.h:327
Definition AudioProcessing.h:351
Definition AudioProcessing.h:53
Definition AudioProcessing.h:436