Skip to content

rkvc

Types

Name Description
BoundedQueue Bounded FIFO with tri-state pop: item / Eof (closed+drained) / error. Buffered items are always delivered before the terminal state.
Context Owns the factory registry, model store, and device probe cache.
Emit Downstream delivery.
Executor Owns per-node worker threads: source ticks, middles pop/process/push, sink drains to the session output queue. First error cancels everything.
Frame Reference-counted media object.
FrameHooks Backend release hook, invoked when the last Frame reference drops.
Graph
ModelMeta 内存态模型(由模型目录装载,或宿主直接构造)。payload kind 约定: "rknn"(NPU 图)/"pmf-gaussian"/"pmf-bitest"/"qptab"/"qppatch"。
Node Node contract: configure() never touches hardware; the input frame is only borrowed for the duration of process() (retain a copy to keep it).
Plan
PlanStep Linear plan: adapter or candidate-factory steps with backtracking fallback.
Registry
Request One media request: intent only, the planner picks the path.
Session Streaming session: push (non-blocking) / pull (blocking) / try_pull (non-blocking) / push_eos. Triple-state contract: Ok / Eof / Again.
Spec Negotiation object between ports.

Macros

Name Description
RKVC_TOOLCHAIN_FINGERPRINT g++ version + language/ABI switches that must match to share C++ types.

Variables

Name Description
kPluginAbi Codec plugin ABI.

Functions

Name Description
load_model_dir 按导出器约定扫描模型目录,把每组配套的原生文件读成内存态 Model: MLVCEncoder_.rknn / MLVCDecoder_.rknn / gaussian.bin / bitest.bin / qptab_{encoder,decoder}.bin / qp_patches/{enc,dec}_qp.qppatch 整组注册 (family "mlvc"),其余 *.rknn 各成单载荷模型(family "sr")。 同一 bundle 目录即同一次导出,配套完整性由 QPP1 base_crc、qptab 表名 与 rung 集合校验在节点侧兜底。
make_download_node CPU download bridge (linear Dmabuf in, packed Host out).
make_queue_source FRAME_SINK endpoint adapters built directly into the plan.
min_size Minimum host bytes for the spec; 0 means unbounded (probe/bitstream).
sha256 Minimal SHA-256 (FIPS 180-4), pure computation, no allocation.
unify Field-level wildcard merge; conflict yields Negotiate with diag context.

Macro Details

RKVC_TOOLCHAIN_FINGERPRINT

#define RKVC_TOOLCHAIN_FINGERPRINT

g++ version + language/ABI switches that must match to share C++ types.

Variable Details

kPluginAbi

constexpr uint32_t kPluginAbi

Codec plugin ABI. Rules for both sides (same toolchain, same release): - every virtual returns Status (or a trivial value); no exception crosses the boundary (core builds -fno-exceptions -fno-rtti; plugins must too); - interface classes carry no data members; factories and nodes stay owned by the plugin, nodes created per session are owned by the graph; - ownership never crosses: strings are views, frames are shared_ptr on a shared heap, descriptors are plugin-static storage.

Function Details

load_model_dir

Result<std::vector<Model>> load_model_dir(const std::string& dir, Diag* diag = nullptr)

按导出器约定扫描模型目录,把每组配套的原生文件读成内存态 Model: MLVCEncoder_.rknn / MLVCDecoder_.rknn / gaussian.bin / bitest.bin / qptab_{encoder,decoder}.bin / qp_patches/{enc,dec}_qp.qppatch 整组注册 (family "mlvc"),其余 *.rknn 各成单载荷模型(family "sr")。 同一 bundle 目录即同一次导出,配套完整性由 QPP1 base_crc、qptab 表名 与 rung 集合校验在节点侧兜底。

make_download_node

NodePtr make_download_node()

CPU download bridge (linear Dmabuf in, packed Host out). Graph::build splices one in wherever a Dmabuf producer would otherwise face a Host consumer with no other spec conflict.

make_queue_source

NodePtr make_queue_source(FrameQueue* in_q, const Spec& spec)

FRAME_SINK endpoint adapters built directly into the plan.

min_size

size_t min_size(const Spec& s) noexcept

Minimum host bytes for the spec; 0 means unbounded (probe/bitstream).

sha256

std::array<uint8_t, 32> sha256(const uint8_t* data, size_t len) noexcept

Minimal SHA-256 (FIPS 180-4), pure computation, no allocation.

unify

Result<Spec> unify(const Spec& a, const Spec& b, Diag* diag = nullptr)

Field-level wildcard merge; conflict yields Negotiate with diag context.