diff --git a/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/video/vaapi.rs b/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/video/vaapi.rs index 2e9738e48..5eb5dc19c 100644 --- a/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/video/vaapi.rs +++ b/native/opennow-streamer/crates/opennow-streamer-platform-linux/src/video/vaapi.rs @@ -18,9 +18,9 @@ use crate::{ const MAX_DECODE_RETRIES: usize = 16; -// Mesa radeonsi rejects H.264 decode contexts below 64x64 with -// VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED, which hid VA-API on AMD GPUs. -const _: () = assert!(INITIAL_CONTEXT_SIZE >= 64); +// Mesa radeonsi rejects H.264 decode contexts below 64x64 and V4L2-backed +// drivers (Qualcomm iris) below 96x96; a smaller probe hid working decoders. +const _: () = assert!(INITIAL_CONTEXT_SIZE >= 96); fn h264_access_unit_payload(data: &[u8]) -> &[u8] { let end = data @@ -240,7 +240,10 @@ pub(crate) struct VaApiDecoder { impl VaApiDecoder { pub fn probe() -> std::result::Result { let (display, decoder) = open_h264_device()?; - let probe_frame = VaFrame::new(Resolution::from((16, 16)), Resolution::from((16, 16))); + let probe_frame = VaFrame::new( + Resolution::from((INITIAL_CONTEXT_SIZE, INITIAL_CONTEXT_SIZE)), + Resolution::from((INITIAL_CONTEXT_SIZE, INITIAL_CONTEXT_SIZE)), + ); drop( probe_frame .to_native_handle(&display) diff --git a/native/opennow-streamer/vendor/cros-codecs-extended/src/backend/vaapi/decoder.rs b/native/opennow-streamer/vendor/cros-codecs-extended/src/backend/vaapi/decoder.rs index f1a4b37f8..e8e6f2dc4 100644 --- a/native/opennow-streamer/vendor/cros-codecs-extended/src/backend/vaapi/decoder.rs +++ b/native/opennow-streamer/vendor/cros-codecs-extended/src/backend/vaapi/decoder.rs @@ -200,13 +200,14 @@ pub struct VaapiBackend { } /// Edge length of the placeholder VAContext created before the first SPS. -pub const INITIAL_CONTEXT_SIZE: u32 = 64; +/// Mesa radeonsi needs at least 64x64, V4L2-backed drivers (Qualcomm iris +/// through the msm VA driver) at least 96x96. +pub const INITIAL_CONTEXT_SIZE: u32 = 128; impl VaapiBackend { pub(crate) fn new(display: Arc, supports_context_reuse: bool) -> Self { // Placeholder until the first SPS arrives (`new_sequence` replaces the - // context). Mesa radeonsi (AMD VCN) rejects H.264 decode contexts - // smaller than 64x64 with VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED. + // context), sized by INITIAL_CONTEXT_SIZE for the drivers' minimums. let init_stream_info = StreamInfo { format: DecodedFormat::NV12, coded_resolution: Resolution::from((INITIAL_CONTEXT_SIZE, INITIAL_CONTEXT_SIZE)),