Fall back to software encoding on wrong HW video encoder configuration

Catch one more IllegalArgumentException to avoid crashes on some devices.

Bug: webrtc:15636
Change-Id: I396473b409a1ceba8f4a91d5e4aa66d5fe3b0f44
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326002
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41113}
This commit is contained in:
Raman Budny 2023-11-06 15:01:31 +00:00 committed by WebRTC LUCI CQ
parent 698e0bec17
commit 36ed560339

View File

@ -292,7 +292,7 @@ class HardwareVideoEncoder implements VideoEncoder {
updateInputFormat(codec.getInputFormat());
codec.start();
} catch (IllegalStateException e) {
} catch (IllegalArgumentException | IllegalStateException e) {
Logging.e(TAG, "initEncodeInternal failed", e);
release();
return VideoCodecStatus.FALLBACK_SOFTWARE;