vpl_sys/lib.rs
1//! Minimal, unprefixed FFI core for a subset of Intel oneVPL (`intel/libvpl`,
2//! MIT). No dependency on `mediaway-common` or any Mediaway facade — this
3//! crate has no Mediaway-specific types, mirroring `iso-bmff`/`iso-cenc`'s
4//! "reusable outside Mediaway" positioning (ADR-0012).
5//!
6//! # Scope (Stage 1)
7//!
8//! - Types: [`raw`] — `bindgen`-generated oneVPL struct/union layout from
9//! vendored headers (`vendor/`), exact `#pragma pack` semantics verified by
10//! real Clang parsing rather than hand-transcribed.
11//! - Constants: [`consts`] — hand-transcribed `MFX_*` values (status codes,
12//! codec/profile/level/IOPattern/rate-control selectors), each cited
13//! against the vendored header it came from.
14//! - Runtime loading: [`dispatcher`] — a **deliberately reduced**
15//! reimplementation of Intel's own oneVPL dispatcher: resolve a
16//! driver-shipped implementation library (`libmfxhw64.dll` on Windows) via
17//! `libloading`, then the ~10 `MFX*` entry points this crate's Stage 1
18//! H.264 CPU-upload encode path needs. **Not** a port of Intel's real
19//! dispatcher (`MFXLoad`/`MFXCreateConfig`/`MFXEnumImplementations`) — no
20//! multi-implementation ranking, no capability filtering, first working
21//! Intel GPU implementation wins. See `dispatcher` module docs and
22//! `mediaway-encoder-quicksync/adr/0001-onevpl-quicksync-encode-surface.md`.
23//!
24//! No build-time link against any Intel-provided import library — every
25//! entry point is resolved at runtime (`GetProcAddress`/`dlsym` via
26//! `libloading`), matching how the real oneVPL dispatcher itself works.
27
28#![allow(unsafe_code)]
29
30pub mod consts;
31pub mod dispatcher;
32pub mod raw;
33
34pub use dispatcher::{Loader, Session, VplError};