| 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // is operated on the IO thread. | 35 // is operated on the IO thread. |
| 36 class CONTENT_EXPORT AudioOutputDelegate | 36 class CONTENT_EXPORT AudioOutputDelegate |
| 37 : public media::AudioOutputController::EventHandler { | 37 : public media::AudioOutputController::EventHandler { |
| 38 public: | 38 public: |
| 39 class CONTENT_EXPORT EventHandler { | 39 class CONTENT_EXPORT EventHandler { |
| 40 public: | 40 public: |
| 41 virtual ~EventHandler() {} | 41 virtual ~EventHandler() {} |
| 42 | 42 |
| 43 // All these methods are called on the IO thread. | 43 // All these methods are called on the IO thread. |
| 44 | 44 |
| 45 // Called when the state changes between playing and not playing. | |
| 46 virtual void OnStreamStateChanged(bool playing) = 0; | |
| 47 | |
| 48 // Called when construction is finished and the stream is ready for | 45 // Called when construction is finished and the stream is ready for |
| 49 // playout. | 46 // playout. |
| 50 virtual void OnStreamCreated(int stream_id, | 47 virtual void OnStreamCreated(int stream_id, |
| 51 base::SharedMemory* shared_memory, | 48 base::SharedMemory* shared_memory, |
| 52 base::CancelableSyncSocket* socket) = 0; | 49 base::CancelableSyncSocket* socket) = 0; |
| 53 | 50 |
| 54 // Called if stream encounters an error and has become unusable. | 51 // Called if stream encounters an error and has become unusable. |
| 55 virtual void OnStreamError(int stream_id) = 0; | 52 virtual void OnStreamError(int stream_id) = 0; |
| 56 }; | 53 }; |
| 57 | 54 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 bool playing_ = false; | 133 bool playing_ = false; |
| 137 base::WeakPtr<AudioOutputDelegate> weak_this_; | 134 base::WeakPtr<AudioOutputDelegate> weak_this_; |
| 138 base::WeakPtrFactory<AudioOutputDelegate> weak_factory_; | 135 base::WeakPtrFactory<AudioOutputDelegate> weak_factory_; |
| 139 | 136 |
| 140 DISALLOW_COPY_AND_ASSIGN(AudioOutputDelegate); | 137 DISALLOW_COPY_AND_ASSIGN(AudioOutputDelegate); |
| 141 }; | 138 }; |
| 142 | 139 |
| 143 } // namespace content | 140 } // namespace content |
| 144 | 141 |
| 145 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DELEGATE_H_ | 142 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_OUTPUT_DELEGATE_H_ |
| OLD | NEW |