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

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

Issue 1809093003: Moving SwitchOutputDevice out of OutputDevice interface, eliminating OutputDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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_stream_sink.h ('k') | media/audio/audio_parameters.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_stream_sink.h" 5 #include "media/audio/audio_output_stream_sink.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 audio_task_runner_->PostTask( 66 audio_task_runner_->PostTask(
67 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoPlay, this)); 67 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoPlay, this));
68 } 68 }
69 69
70 bool AudioOutputStreamSink::SetVolume(double volume) { 70 bool AudioOutputStreamSink::SetVolume(double volume) {
71 audio_task_runner_->PostTask( 71 audio_task_runner_->PostTask(
72 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume)); 72 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume));
73 return true; 73 return true;
74 } 74 }
75 75
76 OutputDevice* AudioOutputStreamSink::GetOutputDevice() { 76 OutputDeviceInfo AudioOutputStreamSink::GetOutputDeviceInfo() {
77 return nullptr; 77 return OutputDeviceInfo();
78 } 78 }
79 79
80 int AudioOutputStreamSink::OnMoreData(AudioBus* dest, 80 int AudioOutputStreamSink::OnMoreData(AudioBus* dest,
81 uint32_t total_bytes_delay, 81 uint32_t total_bytes_delay,
82 uint32_t frames_skipped) { 82 uint32_t frames_skipped) {
83 // Note: Runs on the audio thread created by the OS. 83 // Note: Runs on the audio thread created by the OS.
84 base::AutoLock al(callback_lock_); 84 base::AutoLock al(callback_lock_);
85 if (!active_render_callback_) 85 if (!active_render_callback_)
86 return 0; 86 return 0;
87 87
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 DCHECK(audio_task_runner_->BelongsToCurrentThread()); 143 DCHECK(audio_task_runner_->BelongsToCurrentThread());
144 stream_->SetVolume(volume); 144 stream_->SetVolume(volume);
145 } 145 }
146 146
147 void AudioOutputStreamSink::ClearCallback() { 147 void AudioOutputStreamSink::ClearCallback() {
148 base::AutoLock al(callback_lock_); 148 base::AutoLock al(callback_lock_);
149 active_render_callback_ = NULL; 149 active_render_callback_ = NULL;
150 } 150 }
151 151
152 } // namepace media 152 } // namepace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_stream_sink.h ('k') | media/audio/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698