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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // MediaStreamSource override. | 127 // MediaStreamSource override. |
128 void DoStopSource() final; | 128 void DoStopSource() final; |
129 | 129 |
130 // Removes |track| from the list of instances that get a copy of the source | 130 // Removes |track| from the list of instances that get a copy of the source |
131 // audio data. The "stop callback" that was provided to the track calls | 131 // audio data. The "stop callback" that was provided to the track calls |
132 // this. | 132 // this. |
133 void StopAudioDeliveryTo(MediaStreamAudioTrack* track); | 133 void StopAudioDeliveryTo(MediaStreamAudioTrack* track); |
134 | 134 |
135 // True if the source of audio is a local device. False if the source is | 135 // True if the source of audio is a local device. False if the source is |
136 // remote (e.g., streamed-in from a server). | 136 // remote (e.g., streamed-in from a server). |
| 137 // TODO(crbug.com/598704): should be remove is_local_source_ variable. |
137 const bool is_local_source_; | 138 const bool is_local_source_; |
138 | 139 |
139 // In debug builds, check that all methods that could cause object graph | 140 // In debug builds, check that all methods that could cause object graph |
140 // or data flow changes are being called on the main thread. | 141 // or data flow changes are being called on the main thread. |
141 base::ThreadChecker thread_checker_; | 142 base::ThreadChecker thread_checker_; |
142 | 143 |
143 // Set to true once this source has been permanently stopped. | 144 // Set to true once this source has been permanently stopped. |
144 bool is_stopped_; | 145 bool is_stopped_; |
145 | 146 |
146 // Manages tracks connected to this source and the audio format and data flow. | 147 // Manages tracks connected to this source and the audio format and data flow. |
147 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; | 148 MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_; |
148 | 149 |
149 // Provides weak pointers so that MediaStreamAudioTracks won't call | 150 // Provides weak pointers so that MediaStreamAudioTracks won't call |
150 // StopAudioDeliveryTo() if this instance dies first. | 151 // StopAudioDeliveryTo() if this instance dies first. |
151 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; | 152 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; |
152 | 153 |
153 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); | 154 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); |
154 }; | 155 }; |
155 | 156 |
156 } // namespace content | 157 } // namespace content |
157 | 158 |
158 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 159 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
OLD | NEW |