| 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): should be remove is_local_source_ variable. | |
| 147 const bool is_local_source_; | 146 const bool is_local_source_; |
| 148 | 147 |
| 149 // Set to true once this source has been permanently stopped. | 148 // Set to true once this source has been permanently stopped. |
| 150 bool is_stopped_; | 149 bool is_stopped_; |
| 151 | 150 |
| 152 // Manages tracks connected to this source and the audio format and data flow. | 151 // Manages tracks connected to this source and the audio format and data flow. |
| 153 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; | 152 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; |
| 154 | 153 |
| 155 // The task runner for main thread. Also used to check that all methods that | 154 // The task runner for main thread. Also used to check that all methods that |
| 156 // could cause object graph or data flow changes are being called on the main | 155 // could cause object graph or data flow changes are being called on the main |
| 157 // thread. | 156 // thread. |
| 158 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 157 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 159 | 158 |
| 160 // Provides weak pointers so that MediaStreamAudioTracks won't call | 159 // Provides weak pointers so that MediaStreamAudioTracks won't call |
| 161 // StopAudioDeliveryTo() if this instance dies first. | 160 // StopAudioDeliveryTo() if this instance dies first. |
| 162 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; | 161 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; |
| 163 | 162 |
| 164 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); | 163 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); |
| 165 }; | 164 }; |
| 166 | 165 |
| 167 } // namespace content | 166 } // namespace content |
| 168 | 167 |
| 169 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 168 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
| OLD | NEW |