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

Side by Side Diff: media/audio/fake_audio_output_stream.h

Issue 10826174: Dead code elimination: scythe.chrome_functions:segment.path %media% edition, round 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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/audio_output_proxy_unittest.cc ('k') | media/audio/linux/alsa_output_unittest.cc » ('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 // A fake implementation of AudioOutputStream. It is used for testing purpose. 5 // A fake implementation of AudioOutputStream. It is used for testing purpose.
6 // TODO(hclam): Implement a thread in this fake output stream to simulate an 6 // TODO(hclam): Implement a thread in this fake output stream to simulate an
7 // audio output stream reading from AudioSourceCallback. 7 // audio output stream reading from AudioSourceCallback.
8 8
9 #ifndef MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ 9 #ifndef MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_
10 #define MEDIA_AUDIO_FAKE_AUDIO_OUTOUT_STREAM_H_ 10 #define MEDIA_AUDIO_FAKE_AUDIO_OUTOUT_STREAM_H_
(...skipping 16 matching lines...) Expand all
27 static FakeAudioOutputStream* GetCurrentFakeStream(); 27 static FakeAudioOutputStream* GetCurrentFakeStream();
28 28
29 virtual bool Open() OVERRIDE; 29 virtual bool Open() OVERRIDE;
30 virtual void Start(AudioSourceCallback* callback) OVERRIDE; 30 virtual void Start(AudioSourceCallback* callback) OVERRIDE;
31 virtual void Stop() OVERRIDE; 31 virtual void Stop() OVERRIDE;
32 virtual void SetVolume(double volume) OVERRIDE; 32 virtual void SetVolume(double volume) OVERRIDE;
33 virtual void GetVolume(double* volume) OVERRIDE; 33 virtual void GetVolume(double* volume) OVERRIDE;
34 virtual void Close() OVERRIDE; 34 virtual void Close() OVERRIDE;
35 35
36 uint8* buffer() { return buffer_.get(); } 36 uint8* buffer() { return buffer_.get(); }
37 double volume() { return volume_; }
38 37
39 private: 38 private:
40 explicit FakeAudioOutputStream(AudioManagerBase* manager, 39 explicit FakeAudioOutputStream(AudioManagerBase* manager,
41 const AudioParameters& params); 40 const AudioParameters& params);
42 41
43 virtual ~FakeAudioOutputStream(); 42 virtual ~FakeAudioOutputStream();
44 43
45 static FakeAudioOutputStream* current_fake_stream_; 44 static FakeAudioOutputStream* current_fake_stream_;
46 45
47 AudioManagerBase* audio_manager_; 46 AudioManagerBase* audio_manager_;
48 double volume_; 47 double volume_;
49 AudioSourceCallback* callback_; 48 AudioSourceCallback* callback_;
50 scoped_array<uint8> buffer_; 49 scoped_array<uint8> buffer_;
51 uint32 bytes_per_buffer_; 50 uint32 bytes_per_buffer_;
52 bool closed_; 51 bool closed_;
53 52
54 DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputStream); 53 DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputStream);
55 }; 54 };
56 55
57 } // namespace media 56 } // namespace media
58 57
59 #endif // MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ 58 #endif // MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_
OLDNEW
« no previous file with comments | « media/audio/audio_output_proxy_unittest.cc ('k') | media/audio/linux/alsa_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698