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

Side by Side Diff: media/audio/audio_output_device.cc

Issue 2836293002: Introduce AudioRendererSink::IsOptimizedForHardwareParameters (Closed)
Patch Set: revert preferred_params and add OptimizedForHardwareParameters 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
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { 148 OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() {
149 CHECK(!task_runner()->BelongsToCurrentThread()); 149 CHECK(!task_runner()->BelongsToCurrentThread());
150 did_receive_auth_.Wait(); 150 did_receive_auth_.Wait();
151 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice( 151 return OutputDeviceInfo(AudioDeviceDescription::UseSessionIdToSelectDevice(
152 session_id_, device_id_) 152 session_id_, device_id_)
153 ? matched_device_id_ 153 ? matched_device_id_
154 : device_id_, 154 : device_id_,
155 device_status_, output_params_); 155 device_status_, output_params_);
156 } 156 }
157 157
158 bool AudioOutputDevice::OptimizedForHardwareParameters() {
159 return true;
160 }
161
158 bool AudioOutputDevice::CurrentThreadIsRenderingThread() { 162 bool AudioOutputDevice::CurrentThreadIsRenderingThread() {
159 // Since this function is supposed to be called on the rendering thread, 163 // Since this function is supposed to be called on the rendering thread,
160 // it's safe to access |audio_callback_| here. It will always be valid when 164 // it's safe to access |audio_callback_| here. It will always be valid when
161 // the rendering thread is running. 165 // the rendering thread is running.
162 return audio_callback_->CurrentThreadIsAudioDeviceThread(); 166 return audio_callback_->CurrentThreadIsAudioDeviceThread();
163 } 167 }
164 168
165 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() { 169 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() {
166 DCHECK(task_runner()->BelongsToCurrentThread()); 170 DCHECK(task_runner()->BelongsToCurrentThread());
167 DCHECK_EQ(state_, IDLE); 171 DCHECK_EQ(state_, IDLE);
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 render_callback_->Render(delay, delay_timestamp, frames_skipped, 491 render_callback_->Render(delay, delay_timestamp, frames_skipped,
488 output_bus_.get()); 492 output_bus_.get());
489 } 493 }
490 494
491 bool AudioOutputDevice::AudioThreadCallback:: 495 bool AudioOutputDevice::AudioThreadCallback::
492 CurrentThreadIsAudioDeviceThread() { 496 CurrentThreadIsAudioDeviceThread() {
493 return thread_checker_.CalledOnValidThread(); 497 return thread_checker_.CalledOnValidThread();
494 } 498 }
495 499
496 } // namespace media 500 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698