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