aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_processing/audio_processing_impl.h
diff options
context:
space:
mode:
authorpeah <peah@webrtc.org>2015-11-17 02:16:45 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-17 10:16:51 +0000
commit192164eebc9bbb5c5745f19330b203174304e269 (patch)
tree344ac6c88dc7614edea546961bd04a86cdcf81fc /webrtc/modules/audio_processing/audio_processing_impl.h
parent4d291f7d5e088e3e9f4680dabbe431e62b827f64 (diff)
downloadwebrtc-192164eebc9bbb5c5745f19330b203174304e269.tar.gz
Preparational work before introducing the locks in order to harmonize the code:
-Moved the initialize function -Moved api_format into the shared state BUG= Review URL: https://codereview.webrtc.org/1413093002 Cr-Commit-Position: refs/heads/master@{#10668}
Diffstat (limited to 'webrtc/modules/audio_processing/audio_processing_impl.h')
-rw-r--r--webrtc/modules/audio_processing/audio_processing_impl.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
index 542886ee10..72dfbf419b 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.h
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h
@@ -176,8 +176,17 @@ class AudioProcessingImpl : public AudioProcessing {
std::string last_serialized_config_;
#endif
- // Format of processing streams at input/output call sites.
- ProcessingConfig api_format_;
+ // State that is written to while holding both the render and capture locks
+ // but can be read while holding only one of the locks.
+ struct SharedState {
+ SharedState()
+ : // Format of processing streams at input/output call sites.
+ api_format_({{{kSampleRate16kHz, 1, false},
+ {kSampleRate16kHz, 1, false},
+ {kSampleRate16kHz, 1, false},
+ {kSampleRate16kHz, 1, false}}}) {}
+ ProcessingConfig api_format_;
+ } shared_state_;
// Only the rate and samples fields of fwd_proc_format_ are used because the
// forward processing number of channels is mutable and is tracked by the