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

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 https://codereview.chromium.org/178223013 and used scope_refpt 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 d8fae057c296a048d466fb1c96f6a52cd1a5234d..1cd7ad27d374a17773841d0cdcdd459dd89705b6 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 {
@@ -50,6 +51,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(
+ talk_base::scoped_refptr<webrtc::AudioProcessorInterface> processor);
tommi (sloooow) - chröme 2014/03/04 17:33:54 do we need to use talk_base::scoped_refptr here? I
no longer working on chromium 2014/03/04 18:54:07 Done. Actually it is not a problem since adapter
+
private:
// webrtc::MediaStreamTrack implementation.
virtual std::string kind() const OVERRIDE;
@@ -57,6 +65,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 +84,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_;
tommi (sloooow) - chröme 2014/03/04 17:33:54 scoped_refptr here as well
no longer working on chromium 2014/03/04 18:54:07 Done.
+
// A vector of WebRtc VoE channels that the capturer sends data to.
std::vector<int> voe_channels_;
@@ -80,7 +95,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