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 <stdint.h> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "media/audio/virtual_audio_input_stream.h" | 10 #include "media/audio/virtual_audio_input_stream.h" |
9 | 11 |
10 namespace media { | 12 namespace media { |
11 | 13 |
12 VirtualAudioOutputStream::VirtualAudioOutputStream( | 14 VirtualAudioOutputStream::VirtualAudioOutputStream( |
13 const AudioParameters& params, VirtualAudioInputStream* target, | 15 const AudioParameters& params, VirtualAudioInputStream* target, |
14 const AfterCloseCallback& after_close_cb) | 16 const AfterCloseCallback& after_close_cb) |
15 : params_(params), target_input_stream_(target), | 17 : params_(params), target_input_stream_(target), |
16 after_close_cb_(after_close_cb), callback_(NULL), volume_(1.0f) { | 18 after_close_cb_(after_close_cb), callback_(NULL), volume_(1.0f) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 base::TimeDelta::FromSeconds(1); | 85 base::TimeDelta::FromSeconds(1); |
84 const int frames = callback_->OnMoreData( | 86 const int frames = callback_->OnMoreData( |
85 audio_bus, static_cast<uint32_t>(upstream_delay_in_bytes), 0); | 87 audio_bus, static_cast<uint32_t>(upstream_delay_in_bytes), 0); |
86 if (frames < audio_bus->frames()) | 88 if (frames < audio_bus->frames()) |
87 audio_bus->ZeroFramesPartial(frames, audio_bus->frames() - frames); | 89 audio_bus->ZeroFramesPartial(frames, audio_bus->frames() - frames); |
88 | 90 |
89 return frames > 0 ? volume_ : 0; | 91 return frames > 0 ? volume_ : 0; |
90 } | 92 } |
91 | 93 |
92 } // namespace media | 94 } // namespace media |
OLD | NEW |