Index: content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h |
diff --git a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h |
index cfe4a98ef9d291d96e0746833ecd3edcf2dab27e..36f5bda0cf9d5ddac8aed8295711b7541becc5a4 100644 |
--- a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h |
+++ b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h |
@@ -13,6 +13,7 @@ |
#include "base/synchronization/lock.h" |
#include "base/threading/thread_checker.h" |
#include "content/common/content_export.h" |
+#include "content/renderer/media/media_stream_audio_level_calculator.h" |
#include "third_party/webrtc/api/mediastreamtrack.h" |
#include "third_party/webrtc/media/base/audiorenderer.h" |
@@ -31,6 +32,10 @@ class MediaStreamAudioProcessor; |
class WebRtcAudioSinkAdapter; |
class WebRtcLocalAudioTrack; |
+// Provides an implementation of the webrtc::AudioTrackInterface that can be |
+// bound/unbound to/from a MediaStreamAudioTrack. In other words, this is an |
+// adapter that sits between the media stream object graph and WebRtc's object |
+// graph and proxies between the two. |
class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter |
: NON_EXPORTED_BASE( |
public webrtc::MediaStreamTrack<webrtc::AudioTrackInterface>) { |
@@ -48,9 +53,9 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter |
void Initialize(WebRtcLocalAudioTrack* owner); |
- // Called on the audio thread by the WebRtcLocalAudioTrack to set the signal |
- // level of the audio data. |
- void SetSignalLevel(int signal_level); |
+ // Set the object that provides shared access to the current audio signal |
+ // level. |
+ void SetLevel(scoped_refptr<MediaStreamAudioLevelCalculator::Level> level); |
// Method called by the WebRtcLocalAudioTrack to set the processor that |
// applies signal processing on the data of the track. |
@@ -93,8 +98,8 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter |
// from the audio track. |
ScopedVector<WebRtcAudioSinkAdapter> sink_adapters_; |
- // The amplitude of the signal. |
- int signal_level_; |
+ // Thread-safe accessor to current audio signal level. |
mcasas
2016/02/26 01:28:19
If this is thread-safe, we don't need to protect i
miu
2016/02/27 03:46:36
Done. Actually, that's an interesting point. If
|
+ scoped_refptr<MediaStreamAudioLevelCalculator::Level> level_; |
// Thread checker for libjingle's signaling thread. |
base::ThreadChecker signaling_thread_checker_; |
mcasas
2016/02/26 01:28:19
We don't need |signaling_thread_checker_| is we ha
miu
2016/02/27 03:46:36
Done. Removed both since the latter is only used
|