| 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" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/public/common/media_stream_request.h" | 15 #include "content/public/common/media_stream_request.h" |
| 16 #include "content/renderer/media/aec_dump_message_filter.h" | 16 #include "content/renderer/media/aec_dump_message_filter.h" |
| 17 #include "content/renderer/media/audio_repetition_detector.h" |
| 17 #include "content/renderer/media/webrtc_audio_device_impl.h" | 18 #include "content/renderer/media/webrtc_audio_device_impl.h" |
| 18 #include "media/base/audio_converter.h" | 19 #include "media/base/audio_converter.h" |
| 19 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 20 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
| 20 #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h
" | 21 #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h
" |
| 21 | 22 |
| 22 namespace blink { | 23 namespace blink { |
| 23 class WebMediaConstraints; | 24 class WebMediaConstraints; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace media { | 27 namespace media { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // Called on the main render thread. | 107 // Called on the main render thread. |
| 107 void OnAecDumpFile(const IPC::PlatformFileForTransit& file_handle) override; | 108 void OnAecDumpFile(const IPC::PlatformFileForTransit& file_handle) override; |
| 108 void OnDisableAecDump() override; | 109 void OnDisableAecDump() override; |
| 109 void OnIpcClosing() override; | 110 void OnIpcClosing() override; |
| 110 | 111 |
| 111 protected: | 112 protected: |
| 112 ~MediaStreamAudioProcessor() override; | 113 ~MediaStreamAudioProcessor() override; |
| 113 | 114 |
| 114 private: | 115 private: |
| 115 friend class MediaStreamAudioProcessorTest; | 116 friend class MediaStreamAudioProcessorTest; |
| 117 |
| 116 FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest, | 118 FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest, |
| 117 GetAecDumpMessageFilter); | 119 GetAecDumpMessageFilter); |
| 118 | 120 |
| 119 // WebRtcPlayoutDataSource::Sink implementation. | 121 // WebRtcPlayoutDataSource::Sink implementation. |
| 120 void OnPlayoutData(media::AudioBus* audio_bus, | 122 void OnPlayoutData(media::AudioBus* audio_bus, |
| 121 int sample_rate, | 123 int sample_rate, |
| 122 int audio_delay_milliseconds) override; | 124 int audio_delay_milliseconds) override; |
| 123 void OnPlayoutDataSourceChanged() override; | 125 void OnPlayoutDataSourceChanged() override; |
| 124 | 126 |
| 125 // webrtc::AudioProcessorInterface implementation. | 127 // webrtc::AudioProcessorInterface implementation. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 146 int process_frames, | 148 int process_frames, |
| 147 base::TimeDelta capture_delay, | 149 base::TimeDelta capture_delay, |
| 148 int volume, | 150 int volume, |
| 149 bool key_pressed, | 151 bool key_pressed, |
| 150 float* const* output_ptrs); | 152 float* const* output_ptrs); |
| 151 | 153 |
| 152 // Cached value for the render delay latency. This member is accessed by | 154 // Cached value for the render delay latency. This member is accessed by |
| 153 // both the capture audio thread and the render audio thread. | 155 // both the capture audio thread and the render audio thread. |
| 154 base::subtle::Atomic32 render_delay_ms_; | 156 base::subtle::Atomic32 render_delay_ms_; |
| 155 | 157 |
| 158 // Module to detect and report (to UMA) bit exact audio repetition. |
| 159 scoped_ptr<AudioRepetitionDetector> audio_repetition_detector_; |
| 160 |
| 156 // Module to handle processing and format conversion. | 161 // Module to handle processing and format conversion. |
| 157 scoped_ptr<webrtc::AudioProcessing> audio_processing_; | 162 scoped_ptr<webrtc::AudioProcessing> audio_processing_; |
| 158 | 163 |
| 159 // FIFO to provide 10 ms capture chunks. | 164 // FIFO to provide 10 ms capture chunks. |
| 160 scoped_ptr<MediaStreamAudioFifo> capture_fifo_; | 165 scoped_ptr<MediaStreamAudioFifo> capture_fifo_; |
| 161 // Receives processing output. | 166 // Receives processing output. |
| 162 scoped_ptr<MediaStreamAudioBus> output_bus_; | 167 scoped_ptr<MediaStreamAudioBus> output_bus_; |
| 163 | 168 |
| 164 // FIFO to provide 10 ms render chunks when the AEC is enabled. | 169 // FIFO to provide 10 ms render chunks when the AEC is enabled. |
| 165 scoped_ptr<MediaStreamAudioFifo> render_fifo_; | 170 scoped_ptr<MediaStreamAudioFifo> render_fifo_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // Object for logging echo information when the AEC is enabled. Accessible by | 206 // Object for logging echo information when the AEC is enabled. Accessible by |
| 202 // the libjingle thread through GetStats(). | 207 // the libjingle thread through GetStats(). |
| 203 scoped_ptr<EchoInformation> echo_information_; | 208 scoped_ptr<EchoInformation> echo_information_; |
| 204 | 209 |
| 205 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); | 210 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); |
| 206 }; | 211 }; |
| 207 | 212 |
| 208 } // namespace content | 213 } // namespace content |
| 209 | 214 |
| 210 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ | 215 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| OLD | NEW |