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

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

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
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_audio_renderer.h" 5 #include "content/renderer/media/webrtc_audio_renderer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "content/renderer/media/audio_device_factory.h" 10 #include "content/renderer/media/audio_device_factory.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 DCHECK_EQ(state_, UNINITIALIZED); 103 DCHECK_EQ(state_, UNINITIALIZED);
104 buffer_.reset(); 104 buffer_.reset();
105 } 105 }
106 106
107 bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) { 107 bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) {
108 DVLOG(1) << "WebRtcAudioRenderer::Initialize()"; 108 DVLOG(1) << "WebRtcAudioRenderer::Initialize()";
109 DCHECK(thread_checker_.CalledOnValidThread()); 109 DCHECK(thread_checker_.CalledOnValidThread());
110 base::AutoLock auto_lock(lock_); 110 base::AutoLock auto_lock(lock_);
111 DCHECK_EQ(state_, UNINITIALIZED); 111 DCHECK_EQ(state_, UNINITIALIZED);
112 DCHECK(source); 112 DCHECK(source);
113 DCHECK(!sink_); 113 DCHECK(!sink_.get());
114 DCHECK(!source_); 114 DCHECK(!source_);
115 115
116 // Use stereo output on all platforms exept Android. 116 // Use stereo output on all platforms exept Android.
117 media::ChannelLayout channel_layout = media::CHANNEL_LAYOUT_STEREO; 117 media::ChannelLayout channel_layout = media::CHANNEL_LAYOUT_STEREO;
118 #if defined(OS_ANDROID) 118 #if defined(OS_ANDROID)
119 DVLOG(1) << "Using mono audio output for Android"; 119 DVLOG(1) << "Using mono audio output for Android";
120 channel_layout = media::CHANNEL_LAYOUT_MONO; 120 channel_layout = media::CHANNEL_LAYOUT_MONO;
121 #endif 121 #endif
122 // Ask the renderer for the default audio output hardware sample-rate. 122 // Ask the renderer for the default audio output hardware sample-rate.
123 media::AudioHardwareConfig* hardware_config = 123 media::AudioHardwareConfig* hardware_config =
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 339 }
340 340
341 // De-interleave each channel and convert to 32-bit floating-point 341 // De-interleave each channel and convert to 32-bit floating-point
342 // with nominal range -1.0 -> +1.0 to match the callback format. 342 // with nominal range -1.0 -> +1.0 to match the callback format.
343 audio_bus->FromInterleaved(buffer_.get(), 343 audio_bus->FromInterleaved(buffer_.get(),
344 audio_bus->frames(), 344 audio_bus->frames(),
345 sizeof(buffer_[0])); 345 sizeof(buffer_[0]));
346 } 346 }
347 347
348 } // namespace content 348 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_device_unittest.cc ('k') | content/renderer/media/webrtc_local_audio_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698