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

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

Issue 260073013: Added automatic mode to FakeInputAudioStream to generate automatic beeps (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: consolidated how we inject fake audio devices. Created 6 years, 7 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
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 AudioInputStream, useful for testing purpose. 5 // A fake implementation of AudioInputStream, useful for testing purpose.
6 6
7 #ifndef MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ 7 #ifndef MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_
8 #define MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ 8 #define MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void DoCallback(); 56 void DoCallback();
57 57
58 AudioManagerBase* audio_manager_; 58 AudioManagerBase* audio_manager_;
59 AudioInputCallback* callback_; 59 AudioInputCallback* callback_;
60 scoped_ptr<uint8[]> buffer_; 60 scoped_ptr<uint8[]> buffer_;
61 int buffer_size_; 61 int buffer_size_;
62 AudioParameters params_; 62 AudioParameters params_;
63 base::Thread thread_; 63 base::Thread thread_;
64 base::TimeTicks last_callback_time_; 64 base::TimeTicks last_callback_time_;
65 base::TimeDelta callback_interval_; 65 base::TimeDelta callback_interval_;
66 base::TimeDelta interval_from_last_beep_;
66 int beep_duration_in_buffers_; 67 int beep_duration_in_buffers_;
67 int beep_generated_in_buffers_; 68 int beep_generated_in_buffers_;
68 int beep_period_in_frames_; 69 int beep_period_in_frames_;
69 int frames_elapsed_; 70 int frames_elapsed_;
70 71
71 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); 72 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream);
72 }; 73 };
73 74
74 } // namespace media 75 } // namespace media
75 76
76 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ 77 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698