| 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 // This class is generally not thread safe. Callers should ensure thread safety. | 7 // This class is generally not thread safe. Callers should ensure thread safety. |
| 8 // For instance, the |sink_lock_| in WebAudioSourceProvider synchronizes access | 8 // For instance, the |sink_lock_| in WebAudioSourceProvider synchronizes access |
| 9 // to this object across the main thread (for WebAudio APIs) and the | 9 // to this object across the main thread (for WebAudio APIs) and the |
| 10 // media thread (for HTMLMediaElement APIs). | 10 // media thread (for HTMLMediaElement APIs). |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 void Stop() override; | 44 void Stop() override; |
| 45 void Play() override; | 45 void Play() override; |
| 46 void Pause() override; | 46 void Pause() override; |
| 47 bool SetVolume(double volume) override; | 47 bool SetVolume(double volume) override; |
| 48 OutputDeviceInfo GetOutputDeviceInfo() override; | 48 OutputDeviceInfo GetOutputDeviceInfo() override; |
| 49 void Initialize(const AudioParameters& params, | 49 void Initialize(const AudioParameters& params, |
| 50 AudioRendererSink::RenderCallback* renderer) override; | 50 AudioRendererSink::RenderCallback* renderer) override; |
| 51 void SwitchOutputDevice(const std::string& device_id, | 51 void SwitchOutputDevice(const std::string& device_id, |
| 52 const url::Origin& security_origin, | 52 const url::Origin& security_origin, |
| 53 const OutputDeviceStatusCB& callback) override; | 53 const OutputDeviceStatusCB& callback) override; |
| 54 // This is expected to be called on the audio rendering thread. The caller |
| 55 // must ensure that this input has been added to a mixer before calling the |
| 56 // function, and that it is not removed from the mixer before this function |
| 57 // returns. |
| 54 bool CurrentThreadIsRenderingThread() override; | 58 bool CurrentThreadIsRenderingThread() override; |
| 55 | 59 |
| 56 // Called by AudioRendererMixer when an error occurs. | 60 // Called by AudioRendererMixer when an error occurs. |
| 57 void OnRenderError(); | 61 void OnRenderError(); |
| 58 | 62 |
| 59 protected: | 63 protected: |
| 60 ~AudioRendererMixerInput() override; | 64 ~AudioRendererMixerInput() override; |
| 61 | 65 |
| 62 private: | 66 private: |
| 63 friend class AudioRendererMixerInputTest; | 67 friend class AudioRendererMixerInputTest; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 OutputDeviceStatusCB pending_switch_callback_; | 102 OutputDeviceStatusCB pending_switch_callback_; |
| 99 std::string pending_switch_device_id_; | 103 std::string pending_switch_device_id_; |
| 100 url::Origin pending_switch_security_origin_; | 104 url::Origin pending_switch_security_origin_; |
| 101 | 105 |
| 102 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerInput); | 106 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerInput); |
| 103 }; | 107 }; |
| 104 | 108 |
| 105 } // namespace media | 109 } // namespace media |
| 106 | 110 |
| 107 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_INPUT_H_ | 111 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_INPUT_H_ |
| OLD | NEW |