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

Unified Diff: content/renderer/media/media_stream_audio_processor.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
« no previous file with comments | « no previous file | content/renderer/media/media_stream_audio_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor.h
diff --git a/content/renderer/media/media_stream_audio_processor.h b/content/renderer/media/media_stream_audio_processor.h
index 6b4cf8fe104ba928fb7781fdb8028e89ff99ee3a..58e322bf99e8beec4f8ee64980ac491022ffba97 100644
--- a/content/renderer/media/media_stream_audio_processor.h
+++ b/content/renderer/media/media_stream_audio_processor.h
@@ -12,6 +12,7 @@
#include "content/common/content_export.h"
#include "content/renderer/media/webrtc_audio_device_impl.h"
#include "media/base/audio_converter.h"
+#include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
#include "third_party/webrtc/modules/interface/module_common_types.h"
@@ -34,13 +35,15 @@ namespace content {
class RTCMediaConstraints;
+using webrtc::AudioProcessorInterface;
+
// This class owns an object of webrtc::AudioProcessing which contains signal
// processing components like AGC, AEC and NS. It enables the components based
// on the getUserMedia constraints, processes the data and outputs it in a unit
// of 10 ms data chunk.
class CONTENT_EXPORT MediaStreamAudioProcessor :
- public base::RefCountedThreadSafe<MediaStreamAudioProcessor>,
- NON_EXPORTED_BASE(public WebRtcPlayoutDataSource::Sink) {
+ NON_EXPORTED_BASE(public WebRtcPlayoutDataSource::Sink),
+ NON_EXPORTED_BASE(public AudioProcessorInterface) {
public:
// |playout_data_source| is used to register this class as a sink to the
// WebRtc playout data for processing AEC. If clients do not enable AEC,
@@ -98,6 +101,10 @@ class CONTENT_EXPORT MediaStreamAudioProcessor :
int audio_delay_milliseconds) OVERRIDE;
virtual void OnPlayoutDataSourceChanged() OVERRIDE;
+ // webrtc::AudioProcessorInterface implementation.
+ // This method is called on the libjingle thread.
+ virtual void GetStats(AudioProcessorStats* stats) OVERRIDE;
+
// Helper to initialize the WebRtc AudioProcessing.
void InitializeAudioProcessingModule(
const blink::WebMediaConstraints& constraints, int effects);
@@ -164,8 +171,10 @@ class CONTENT_EXPORT MediaStreamAudioProcessor :
// Used by the typing detection.
scoped_ptr<webrtc::TypingDetection> typing_detector_;
- // Result from the typing detection.
- bool typing_detected_;
+ // This flag is used to show the result of typing detection.
+ // It can be accessed by the capture audio thread and by the libjingle thread
+ // which calls GetStats().
+ base::subtle::Atomic32 typing_detected_;
};
} // namespace content
« no previous file with comments | « no previous file | content/renderer/media/media_stream_audio_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698