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

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

Issue 1453233002: Improve input handling for WaveAudioHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Update FileSource Created 5 years, 1 month 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 "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "media/audio/audio_io.h" 10 #include "media/audio/audio_io.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const base::FilePath& path_to_wav_file); 55 const base::FilePath& path_to_wav_file);
56 ~FileSource() override; 56 ~FileSource() override;
57 57
58 // Implementation of AudioSourceCallback. 58 // Implementation of AudioSourceCallback.
59 int OnMoreData(AudioBus* audio_bus, uint32 total_bytes_delay) override; 59 int OnMoreData(AudioBus* audio_bus, uint32 total_bytes_delay) override;
60 void OnError(AudioOutputStream* stream) override; 60 void OnError(AudioOutputStream* stream) override;
61 61
62 private: 62 private:
63 AudioParameters params_; 63 AudioParameters params_;
64 base::FilePath path_to_wav_file_; 64 base::FilePath path_to_wav_file_;
65 scoped_ptr<uint8[]> wav_file_data_;
66 scoped_ptr<WavAudioHandler> wav_audio_handler_; 65 scoped_ptr<WavAudioHandler> wav_audio_handler_;
67 scoped_ptr<AudioConverter> file_audio_converter_; 66 scoped_ptr<AudioConverter> file_audio_converter_;
68 int wav_file_read_pos_; 67 int wav_file_read_pos_;
69 bool load_failed_; 68 bool load_failed_;
70 69
71 // Provides audio data from wav_audio_handler_ into the file audio converter. 70 // Provides audio data from wav_audio_handler_ into the file audio converter.
72 double ProvideInput(AudioBus* audio_bus, 71 double ProvideInput(AudioBus* audio_bus,
73 base::TimeDelta buffer_delay) override; 72 base::TimeDelta buffer_delay) override;
74 73
75 // Loads the wav file on the first OnMoreData invocation. 74 // Loads the wav file on the first OnMoreData invocation.
(...skipping 17 matching lines...) Expand all
93 base::TimeTicks last_callback_time_; 92 base::TimeTicks last_callback_time_;
94 base::TimeDelta interval_from_last_beep_; 93 base::TimeDelta interval_from_last_beep_;
95 int beep_duration_in_buffers_; 94 int beep_duration_in_buffers_;
96 int beep_generated_in_buffers_; 95 int beep_generated_in_buffers_;
97 int beep_period_in_frames_; 96 int beep_period_in_frames_;
98 }; 97 };
99 98
100 } // namespace media 99 } // namespace media
101 100
102 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ 101 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698