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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Called by subclasses to deliver audio data to the currently-connected | 125 // Called by subclasses to deliver audio data to the currently-connected |
126 // tracks. This method is thread-safe. | 126 // tracks. This method is thread-safe. |
127 void DeliverDataToTracks(const media::AudioBus& audio_bus, | 127 void DeliverDataToTracks(const media::AudioBus& audio_bus, |
128 base::TimeTicks reference_time); | 128 base::TimeTicks reference_time); |
129 | 129 |
130 // Called by subclasses when capture error occurs. | 130 // Called by subclasses when capture error occurs. |
131 // Note: This can be called on any thread, and will post a task to the main | 131 // Note: This can be called on any thread, and will post a task to the main |
132 // thread to stop the source soon. | 132 // thread to stop the source soon. |
133 void StopSourceOnError(const std::string& why); | 133 void StopSourceOnError(const std::string& why); |
134 | 134 |
| 135 // Sets muted state and notifies it to all registered tracks. |
| 136 void SetMutedState(bool state); |
| 137 |
135 private: | 138 private: |
136 // MediaStreamSource override. | 139 // MediaStreamSource override. |
137 void DoStopSource() final; | 140 void DoStopSource() final; |
138 | 141 |
139 // Removes |track| from the list of instances that get a copy of the source | 142 // 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 | 143 // audio data. The "stop callback" that was provided to the track calls |
141 // this. | 144 // this. |
142 void StopAudioDeliveryTo(MediaStreamAudioTrack* track); | 145 void StopAudioDeliveryTo(MediaStreamAudioTrack* track); |
143 | 146 |
144 // True if the source of audio is a local device. False if the source is | 147 // True if the source of audio is a local device. False if the source is |
(...skipping 14 matching lines...) Expand all Loading... |
159 // Provides weak pointers so that MediaStreamAudioTracks won't call | 162 // Provides weak pointers so that MediaStreamAudioTracks won't call |
160 // StopAudioDeliveryTo() if this instance dies first. | 163 // StopAudioDeliveryTo() if this instance dies first. |
161 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; | 164 base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_; |
162 | 165 |
163 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); | 166 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource); |
164 }; | 167 }; |
165 | 168 |
166 } // namespace content | 169 } // namespace content |
167 | 170 |
168 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ | 171 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_ |
OLD | NEW |