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

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

Issue 1186943003: Revert of Add support for the audio-output-device switching IPC mechanism to the renderer lower... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/clockless_audio_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 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "media/audio/audio_manager.h" 10 #include "media/audio/audio_manager.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 base::AutoLock al(callback_lock_); 50 base::AutoLock al(callback_lock_);
51 active_render_callback_ = render_callback_; 51 active_render_callback_ = render_callback_;
52 audio_task_runner_->PostTask( 52 audio_task_runner_->PostTask(
53 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoPlay, this)); 53 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoPlay, this));
54 } 54 }
55 55
56 bool AudioOutputStreamSink::SetVolume(double volume) { 56 bool AudioOutputStreamSink::SetVolume(double volume) {
57 audio_task_runner_->PostTask( 57 audio_task_runner_->PostTask(
58 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume)); 58 FROM_HERE, base::Bind(&AudioOutputStreamSink::DoSetVolume, this, volume));
59 return true; 59 return true;
60 } 60 };
61
62 void AudioOutputStreamSink::SwitchOutputDevice(
63 const std::string& device_id,
64 const GURL& security_origin,
65 const SwitchOutputDeviceCB& callback) {
66 callback.Run(SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED);
67 }
68 61
69 int AudioOutputStreamSink::OnMoreData(AudioBus* dest, 62 int AudioOutputStreamSink::OnMoreData(AudioBus* dest,
70 uint32 total_bytes_delay) { 63 uint32 total_bytes_delay) {
71 // Note: Runs on the audio thread created by the OS. 64 // Note: Runs on the audio thread created by the OS.
72 base::AutoLock al(callback_lock_); 65 base::AutoLock al(callback_lock_);
73 if (!active_render_callback_) 66 if (!active_render_callback_)
74 return 0; 67 return 0;
75 68
76 return active_render_callback_->Render( 69 return active_render_callback_->Render(
77 dest, total_bytes_delay * 1000.0 / params_.GetBytesPerSecond()); 70 dest, total_bytes_delay * 1000.0 / params_.GetBytesPerSecond());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 DCHECK(audio_task_runner_->BelongsToCurrentThread()); 117 DCHECK(audio_task_runner_->BelongsToCurrentThread());
125 stream_->SetVolume(volume); 118 stream_->SetVolume(volume);
126 } 119 }
127 120
128 void AudioOutputStreamSink::ClearCallback() { 121 void AudioOutputStreamSink::ClearCallback() {
129 base::AutoLock al(callback_lock_); 122 base::AutoLock al(callback_lock_);
130 active_render_callback_ = NULL; 123 active_render_callback_ = NULL;
131 } 124 }
132 125
133 } // namepace media 126 } // namepace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_stream_sink.h ('k') | media/audio/clockless_audio_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698