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

Side by Side Diff: chrome/renderer/media/audio_renderer_impl.cc

Issue 2101022: refactoring decoder interface (Closed)
Patch Set: q Created 10 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 | « no previous file | media/base/filters.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 (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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | media/base/filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698