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

Side by Side Diff: media/audio/audio_output_device.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/audio/audio_output_device.h ('k') | media/audio/audio_output_stream_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/audio/audio_output_device.h" 5 #include "media/audio/audio_output_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { 158 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() {
159 CHECK(!task_runner()->BelongsToCurrentThread()); 159 CHECK(!task_runner()->BelongsToCurrentThread());
160 did_receive_auth_.Wait(); 160 did_receive_auth_.Wait();
161 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice( 161 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice(
162 session_id_, device_id_) 162 session_id_, device_id_)
163 ? matched_device_id_ 163 ? matched_device_id_
164 : device_id_, 164 : device_id_,
165 device_status_, output_params_); 165 device_status_, output_params_);
166 } 166 }
167 167
168 bool AudioOutputDevice::IsOptimizedForHardwareParameters() {
169 return true;
170 }
171
168 bool AudioOutputDevice::CurrentThreadIsRenderingThread() { 172 bool AudioOutputDevice::CurrentThreadIsRenderingThread() {
169 // Since this function is supposed to be called on the rendering thread, 173 // Since this function is supposed to be called on the rendering thread,
170 // it's safe to access |audio_callback_| here. It will always be valid when 174 // it's safe to access |audio_callback_| here. It will always be valid when
171 // the rendering thread is running. 175 // the rendering thread is running.
172 return audio_callback_->CurrentThreadIsAudioDeviceThread(); 176 return audio_callback_->CurrentThreadIsAudioDeviceThread();
173 } 177 }
174 178
175 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() { 179 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() {
176 DCHECK(task_runner()->BelongsToCurrentThread()); 180 DCHECK(task_runner()->BelongsToCurrentThread());
177 DCHECK_EQ(state_, IDLE); 181 DCHECK_EQ(state_, IDLE);
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 render_callback_->Render(delay, delay_timestamp, frames_skipped, 501 render_callback_->Render(delay, delay_timestamp, frames_skipped,
498 output_bus_.get()); 502 output_bus_.get());
499 } 503 }
500 504
501 bool AudioOutputDevice::AudioThreadCallback:: 505 bool AudioOutputDevice::AudioThreadCallback::
502 CurrentThreadIsAudioDeviceThread() { 506 CurrentThreadIsAudioDeviceThread() {
503 return thread_checker_.CalledOnValidThread(); 507 return thread_checker_.CalledOnValidThread();
504 } 508 }
505 509
506 } // namespace media 510 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_device.h ('k') | media/audio/audio_output_stream_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698