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. | |
148 const bool is_local_source_; | 146 const bool is_local_source_; |
149 | 147 |
150 // Set to true once this source has been permanently stopped. | 148 // Set to true once this source has been permanently stopped. |
151 bool is_stopped_; | 149 bool is_stopped_; |
152 | 150 |
153 // 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. |
154 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; | 152 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; |
155 | 153 |
156 // 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 |
157 // 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 |
158 // thread. | 156 // thread. |
159 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 157 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
160 | 158 |
161 // Provides weak pointers so that MediaStreamAudioTracks won't call | 159 // Provides weak pointers so that MediaStreamAudioTracks won't call |
162 // StopAudioDeliveryTo() if this instance dies first. | 160 // StopAudioDeliveryTo() if this instance dies first. |
163 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; | 161 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; |
164 | 162 |
165 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); | 163 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); |
166 }; | 164 }; |
167 | 165 |
168 } // namespace content | 166 } // namespace content |
169 | 167 |
170 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 168 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
OLD | NEW |