forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB86fb0f3Tahinli7 days ago3927 commits

lib.rs57 lines, 2.0 KiBHistoryRawDownload
1//! VA-API (libva) layer over [`cros_libva`].
2//!
3//! This is the hardware-video foundation of the `edith_codecs` family: `ec-hw`
4//! builds stateless VA-API decoders and encoders on top of it, and nothing else
5//! in the family talks to libva directly. Every libva call goes through
6//! cros-libva's safe wrappers, so this crate contains no `unsafe` of its own.
7//!
8//! * [`va`] — the whole cros-libva API, re-exported: raw constants and typed
9//! codec parameter buffers ([`va::BufferType`], e.g.
10//! `BufferType::PictureParameter(PictureParameter::H264(..))`).
11//! * [`Display`], [`Config`], [`Context`], [`Surface`], [`Picture`], [`Buffer`]
12//! and [`Image`] are cros-libva's RAII handles. Each child holds an `Rc` of
13//! its parent, so libva's destruction order is enforced by ownership.
14//! * [`surface`] adds PRIME export/import, timed sync and pool creation;
15//! [`caps`] probes what the driver supports; [`vpp`] is a video-processing
16//! pipeline.
17//!
18//! # Version policy
19//!
20//! The pinned cros-libva revision builds against libva 1.23. The runtime
21//! version is not exposed by cros-libva, so it is not checked here.
22//!
23//! # Example
24//!
25//! ```no_run
26//! use ec_va::caps::{CapReport, Entrypoint, Profile};
27//!
28//! let display = ec_va::open()?;
29//! let caps = CapReport::probe(&display)?;
30//! assert!(caps.supports(Profile::H264Main, Entrypoint::VLD));
31//! # Ok::<(), ec_va::Error>(())
32//! ```
33
34#![forbid(unsafe_code)]
35#![deny(missing_docs)]
36
37pub mod cacheline;
38pub mod caps;
39pub mod config;
40pub mod display;
41pub mod error;
42pub mod picture;
43pub mod surface;
44pub mod vpp;
45
46pub use cros_libva as va;
47
48pub use caps::{CapEntry, CapReport, Entrypoint, Profile, fourcc_str};
49pub use config::{Config, ConfigAttrib, SurfaceCaps, caps_of};
50pub use display::{Display, open, open_path};
51pub use error::{Error, Result};
52pub use picture::{Buffer, Context, Picture, create_context};
53pub use surface::{
54 Image, PrimeLayer, PrimeObject, PrimeSurface, Surface, SurfaceExt, SurfaceSpec, create_pool,
55 import_prime,
56};
57pub use vpp::Vpp;