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

Side by Side Diff: content/renderer/media/webrtc/processed_local_audio_source.cc

Issue 2919793002: Detect AudioInputStream muting and propagate to MediaStreamAudioSource. (Closed)
Patch Set: Reworked test again, to make tsan2 happy. Created 3 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/renderer/media/webrtc/processed_local_audio_source.h" 5 #include "content/renderer/media/webrtc/processed_local_audio_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "content/renderer/media/audio_device_factory.h" 10 #include "content/renderer/media/audio_device_factory.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 current_volume = new_volume; 335 current_volume = new_volume;
336 } 336 }
337 } 337 }
338 } 338 }
339 339
340 void ProcessedLocalAudioSource::OnCaptureError(const std::string& message) { 340 void ProcessedLocalAudioSource::OnCaptureError(const std::string& message) {
341 WebRtcLogMessage("ProcessedLocalAudioSource::OnCaptureError: " + message); 341 WebRtcLogMessage("ProcessedLocalAudioSource::OnCaptureError: " + message);
342 StopSourceOnError(message); 342 StopSourceOnError(message);
343 } 343 }
344 344
345 void ProcessedLocalAudioSource::OnCaptureMuted(bool is_muted) {
346 SetMutedState(is_muted);
347 }
348
345 media::AudioParameters ProcessedLocalAudioSource::GetInputFormat() const { 349 media::AudioParameters ProcessedLocalAudioSource::GetInputFormat() const {
346 return audio_processor_ ? audio_processor_->InputFormat() 350 return audio_processor_ ? audio_processor_->InputFormat()
347 : media::AudioParameters(); 351 : media::AudioParameters();
348 } 352 }
349 353
350 int ProcessedLocalAudioSource::GetBufferSize(int sample_rate) const { 354 int ProcessedLocalAudioSource::GetBufferSize(int sample_rate) const {
351 DCHECK(thread_checker_.CalledOnValidThread()); 355 DCHECK(thread_checker_.CalledOnValidThread());
352 #if defined(OS_ANDROID) 356 #if defined(OS_ANDROID)
353 // TODO(henrika): Re-evaluate whether to use same logic as other platforms. 357 // TODO(henrika): Re-evaluate whether to use same logic as other platforms.
354 // http://crbug.com/638081 358 // http://crbug.com/638081
(...skipping 12 matching lines...) Expand all
367 371
368 // If the buffer size is missing from the StreamDeviceInfo, provide 10ms as a 372 // If the buffer size is missing from the StreamDeviceInfo, provide 10ms as a
369 // fall-back. 373 // fall-back.
370 // 374 //
371 // TODO(miu): Identify where/why the buffer size might be missing, fix the 375 // TODO(miu): Identify where/why the buffer size might be missing, fix the
372 // code, and then require it here. http://crbug.com/638081 376 // code, and then require it here. http://crbug.com/638081
373 return (sample_rate / 100); 377 return (sample_rate / 100);
374 } 378 }
375 379
376 } // namespace content 380 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/processed_local_audio_source.h ('k') | content/renderer/pepper/pepper_platform_audio_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698