Optional Plugins (UniOHOS/plugin)
UniOHOS/plugin hosts optional, standalone feature plugins whose upstream licenses (such as GPL-2.0-or-later) differ from the pure Apache-2.0 license of UniOHOS/core and UniOHOS-Devices/*-bsp.
1. Repository Aggregation vs Runtime Licensing
Understanding the two distinct licensing layers prevents accidental license mixing:
- Repository-Level Mere Aggregation (
GPLv2 Section 2):- Top-level scaffolding (
Makefile,scripts/,registry/plugins.json) isApache-2.0. - Each plugin lives in
plugins/<id>/with its ownLICENSE,NOTICE,plugin.json, and tests, built independently without static linking intoUniOHOS/coreor*-bsp.
- Top-level scaffolding (
- Runtime Combination:
- In-Process (
dlopen): Dynamically loading aGPL-2.0-or-latershared library into anApache-2.0host process operates underGPL-3.0-or-latercompatibility (via the "or later" clause, sinceApache-2.0is compatible withGPL-3.0). - Out-of-Process (CLI / IPC): If a deployment requires the host process to stay strictly
Apache-2.0, invoke the plugin as a standalone process over CLI or IPC, or omit the optional plugin.
- In-Process (
2. Included Plugin: cb1-hdr (GPL-2.0-or-later)
plugins/cb1-hdr is a self-contained C11 dynamic HDR reconstruction, RPU bitstream parser, and OpenGL ES 3.10 GLSL generator built on CroqueMr/libreelec-CB1 (ea305d1, CB1 1.1) with LGPL-2.1-or-later ABI shims in compat/.
Pluggable Sink Modes (SINK=generic | xring-o1)
SINK=generic(All SoCs): Compilesthird_party/libreelec-cb1/,compat/, andsrc/core/(ETSI GS CCM 001 V1.1.1 Poly/MMR/NLQ 12-bit FEL reconstruction, Profile 5/7/8.1/8.4, CMv2.9/CMv4.0, nativeNAL_UNSPEC62RPU parser & PTS sync, and ESSL 3.10 shader generator) with zero SoC dependencies.SINK=xring-o1(Default): Addssrc/sinks/xring-o1/xring_hdr_sink.cfor DSI-1 Peak HDR (P010/AB30) and Type-C DP-1 Alt-Mode 12-bit tunnel + CTA-861 metadata packing (deployed as/vendor/lib64/libdijun_cb1_dyn_hdr.sowhen paired withxiaomi-xring-o1-bsp).
Build & Test Commands
bash
git clone https://github.com/UniOHOS/plugin.git
cd plugin
# Verify hygiene, build all plugins, and run Normal + ASan/UBSan/LSan + TSan tests
make hygiene
make all
make test
make test-sanitizers
# Build cb1-hdr in platform-agnostic generic mode only
make -C plugins/cb1-hdr SINK=generic all test3. Contributing a New Plugin
- Create
plugins/<plugin-id>/containingplugin.json,LICENSE,NOTICE,README.md,README.zh-CN.md,Makefile, and host-runnabletests/. - Register the entry in
registry/plugins.json(external plugin repositories are also supported viaexternal_repo). - Verify
make hygiene && make all && make testpasses cleanly and sign off commits withgit commit -s(DCO 1.1).