| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_AUDIO_OUTPUT_DELEGATE_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_DELEGATE_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_DELEGATE_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 base::SharedMemory* shared_memory, | 36 base::SharedMemory* shared_memory, |
| 37 base::CancelableSyncSocket* socket) = 0; | 37 base::CancelableSyncSocket* socket) = 0; |
| 38 | 38 |
| 39 // Called if stream encounters an error and has become unusable. | 39 // Called if stream encounters an error and has become unusable. |
| 40 virtual void OnStreamError(int stream_id) = 0; | 40 virtual void OnStreamError(int stream_id) = 0; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 AudioOutputDelegate(); | 43 AudioOutputDelegate(); |
| 44 virtual ~AudioOutputDelegate(); | 44 virtual ~AudioOutputDelegate(); |
| 45 | 45 |
| 46 // TODO(maxmorin): Remove GetController() when crbug.com/647185 is closed. | |
| 47 // This function is used to provide control of the audio stream to | |
| 48 // WebrtcAudioPrivateGetActiveSinkFunction and others in the webrtc extension | |
| 49 // API. Since the controller is shared, this means that it might outlive the | |
| 50 // AudioOutputDelegate. In this case, it is still safe to call functions on | |
| 51 // the controller, but it will not do anything. The controller is also shared | |
| 52 // with AudioStreamMonitor. | |
| 53 virtual scoped_refptr<AudioOutputController> GetController() const = 0; | |
| 54 virtual int GetStreamId() const = 0; | 46 virtual int GetStreamId() const = 0; |
| 55 | 47 |
| 56 // Stream control: | 48 // Stream control: |
| 57 virtual void OnPlayStream() = 0; | 49 virtual void OnPlayStream() = 0; |
| 58 virtual void OnPauseStream() = 0; | 50 virtual void OnPauseStream() = 0; |
| 59 virtual void OnSetVolume(double volume) = 0; | 51 virtual void OnSetVolume(double volume) = 0; |
| 60 }; | 52 }; |
| 61 | 53 |
| 62 } // namespace media | 54 } // namespace media |
| 63 | 55 |
| 64 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DELEGATE_H_ | 56 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DELEGATE_H_ |
| OLD | NEW |