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

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: rebased Created 6 years, 9 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 d8fae057c296a048d466fb1c96f6a52cd1a5234d..b35ad4a01eaf7730b5a37188d8143543f48c3952 100644
--- a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h
+++ b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h
@@ -20,10 +20,12 @@ class AudioRenderer;
namespace webrtc {
class AudioSourceInterface;
+class AudioProcessorInterface;
}
namespace content {
+class MediaStreamAudioProcessor;
class WebRtcAudioSinkAdapter;
class WebRtcLocalAudioTrack;
@@ -50,6 +52,13 @@ class CONTENT_EXPORT WebRtcLocalAudioTrackAdapter
// level of the audio data.
void SetSignalLevel(int signal_level);
+ // 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(
+ const scoped_refptr<MediaStreamAudioProcessor>& processor);
+
private:
// webrtc::MediaStreamTrack implementation.
virtual std::string kind() const OVERRIDE;
@@ -57,6 +66,9 @@ 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 talk_base::scoped_refptr<webrtc::AudioProcessorInterface>
+ GetAudioProcessor() OVERRIDE;
// cricket::AudioCapturer implementation.
virtual void AddChannel(int channel_id) OVERRIDE;
@@ -73,6 +85,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.
+ scoped_refptr<MediaStreamAudioProcessor> audio_processor_;
+
// A vector of WebRtc VoE channels that the capturer sends data to.
std::vector<int> voe_channels_;
@@ -80,7 +96,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