Commit 3033ecfe authored by Shik Chen's avatar Shik Chen Committed by Commit Bot

CCA: Disable echo cancellation when recording

Echo cancellation is mainly for video conferencing. Disable it in CCA
could save ~10% cpu on Nocturne in video recording.

Bug: b:139788862
Test: Record video on Nocturne, measure performance by pprof and top.

Change-Id: Ib531c338a46e9a6c611e269ade1e96541be764ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864757Reviewed-by: default avatarWei Lee <wtlee@chromium.org>
Commit-Queue: Shik Chen <shik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706406}
parent 99545773
......@@ -326,7 +326,7 @@ cca.device.VideoConstraintsPreferrer =
};
const toConstraints = (width, height, fps) => ({
audio: true,
audio: {echoCancellation: false},
video: {
deviceId: {exact: deviceId},
frameRate: fps ? {exact: fps} : {min: 24},
......
......@@ -254,7 +254,10 @@ cca.views.camera.Modes.getV1Constraints = async function(videoMode, deviceId) {
// deviceId is set to null for requesting camera with default facing.
constraint.facingMode = {exact: defaultFacing};
}
return {audio: videoMode, video: constraint};
return {
audio: videoMode ? {echoCancellation: false} : false,
video: constraint,
};
});
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment