| 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 // THREAD SAFETY | 5 // THREAD SAFETY |
| 6 // | 6 // |
| 7 // AlsaPcmOutputStream object is *not* thread-safe and should only be used | 7 // AlsaPcmOutputStream object is *not* thread-safe and should only be used |
| 8 // from the audio thread. We DCHECK on this assumption whenever we can. | 8 // from the audio thread. We DCHECK on this assumption whenever we can. |
| 9 // | 9 // |
| 10 // SEMANTICS OF Close() | 10 // SEMANTICS OF Close() |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 if (source_callback_) { | 753 if (source_callback_) { |
| 754 source_callback_->WaitTillDataReady(); | 754 source_callback_->WaitTillDataReady(); |
| 755 return source_callback_->OnMoreData(audio_bus, buffers_state); | 755 return source_callback_->OnMoreData(audio_bus, buffers_state); |
| 756 } | 756 } |
| 757 | 757 |
| 758 return 0; | 758 return 0; |
| 759 } | 759 } |
| 760 | 760 |
| 761 void AlsaPcmOutputStream::RunErrorCallback(int code) { | 761 void AlsaPcmOutputStream::RunErrorCallback(int code) { |
| 762 if (source_callback_) | 762 if (source_callback_) |
| 763 source_callback_->OnError(this, code); | 763 source_callback_->OnError(this); |
| 764 } | 764 } |
| 765 | 765 |
| 766 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to | 766 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to |
| 767 // release ownership of the currently registered callback. | 767 // release ownership of the currently registered callback. |
| 768 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) { | 768 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) { |
| 769 DCHECK(IsOnAudioThread()); | 769 DCHECK(IsOnAudioThread()); |
| 770 source_callback_ = callback; | 770 source_callback_ = callback; |
| 771 } | 771 } |
| 772 | 772 |
| 773 } // namespace media | 773 } // namespace media |
| OLD | NEW |