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

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

Issue 2004283002: AudioConverter: Express delay in frames rather than msec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 #ifndef MEDIA_AUDIO_SIMPLE_SOURCES_H_ 5 #ifndef MEDIA_AUDIO_SIMPLE_SOURCES_H_
6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_ 6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // This memory needs to survive for the lifetime of |wav_audio_handler_|, 75 // This memory needs to survive for the lifetime of |wav_audio_handler_|,
76 // so declare it first. Do not access this member directly. 76 // so declare it first. Do not access this member directly.
77 std::unique_ptr<char[]> raw_wav_data_; 77 std::unique_ptr<char[]> raw_wav_data_;
78 78
79 std::unique_ptr<WavAudioHandler> wav_audio_handler_; 79 std::unique_ptr<WavAudioHandler> wav_audio_handler_;
80 std::unique_ptr<AudioConverter> file_audio_converter_; 80 std::unique_ptr<AudioConverter> file_audio_converter_;
81 int wav_file_read_pos_; 81 int wav_file_read_pos_;
82 bool load_failed_; 82 bool load_failed_;
83 83
84 // Provides audio data from wav_audio_handler_ into the file audio converter. 84 // Provides audio data from wav_audio_handler_ into the file audio converter.
85 double ProvideInput(AudioBus* audio_bus, 85 double ProvideInput(AudioBus* audio_bus, uint32_t frames_delayed) override;
86 base::TimeDelta buffer_delay) override;
87 86
88 // Loads the wav file on the first OnMoreData invocation. 87 // Loads the wav file on the first OnMoreData invocation.
89 void LoadWavFile(const base::FilePath& path_to_wav_file); 88 void LoadWavFile(const base::FilePath& path_to_wav_file);
90 }; 89 };
91 90
92 class BeepingSource : public AudioOutputStream::AudioSourceCallback { 91 class BeepingSource : public AudioOutputStream::AudioSourceCallback {
93 public: 92 public:
94 BeepingSource(const AudioParameters& params); 93 BeepingSource(const AudioParameters& params);
95 ~BeepingSource() override; 94 ~BeepingSource() override;
96 95
(...skipping 11 matching lines...) Expand all
108 base::TimeTicks last_callback_time_; 107 base::TimeTicks last_callback_time_;
109 base::TimeDelta interval_from_last_beep_; 108 base::TimeDelta interval_from_last_beep_;
110 int beep_duration_in_buffers_; 109 int beep_duration_in_buffers_;
111 int beep_generated_in_buffers_; 110 int beep_generated_in_buffers_;
112 int beep_period_in_frames_; 111 int beep_period_in_frames_;
113 }; 112 };
114 113
115 } // namespace media 114 } // namespace media
116 115
117 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ 116 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698