Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(634)

Side by Side Diff: content/renderer/media/media_stream_audio_processor_options.h

Issue 227743004: Added a kEchoCancellation constraint to turn off the audio processing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: addressed the comments. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 12 matching lines...) Expand all
23 23
24 } 24 }
25 25
26 namespace content { 26 namespace content {
27 27
28 class RTCMediaConstraints; 28 class RTCMediaConstraints;
29 29
30 using webrtc::AudioProcessing; 30 using webrtc::AudioProcessing;
31 using webrtc::MediaConstraintsInterface; 31 using webrtc::MediaConstraintsInterface;
32 32
33 // Constraint keys used by audio processing.
34 extern const char kEchoCancellation[];
35 extern const char kGoogEchoCancellation[];
36 extern const char kGoogExperimentalEchoCancellation[];
37 extern const char kGoogAutoGainControl[];
38 extern const char kGoogExperimentalAutoGainControl[];
39 extern const char kGoogNoiseSuppression[];
40 extern const char kGoogExperimentalNoiseSuppression[];
41 extern const char kGoogHighpassFilter[];
42 extern const char kGoogTypingNoiseDetection[];
43 extern const char kGoogAudioMirroring[];
44
33 // Merge |constraints| with |kDefaultAudioConstraints|. For any key which exists 45 // Merge |constraints| with |kDefaultAudioConstraints|. For any key which exists
34 // in both, the value from |constraints| is maintained, including its 46 // in both, the value from |constraints| is maintained, including its
35 // mandatory/optional status. New values from |kDefaultAudioConstraints| will 47 // mandatory/optional status. New values from |kDefaultAudioConstraints| will
36 // be added with mandatory status. 48 // be added with mandatory status.
37 void ApplyFixedAudioConstraints(RTCMediaConstraints* constraints); 49 void ApplyFixedAudioConstraints(RTCMediaConstraints* constraints);
38 50
39 // Checks if any audio constraints are set that requires audio processing to 51 // Checks if any audio constraints are set that requires audio processing to
40 // be applied. |effects| is the bitmasks telling whether certain platform 52 // be applied. |effects| is the bitmasks telling whether certain platform
41 // hardware audio effects are enabled, like hardware echo cancellation. If some 53 // hardware audio effects are enabled, like hardware echo cancellation. If some
42 // hardware effect is enabled, the corresponding software audio processing will 54 // hardware effect is enabled, the corresponding software audio processing will
43 // be disabled. 55 // be disabled.
44 bool NeedsAudioProcessing(const blink::WebMediaConstraints& constraints, 56 bool NeedsAudioProcessing(const blink::WebMediaConstraints& constraints,
45 int effects); 57 int effects);
46 58
47 // Gets the property named by |key| from the |constraints|. 59 // Gets the property named by |key| from the |constraints|.
48 // Returns true if the key is found and has a valid boolean value; Otherwise 60 // Returns true if the key is found and has a valid boolean value; Otherwise
perkj_chrome 2014/04/11 11:45:04 "and has a valid boolean value that is true." I t
no longer working on chromium 2014/04/11 16:47:05 Returning two values might not be the best. The u
49 // false. 61 // false.
perkj_chrome 2014/04/11 11:45:04 document |effects|
no longer working on chromium 2014/04/11 16:47:05 Added comment to the constructor of the new MediaA
50 bool GetPropertyFromConstraints( 62 bool GetPropertyFromConstraints(
perkj_chrome 2014/04/11 11:45:04 I think you have to but these functions in class s
no longer working on chromium 2014/04/11 16:47:05 Done.
51 const MediaConstraintsInterface* constraints, 63 const blink::WebMediaConstraints& constraints,
52 const std::string& key); 64 const std::string& key,
65 int effects);
66
67 // Returns true if all the mandatory constraints in |constraints| are valid;
68 // Otherwise return false.
69 bool IsValid(const blink::WebMediaConstraints& constraints);
perkj_chrome 2014/04/11 11:45:04 dito - this is audio specific.
no longer working on chromium 2014/04/11 16:47:05 Done.
53 70
54 // Enables the echo cancellation in |audio_processing|. 71 // Enables the echo cancellation in |audio_processing|.
55 void EnableEchoCancellation(AudioProcessing* audio_processing); 72 void EnableEchoCancellation(AudioProcessing* audio_processing);
56 73
57 // Enables the noise suppression in |audio_processing|. 74 // Enables the noise suppression in |audio_processing|.
58 void EnableNoiseSuppression(AudioProcessing* audio_processing); 75 void EnableNoiseSuppression(AudioProcessing* audio_processing);
59 76
60 // Enables the experimental noise suppression in |audio_processing|. 77 // Enables the experimental noise suppression in |audio_processing|.
61 void EnableExperimentalNoiseSuppression(AudioProcessing* audio_processing); 78 void EnableExperimentalNoiseSuppression(AudioProcessing* audio_processing);
62 79
(...skipping 17 matching lines...) Expand all
80 void StopEchoCancellationDump(AudioProcessing* audio_processing); 97 void StopEchoCancellationDump(AudioProcessing* audio_processing);
81 98
82 void EnableAutomaticGainControl(AudioProcessing* audio_processing); 99 void EnableAutomaticGainControl(AudioProcessing* audio_processing);
83 100
84 void GetAecStats(AudioProcessing* audio_processing, 101 void GetAecStats(AudioProcessing* audio_processing,
85 webrtc::AudioProcessorInterface::AudioProcessorStats* stats); 102 webrtc::AudioProcessorInterface::AudioProcessorStats* stats);
86 103
87 } // namespace content 104 } // namespace content
88 105
89 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ 106 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698