(
id_for_perfer: Option<&str>,
_flutter: bool,
_luid: Option<i64>,
mark_unsupported: &Vec<CodecFormat>,
)
| 416 | |
| 417 | impl Decoder { |
| 418 | pub fn supported_decodings( |
| 419 | id_for_perfer: Option<&str>, |
| 420 | _flutter: bool, |
| 421 | _luid: Option<i64>, |
| 422 | mark_unsupported: &Vec<CodecFormat>, |
| 423 | ) -> SupportedDecoding { |
| 424 | let (prefer, prefer_chroma) = Self::preference(id_for_perfer); |
| 425 | |
| 426 | #[allow(unused_mut)] |
| 427 | let mut decoding = SupportedDecoding { |
| 428 | ability_vp8: 1, |
| 429 | ability_vp9: 1, |
| 430 | ability_av1: if disable_av1() { 0 } else { 1 }, |
| 431 | i444: Some(CodecAbility { |
| 432 | vp9: true, |
| 433 | av1: true, |
| 434 | ..Default::default() |
| 435 | }) |
| 436 | .into(), |
| 437 | prefer: prefer.into(), |
| 438 | prefer_chroma: prefer_chroma.into(), |
| 439 | ..Default::default() |
| 440 | }; |
| 441 | #[cfg(feature = "hwcodec")] |
| 442 | { |
| 443 | decoding.ability_h264 |= if HwRamDecoder::try_get(CodecFormat::H264).is_some() { |
| 444 | 1 |
| 445 | } else { |
| 446 | 0 |
| 447 | }; |
| 448 | decoding.ability_h265 |= if HwRamDecoder::try_get(CodecFormat::H265).is_some() { |
| 449 | 1 |
| 450 | } else { |
| 451 | 0 |
| 452 | }; |
| 453 | } |
| 454 | #[cfg(feature = "vram")] |
| 455 | if enable_vram_option() && _flutter { |
| 456 | decoding.ability_h264 |= if VRamDecoder::available(CodecFormat::H264, _luid).len() > 0 { |
| 457 | 1 |
| 458 | } else { |
| 459 | 0 |
| 460 | }; |
| 461 | decoding.ability_h265 |= if VRamDecoder::available(CodecFormat::H265, _luid).len() > 0 { |
| 462 | 1 |
| 463 | } else { |
| 464 | 0 |
| 465 | }; |
| 466 | } |
| 467 | #[cfg(feature = "mediacodec")] |
| 468 | if enable_hwcodec_option() { |
| 469 | decoding.ability_h264 = |
| 470 | if H264_DECODER_SUPPORT.load(std::sync::atomic::Ordering::SeqCst) { |
| 471 | 1 |
| 472 | } else { |
| 473 | 0 |
| 474 | }; |
| 475 | decoding.ability_h265 = |
nothing calls this directly
no test coverage detected