Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 37 WebRtcLocalAudioTrackAdapter( | 37 WebRtcLocalAudioTrackAdapter( |
| 38 const std::string& label, | 38 const std::string& label, |
| 39 webrtc::AudioSourceInterface* track_source); | 39 webrtc::AudioSourceInterface* track_source); |
| 40 | 40 |
| 41 virtual ~WebRtcLocalAudioTrackAdapter(); | 41 virtual ~WebRtcLocalAudioTrackAdapter(); |
| 42 | 42 |
| 43 void Initialize(WebRtcLocalAudioTrack* owner); | 43 void Initialize(WebRtcLocalAudioTrack* owner); |
| 44 | 44 |
| 45 std::vector<int> VoeChannels() const; | 45 std::vector<int> VoeChannels() const; |
| 46 | 46 |
| 47 void SetSignalLevel(int signal_level); | |
| 48 | |
| 47 private: | 49 private: |
| 48 // webrtc::MediaStreamTrack implementation. | 50 // webrtc::MediaStreamTrack implementation. |
| 49 virtual std::string kind() const OVERRIDE; | 51 virtual std::string kind() const OVERRIDE; |
| 50 | 52 |
| 51 // cricket::AudioCapturer implementation. | 53 // cricket::AudioCapturer implementation. |
| 52 virtual void AddChannel(int channel_id) OVERRIDE; | 54 virtual void AddChannel(int channel_id) OVERRIDE; |
| 53 virtual void RemoveChannel(int channel_id) OVERRIDE; | 55 virtual void RemoveChannel(int channel_id) OVERRIDE; |
| 54 | 56 |
| 55 // webrtc::AudioTrackInterface implementation. | 57 // webrtc::AudioTrackInterface implementation. |
| 56 virtual webrtc::AudioSourceInterface* GetSource() const OVERRIDE; | 58 virtual webrtc::AudioSourceInterface* GetSource() const OVERRIDE; |
| 57 virtual cricket::AudioRenderer* GetRenderer() OVERRIDE; | 59 virtual cricket::AudioRenderer* GetRenderer() OVERRIDE; |
| 58 | 60 |
| 59 // Weak reference. | 61 // Weak reference. |
| 60 WebRtcLocalAudioTrack* owner_; | 62 WebRtcLocalAudioTrack* owner_; |
| 61 | 63 |
| 62 // The source of the audio track which handles the audio constraints. | 64 // The source of the audio track which handles the audio constraints. |
| 63 // TODO(xians): merge |track_source_| to |capturer_| in WebRtcLocalAudioTrack. | 65 // TODO(xians): merge |track_source_| to |capturer_| in WebRtcLocalAudioTrack. |
| 64 talk_base::scoped_refptr<webrtc::AudioSourceInterface> track_source_; | 66 talk_base::scoped_refptr<webrtc::AudioSourceInterface> track_source_; |
| 65 | 67 |
| 66 // A vector of WebRtc VoE channels that the capturer sends data to. | 68 // A vector of WebRtc VoE channels that the capturer sends data to. |
| 67 std::vector<int> voe_channels_; | 69 std::vector<int> voe_channels_; |
| 68 | 70 |
| 69 // Protects |voe_channels_|. | 71 // The amplitude of the signal. |
| 72 int signal_level_; | |
|
tommi (sloooow) - chröme
2014/02/27 08:39:43
As is, this variable is never used. Can we skip a
no longer working on chromium
2014/02/28 08:16:25
Done.
| |
| 73 | |
| 74 // Protects |voe_channels_|, |signal_level_|. | |
| 70 mutable base::Lock lock_; | 75 mutable base::Lock lock_; |
| 71 }; | 76 }; |
| 72 | 77 |
| 73 } // namespace content | 78 } // namespace content |
| 74 | 79 |
| 75 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ | 80 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_LOCAL_AUDIO_TRACK_ADAPTER_H_ |
| OLD | NEW |