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

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

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use gfx::Point3F. Created 5 years, 3 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_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/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
11 #include "base/threading/thread_checker.h" 11 #include "base/threading/thread_checker.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/public/common/media_stream_request.h"
14 #include "content/renderer/media/aec_dump_message_filter.h" 15 #include "content/renderer/media/aec_dump_message_filter.h"
15 #include "content/renderer/media/webrtc_audio_device_impl.h" 16 #include "content/renderer/media/webrtc_audio_device_impl.h"
16 #include "media/base/audio_converter.h" 17 #include "media/base/audio_converter.h"
17 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" 18 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
18 #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h " 19 #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h "
19 20
20 namespace blink { 21 namespace blink {
21 class WebMediaConstraints; 22 class WebMediaConstraints;
22 } 23 }
23 24
(...skipping 21 matching lines...) Expand all
45 // on the getUserMedia constraints, processes the data and outputs it in a unit 46 // on the getUserMedia constraints, processes the data and outputs it in a unit
46 // of 10 ms data chunk. 47 // of 10 ms data chunk.
47 class CONTENT_EXPORT MediaStreamAudioProcessor : 48 class CONTENT_EXPORT MediaStreamAudioProcessor :
48 NON_EXPORTED_BASE(public WebRtcPlayoutDataSource::Sink), 49 NON_EXPORTED_BASE(public WebRtcPlayoutDataSource::Sink),
49 NON_EXPORTED_BASE(public AudioProcessorInterface), 50 NON_EXPORTED_BASE(public AudioProcessorInterface),
50 NON_EXPORTED_BASE(public AecDumpMessageFilter::AecDumpDelegate) { 51 NON_EXPORTED_BASE(public AecDumpMessageFilter::AecDumpDelegate) {
51 public: 52 public:
52 // |playout_data_source| is used to register this class as a sink to the 53 // |playout_data_source| is used to register this class as a sink to the
53 // WebRtc playout data for processing AEC. If clients do not enable AEC, 54 // WebRtc playout data for processing AEC. If clients do not enable AEC,
54 // |playout_data_source| won't be used. 55 // |playout_data_source| won't be used.
55 MediaStreamAudioProcessor(const blink::WebMediaConstraints& constraints, 56 MediaStreamAudioProcessor(
56 int effects, 57 const blink::WebMediaConstraints& constraints,
57 WebRtcPlayoutDataSource* playout_data_source); 58 const MediaStreamDevice::AudioDeviceParameters& input_params,
59 WebRtcPlayoutDataSource* playout_data_source);
58 60
59 // Called when the format of the capture data has changed. 61 // Called when the format of the capture data has changed.
60 // Called on the main render thread. The caller is responsible for stopping 62 // Called on the main render thread. The caller is responsible for stopping
61 // the capture thread before calling this method. 63 // the capture thread before calling this method.
62 // After this method, the capture thread will be changed to a new capture 64 // After this method, the capture thread will be changed to a new capture
63 // thread. 65 // thread.
64 void OnCaptureFormatChanged(const media::AudioParameters& source_params); 66 void OnCaptureFormatChanged(const media::AudioParameters& source_params);
65 67
66 // Pushes capture data in |audio_source| to the internal FIFO. Each call to 68 // Pushes capture data in |audio_source| to the internal FIFO. Each call to
67 // this method should be followed by calls to ProcessAndConsumeData() while 69 // this method should be followed by calls to ProcessAndConsumeData() while
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 int sample_rate, 120 int sample_rate,
119 int audio_delay_milliseconds) override; 121 int audio_delay_milliseconds) override;
120 void OnPlayoutDataSourceChanged() override; 122 void OnPlayoutDataSourceChanged() override;
121 123
122 // webrtc::AudioProcessorInterface implementation. 124 // webrtc::AudioProcessorInterface implementation.
123 // This method is called on the libjingle thread. 125 // This method is called on the libjingle thread.
124 void GetStats(AudioProcessorStats* stats) override; 126 void GetStats(AudioProcessorStats* stats) override;
125 127
126 // Helper to initialize the WebRtc AudioProcessing. 128 // Helper to initialize the WebRtc AudioProcessing.
127 void InitializeAudioProcessingModule( 129 void InitializeAudioProcessingModule(
128 const blink::WebMediaConstraints& constraints, int effects); 130 const blink::WebMediaConstraints& constraints,
131 const MediaStreamDevice::AudioDeviceParameters& input_params);
129 132
130 // Helper to initialize the capture converter. 133 // Helper to initialize the capture converter.
131 void InitializeCaptureFifo(const media::AudioParameters& input_format); 134 void InitializeCaptureFifo(const media::AudioParameters& input_format);
132 135
133 // Helper to initialize the render converter. 136 // Helper to initialize the render converter.
134 void InitializeRenderFifoIfNeeded(int sample_rate, 137 void InitializeRenderFifoIfNeeded(int sample_rate,
135 int number_of_channels, 138 int number_of_channels,
136 int frames_per_buffer); 139 int frames_per_buffer);
137 140
138 // Called by ProcessAndConsumeData(). 141 // Called by ProcessAndConsumeData().
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // Object for logging echo information when the AEC is enabled. Accessible by 200 // Object for logging echo information when the AEC is enabled. Accessible by
198 // the libjingle thread through GetStats(). 201 // the libjingle thread through GetStats().
199 scoped_ptr<EchoInformation> echo_information_; 202 scoped_ptr<EchoInformation> echo_information_;
200 203
201 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); 204 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor);
202 }; 205 };
203 206
204 } // namespace content 207 } // namespace content
205 208
206 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ 209 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698