-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade webrtc-audio-processing lib to v2.0 #43
base: upgrade-v1
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a pass by review, looks good on paper
impl From<CaptureLevelAdjustment> for ffi::AudioProcessing_Config_CaptureLevelAdjustment { | ||
fn from(other: CaptureLevelAdjustment) -> Self { | ||
let analog_mic_gain_emulation = | ||
ffi::AudioProcessing_Config_CaptureLevelAdjustment_AnalogMicGainEmulation { | ||
enabled: false, | ||
initial_level: 255, | ||
}; | ||
|
||
Self { | ||
enabled: true, | ||
pre_gain_factor: other.pre_gain_factor, | ||
post_gain_factor: other.post_gain_factor, | ||
analog_mic_gain_emulation, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit: we could instead implement impl From<
Option
<CaptureLevelAdjustment>> for ffi::AudioProcessing_Config_CaptureLevelAdjustment {
and set enabled: false
if it is None - i.e. move some logic from the caller to here.
OTOH I guess this pattern is used for many types here, so we shuold probably either convert either all or none - which is better suited for a separate PR.
It builds, but functionalities haven't been tested.