Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2670)

Unified Diff: content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h

Issue 185413009: Implements the GetSignalLevel and GetStats interface for the local audio track. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a721a9f57fdc77e4e431f65097a86b2d7cf4cda9..dd70c20403aa0da1a46ff55d63f79f65bed591ff 100644
--- a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h
+++ b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h
@@ -20,6 +20,7 @@ class AudioRenderer;
namespace webrtc {
class AudioSourceInterface;
+class AudioProcessorInterface;
}
namespace content {
@@ -46,6 +47,12 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter
std::vector<int> VoeChannels() const;
+ // Method called by the WebRtcLocalAudioTrack to set the processor that
+ // applies signal processing on the data of the track.
+ // This class will keep a reference of the |processor|.
+ // Called on the main render thread.
+ void SetAudioProcessor(webrtc::AudioProcessorInterface* processor);
+
private:
// webrtc::MediaStreamTrack implementation.
virtual std::string kind() const OVERRIDE;
@@ -53,6 +60,8 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter
// webrtc::AudioTrackInterface implementation.
virtual void AddSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE;
virtual void RemoveSink(webrtc::AudioTrackSinkInterface* sink) OVERRIDE;
+ virtual bool GetSignalLevel(int* level) OVERRIDE;
+ virtual webrtc::AudioProcessorInterface* GetAudioProcessor() OVERRIDE;
// cricket::AudioCapturer implementation.
virtual void AddChannel(int channel_id) OVERRIDE;
@@ -69,6 +78,10 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter
// TODO(xians): merge |track_source_| to |capturer_| in WebRtcLocalAudioTrack.
talk_base::scoped_refptr<webrtc::AudioSourceInterface> track_source_;
+ // The audio processsor that applies audio processing on the data of audio
+ // track.
+ talk_base::scoped_refptr<webrtc::AudioProcessorInterface> audio_processor_;
+
// A vector of WebRtc VoE channels that the capturer sends data to.
std::vector<int> voe_channels_;
@@ -76,7 +89,10 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter
// from the audio track.
ScopedVector<WebRtcAudioSinkAdapter> sink_adapters_;
- // Protects |voe_channels_|.
+ // The amplitude of the signal.
+ int signal_level_;
+
+ // Protects |voe_channels_|, |audio_processor_| and |signal_level_|.
mutable base::Lock lock_;
};

Powered by Google App Engine
This is Rietveld 408576698