| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // MediaStreamSource override. | 136 // MediaStreamSource override. |
| 137 void DoStopSource() final; | 137 void DoStopSource() final; |
| 138 | 138 |
| 139 // Removes |track| from the list of instances that get a copy of the source | 139 // Removes |track| from the list of instances that get a copy of the source |
| 140 // audio data. The "stop callback" that was provided to the track calls | 140 // audio data. The "stop callback" that was provided to the track calls |
| 141 // this. | 141 // this. |
| 142 void StopAudioDeliveryTo(MediaStreamAudioTrack* track); | 142 void StopAudioDeliveryTo(MediaStreamAudioTrack* track); |
| 143 | 143 |
| 144 // True if the source of audio is a local device. False if the source is | 144 // True if the source of audio is a local device. False if the source is |
| 145 // remote (e.g., streamed-in from a server). | 145 // remote (e.g., streamed-in from a server). |
| 146 // TODO(crbug.com/598704): This variable is not likely to be used anymore. |
| 147 // The remote option was erased by crbug.com/598704. |
| 146 const bool is_local_source_; | 148 const bool is_local_source_; |
| 147 | 149 |
| 148 // Set to true once this source has been permanently stopped. | 150 // Set to true once this source has been permanently stopped. |
| 149 bool is_stopped_; | 151 bool is_stopped_; |
| 150 | 152 |
| 151 // Manages tracks connected to this source and the audio format and data flow. | 153 // Manages tracks connected to this source and the audio format and data flow. |
| 152 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; | 154 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; |
| 153 | 155 |
| 154 // The task runner for main thread. Also used to check that all methods that | 156 // The task runner for main thread. Also used to check that all methods that |
| 155 // could cause object graph or data flow changes are being called on the main | 157 // could cause object graph or data flow changes are being called on the main |
| 156 // thread. | 158 // thread. |
| 157 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 159 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 158 | 160 |
| 159 // Provides weak pointers so that MediaStreamAudioTracks won't call | 161 // Provides weak pointers so that MediaStreamAudioTracks won't call |
| 160 // StopAudioDeliveryTo() if this instance dies first. | 162 // StopAudioDeliveryTo() if this instance dies first. |
| 161 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; | 163 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; |
| 162 | 164 |
| 163 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); | 165 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); |
| 164 }; | 166 }; |
| 165 | 167 |
| 166 } // namespace content | 168 } // namespace content |
| 167 | 169 |
| 168 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 170 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
| OLD | NEW |