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

Side by Side Diff: media/filters/audio_renderer_impl.cc

Issue 357004: SetVolume and GetVolume take one volume instead of separate left and right vo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/win/waveout_output_win.cc ('k') | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « media/audio/win/waveout_output_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698