A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(voice): prefer vp9 over software h264 for screen shares (#3106)
Hampusee2d11ee0af9
diff --git a/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts b/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.tsindex 86de682af..402f31fda 100644--- a/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts+++ b/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts@@ -4,6 +4,7 @@ import type {CodecPreference, ScreenShareEncoderMode} from '@app/features/voice/import type {VideoCodec} from 'livekit-client';export const CODEC_PREFERENCE: ReadonlyArray<VideoCodec> = ['av1', 'h265', 'h264', 'vp9', 'vp8'];+const SOFTWARE_H264_CODEC_PREFERENCE: ReadonlyArray<VideoCodec> = ['av1', 'h265', 'vp9', 'h264', 'vp8'];const COMPATIBILITY_CODECS: ReadonlySet<VideoCodec> = new Set(['h264', 'vp9', 'vp8']);export const LAST_RESORT_VIDEO_CODEC: VideoCodec = 'vp8';const BASELINE_BROWSER_CODECS: ReadonlySet<VideoCodec> = new Set(['h264', 'vp8']);@@ -103,7 +104,8 @@ export function rankScreenShareCodecs(input: ScreenShareCodecRankingInput): Screif (codec === 'h265') return pin === 'h265' || (input.encoderModeSetting !== 'software' && isHardware('h265'));return true;};- const survivors = CODEC_PREFERENCE.filter(survives);+ const preference = isHardware('h264') ? CODEC_PREFERENCE : SOFTWARE_H264_CODEC_PREFERENCE;+ const survivors = preference.filter(survives);const ranked =input.encoderModeSetting === 'software'? survivors