1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Ring-buffer input surface pool for QSV encode.
//!
//! A single `SurfaceSlot` pairs an `MfxFrameSurface1` with its backing
//! allocation and the last sync point produced by `EncodeFrameAsync` on
//! that slot. `RING_SIZE = 4` matches upstream `sample_encode`'s
//! recommended `AsyncDepth = 4` on Arc / Meteor Lake.
use crateMfxFrameSurface1;
use MfxSyncPoint;
/// Encoder pipeline depth — number of input surfaces + sync points
/// in flight before we must drain one. Matches NVENC's `RING_SIZE = 4`
/// and upstream oneVPL `sample_encode`'s recommended `AsyncDepth = 4`
/// on Arc / Meteor Lake.
pub const RING_SIZE: usize = 4;
/// A single input-surface slot in the 4-deep ring. Holds the
/// `MfxFrameSurface1` plus the backing NV12/P010 buffer that surface's
/// pointers live in.
pub
// SAFETY: `MfxSyncPoint = *mut c_void` is a raw pointer, not
// auto-`Send`, but oneVPL documents sync points as thread-safe
// handles that are opaque from our perspective. The ring only
// migrates between threads when the whole `QsvSession` migrates
// (via `spawn_blocking`), and access is serialized through `&mut
// self`. No sharing; same Send constraint as `QsvSession`.
unsafe