forge
Explore
Log in

Don't you dare go Hollow

edith-sink: silence libva info lines (errors kept); ec-hw: docs no longer call working codecs unsupported

Browse files at this commit

d346e45619e48cd4d8f3bdb47ec09a775f786ad7Ahmet Kaan GümüşParent: 8e0480a
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
2-//! with [`Error::Unsupported`] until their parameter buffers are ported).
1+//! Hardware encoding: H.264, HEVC and AV1.
32 //!
43 //! The bitstream writers in [`headers`] are pure. The parameter buffers are
54 //! built from cros-libva's typed constructors in each codec module.
crates/ec-hw/src/lib.rsmodified+3 -4
@@ -35,10 +35,9 @@
3535 //!
3636 //! * [`params`] — the codec parameter buffers, converted to cros-libva's typed
3737 //! buffers.
38-//! * [`dec`] — one stateless decoder per codec behind [`Decoder`]. H.264 is
39-//! ported; HEVC, VP9 and AV1 return [`Error::Unsupported`] for now.
40-//! * [`enc`] — H.264, HEVC and AV1 encoders. Not ported yet: they return
41-//! [`Error::Unsupported`].
38+//! * [`dec`] — one stateless decoder per codec behind [`Decoder`]: H.264,
39+//! HEVC, VP9 and AV1.
40+//! * [`enc`] — H.264, HEVC and AV1 encoders: IDR + P GOPs, CQP/CBR/VBR/QVBR.
4241 //! * [`SurfacePool`] / [`Frame`] — surface recycling and pixel access.
4342 //!
4443 //! # Unsafe
tools/edith-sink/src/main.rsmodified+16 -0
@@ -340,7 +340,23 @@ fn run() -> Res<u64> {
340340 Ok(frames)
341341 }
342342
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+
343356 fn main() -> ExitCode {
357+ if let Some(code) = quiet_libva() {
358+ return code;
359+ }
344360 match run() {
345361 Ok(frames) => {
346362 eprintln!("edith-sink: {frames} frames");