| 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/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 had_error_(0) { | 51 had_error_(0) { |
| 52 } | 52 } |
| 53 // AudioSourceCallback::OnMoreData implementation: | 53 // AudioSourceCallback::OnMoreData implementation: |
| 54 virtual int OnMoreData(AudioBus* audio_bus, | 54 virtual int OnMoreData(AudioBus* audio_bus, |
| 55 AudioBuffersState buffers_state) { | 55 AudioBuffersState buffers_state) { |
| 56 ++callback_count_; | 56 ++callback_count_; |
| 57 // Touch the channel memory value to make sure memory is good. | 57 // Touch the channel memory value to make sure memory is good. |
| 58 audio_bus->Zero(); | 58 audio_bus->Zero(); |
| 59 return audio_bus->frames(); | 59 return audio_bus->frames(); |
| 60 } | 60 } |
| 61 virtual int OnMoreIOData(AudioBus* source, | |
| 62 AudioBus* dest, | |
| 63 AudioBuffersState buffers_state) { | |
| 64 NOTREACHED(); | |
| 65 return 0; | |
| 66 } | |
| 67 // AudioSourceCallback::OnError implementation: | 61 // AudioSourceCallback::OnError implementation: |
| 68 virtual void OnError(AudioOutputStream* stream) { | 62 virtual void OnError(AudioOutputStream* stream) { |
| 69 ++had_error_; | 63 ++had_error_; |
| 70 } | 64 } |
| 71 // Returns how many times OnMoreData() has been called. | 65 // Returns how many times OnMoreData() has been called. |
| 72 int callback_count() const { | 66 int callback_count() const { |
| 73 return callback_count_; | 67 return callback_count_; |
| 74 } | 68 } |
| 75 // Returns how many times the OnError callback was called. | 69 // Returns how many times the OnError callback was called. |
| 76 int had_error() const { | 70 int had_error() const { |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 oas->Start(&source); | 682 oas->Start(&source); |
| 689 | 683 |
| 690 ::WaitForSingleObject(thread, INFINITE); | 684 ::WaitForSingleObject(thread, INFINITE); |
| 691 ::CloseHandle(thread); | 685 ::CloseHandle(thread); |
| 692 | 686 |
| 693 oas->Stop(); | 687 oas->Stop(); |
| 694 oas->Close(); | 688 oas->Close(); |
| 695 } | 689 } |
| 696 | 690 |
| 697 } // namespace media | 691 } // namespace media |
| OLD | NEW |