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/virtual_audio_output_stream.h" | 5 #include "media/audio/virtual_audio_output_stream.h" |
6 | 6 |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "media/audio/virtual_audio_input_stream.h" | 8 #include "media/audio/virtual_audio_input_stream.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 VirtualAudioOutputStream::VirtualAudioOutputStream( | 12 VirtualAudioOutputStream::VirtualAudioOutputStream( |
13 const AudioParameters& params, base::MessageLoopProxy* message_loop, | 13 const AudioParameters& params, base::MessageLoopProxy* message_loop, |
14 VirtualAudioInputStream* target, const AfterCloseCallback& after_close_cb) | 14 VirtualAudioInputStream* target, const AfterCloseCallback& after_close_cb) |
15 : params_(params), message_loop_(message_loop), | 15 : params_(params), message_loop_(message_loop), |
16 target_input_stream_(target), after_close_cb_(after_close_cb), | 16 target_input_stream_(target), after_close_cb_(after_close_cb), |
17 callback_(NULL), volume_(1.0f) { | 17 callback_(NULL), volume_(1.0f) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 DCHECK(callback_); | 75 DCHECK(callback_); |
76 | 76 |
77 const int frames = callback_->OnMoreData(audio_bus, AudioBuffersState()); | 77 const int frames = callback_->OnMoreData(audio_bus, AudioBuffersState()); |
78 if (frames < audio_bus->frames()) | 78 if (frames < audio_bus->frames()) |
79 audio_bus->ZeroFramesPartial(frames, audio_bus->frames() - frames); | 79 audio_bus->ZeroFramesPartial(frames, audio_bus->frames() - frames); |
80 | 80 |
81 return frames > 0 ? volume_ : 0; | 81 return frames > 0 ? volume_ : 0; |
82 } | 82 } |
83 | 83 |
84 } // namespace media | 84 } // namespace media |
OLD | NEW |