Remove the requirement to call set_sample_rate_hz and friends.
Instead have ProcessStream transparently handle changes to the stream audio parameters (sample rate and channels). This removes two locks per 10 ms ProcessStream call taken by VoiceEngine (four total with the audio level indicator.) Also, prepare future improvements by having the splitting filter take a length parameter. This will allow it to work at different sample rates. Remove the useless splitting_filter wrapper. TESTED=voe_cmd_test with audio processing enabled and switching between codecs; unit tests. R=aluebs@webrtc.org, bjornv@webrtc.org, turaj@webrtc.org, xians@webrtc.org Review URL: https://webrtc-codereview.appspot.com/3949004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5346 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -47,7 +47,7 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
kSampleRate32kHz = 32000
|
||||
};
|
||||
|
||||
explicit AudioProcessingImpl(int id);
|
||||
AudioProcessingImpl();
|
||||
virtual ~AudioProcessingImpl();
|
||||
|
||||
CriticalSectionWrapper* crit() const;
|
||||
@ -57,7 +57,6 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
|
||||
// AudioProcessing methods.
|
||||
virtual int Initialize() OVERRIDE;
|
||||
virtual int InitializeLocked();
|
||||
virtual void SetExtraOptions(const Config& config) OVERRIDE;
|
||||
virtual int EnableExperimentalNs(bool enable) OVERRIDE;
|
||||
virtual bool experimental_ns_enabled() const OVERRIDE {
|
||||
@ -92,14 +91,17 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
// Module methods.
|
||||
virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
|
||||
|
||||
protected:
|
||||
virtual int InitializeLocked();
|
||||
|
||||
private:
|
||||
int MaybeInitializeLocked(int sample_rate_hz, int num_input_channels,
|
||||
int num_output_channels, int num_reverse_channels);
|
||||
bool is_data_processed() const;
|
||||
bool interleave_needed(bool is_data_processed) const;
|
||||
bool synthesis_needed(bool is_data_processed) const;
|
||||
bool analysis_needed(bool is_data_processed) const;
|
||||
|
||||
int id_;
|
||||
|
||||
EchoCancellationImplWrapper* echo_cancellation_;
|
||||
EchoControlMobileImpl* echo_control_mobile_;
|
||||
GainControlImpl* gain_control_;
|
||||
@ -118,8 +120,8 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
int WriteMessageToDebugFile();
|
||||
int WriteInitMessage();
|
||||
scoped_ptr<FileWrapper> debug_file_;
|
||||
scoped_ptr<audioproc::Event> event_msg_; // Protobuf message.
|
||||
std::string event_str_; // Memory for protobuf serialization.
|
||||
scoped_ptr<audioproc::Event> event_msg_; // Protobuf message.
|
||||
std::string event_str_; // Memory for protobuf serialization.
|
||||
#endif
|
||||
|
||||
int sample_rate_hz_;
|
||||
|
||||
Reference in New Issue
Block a user