blob: 6057ae1f75f25f5068152d12b829e141835cc605 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_
#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_
#include <string>
namespace blink {
class WebMediaConstraints;
}
namespace webrtc {
class AudioFrame;
class AudioProcessing;
class MediaConstraintsInterface;
}
namespace content {
class RTCMediaConstraints;
using webrtc::AudioProcessing;
using webrtc::MediaConstraintsInterface;
// Merge |constraints| with |kDefaultAudioConstraints|. For any key which exists
// in both, the value from |constraints| is maintained, including its
// mandatory/optional status. New values from |kDefaultAudioConstraints| will
// be added with mandatory status.
void ApplyFixedAudioConstraints(RTCMediaConstraints* constraints);
// Checks if any audio constraints are set that requires audio processing to
// be applied. |effects| is the bitmasks telling whether certain platform
// hardware audio effects are enabled, like hardware echo cancellation. If some
// hardware effect is enabled, the corresponding software audio processing will
// be disabled.
bool NeedsAudioProcessing(const blink::WebMediaConstraints& constraints,
int effects);
// Gets the property named by |key| from the |constraints|.
// Returns true if the key is found and has a valid boolean value; Otherwise
// false.
bool GetPropertyFromConstraints(
const MediaConstraintsInterface* constraints,
const std::string& key);
// Enables the echo cancellation in |audio_processing|.
void EnableEchoCancellation(AudioProcessing* audio_processing);
// Enables the noise suppression in |audio_processing|.
void EnableNoiseSuppression(AudioProcessing* audio_processing);
// Enables the high pass filter in |audio_processing|.
void EnableHighPassFilter(AudioProcessing* audio_processing);
// Enables the typing detection in |audio_processing|.
void EnableTypingDetection(AudioProcessing* audio_processing);
// Enables the experimental echo cancellation in |audio_processing|.
void EnableExperimentalEchoCancellation(AudioProcessing* audio_processing);
// Starts the echo cancellation dump in |audio_processing|.
void StartAecDump(AudioProcessing* audio_processing);
// Stops the echo cancellation dump in |audio_processing|.
void StopAecDump(AudioProcessing* audio_processing);
void EnableAutomaticGainControl(AudioProcessing* audio_processing);
} // namespace content
#endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_
|