oximedia-plugin
Plugin system for OxiMedia -- dynamic codec loading.
Overview
This crate provides a plugin architecture that allows external codec implementations to be registered with OxiMedia at runtime. Third-party or patent-encumbered codecs can be distributed as separate shared libraries and loaded on demand, keeping the core OxiMedia framework patent-free.
Key Components
CodecPlugintrait -- The interface all plugins must implement, declaring metadata and codec capabilitiesPluginRegistry-- Central registry for discovering, loading, and querying pluginsStaticPlugin-- Builder-pattern helper for registering plugins without shared librariesPluginManifest-- JSON-based plugin metadata for discovery and validationdeclare_plugin!macro -- Generates FFI exports for shared library plugins
Feature Flags
| Feature | Description |
|---|---|
dynamic-loading |
Enables loading plugins from shared libraries (.so/.dylib/.dll) via libloading. Without this feature, only static plugin registration is available. |
Usage
Static Plugin Registration
use ;
use Arc;
use HashMap;
let info = CodecPluginInfo ;
let plugin = new
.add_capability;
let registry = new;
registry.register.expect;
Dynamic Loading (feature = "dynamic-loading")
Shared library plugins must export two symbols:
oximedia_plugin_api_version() -> u32oximedia_plugin_create() -> *mut dyn CodecPlugin
Use the declare_plugin! macro to generate these exports automatically.
License
Apache-2.0
Copyright COOLJAPAN OU (Team Kitasan)