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

Unified Diff: webrtc/modules/audio_mixer/audio_mixer_impl.h

Issue 2286343002: Less lock acquisitions for AudioMixer. (Closed)
Patch Set: GUARDED_BY, ACCESS_ON, C header and EXPECT_EQ order. Created 4 years, 4 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 | webrtc/modules/audio_mixer/audio_mixer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_mixer/audio_mixer_impl.h
diff --git a/webrtc/modules/audio_mixer/audio_mixer_impl.h b/webrtc/modules/audio_mixer/audio_mixer_impl.h
index 6ddf9ca5e8bde5c6954d458a6cfcdba8a902f9e7..ca8bdbeaed5ffe056a8d2eecd84ab37867edda8a 100644
--- a/webrtc/modules/audio_mixer/audio_mixer_impl.h
+++ b/webrtc/modules/audio_mixer/audio_mixer_impl.h
@@ -89,7 +89,8 @@ class AudioMixerImpl : public AudioMixer {
// Compute what audio sources to mix from audio_source_list_. Ramp in
// and out. Update mixed status. maxAudioFrameCounter specifies how
// many participants are allowed to be mixed.
- AudioFrameList UpdateToMix(size_t maxAudioFrameCounter) const;
+ AudioFrameList UpdateToMix(size_t maxAudioFrameCounter) const
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
// Return the lowest mixing frequency that can be used without having to
// downsample any audio.
@@ -98,7 +99,8 @@ class AudioMixerImpl : public AudioMixer {
const MixerAudioSourceList& mixList) const;
// Return the AudioFrames that should be mixed anonymously.
- void GetAdditionalAudio(AudioFrameList* additionalFramesList) const;
+ void GetAdditionalAudio(AudioFrameList* additionalFramesList) const
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
// This function returns true if it finds the MixerAudioSource in the
// specified list of MixerAudioSources.
@@ -132,7 +134,6 @@ class AudioMixerImpl : public AudioMixer {
int GetOutputAudioLevelFullRange() override;
std::unique_ptr<CriticalSectionWrapper> crit_;
- std::unique_ptr<CriticalSectionWrapper> cb_crit_;
int32_t id_;
@@ -141,12 +142,12 @@ class AudioMixerImpl : public AudioMixer {
size_t sample_size_;
// List of all audio sources. Note all lists are disjunct
- MixerAudioSourceList audio_source_list_; // May be mixed.
+ MixerAudioSourceList audio_source_list_ GUARDED_BY(crit_); // May be mixed.
// Always mixed, anonomously.
- MixerAudioSourceList additional_audio_source_list_;
+ MixerAudioSourceList additional_audio_source_list_ GUARDED_BY(crit_);
- size_t num_mixed_audio_sources_;
+ size_t num_mixed_audio_sources_ GUARDED_BY(crit_);
kwiberg-webrtc 2016/09/01 11:19:00 Good, but it makes me very suspicious that this cl
aleloi 2016/09/01 11:24:39 The other ones are only accessed by the mixer func
kwiberg-webrtc 2016/09/01 11:32:28 Could you annotate them with the thread checker st
aleloi 2016/09/01 12:33:06 Good point! I've followed the example usage instru
kwiberg-webrtc 2016/09/02 07:45:45 Excellent! Did you verify that you got the expecte
// Determines if we will use a limiter for clipping protection during
// mixing.
bool use_limiter_;
« no previous file with comments | « no previous file | webrtc/modules/audio_mixer/audio_mixer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698