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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Rockchip MPP (Media Process Platform) hardware H.264/HEVC encoder.
//!
//! Resolves `librockchip_mpp.so` at runtime via `dlopen` — the binary
//! compiles on every platform; HW encoding only activates on Rockchip
//! devices where the library is present.
//!
//! # Why this exists
//!
//! Software H.264 encode of a 720p I-frame takes 20–30 ms on RK3588's
//! A76 cores. That alone exceeds the 10 ms FPV budget. Rockchip's MPP
//! does the same encode in 2–3 ms on dedicated VPU hardware, plus
//! supports zero-copy input directly from DMA-BUF or `MB_BLK` (the same
//! handle type used by `RknnBackend::wrap_mb_blk`).
//!
//! # Coverage
//!
//! - `mpp_create` / `mpp_init` / `mpp_destroy` — context lifecycle
//! - `mpp_packet_*` — encoded NAL output
//! - `mpp_frame_*` — raw input wrapping
//! - `mpi.encode_put_frame` / `encode_get_packet` — synchronous encode
//! - `mpp_buffer_get_mpp_buffer` — extract MB_BLK for zero-copy input
//!
//! # Safety
//!
//! All `unsafe` is confined to FFI call sites. Library symbols obtained
//! via `dlopen`/`dlsym` are checked non-null. RAII Drop handlers free
//! every MPP resource (encoder ctx, frames, packets) deterministically.
pub use ;
pub use ;
/// Check whether `librockchip_mpp.so` is loadable on this host.
///
/// On non-Linux platforms or non-feature-enabled builds, returns `false`.