OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/media/audio_renderer_impl.h" | 5 #include "chrome/renderer/media/audio_renderer_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/renderer/audio_message_filter.h" | 10 #include "chrome/renderer/audio_message_filter.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 void AudioRendererImpl::OnReadComplete(media::Buffer* buffer_in) { | 96 void AudioRendererImpl::OnReadComplete(media::Buffer* buffer_in) { |
97 AutoLock auto_lock(lock_); | 97 AutoLock auto_lock(lock_); |
98 if (stopped_) | 98 if (stopped_) |
99 return; | 99 return; |
100 | 100 |
101 // TODO(hclam): handle end of stream here. | 101 // TODO(hclam): handle end of stream here. |
102 | 102 |
103 // Use the base class to queue the buffer. | 103 // Use the base class to queue the buffer. |
104 AudioRendererBase::OnReadComplete(buffer_in); | 104 AudioRendererBase::OnFillBufferDone(buffer_in); |
105 | 105 |
106 // Post a task to render thread to notify a packet reception. | 106 // Post a task to render thread to notify a packet reception. |
107 io_loop_->PostTask(FROM_HERE, | 107 io_loop_->PostTask(FROM_HERE, |
108 NewRunnableMethod(this, &AudioRendererImpl::NotifyPacketReadyTask)); | 108 NewRunnableMethod(this, &AudioRendererImpl::NotifyPacketReadyTask)); |
109 } | 109 } |
110 | 110 |
111 void AudioRendererImpl::SetPlaybackRate(float rate) { | 111 void AudioRendererImpl::SetPlaybackRate(float rate) { |
112 DCHECK(rate >= 0.0f); | 112 DCHECK(rate >= 0.0f); |
113 | 113 |
114 AutoLock auto_lock(lock_); | 114 AutoLock auto_lock(lock_); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 DCHECK(MessageLoop::current() == io_loop_); | 343 DCHECK(MessageLoop::current() == io_loop_); |
344 | 344 |
345 // We treat the IO loop going away the same as stopping. | 345 // We treat the IO loop going away the same as stopping. |
346 AutoLock auto_lock(lock_); | 346 AutoLock auto_lock(lock_); |
347 if (stopped_) | 347 if (stopped_) |
348 return; | 348 return; |
349 | 349 |
350 stopped_ = true; | 350 stopped_ = true; |
351 DestroyTask(); | 351 DestroyTask(); |
352 } | 352 } |
OLD | NEW |