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

Side by Side Diff: media/audio/null_audio_sink.cc

Issue 10703191: Remove GetVolume from media::AudioRendererSink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/null_audio_sink.h ('k') | media/base/audio_renderer_mixer_input.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) 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/null_audio_sink.h" 5 #include "media/audio/null_audio_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/sys_byteorder.h" 9 #include "base/sys_byteorder.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void NullAudioSink::SetPlaybackRate(float rate) { 65 void NullAudioSink::SetPlaybackRate(float rate) {
66 base::AutoLock auto_lock(lock_); 66 base::AutoLock auto_lock(lock_);
67 playback_rate_ = rate; 67 playback_rate_ = rate;
68 } 68 }
69 69
70 bool NullAudioSink::SetVolume(double volume) { 70 bool NullAudioSink::SetVolume(double volume) {
71 // Audio is always muted. 71 // Audio is always muted.
72 return volume == 0.0; 72 return volume == 0.0;
73 } 73 }
74 74
75 void NullAudioSink::GetVolume(double* volume) {
76 // Audio is always muted.
77 *volume = 0.0;
78 }
79
80 void NullAudioSink::SetPlaying(bool is_playing) { 75 void NullAudioSink::SetPlaying(bool is_playing) {
81 base::AutoLock auto_lock(lock_); 76 base::AutoLock auto_lock(lock_);
82 playing_ = is_playing; 77 playing_ = is_playing;
83 } 78 }
84 79
85 NullAudioSink::~NullAudioSink() { 80 NullAudioSink::~NullAudioSink() {
86 DCHECK(!thread_.IsRunning()); 81 DCHECK(!thread_.IsRunning());
87 for (size_t i = 0; i < audio_data_.size(); ++i) 82 for (size_t i = 0; i < audio_data_.size(); ++i)
88 delete [] audio_data_[i]; 83 delete [] audio_data_[i];
89 } 84 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 base::MD5Final(&digest, &md5_channel_contexts_[i]); 146 base::MD5Final(&digest, &md5_channel_contexts_[i]);
152 base::MD5Update(&md5_channel_contexts_[0], base::StringPiece( 147 base::MD5Update(&md5_channel_contexts_[0], base::StringPiece(
153 reinterpret_cast<char*>(&digest), sizeof(base::MD5Digest))); 148 reinterpret_cast<char*>(&digest), sizeof(base::MD5Digest)));
154 } 149 }
155 150
156 base::MD5Final(&digest, &md5_channel_contexts_[0]); 151 base::MD5Final(&digest, &md5_channel_contexts_[0]);
157 return base::MD5DigestToBase16(digest); 152 return base::MD5DigestToBase16(digest);
158 } 153 }
159 154
160 } // namespace media 155 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/null_audio_sink.h ('k') | media/base/audio_renderer_mixer_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698