OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "content/public/common/media_stream_request.h" | |
perkj_chrome
2014/04/08 10:28:12
this seems like a weird inclusion. This is not for
no longer working on chromium
2014/04/11 08:56:30
Done.
| |
11 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 12 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 class WebMediaConstraints; | 15 class WebMediaConstraints; |
15 } | 16 } |
16 | 17 |
17 namespace webrtc { | 18 namespace webrtc { |
18 | 19 |
19 class AudioFrame; | 20 class AudioFrame; |
20 class AudioProcessing; | 21 class AudioProcessing; |
21 class MediaConstraintsInterface; | 22 class MediaConstraintsInterface; |
22 class TypingDetection; | 23 class TypingDetection; |
23 | 24 |
24 } | 25 } |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
28 class RTCMediaConstraints; | 29 class RTCMediaConstraints; |
29 | 30 |
30 using webrtc::AudioProcessing; | 31 using webrtc::AudioProcessing; |
31 using webrtc::MediaConstraintsInterface; | 32 using webrtc::MediaConstraintsInterface; |
32 | 33 |
34 // Constraint keys used by audio processing. | |
35 // Specified by draft-alvestrand-constraints-resolution-00b. | |
perkj_chrome
2014/04/08 10:28:12
No- this comment is wrong. this draft has nothing
no longer working on chromium
2014/04/11 08:56:30
removed.
| |
36 extern const char kEchoCancellation[]; | |
37 extern const char kGoogEchoCancellation[]; | |
38 extern const char kGoogExperimentalEchoCancellation[]; | |
39 extern const char kGoogAutoGainControl[]; | |
40 extern const char kGoogExperimentalAutoGainControl[]; | |
41 extern const char kGoogNoiseSuppression[]; | |
42 extern const char kGoogExperimentalNoiseSuppression[]; | |
43 extern const char kGoogHighpassFilter[]; | |
44 extern const char kGoogTypingNoiseDetection[]; | |
45 extern const char kGoogAudioMirroring[]; | |
46 | |
33 // Merge |constraints| with |kDefaultAudioConstraints|. For any key which exists | 47 // Merge |constraints| with |kDefaultAudioConstraints|. For any key which exists |
34 // in both, the value from |constraints| is maintained, including its | 48 // in both, the value from |constraints| is maintained, including its |
35 // mandatory/optional status. New values from |kDefaultAudioConstraints| will | 49 // mandatory/optional status. New values from |kDefaultAudioConstraints| will |
36 // be added with mandatory status. | 50 // be added with mandatory status. |
37 void ApplyFixedAudioConstraints(RTCMediaConstraints* constraints); | 51 void ApplyFixedAudioConstraints(RTCMediaConstraints* constraints); |
38 | 52 |
39 // Checks if any audio constraints are set that requires audio processing to | 53 // Checks if any audio constraints are set that requires audio processing to |
40 // be applied. |effects| is the bitmasks telling whether certain platform | 54 // be applied. |effects| is the bitmasks telling whether certain platform |
41 // hardware audio effects are enabled, like hardware echo cancellation. If some | 55 // hardware audio effects are enabled, like hardware echo cancellation. If some |
42 // hardware effect is enabled, the corresponding software audio processing will | 56 // hardware effect is enabled, the corresponding software audio processing will |
43 // be disabled. | 57 // be disabled. |
44 bool NeedsAudioProcessing(const blink::WebMediaConstraints& constraints, | 58 bool NeedsAudioProcessing(const blink::WebMediaConstraints& constraints, |
45 int effects); | 59 int effects, MediaStreamType type); |
46 | 60 |
47 // Gets the property named by |key| from the |constraints|. | 61 // Gets the property named by |key| from the |constraints|. |
48 // Returns true if the key is found and has a valid boolean value; Otherwise | 62 // Returns true if the key is found and has a valid boolean value; Otherwise |
49 // false. | 63 // false. |
50 bool GetPropertyFromConstraints( | 64 bool GetPropertyFromConstraints( |
51 const MediaConstraintsInterface* constraints, | 65 const blink::WebMediaConstraints& constraints, |
52 const std::string& key); | 66 const std::string& key, |
67 int effects, | |
68 MediaStreamType type); | |
53 | 69 |
54 // Enables the echo cancellation in |audio_processing|. | 70 // Enables the echo cancellation in |audio_processing|. |
55 void EnableEchoCancellation(AudioProcessing* audio_processing); | 71 void EnableEchoCancellation(AudioProcessing* audio_processing); |
56 | 72 |
57 // Enables the noise suppression in |audio_processing|. | 73 // Enables the noise suppression in |audio_processing|. |
58 void EnableNoiseSuppression(AudioProcessing* audio_processing); | 74 void EnableNoiseSuppression(AudioProcessing* audio_processing); |
59 | 75 |
60 // Enables the experimental noise suppression in |audio_processing|. | 76 // Enables the experimental noise suppression in |audio_processing|. |
61 void EnableExperimentalNoiseSuppression(AudioProcessing* audio_processing); | 77 void EnableExperimentalNoiseSuppression(AudioProcessing* audio_processing); |
62 | 78 |
(...skipping 17 matching lines...) Expand all Loading... | |
80 void StopEchoCancellationDump(AudioProcessing* audio_processing); | 96 void StopEchoCancellationDump(AudioProcessing* audio_processing); |
81 | 97 |
82 void EnableAutomaticGainControl(AudioProcessing* audio_processing); | 98 void EnableAutomaticGainControl(AudioProcessing* audio_processing); |
83 | 99 |
84 void GetAecStats(AudioProcessing* audio_processing, | 100 void GetAecStats(AudioProcessing* audio_processing, |
85 webrtc::AudioProcessorInterface::AudioProcessorStats* stats); | 101 webrtc::AudioProcessorInterface::AudioProcessorStats* stats); |
86 | 102 |
87 } // namespace content | 103 } // namespace content |
88 | 104 |
89 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ | 105 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ |
OLD | NEW |