ProcessReconfigure initialized ok to false, causing on-the-fly reconfiguration
to always fail and drain+recreate the encoder unnecessarily.
Additionally, BitrateChange carries a Maybe<uint32_t>. Reconfiguring from a
config with an explicit bitrate to one without produces BitrateChange{Nothing()},
which hit an unchecked .ref() in FFmpegDataEncoder. While this looks strange, it
means: "revert the decoder to picking the bitrate it wants", e.g based on
resolution/framerate or whatever the encoder's policy is.
Differential Revision: https://phabricator.services.mozilla.com/D286672
32 lines
578 B
HTML
32 lines
578 B
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<body>
|
|
<script>
|
|
async function run() {
|
|
if (typeof VideoEncoder === "undefined") {
|
|
return;
|
|
}
|
|
const encoder = new VideoEncoder({ output: () => {}, error: () => {} });
|
|
encoder.configure({
|
|
codec: "avc1.42001E",
|
|
width: 640,
|
|
height: 480,
|
|
avc: {},
|
|
bitrate: 1000000
|
|
});
|
|
encoder.configure({
|
|
codec: "avc1.42001E",
|
|
width: 320,
|
|
height: 240,
|
|
avc: {}
|
|
});
|
|
await encoder.flush().catch(() => {});
|
|
}
|
|
|
|
run().finally(() => {
|
|
document.documentElement.className = "";
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|