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

Side by Side Diff: media/base/audio_renderer_mixer_input.cc

Issue 2836293002: Introduce AudioRendererSink::IsOptimizedForHardwareParameters (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « media/base/audio_renderer_mixer_input.h ('k') | media/base/audio_renderer_sink.h » ('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 (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 "media/base/audio_renderer_mixer_input.h" 5 #include "media/base/audio_renderer_mixer_input.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return true; 108 return true;
109 } 109 }
110 110
111 OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() { 111 OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() {
112 return mixer_ 112 return mixer_
113 ? mixer_->GetOutputDeviceInfo() 113 ? mixer_->GetOutputDeviceInfo()
114 : mixer_pool_->GetOutputDeviceInfo(owner_id_, 0 /* session_id */, 114 : mixer_pool_->GetOutputDeviceInfo(owner_id_, 0 /* session_id */,
115 device_id_, security_origin_); 115 device_id_, security_origin_);
116 } 116 }
117 117
118 bool AudioRendererMixerInput::IsOptimizedForHardwareParameters() {
119 return true;
120 }
121
118 bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() { 122 bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() {
119 return mixer_->CurrentThreadIsRenderingThread(); 123 return mixer_->CurrentThreadIsRenderingThread();
120 } 124 }
121 125
122 void AudioRendererMixerInput::SwitchOutputDevice( 126 void AudioRendererMixerInput::SwitchOutputDevice(
123 const std::string& device_id, 127 const std::string& device_id,
124 const url::Origin& security_origin, 128 const url::Origin& security_origin,
125 const OutputDeviceStatusCB& callback) { 129 const OutputDeviceStatusCB& callback) {
126 if (device_id == device_id_) { 130 if (device_id == device_id_) {
127 callback.Run(OUTPUT_DEVICE_STATUS_OK); 131 callback.Run(OUTPUT_DEVICE_STATUS_OK);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 base::AutoLock auto_lock(volume_lock_); 192 base::AutoLock auto_lock(volume_lock_);
189 return frames_filled > 0 ? volume_ : 0; 193 return frames_filled > 0 ? volume_ : 0;
190 } 194 }
191 } 195 }
192 196
193 void AudioRendererMixerInput::OnRenderError() { 197 void AudioRendererMixerInput::OnRenderError() {
194 callback_->OnRenderError(); 198 callback_->OnRenderError();
195 } 199 }
196 200
197 } // namespace media 201 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_renderer_mixer_input.h ('k') | media/base/audio_renderer_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698