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

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

Issue 1809093003: Moving SwitchOutputDevice out of OutputDevice interface, eliminating OutputDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace RestartableAudioRendererSink with SwitchableAudioRendererSink in webmediaplayer_impl unit t… Created 4 years, 9 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return false; 135 return false;
136 } 136 }
137 137
138 return true; 138 return true;
139 } 139 }
140 140
141 OutputDevice* AudioOutputDevice::GetOutputDevice() { 141 OutputDevice* AudioOutputDevice::GetOutputDevice() {
142 return this; 142 return this;
143 } 143 }
144 144
145 void AudioOutputDevice::SwitchOutputDevice(
146 const std::string& device_id,
147 const url::Origin& security_origin,
148 const SwitchOutputDeviceCB& callback) {
149 NOTREACHED();
150 }
151
152 AudioParameters AudioOutputDevice::GetOutputParameters() { 145 AudioParameters AudioOutputDevice::GetOutputParameters() {
153 CHECK(!task_runner()->BelongsToCurrentThread()); 146 CHECK(!task_runner()->BelongsToCurrentThread());
154 did_receive_auth_.Wait(); 147 did_receive_auth_.Wait();
155 return output_params_; 148 return output_params_;
156 } 149 }
157 150
158 OutputDeviceStatus AudioOutputDevice::GetDeviceStatus() { 151 OutputDeviceStatus AudioOutputDevice::GetDeviceStatus() {
159 CHECK(!task_runner()->BelongsToCurrentThread()); 152 CHECK(!task_runner()->BelongsToCurrentThread());
160 did_receive_auth_.Wait(); 153 did_receive_auth_.Wait();
161 return device_status_; 154 return device_status_;
162 } 155 }
163 156
157 std::string AudioOutputDevice::GetDeviceId() {
158 CHECK(!task_runner()->BelongsToCurrentThread());
159 did_receive_auth_.Wait();
160 return device_id_;
161 }
162
164 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() { 163 void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() {
165 DCHECK(task_runner()->BelongsToCurrentThread()); 164 DCHECK(task_runner()->BelongsToCurrentThread());
166 DCHECK_EQ(state_, IDLE); 165 DCHECK_EQ(state_, IDLE);
167 state_ = AUTHORIZING; 166 state_ = AUTHORIZING;
168 ipc_->RequestDeviceAuthorization(this, session_id_, device_id_, 167 ipc_->RequestDeviceAuthorization(this, session_id_, device_id_,
169 security_origin_); 168 security_origin_);
170 } 169 }
171 170
172 void AudioOutputDevice::CreateStreamOnIOThread(const AudioParameters& params) { 171 void AudioOutputDevice::CreateStreamOnIOThread(const AudioParameters& params) {
173 DCHECK(task_runner()->BelongsToCurrentThread()); 172 DCHECK(task_runner()->BelongsToCurrentThread());
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 440
442 // Update the audio-delay measurement, inform about the number of skipped 441 // Update the audio-delay measurement, inform about the number of skipped
443 // frames, and ask client to render audio. Since |output_bus_| is wrapping 442 // frames, and ask client to render audio. Since |output_bus_| is wrapping
444 // the shared memory the Render() call is writing directly into the shared 443 // the shared memory the Render() call is writing directly into the shared
445 // memory. 444 // memory.
446 render_callback_->Render(output_bus_.get(), std::round(frames_delayed), 445 render_callback_->Render(output_bus_.get(), std::round(frames_delayed),
447 frames_skipped); 446 frames_skipped);
448 } 447 }
449 448
450 } // namespace media 449 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698