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

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

Issue 155471: Refactoring to share MockAudioOutputStream implementations across 3 platforms... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/audio_output.h ('k') | media/audio/fake_audio_output_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 //
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
7 // audio output stream reading from AudioSourceCallback.
8
9 #ifndef MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_
10 #define MEDIA_AUDIO_FAKE_AUDIO_OUTOUT_STREAM_H_
11
12 #include <vector>
13
14 #include "base/scoped_ptr.h"
15 #include "media/audio/audio_output.h"
16
17 class FakeAudioOutputStream : public AudioOutputStream {
18 public:
19 static AudioOutputStream* MakeFakeStream();
20 static FakeAudioOutputStream* GetLastFakeStream();
21
22 virtual bool Open(size_t packet_size);
23 virtual void Start(AudioSourceCallback* callback);
24 virtual void Stop();
25 virtual void SetVolume(double left_level, double right_level);
26 virtual void GetVolume(double* left_level, double* right_level);
27 virtual void Close();
28
29 char* buffer() { return buffer_.get(); }
30 double left_volume() { return left_volume_; }
31 double right_volume() { return right_volume_; }
32
33 private:
34 FakeAudioOutputStream();
35 virtual ~FakeAudioOutputStream() {}
36
37 static void DestroyLastFakeStream(void* param);
38 static bool has_created_fake_stream_;
39 static FakeAudioOutputStream* last_fake_stream_;
40
41 double left_volume_;
42 double right_volume_;
43 AudioSourceCallback* callback_;
44 scoped_ptr_malloc<char> buffer_;
45 size_t packet_size_;
46
47 DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputStream);
48 };
49
50 #endif // MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_
OLDNEW
« no previous file with comments | « media/audio/audio_output.h ('k') | media/audio/fake_audio_output_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698