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

Side by Side Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 23533039: Re-enables three WebRTC unit tests in content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled Android and improved tests for all other platforms Created 7 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 | Annotate | Revision Log
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 #include "content/renderer/media/webrtc_audio_device_impl.h" 5 #include "content/renderer/media/webrtc_audio_device_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 DCHECK(thread_checker_.CalledOnValidThread()); 113 DCHECK(thread_checker_.CalledOnValidThread());
114 } 114 }
115 115
116 void WebRtcAudioDeviceImpl::RenderData(uint8* audio_data, 116 void WebRtcAudioDeviceImpl::RenderData(uint8* audio_data,
117 int number_of_channels, 117 int number_of_channels,
118 int number_of_frames, 118 int number_of_frames,
119 int audio_delay_milliseconds) { 119 int audio_delay_milliseconds) {
120 DCHECK_LE(number_of_frames, output_buffer_size()); 120 DCHECK_LE(number_of_frames, output_buffer_size());
121 { 121 {
122 base::AutoLock auto_lock(lock_); 122 base::AutoLock auto_lock(lock_);
123 DCHECK(audio_transport_callback_);
123 // Store the reported audio delay locally. 124 // Store the reported audio delay locally.
124 output_delay_ms_ = audio_delay_milliseconds; 125 output_delay_ms_ = audio_delay_milliseconds;
125 } 126 }
126 127
127 const int channels = number_of_channels; 128 const int channels = number_of_channels;
128 DCHECK_LE(channels, output_channels()); 129 DCHECK_LE(channels, output_channels());
129 130
130 int samples_per_sec = output_sample_rate(); 131 int samples_per_sec = output_sample_rate();
131 int samples_per_10_msec = (samples_per_sec / 100); 132 int samples_per_10_msec = (samples_per_sec / 100);
132 int bytes_per_sample = output_audio_parameters_.bits_per_sample() / 8; 133 int bytes_per_sample = output_audio_parameters_.bits_per_sample() / 8;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 for (CapturerList::const_iterator iter = capturers_.begin(); 482 for (CapturerList::const_iterator iter = capturers_.begin();
482 iter != capturers_.end(); ++iter) { 483 iter != capturers_.end(); ++iter) {
483 if (!(*iter)->device_id().empty()) 484 if (!(*iter)->device_id().empty())
484 return *iter; 485 return *iter;
485 } 486 }
486 487
487 return NULL; 488 return NULL;
488 } 489 }
489 490
490 } // namespace content 491 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/mock_media_observer.h ('k') | content/renderer/media/webrtc_audio_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698