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

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

Issue 1528473003: Feed the WebRTC APM with empty far-end frames for the number of frames skipped by OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review. Rebase. Created 5 years 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
« no previous file with comments | « no previous file | content/renderer/media/media_stream_audio_processor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 private: 115 private:
116 friend class MediaStreamAudioProcessorTest; 116 friend class MediaStreamAudioProcessorTest;
117 117
118 FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest, 118 FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioProcessorTest,
119 GetAecDumpMessageFilter); 119 GetAecDumpMessageFilter);
120 120
121 // WebRtcPlayoutDataSource::Sink implementation. 121 // WebRtcPlayoutDataSource::Sink implementation.
122 void OnPlayoutData(media::AudioBus* audio_bus, 122 void OnPlayoutData(media::AudioBus* audio_bus,
123 int sample_rate, 123 int sample_rate,
124 int audio_delay_milliseconds) override; 124 int audio_delay_milliseconds,
125 uint32_t skipped_frames) override;
125 void OnPlayoutDataSourceChanged() override; 126 void OnPlayoutDataSourceChanged() override;
126 127
127 // webrtc::AudioProcessorInterface implementation. 128 // webrtc::AudioProcessorInterface implementation.
128 // This method is called on the libjingle thread. 129 // This method is called on the libjingle thread.
129 void GetStats(AudioProcessorStats* stats) override; 130 void GetStats(AudioProcessorStats* stats) override;
130 131
131 // Helper to initialize the WebRtc AudioProcessing. 132 // Helper to initialize the WebRtc AudioProcessing.
132 void InitializeAudioProcessingModule( 133 void InitializeAudioProcessingModule(
133 const blink::WebMediaConstraints& constraints, 134 const blink::WebMediaConstraints& constraints,
134 const MediaStreamDevice::AudioDeviceParameters& input_params); 135 const MediaStreamDevice::AudioDeviceParameters& input_params);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Communication with browser for AEC dump. 201 // Communication with browser for AEC dump.
201 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; 202 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
202 203
203 // Flag to avoid executing Stop() more than once. 204 // Flag to avoid executing Stop() more than once.
204 bool stopped_; 205 bool stopped_;
205 206
206 // Object for logging echo information when the AEC is enabled. Accessible by 207 // Object for logging echo information when the AEC is enabled. Accessible by
207 // the libjingle thread through GetStats(). 208 // the libjingle thread through GetStats().
208 scoped_ptr<EchoInformation> echo_information_; 209 scoped_ptr<EchoInformation> echo_information_;
209 210
211 // Stores the number of skipped output frames. The APM only accepts 10 ms
212 // chunks of data, so we ned to store it until it reaches that amount.
213 uint32_t skipped_output_frames_;
214
210 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); 215 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor);
211 }; 216 };
212 217
213 } // namespace content 218 } // namespace content
214 219
215 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ 220 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/media_stream_audio_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698