| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <math.h> | 5 #include <math.h> |
| 6 | 6 |
| 7 #include "media/base/filter_host.h" | 7 #include "media/base/filter_host.h" |
| 8 #include "media/filters/audio_renderer_impl.h" | 8 #include "media/filters/audio_renderer_impl.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // TODO(fbarchard): limit rate to reasonable values | 40 // TODO(fbarchard): limit rate to reasonable values |
| 41 AudioRendererBase::SetPlaybackRate(rate); | 41 AudioRendererBase::SetPlaybackRate(rate); |
| 42 | 42 |
| 43 static bool started = false; | 43 static bool started = false; |
| 44 if (rate > 0.0f && !started && stream_) | 44 if (rate > 0.0f && !started && stream_) |
| 45 stream_->Start(this); | 45 stream_->Start(this); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void AudioRendererImpl::SetVolume(float volume) { | 48 void AudioRendererImpl::SetVolume(float volume) { |
| 49 if (stream_) | 49 if (stream_) |
| 50 stream_->SetVolume(volume, volume); | 50 stream_->SetVolume(volume); |
| 51 } | 51 } |
| 52 | 52 |
| 53 size_t AudioRendererImpl::OnMoreData(AudioOutputStream* stream, void* dest_void, | 53 size_t AudioRendererImpl::OnMoreData(AudioOutputStream* stream, void* dest_void, |
| 54 size_t len, int pending_bytes) { | 54 size_t len, int pending_bytes) { |
| 55 // TODO(scherkus): handle end of stream. | 55 // TODO(scherkus): handle end of stream. |
| 56 if (!stream_) | 56 if (!stream_) |
| 57 return 0; | 57 return 0; |
| 58 | 58 |
| 59 // TODO(scherkus): Maybe change OnMoreData to pass in char/uint8 or similar. | 59 // TODO(scherkus): Maybe change OnMoreData to pass in char/uint8 or similar. |
| 60 // TODO(fbarchard): Waveout_output_win.h should handle zero length buffers | 60 // TODO(fbarchard): Waveout_output_win.h should handle zero length buffers |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void AudioRendererImpl::OnStop() { | 104 void AudioRendererImpl::OnStop() { |
| 105 if (stream_) | 105 if (stream_) |
| 106 stream_->Stop(); | 106 stream_->Stop(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace media | 109 } // namespace media |
| OLD | NEW |