Skip to content

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:

  1. Repository-Level Mere Aggregation (GPLv2 Section 2):
    • Top-level scaffolding (Makefile, scripts/, registry/plugins.json) is Apache-2.0.
    • Each plugin lives in plugins/<id>/ with its own LICENSE, NOTICE, plugin.json, and tests, built independently without static linking into UniOHOS/core or *-bsp.
  2. Runtime Combination:
    • In-Process (dlopen): Dynamically loading a GPL-2.0-or-later shared library into an Apache-2.0 host process operates under GPL-3.0-or-later compatibility (via the "or later" clause, since Apache-2.0 is compatible with GPL-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.

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): Compiles third_party/libreelec-cb1/, compat/, and src/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, native NAL_UNSPEC62 RPU parser & PTS sync, and ESSL 3.10 shader generator) with zero SoC dependencies.
  • SINK=xring-o1 (Default): Adds src/sinks/xring-o1/xring_hdr_sink.c for 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.so when paired with xiaomi-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 test

3. Contributing a New Plugin ​

  1. Create plugins/<plugin-id>/ containing plugin.json, LICENSE, NOTICE, README.md, README.zh-CN.md, Makefile, and host-runnable tests/.
  2. Register the entry in registry/plugins.json (external plugin repositories are also supported via external_repo).
  3. Verify make hygiene && make all && make test passes cleanly and sign off commits with git commit -s (DCO 1.1).

Independent Open-Source Community (CC-BY-4.0). Not affiliated with Huawei, HiSilicon, OpenAtom Foundation, Xiaomi, Qualcomm, MediaTek, or Arm.