OLD | NEW |
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 #include <windows.h> | 5 #include <windows.h> |
6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 max_size = file_size() - pos_; | 123 max_size = file_size() - pos_; |
124 int frames = max_size / (audio_bus->channels() * kBitsPerSample / 8); | 124 int frames = max_size / (audio_bus->channels() * kBitsPerSample / 8); |
125 if (max_size) { | 125 if (max_size) { |
126 audio_bus->FromInterleaved( | 126 audio_bus->FromInterleaved( |
127 file_->data() + pos_, frames, kBitsPerSample / 8); | 127 file_->data() + pos_, frames, kBitsPerSample / 8); |
128 pos_ += max_size; | 128 pos_ += max_size; |
129 } | 129 } |
130 return frames; | 130 return frames; |
131 } | 131 } |
132 | 132 |
133 virtual int OnMoreIOData(AudioBus* source, | |
134 AudioBus* dest, | |
135 AudioBuffersState buffers_state) OVERRIDE { | |
136 NOTREACHED(); | |
137 return 0; | |
138 } | |
139 | |
140 virtual void OnError(AudioOutputStream* stream) {} | 133 virtual void OnError(AudioOutputStream* stream) {} |
141 | 134 |
142 int file_size() { return file_->data_size(); } | 135 int file_size() { return file_->data_size(); } |
143 | 136 |
144 private: | 137 private: |
145 scoped_refptr<DecoderBuffer> file_; | 138 scoped_refptr<DecoderBuffer> file_; |
146 scoped_ptr<int[]> delta_times_; | 139 scoped_ptr<int[]> delta_times_; |
147 int pos_; | 140 int pos_; |
148 base::TimeTicks previous_call_time_; | 141 base::TimeTicks previous_call_time_; |
149 FILE* text_file_; | 142 FILE* text_file_; |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 | 656 |
664 aos->Start(&source); | 657 aos->Start(&source); |
665 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), | 658 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), |
666 TestTimeouts::action_timeout()); | 659 TestTimeouts::action_timeout()); |
667 loop.Run(); | 660 loop.Run(); |
668 aos->Stop(); | 661 aos->Stop(); |
669 aos->Close(); | 662 aos->Close(); |
670 } | 663 } |
671 | 664 |
672 } // namespace media | 665 } // namespace media |
OLD | NEW |