| 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_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const scoped_refptr<MediaStreamAudioProcessor>& processor); | 60 const scoped_refptr<MediaStreamAudioProcessor>& processor); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // webrtc::MediaStreamTrack implementation. | 63 // webrtc::MediaStreamTrack implementation. |
| 64 virtual std::string kind() const OVERRIDE; | 64 virtual std::string kind() const OVERRIDE; |
| 65 | 65 |
| 66 // webrtc::AudioTrackInterface implementation. | 66 // webrtc::AudioTrackInterface implementation. |
| 67 virtual void AddSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE; | 67 virtual void AddSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE; |
| 68 virtual void RemoveSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE; | 68 virtual void RemoveSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE; |
| 69 virtual bool GetSignalLevel(int* level) OVERRIDE; | 69 virtual bool GetSignalLevel(int* level) OVERRIDE; |
| 70 virtual talk_base::scoped_refptr<webrtc::AudioProcessorInterface> | 70 virtual rtc::scoped_refptr<webrtc::AudioProcessorInterface> |
| 71 GetAudioProcessor() OVERRIDE; | 71 GetAudioProcessor() OVERRIDE; |
| 72 | 72 |
| 73 // cricket::AudioCapturer implementation. | 73 // cricket::AudioCapturer implementation. |
| 74 virtual void AddChannel(int channel_id) OVERRIDE; | 74 virtual void AddChannel(int channel_id) OVERRIDE; |
| 75 virtual void RemoveChannel(int channel_id) OVERRIDE; | 75 virtual void RemoveChannel(int channel_id) OVERRIDE; |
| 76 | 76 |
| 77 // webrtc::AudioTrackInterface implementation. | 77 // webrtc::AudioTrackInterface implementation. |
| 78 virtual webrtc::AudioSourceInterface* GetSource() const OVERRIDE; | 78 virtual webrtc::AudioSourceInterface* GetSource() const OVERRIDE; |
| 79 virtual cricket::AudioRenderer* GetRenderer() OVERRIDE; | 79 virtual cricket::AudioRenderer* GetRenderer() OVERRIDE; |
| 80 | 80 |
| 81 // Weak reference. | 81 // Weak reference. |
| 82 WebRtcLocalAudioTrack* owner_; | 82 WebRtcLocalAudioTrack* owner_; |
| 83 | 83 |
| 84 // The source of the audio track which handles the audio constraints. | 84 // The source of the audio track which handles the audio constraints. |
| 85 // TODO(xians): merge |track_source_| to |capturer_| in WebRtcLocalAudioTrack. | 85 // TODO(xians): merge |track_source_| to |capturer_| in WebRtcLocalAudioTrack. |
| 86 talk_base::scoped_refptr<webrtc::AudioSourceInterface> track_source_; | 86 rtc::scoped_refptr<webrtc::AudioSourceInterface> track_source_; |
| 87 | 87 |
| 88 // The audio processsor that applies audio processing on the data of audio | 88 // The audio processsor that applies audio processing on the data of audio |
| 89 // track. | 89 // track. |
| 90 scoped_refptr<MediaStreamAudioProcessor> audio_processor_; | 90 scoped_refptr<MediaStreamAudioProcessor> audio_processor_; |
| 91 | 91 |
| 92 // A vector of WebRtc VoE channels that the capturer sends data to. | 92 // A vector of WebRtc VoE channels that the capturer sends data to. |
| 93 std::vector<int> voe_channels_; | 93 std::vector<int> voe_channels_; |
| 94 | 94 |
| 95 // A vector of the peer connection sink adapters which receive the audio data | 95 // A vector of the peer connection sink adapters which receive the audio data |
| 96 // from the audio track. | 96 // from the audio track. |
| 97 ScopedVector<WebRtcAudioSinkAdapter> sink_adapters_; | 97 ScopedVector<WebRtcAudioSinkAdapter> sink_adapters_; |
| 98 | 98 |
| 99 // The amplitude of the signal. | 99 // The amplitude of the signal. |
| 100 int signal_level_; | 100 int signal_level_; |
| 101 | 101 |
| 102 // Protects |voe_channels_|, |audio_processor_| and |signal_level_|. | 102 // Protects |voe_channels_|, |audio_processor_| and |signal_level_|. |
| 103 mutable base::Lock lock_; | 103 mutable base::Lock lock_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace content | 106 } // namespace content |
| 107 | 107 |
| 108 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ | 108 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ |
| OLD | NEW |