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

Unified Diff: webrtc/modules/audio_processing/voice_detection_impl.h

Issue 1424663003: Lock scheme #8: Introduced the new locking scheme (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@add_threadcheckers_CL
Patch Set: Created a threadsafe wrapper for the random generator in the locktest. Fixed an unprotected variabl… Created 5 years, 1 month 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: webrtc/modules/audio_processing/voice_detection_impl.h
diff --git a/webrtc/modules/audio_processing/voice_detection_impl.h b/webrtc/modules/audio_processing/voice_detection_impl.h
index b18808316e7bc09667820f8e5f61427417410a06..3a1193c1d7be06be89fc9b115f87913c8b470f7c 100644
--- a/webrtc/modules/audio_processing/voice_detection_impl.h
+++ b/webrtc/modules/audio_processing/voice_detection_impl.h
@@ -11,18 +11,18 @@
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_VOICE_DETECTION_IMPL_H_
#define WEBRTC_MODULES_AUDIO_PROCESSING_VOICE_DETECTION_IMPL_H_
+#include "webrtc/base/criticalsection.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/modules/audio_processing/processing_component.h"
namespace webrtc {
class AudioBuffer;
-class CriticalSectionWrapper;
class VoiceDetectionImpl : public VoiceDetection,
public ProcessingComponent {
public:
- VoiceDetectionImpl(const AudioProcessing* apm, CriticalSectionWrapper* crit);
+ VoiceDetectionImpl(const AudioProcessing* apm, rtc::CriticalSection* crit);
virtual ~VoiceDetectionImpl();
int ProcessCaptureAudio(AudioBuffer* audio);
@@ -51,13 +51,16 @@ class VoiceDetectionImpl : public VoiceDetection,
int num_handles_required() const override;
int GetHandleError(void* handle) const override;
+ // Not guarded as its public API is thread safe.
const AudioProcessing* apm_;
- CriticalSectionWrapper* crit_;
- bool stream_has_voice_;
- bool using_external_vad_;
- Likelihood likelihood_;
- int frame_size_ms_;
- size_t frame_size_samples_;
+
+ rtc::CriticalSection* const crit_;
+
+ bool stream_has_voice_ GUARDED_BY(crit_);
+ bool using_external_vad_ GUARDED_BY(crit_);
+ Likelihood likelihood_ GUARDED_BY(crit_);
+ int frame_size_ms_ GUARDED_BY(crit_);
+ size_t frame_size_samples_ GUARDED_BY(crit_);
};
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_processing/noise_suppression_impl.cc ('k') | webrtc/modules/audio_processing/voice_detection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698