OLD | NEW |
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void AudioOutputDevice::CreateStreamOnIOThread(const AudioParameters& params) { | 185 void AudioOutputDevice::CreateStreamOnIOThread(const AudioParameters& params) { |
186 DCHECK(task_runner()->BelongsToCurrentThread()); | 186 DCHECK(task_runner()->BelongsToCurrentThread()); |
187 switch (state_) { | 187 switch (state_) { |
188 case IPC_CLOSED: | 188 case IPC_CLOSED: |
189 if (callback_) | 189 if (callback_) |
190 callback_->OnRenderError(); | 190 callback_->OnRenderError(); |
191 break; | 191 break; |
192 | 192 |
193 case IDLE: | 193 case IDLE: |
194 if (did_receive_auth_.IsSignaled() && device_id_.empty() && | 194 if (did_receive_auth_.IsSignaled() && device_id_.empty() && |
195 security_origin_.unique()) { | 195 security_origin_.opaque()) { |
196 state_ = CREATING_STREAM; | 196 state_ = CREATING_STREAM; |
197 ipc_->CreateStream(this, params); | 197 ipc_->CreateStream(this, params); |
198 } else { | 198 } else { |
199 RequestDeviceAuthorizationOnIOThread(); | 199 RequestDeviceAuthorizationOnIOThread(); |
200 start_on_authorized_ = true; | 200 start_on_authorized_ = true; |
201 } | 201 } |
202 break; | 202 break; |
203 | 203 |
204 case AUTHORIZING: | 204 case AUTHORIZING: |
205 start_on_authorized_ = true; | 205 start_on_authorized_ = true; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 render_callback_->Render(delay, delay_timestamp, frames_skipped, | 487 render_callback_->Render(delay, delay_timestamp, frames_skipped, |
488 output_bus_.get()); | 488 output_bus_.get()); |
489 } | 489 } |
490 | 490 |
491 bool AudioOutputDevice::AudioThreadCallback:: | 491 bool AudioOutputDevice::AudioThreadCallback:: |
492 CurrentThreadIsAudioDeviceThread() { | 492 CurrentThreadIsAudioDeviceThread() { |
493 return thread_checker_.CalledOnValidThread(); | 493 return thread_checker_.CalledOnValidThread(); |
494 } | 494 } |
495 | 495 |
496 } // namespace media | 496 } // namespace media |
OLD | NEW |