| 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_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 // Accessor to check if the audio processing is enabled or not. | 104 // Accessor to check if the audio processing is enabled or not. |
| 105 bool has_audio_processing() const { return audio_processing_ != NULL; } | 105 bool has_audio_processing() const { return audio_processing_ != NULL; } |
| 106 | 106 |
| 107 // AecDumpMessageFilter::AecDumpDelegate implementation. | 107 // AecDumpMessageFilter::AecDumpDelegate implementation. |
| 108 // Called on the main render thread. | 108 // Called on the main render thread. |
| 109 void OnAecDumpFile(const IPC::PlatformFileForTransit& file_handle) override; | 109 void OnAecDumpFile(const IPC::PlatformFileForTransit& file_handle) override; |
| 110 void OnDisableAecDump() override; | 110 void OnDisableAecDump() override; |
| 111 void OnIpcClosing() override; | 111 void OnIpcClosing() override; |
| 112 | 112 |
| 113 // Returns true if MediaStreamAudioProcessor would modify the audio signal, |
| 114 // based on the |constraints| and |effects_flags| parsed from a user media |
| 115 // request. If the audio signal would not be modified, there is no need to |
| 116 // instantiate a MediaStreamAudioProcessor and feed audio through it. Doing so |
| 117 // would waste a non-trivial amount of memory and CPU resources. |
| 118 // |
| 119 // See media::AudioParameters::PlatformEffectsMask for interpretation of |
| 120 // |effects_flags|. |
| 121 static bool WouldModifyAudio(const blink::WebMediaConstraints& constraints, |
| 122 int effects_flags); |
| 123 |
| 113 protected: | 124 protected: |
| 114 ~MediaStreamAudioProcessor() override; | 125 ~MediaStreamAudioProcessor() override; |
| 115 | 126 |
| 116 private: | 127 private: |
| 117 friend class MediaStreamAudioProcessorTest; | 128 friend class MediaStreamAudioProcessorTest; |
| 118 | 129 |
| 119 FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest, | 130 FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest, |
| 120 GetAecDumpMessageFilter); | 131 GetAecDumpMessageFilter); |
| 121 | 132 |
| 122 // WebRtcPlayoutDataSource::Sink implementation. | 133 // WebRtcPlayoutDataSource::Sink implementation. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Object for logging UMA stats for echo information when the AEC is enabled. | 226 // Object for logging UMA stats for echo information when the AEC is enabled. |
| 216 // Accessed on the main render thread. | 227 // Accessed on the main render thread. |
| 217 std::unique_ptr<EchoInformation> echo_information_; | 228 std::unique_ptr<EchoInformation> echo_information_; |
| 218 | 229 |
| 219 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); | 230 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); |
| 220 }; | 231 }; |
| 221 | 232 |
| 222 } // namespace content | 233 } // namespace content |
| 223 | 234 |
| 224 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ | 235 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| OLD | NEW |