edith-sink: silence libva info lines (errors kept); ec-hw: docs no longer call working codecs unsupported
Browse files at this commitd346e45619e48cd4d8f3bdb47ec09a775f786ad7Parent: 8e0480a3 changed files +20 -6
crates/ec-hw/src/enc/mod.rsmodified+1 -2
| @@ -1,5 +1,4 @@ | |||
| 1 | -//! Hardware encoding: H.264 (ported to cros-libva), HEVC and AV1 (refused | 1 | +//! Hardware encoding: H.264, HEVC and AV1. |
| 2 | -//! with [`Error::Unsupported`] until their parameter buffers are ported). | ||
| 3 | //! | 2 | //! |
| 4 | //! The bitstream writers in [`headers`] are pure. The parameter buffers are | 3 | //! The bitstream writers in [`headers`] are pure. The parameter buffers are |
| 5 | //! built from cros-libva's typed constructors in each codec module. | 4 | //! built from cros-libva's typed constructors in each codec module. |
crates/ec-hw/src/lib.rsmodified+3 -4
| @@ -35,10 +35,9 @@ | |||
| 35 | //! | 35 | //! |
| 36 | //! * [`params`] — the codec parameter buffers, converted to cros-libva's typed | 36 | //! * [`params`] — the codec parameter buffers, converted to cros-libva's typed |
| 37 | //! buffers. | 37 | //! buffers. |
| 38 | -//! * [`dec`] — one stateless decoder per codec behind [`Decoder`]. H.264 is | 38 | +//! * [`dec`] — one stateless decoder per codec behind [`Decoder`]: H.264, |
| 39 | -//! ported; HEVC, VP9 and AV1 return [`Error::Unsupported`] for now. | 39 | +//! HEVC, VP9 and AV1. |
| 40 | -//! * [`enc`] — H.264, HEVC and AV1 encoders. Not ported yet: they return | 40 | +//! * [`enc`] — H.264, HEVC and AV1 encoders: IDR + P GOPs, CQP/CBR/VBR/QVBR. |
| 41 | -//! [`Error::Unsupported`]. | ||
| 42 | //! * [`SurfacePool`] / [`Frame`] — surface recycling and pixel access. | 41 | //! * [`SurfacePool`] / [`Frame`] — surface recycling and pixel access. |
| 43 | //! | 42 | //! |
| 44 | //! # Unsafe | 43 | //! # Unsafe |
tools/edith-sink/src/main.rsmodified+16 -0
| @@ -340,7 +340,23 @@ fn run() -> Res<u64> { | |||
| 340 | Ok(frames) | 340 | Ok(frames) |
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | +fn quiet_libva() -> Option<ExitCode> { | ||
| 344 | + if std::env::var_os("LIBVA_MESSAGING_LEVEL").is_some() { | ||
| 345 | + return None; | ||
| 346 | + } | ||
| 347 | + let exe = std::env::current_exe().ok()?; | ||
| 348 | + let status = std::process::Command::new(exe) | ||
| 349 | + .args(std::env::args_os().skip(1)) | ||
| 350 | + .env("LIBVA_MESSAGING_LEVEL", "1") | ||
| 351 | + .status() | ||
| 352 | + .ok()?; | ||
| 353 | + Some(ExitCode::from(u8::try_from(status.code().unwrap_or(1)).unwrap_or(1))) | ||
| 354 | +} | ||
| 355 | + | ||
| 343 | fn main() -> ExitCode { | 356 | fn main() -> ExitCode { |
| 357 | + if let Some(code) = quiet_libva() { | ||
| 358 | + return code; | ||
| 359 | + } | ||
| 344 | match run() { | 360 | match run() { |
| 345 | Ok(frames) => { | 361 | Ok(frames) => { |
| 346 | eprintln!("edith-sink: {frames} frames"); | 362 | eprintln!("edith-sink: {frames} frames"); |