| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WEBRTC_LOCAL_AUDIO_TRACK_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Add a sink to the track. This function will trigger a SetCaptureFormat() | 38 // Add a sink to the track. This function will trigger a SetCaptureFormat() |
| 39 // call on the |sink|. | 39 // call on the |sink|. |
| 40 // Called on the main render thread. | 40 // Called on the main render thread. |
| 41 void AddSink(WebRtcAudioCapturerSink* sink); | 41 void AddSink(WebRtcAudioCapturerSink* sink); |
| 42 | 42 |
| 43 // Remove a sink from the track. | 43 // Remove a sink from the track. |
| 44 // Called on the main render thread. | 44 // Called on the main render thread. |
| 45 void RemoveSink(WebRtcAudioCapturerSink* sink); | 45 void RemoveSink(WebRtcAudioCapturerSink* sink); |
| 46 | 46 |
| 47 // Starts the local audio track. Called on the main render thread and |
| 48 // should be called only once when audio track is created. |
| 49 void Start(); |
| 50 |
| 51 // Stops the local audio track. Called on the main render thread and |
| 52 // should be called only once when audio track going away. |
| 53 void Stop(); |
| 54 |
| 47 protected: | 55 protected: |
| 48 WebRtcLocalAudioTrack(const std::string& label, | 56 WebRtcLocalAudioTrack(const std::string& label, |
| 49 const scoped_refptr<WebRtcAudioCapturer>& capturer, | 57 const scoped_refptr<WebRtcAudioCapturer>& capturer, |
| 50 webrtc::AudioSourceInterface* stream_source); | 58 webrtc::AudioSourceInterface* stream_source); |
| 51 virtual ~WebRtcLocalAudioTrack(); | 59 virtual ~WebRtcLocalAudioTrack(); |
| 52 | 60 |
| 53 private: | 61 private: |
| 54 typedef std::list<scoped_refptr<WebRtcAudioCapturerSinkOwner> > SinkList; | 62 typedef std::list<scoped_refptr<WebRtcAudioCapturerSinkOwner> > SinkList; |
| 55 | 63 |
| 56 // content::WebRtcAudioCapturerSink implementation. | 64 // content::WebRtcAudioCapturerSink implementation. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 97 |
| 90 // Protects |params_| and |sinks_|. | 98 // Protects |params_| and |sinks_|. |
| 91 mutable base::Lock lock_; | 99 mutable base::Lock lock_; |
| 92 | 100 |
| 93 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioTrack); | 101 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioTrack); |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 } // namespace content | 104 } // namespace content |
| 97 | 105 |
| 98 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ | 106 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ |
| OLD | NEW |