Add RuntimeSettings to CustomProcessing.
CustomProcessing is the interface to injectable audio processing submodules to AudioProcessing. This CL makes it possible to set runtime settings on the injected render processing component. Note that the current runtime setting handling happens on the capture thread. Therefore, we add another SwapQueue to communicate with the render thread. Bug: webrtc:9138, webrtc:9262 Change-Id: I665ce2d83a2b35ca8b25cca813d2cef7bd0ba911 Reviewed-on: https://webrtc-review.googlesource.com/76123 Commit-Queue: Alex Loiko <aleloi@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23236}
This commit is contained in:
@ -313,7 +313,11 @@ class AudioProcessing : public rtc::RefCountInterface {
|
||||
// runtime.
|
||||
class RuntimeSetting {
|
||||
public:
|
||||
enum class Type { kNotSpecified, kCapturePreGain };
|
||||
enum class Type {
|
||||
kNotSpecified,
|
||||
kCapturePreGain,
|
||||
kCustomRenderProcessingRuntimeSetting
|
||||
};
|
||||
|
||||
RuntimeSetting() : type_(Type::kNotSpecified), value_(0.f) {}
|
||||
~RuntimeSetting() = default;
|
||||
@ -323,6 +327,10 @@ class AudioProcessing : public rtc::RefCountInterface {
|
||||
return {Type::kCapturePreGain, gain};
|
||||
}
|
||||
|
||||
static RuntimeSetting CreateCustomRenderSetting(float payload) {
|
||||
return {Type::kCustomRenderProcessingRuntimeSetting, payload};
|
||||
}
|
||||
|
||||
Type type() const { return type_; }
|
||||
void GetFloat(float* value) const {
|
||||
RTC_DCHECK(value);
|
||||
@ -1119,6 +1127,9 @@ class CustomProcessing {
|
||||
virtual void Process(AudioBuffer* audio) = 0;
|
||||
// Returns a string representation of the module state.
|
||||
virtual std::string ToString() const = 0;
|
||||
// Handles RuntimeSettings. TODO(webrtc:9262): make pure virtual
|
||||
// after updating dependencies.
|
||||
virtual void SetRuntimeSetting(AudioProcessing::RuntimeSetting setting);
|
||||
|
||||
virtual ~CustomProcessing() {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user