Initial commit: OrangePi3588 Media Server project

This commit is contained in:
sladro 2025-12-08 17:05:22 +08:00
commit a5f7a58b33
2071 changed files with 1735429 additions and 0 deletions

33
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
host-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure & build (host)
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
./scripts/build_host.sh
rk3588-cross-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Build (cross)
env:
RK3588_SYSROOT: /opt/rk3588-sysroot
run: |
mkdir -p "$RK3588_SYSROOT"
./scripts/build_board.sh

35
.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
## Build and CMake artifacts
/build/
/cmake-build-*/
/CMakeFiles/
/CMakeCache.txt
/*.ninja
/*.ninja_log
/*.ninja_deps
/Testing/
## Tooling outputs
/compile_commands.json
/.cache/
## Binaries and objects
*.o
*.obj
*.a
*.la
*.lo
*.so
*.so.*
*.dylib
*.dll
*.exe
## Logs
*.log
## IDE/editor
/.vscode/
/.idea/
*.swp
*.swo
.DS_Store

72
CMakeLists.txt Normal file
View File

@ -0,0 +1,72 @@
# Minimum version based on requirements from PRD (CMake >= 3.20)
cmake_minimum_required(VERSION 3.20)
project(rk3588_media_server
VERSION 0.1.0
DESCRIPTION "RK3588 media server bootstrap"
LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(BUILD_SAMPLES "Build demo binaries" ON)
option(ENABLE_RK_DEMOS "Use official Rockchip demos that link against vendor SDKs" OFF)
set(RK_MPP_ROOT "${CMAKE_SOURCE_DIR}/third_party/mpp" CACHE PATH "Path to Rockchip MPP SDK root")
set(RK_MPP_LIB_PATH "" CACHE FILEPATH "Absolute path to librockchip_mpp.so built for RK3588")
set(RK_RKNN_ROOT "${CMAKE_SOURCE_DIR}/third_party/rknpu2" CACHE PATH "Path to Rockchip RKNN runtime repository")
set(RKNN_RUNTIME_LIB_DIR "${RK_RKNN_ROOT}/runtime/RK3588/Linux/librknn_api/aarch64" CACHE PATH "Directory containing librknnrt.so")
set(RKNN_RUNTIME_INCLUDE_DIR "${RK_RKNN_ROOT}/runtime/RK3588/Linux/librknn_api/include" CACHE PATH "include path for rknn_api.h")
set(RKNN_MODEL_PATH "${RK_RKNN_ROOT}/examples/rknn_api_demo/model/RK3588/mobilenet_v1.rknn" CACHE FILEPATH "Default RKNN demo model")
set(RKNN_SAMPLE_IMAGE "${RK_RKNN_ROOT}/examples/rknn_api_demo/model/dog_224x224.jpg" CACHE FILEPATH "Default RKNN demo input image")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Helper target for common warnings
add_library(project_options INTERFACE)
if(MSVC)
target_compile_options(project_options INTERFACE /W4)
else()
target_compile_options(project_options INTERFACE -Wall -Wextra -Wpedantic)
endif()
# Resolve git revision if possible
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE RK_GIT_SHA
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
endif()
if(NOT RK_GIT_SHA)
set(RK_GIT_SHA "nogit")
endif()
set(SRC_FILES
src/main.cpp
src/media_server_app.cpp
)
add_executable(media-server ${SRC_FILES})
target_include_directories(media-server
PRIVATE
${CMAKE_SOURCE_DIR}/include
)
target_link_libraries(media-server PRIVATE project_options)
target_compile_definitions(media-server PRIVATE
RK_PROJECT_VERSION="${PROJECT_VERSION}"
RK_GIT_SHA="${RK_GIT_SHA}"
)
install(TARGETS media-server RUNTIME DESTINATION bin)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()
include(GNUInstallDirs)
install(FILES configs/sample_cam1.json DESTINATION ${CMAKE_INSTALL_DATADIR}/rk3588-media-server)

287
Plan.md Normal file
View File

@ -0,0 +1,287 @@
---
## 总体思路
- 每个阶段都交付一个**可运行的“小产品”**(而不是一堆库)
- 优先把 **RK3588 的硬件链路打通**(解码 → 前处理 → NPU → 编码)
- 从 **最简单的“转码网关”** 一步步进化到 **“智能分析+报警+录像”**
建议整体 roadmap ≈ 7~8 个迭代:
1. Sprint 0环境&硬件打底
2. Sprint 1最小可用媒体服务器纯转码网关
3. Sprint 2插件框架 + DAG 图 & 队列打通
4. Sprint 3AI 推理链路preprocess + ai_yolo + OSD
5. Sprint 4报警 + 录像插件,打通完整“安防通道”
6. Sprint 5配置系统templates/instances+ 热更新 + Drain
7. Sprint 6监控指标 + Web 控制台基础
8. Sprint 7多路性能调优 + 长稳测试
下面每个 Sprint 我都给一个**目标 / 核心任务 / 关键里程碑**。
---
## Sprint 0环境准备 & 板子打通
**目标:** 所有开发人员都能在本地和 RK3588 板子上编译、部署、跑官方 demo。
**核心任务:**
- 建工程骨架:
- 建 Git 仓库 + 基础目录结构(`src/`, `include/`, `plugins/`, `cmake/` 等)
- CMake + Ninja 构建脚本
- 搭建交叉编译环境:
- 配置 `aarch64-linux-gnu-gcc`
- 能在 x86 上编译并在 RK3588 板子上运行“hello world”
- 验证 RK 官方 SDK
- 跑 MPP 解码 demo本地 H264 文件 → 屏幕或 /dev/null
- 跑 RKNN demo官方示例图片 → 得到推理结果)
- CI 基础:
- 至少有一个自动构建(例如 push 后自动编译)
**关键里程碑:**
- ✅ 在 RK3588 板子上成功运行:
- 一个 MPP 解码 demo
- 一个 RKNN 推理 demo
- ✅ `media-server` 空壳程序(打印版本号)能从 CI 输出产物并部署到板子上运行
---
## Sprint 1最小可用媒体服务器纯转码网关
**目标:** 实现一个**最小可用产品**
> 从 RTSP 拉流 → 解码 → 编码 → 再推 RTSP/HLS
> 还没有 AI、报警、录像只是转码网关。
**核心任务:**
- 定义最初版 `Frame` 结构(至少包含:宽高、格式、 pts、dma_fd
- 实现最简单的**线性 pipeline**(先不用 DAG
- `input_rtsp` 插件:
- 拉 RTSP 流,断线重连
- 用 MPP 解码为 NV12/YUV
- `publish` 插件:
- 用 MPP VENC 编码 H264/H265
- 启动简单 RTSP server 或 HLS 输出
- 初版线程模型:
- 1 个拉流/解码线程
- 1 个编码/推流线程
- 中间通过 SPSC 队列传 `shared_ptr<Frame>`
- 配置文件:
- 简单 JSON只支持一条通道
```json
{
"graphs": [
{
"name": "cam1",
"nodes": [...],
"edges": [...]
}
]
}
```
**关键里程碑:**
- ✅ 在 RK3588 板子上:
- 从外部摄像头 / NVR 拉一路 RTSP
- 在本机 8554 端口重新发布 RTSP或 8080 HLS
- VLC / ffplay 打开 `rtsp://board_ip:8554/live/cam1` 能稳定观看
- ✅ 初始版本 `Frame` + 队列已经固定下来,后面不会大改接口
---
## Sprint 2插件框架 + DAG 图 & 队列体系
**目标:** 从「硬编码 pipeline」升级为「插件 + DAG 驱动」,让架构进入你 PRD 描述的形态。
**核心任务:**
- 定义 `INode` 接口(含 Init/Start/Process/UpdateConfig/Drain/Stop
- 完成插件加载系统:
- `.so` 动态加载dlopen
- `REGISTER_NODE` 宏 + `GetNodeType`/`GetAbiVersion`
- 实现 GraphMgr
- 支持从 JSON 读取 `graphs[nodes + edges]`
- 根据 type 创建节点、连接 edges
- 每条 edge 对应一个 SPSC 队列
- 多分支 DAG 支持:
- 允许一个节点连接多个下游GraphMgr 为每条边创建独立队列
- 把 Sprint1 的 input/publish 改造成插件形式,跑在 DAG 上:
- Graph`input_rtsp -> publish`
**关键里程碑:**
- ✅ 支持通过 JSON 配置任意组合节点(至少:`in→pub`、`in→pre→pub` 两种)
- ✅ 节点以 `.so` 的形式存在,可以单独编译、加载/卸载
- ✅ 框架已支持一对多分支(即使当前下游还只有一个,这点结构上要打好)
---
## Sprint 3AI 链路打通preprocess + ai_yolo + OSD
**目标:** 打通一条完整的 **AI 视觉链路**
> 拉流 → 前处理 → YOLO 推理RKNN → 叠框 OSD → 推流
**核心任务:**
- 完整定义 `Detection` / `DetectionResult` / 扩展版 `Frame` 结构(含 `det`
- 实现 `preprocess` 插件:
- RGA 缩放(例如 1080p → 640×640
- NV12 → RGB/BGR 格式转换
- 实现 `AiScheduler`
- 提供提交/回调接口
- 内部管理 RKNN 上下文和 NPU 资源
- 暂时可只支持单路/单 batch先打通功能
- 实现 `ai_yolo` 插件:
- 加载 `.rknn` 模型
- 调用 `AiScheduler` 做推理
- 将输出写入 `Frame::det`
- 实现 `osd` 插件:
- 根据 `Frame::det` 在原图上画框/标签
- 输出 NV12/YUV 帧(可以软绘+回写,也可以用 RGA
- 在 JSON 中构建一条完整 AI pipeline
- `input_rtsp -> preprocess -> ai_yolo -> osd -> publish`
**关键里程碑:**
- ✅ 在板子上:
- 拉一条实际摄像头画面
- web/RTSP 观看输出画面时,能看到实时的检测框
- ✅ 基础性能满足:
- 单路 1080p 流畅运行(不明显掉帧)
- CPU/NPU 占用在可接受范围内(不超出预期天花板)
---
## Sprint 4报警 + 录像插件(完成一条“安防通道”)
**目标:** 在 AI 结果基础上,增加 **报警逻辑 + 录像**,形成完整“安防产品”的基本形态。
**核心任务:**
- 实现 `alarm` 插件:
- 支持按规则配置object 类型、ROI、最小持续时间、时间段类似你 PRD 里的 `rules`
- 支持 HTTP/MQTT 等方式发报警(先做 HTTP
- 实现 `storage` 插件:
- 支持 continuous 模式(持续录像,分段保存)
- 文件切片(`segment_sec`
- 先不做 event 模式,后续可以扩展 pre/post-event 缓冲
- 在 DAG 上实现典型拓扑:
- `ai_yolo → alarm`(分支 1
- `ai_yolo → osd → storage`(分支 2
- `osd → publish`(分支 3
- 简单报警可视化:
- HTTP 回调到一个简单日志服务,或直接打印到日志,先验证链路
**关键里程碑:**
- ✅ 配置一个规则:例如“白天有人进入 ROI 区域触发报警”
- ✅ 摄像头对准测试区域:
- 屏幕上能看到检测框
- 有人进 ROI 时,后台收到 HTTP 报警请求(或日志输出)
- 同时有录像文件被写入(在 `/rec/cam1` 下能找到)
---
## Sprint 5配置系统完善 + 模板/实例 + 热更新 & Drain
**目标:** 从“能跑”升级到“**好配、好改**”:
实现 templates/instances、节点 enable/override、热更新、Drain/Stop 正常运转。
**核心任务:**
- 完善配置结构:
- `global`、`templates`、`instances`、`graphs`
- 节点通用字段(`enable`, `role`, `queue`
- 模板 + 实例展开逻辑:
- 支持 `${placeholder}` 替换
- 支持实例级 `override`(开启/关闭某节点、覆盖某些参数)
- 实现 `UpdateConfig`
- 对一部分节点alarm/publish/storage支持参数热更新
- 实现图的热更新流程:
- inotify 监控 config
- 构建新图 → 校验 → 若成功则原子切换
- 对旧节点按顺序调用 `Drain()``Stop()`
- 失败则回滚旧配置
- 对 "enable=false" 节点的处理:
- 构图时直接忽略该节点和相关 edges
- 或者实现旁路逻辑(看你最终选哪种,在代码里统一)
**关键里程碑:**
- ✅ 不重启进程的前提下:
- 通过修改 config把某一路的 `ai_yolo.enable` 改为 false → 该通道立即变成纯转码网关
- 再改回 true恢复智能分析
- ✅ 热更新时:
- 流“几乎不断”(允许 1 秒内小抖动)
- 没有崩溃 / 明显内存泄漏 / 死锁
---
## Sprint 6监控指标 + Web 控制台基础
**目标:** 增加可观测性,让系统变成“可视化可管理”的产品,而不是黑盒程序。
**核心任务:**
- 指标采集模块:
- 节点级input/output fps、queue 长度、drop 数、error 数、平均处理时长
- 图级:总 fps、报警数、当前推流客户端数
- HTTP API
- `GET /api/graphs`
- `GET /api/graphs/{name}`
- `GET /api/nodes/{id}/metrics`
- (可选)`POST /api/nodes/{id}/config` 调用 `UpdateConfig`
- Web 控制台Vue第一版
- 简单展示通道列表、节点状态、关键指标
- 不必太花哨能看到“通道是否绿”、“fps 大概多少”即可
- 日志查看:
- 提供简单接口/页面看到最近日志(或直接解析 log 文件)
**关键里程碑:**
- ✅ 打开 Web 页面:
- 能看到所有通道以及每个通道的状态Running/Stopped/Error
- 能看到某通道底下的节点链条in→pre→ai→osd→alarm/storage/publish
- 能看到每个节点的大致 fps & 队列深度
- ✅ 模拟异常(例如关闭摄像头):
- Web 页面能看到该通道出现错误/掉线状态,日志中有清晰错误信息
---
## Sprint 7多路性能调优 + 长稳测试
**目标:** 把系统从 demo 提升到「能上生产」的水平:多路、低延迟、长时间稳定。
**核心任务:**
- 多路场景压测:
- 逐步从 2 路 → 4 路 → 8 路 → 16 路(根据目标)
- 观察 CPU、NPU、内存占用和延迟
- 性能调优点:
- 队列策略(`drop_oldest` vs `block`
- OSD 放在 RGA/CPU 侧的性能权衡
- AiScheduler 模式(是否可以 batch、是否减少多线程抢 NPU
- 绑核策略input/ai/stroage/publish 分布在大/小核)
- 长稳测试:
- 7×24 小时连续跑,统计:
- 内存占用曲线
- CPU/NPU 曲线
- 崩溃/重启次数
- 回归测试:
- 关键功能场景(报警、录像、推流、热更新)跑完一遍
**关键里程碑:**
- ✅ 在目标多路场景(例如 8×1080p
- 系统端到端延迟满足 PRD 要求
- CPU/NPU 占用在目标范围内(如 CPU <30%NPU >90%
- ✅ 连续运行 7×24 小时:
- 无崩溃 / 无明显内存泄漏(内存曲线稳定)
- 所有通道仍在正常推流/录制/报警
---

605
Readme.md Normal file
View File

@ -0,0 +1,605 @@
## 回答
# RK3588 智能视频分析系统 PRD完整方案 v1.1
> 在你 v1.0 的基础上,已经补上你点名要的这几块:
> **DAG 多分支示例 + 节点通用字段 + 生命周期 Drain + Frame 结构 + 性能 / 线程 / 监控章节**,现在这份可以直接当总 PRD 用。
---
## 一、文档综述
### 1.1 项目背景
为了充分利用瑞芯微 RK3588 芯片提供的:
- **NPU约 6 TOPS**RKNNINT8 推理能力)
- **VPU多路 1080p 硬件解码/编码**
- **RGA硬件图像处理缩放/颜色转换/OSD 等)**
构建一套**纯 C++ 实现、高性能、低延迟、模块化**的边缘计算视频分析平台。平台主要部署在园区、仓库、工厂等场景,实现就地智能分析与处理,减少带宽与中心算力压力。
### 1.2 核心目标
- **高性能**
- 单 RK3588 支持 816 路 1080p 实时分析
- 单路端到端(拉流→推理→输出)延迟 < 500ms
- **低耦合**
- 基于插件 + DAG 流水线架构
- 算法、业务逻辑与底层框架完全解耦
- **易运维**
- JSON 配置驱动
- 支持热更新,无需重启进程即可变更流程/参数
- **多场景覆盖**
- 同一套框架通过不同配置图覆盖:
- 安防报警
- 录像存储
- 转码网关RTSP/HLS
- 混合场景(报警 + 存储 + 推流)
---
## 二、总体架构设计
### 2.1 系统逻辑架构
```text
[ media-server 主进程 ]
|
+-- Graph Manager (图管理加载配置、构建DAG、热更新/回滚)
|
+-- Plugin Loader (插件加载dlopen .so检查 ABI 版本)
|
+-- AiScheduler (统一调度 NPU 推理请求)
|
+-- Metrics & Logger (监控指标、日志)
|
+-- HTTP Server (REST API + Web 控制台 + 状态查询)
```
- **media-server**:主入口,负责初始化配置、图构建、主事件循环。
- **Graph ManagerGraphMgr**
- 对应多个 graph每个 graph 一路/一组业务流程)。
- 实例化节点Node建立边Edge负责热更新时的 diff & 切换。
- **Plugin Loader**
- 动态加载插件 `.so`,校验节点类型和 ABI 版本。
- **AiScheduler**
- 所有 AI 节点统一将推理任务提交到 AiScheduler由其管理 NPU 资源。
- **HTTP Server**
- 对外提供图状态查询、节点指标、配置热更新触发等。
### 2.2 数据流架构DAG
- **Graph**一个完整业务通道。例如Camera 1 的“拉流→AI→报警+录像+推流”。
- **Node节点**:功能基本单元,由动态加载的 `.so` 实例实现。
- **Edge**:节点间的数据通道,每条边对应一个 **SPSC单生产者单消费者环形队列**
- **多分支支持**:一个节点可以有多个下游(多条边),实现一对多分支。
示意:
```text
[in] → [pre] → [ai] ─────→ [alarm]
└──→ [osd] → [storage]
└──→ [publish]
```
---
## 三、数据模型Frame & 元数据)
### 3.1 检测结果结构Detection & DetectionResult
> 约定:**所有 AI 节点写入此结构**OSD / 报警 等节点只读。
```cpp
struct Rect {
float x; // 左上角X像素或归一化坐标
float y; // 左上角Y
float w; // 宽
float h; // 高
};
struct Detection {
int cls_id; // 类别ID
float score; // 置信度 [0,1]
Rect bbox; // 检测框
int track_id; // 跟踪ID可选无则 -1 或 0
};
struct DetectionResult {
std::vector<Detection> items;
int img_w; // 推理输入宽
int img_h; // 推理输入高
std::string model_name; // 模型名/版本
};
```
**约定:**
- `bbox` 坐标标准在 PRD 中约定好(建议:像素坐标),避免后续插件互相搞混。
- class 映射表由 AI 节点自行维护OSD/报警通过 `cls_id` 做规则匹配。
### 3.2 Frame 结构
```cpp
enum class PixelFormat {
NV12,
YUV420,
RGB,
BGR,
UNKNOWN
};
struct Frame {
int width;
int height;
PixelFormat format;
int dma_fd; // DMA-BUF FD无则为 -1
uint8_t* data; // CPU 内存指针可选有则指向内存buffer
uint64_t pts; // 时间戳(微秒)
uint64_t frame_id; // 单调递增ID
std::shared_ptr<DetectionResult> det; // AI 检测结果
std::shared_ptr<void> user_meta; // 扩展元数据(具体类型由插件间约定)
};
```
**约定:**
- **零拷贝优先**:解码/前处理尽量通过 `dma_fd` 传递,必要时才用 data。
- 节点默认只读图像数据,**可以更新 `det` / `user_meta`**。
- 所有队列中传递的都是 `std::shared_ptr<Frame>`,实现多下游共享。
---
## 四、插件模型与生命周期
### 4.1 节点通用字段Node 通用配置)
每个节点配置中推荐包含以下通用字段:
```json
{
"id": "唯一节点ID",
"type": "节点类型,如 input_rtsp / ai_yolo",
"enable": true,
"role": "source|filter|sink", // 可选,但建议写上,便于校验
"queue": { // 可选:覆盖边上的默认队列策略
"size": 128,
"policy": "drop_oldest" // drop_oldest / drop_newest / block
},
"...特定节点参数..."
}
```
- `enable = false`GraphMgr 构建图时可直接忽略该节点及相关 edges。
- `role` 主要用于配置校验source 不应有上游sink 不应有下游等)。
### 4.2 INode 接口(含 Drain
```cpp
// NodeStatus 用于描述处理结果
enum class NodeStatus {
OK, // 正常处理
DROP, // 丢弃该帧(例如不满足条件)
ERROR // 发生错误,需要记录日志
};
class INode {
public:
virtual ~INode() = default;
// 1. 初始化:解析 JSON 配置,申请静态资源
virtual bool Init(const Json::Value& config) = 0;
// 2. 启动:启动内部线程(如有),准备接收/发送数据
virtual bool Start() = 0;
// 3. 处理数据GraphMgr 从队列中取到 Frame 后调用
// - 对 filter/sink 节点:正常消费上游 Frame
// - 对 source 节点:通常可忽略(见下文约定)
virtual NodeStatus Process(std::shared_ptr<Frame> frame) = 0;
// 4. 动态配置更新支持热更参数如改变报警阈值、bitrate
// 返回 true 表示就地更新成功,无需重建节点
virtual bool UpdateConfig(const Json::Value& new_config) { return false; }
// 5. Drain停止前**不再有新输入**,但需处理完内部队列/缓冲数据
// 如storage 完成当前切片写入publish 发送剩余帧等
virtual void Drain() {}
// 6. 停止释放资源线程、句柄、内存等Drain 之后调用
virtual void Stop() = 0;
};
```
### 4.3 插件导出与 ABI 版本
```cpp
#define ABI_VERSION 20250101
#define REGISTER_NODE(TYPE_NAME, CLASS_NAME) \
extern "C" { \
INode* CreateNode() { \
return new CLASS_NAME(); \
} \
const char* GetNodeType() { \
return TYPE_NAME; \
} \
int GetAbiVersion() { \
return ABI_VERSION; \
} \
const char* GetNodeDescription() { \
return "node: " TYPE_NAME; \
} \
}
```
GraphMgr 在加载插件 `.so` 时:
- 调用 `GetAbiVersion()` 校验兼容性。
- 通过 `GetNodeType()` 找到对应 `type` 的构造函数。
### 4.4 Source 节点约定
为避免把所有采集逻辑都硬塞进 `Process()`PRD 中统一约定:
- `role == "source"` 的节点(如 `input_rtsp` / `input_file`
- 在 `Start()` 中启动**内部采集线程**。
- 线程中从外部拉流/读文件,构造 `Frame`,通过框架提供的 `FrameEmitter` 写入下游队列。
- `Process()` 可以是空实现或仅做心跳/监控。
- `role != "source"` 的节点:
- 由 GraphMgr 驱动 `Process(frame)`,消费上游队列元素。
GraphMgr 负责:
- 对非 source 节点:循环从对应队列取 `Frame` → 调用 `Process()`
- 对所有节点:在热更新 / 停止时,控制 `Drain()``Stop()` 的调用顺序。
---
## 五、配置系统Config System
整个系统由 `config.json` 驱动,主要包含三层:
- `global`:全局配置
- `templates`pipeline 模板(复用节点与拓扑)
- `instances` / `graphs`:具体业务实例(通道)
### 5.1 顶层结构示例
```json
{
"global": {
"plugin_path": "/usr/lib/rknodes",
"log_level": "info",
"metrics_port": 9000
},
"templates": { ... },
"instances": [ ... ],
"graphs": [ ... ] // 可选直接手写graph
}
```
- **优先方式**:使用 `templates + instances` 快速生成多路通道。
- **高级用法**:直接使用 `graphs` 写复杂拓扑(例如:一条流拆成多个完全不同的分支)。
### 5.2 DAG 多分支完整示例(带报警 + 存储 + 推流)
```json
{
"graphs": [
{
"name": "cam1_pipeline",
"nodes": [
{
"id": "in_cam1",
"type": "input_rtsp",
"role": "source",
"enable": true,
"url": "rtsp://user:pwd@ip/stream1"
},
{
"id": "pre_cam1",
"type": "preprocess",
"role": "filter",
"enable": true,
"dst_w": 640,
"dst_h": 640,
"keep_ratio": true
},
{
"id": "ai_cam1",
"type": "ai_yolo",
"role": "filter",
"enable": true,
"model_path": "/models/yolov8n.rknn",
"conf": 0.5,
"nms": 0.5,
"class_filter": [0, 1]
},
{
"id": "osd_cam1",
"type": "osd",
"role": "filter",
"enable": true,
"draw_bbox": true,
"draw_text": true
},
{
"id": "alarm_cam1",
"type": "alarm",
"role": "sink",
"enable": true,
"rules": [
{
"name": "intrusion_day",
"object": ["person"],
"roi": "roi1",
"min_duration_ms": 500,
"schedule": "08:00-20:00"
}
]
},
{
"id": "storage_cam1",
"type": "storage",
"role": "sink",
"enable": true,
"mode": "continuous",
"segment_sec": 300,
"path": "/rec/cam1"
},
{
"id": "publish_cam1",
"type": "publish",
"role": "sink",
"enable": true,
"codec": {
"video": "h264",
"bitrate_kbps": 2048,
"gop": 50
},
"outputs": [
{ "proto": "rtsp", "port": 8554, "path": "/live/cam1" },
{ "proto": "hls", "port": 8080, "path": "/hls/cam1", "segment_sec": 2 }
]
}
],
"edges": [
["in_cam1", "pre_cam1"],
["pre_cam1", "ai_cam1"],
["ai_cam1", "alarm_cam1"],
["ai_cam1", "osd_cam1"],
["osd_cam1", "storage_cam1"],
["osd_cam1", "publish_cam1"]
]
}
]
}
```
通过简单改动即可支持不同组合:
- 不报警:`alarm_cam1.enable = false` 或移除该节点/边。
- 只转码网关:直接连 `["in_cam1", "publish_cam1"]`,并禁用 AI/OSD/报警/storage。
- 只录像:`["in_cam1", "storage_cam1"]`。
### 5.3 模板templates与实例instances
#### 5.3.1 模板示例:标准安防流程
```json
"templates": {
"standard_security": {
"nodes": [
{ "id": "in", "type": "input_rtsp", "role": "source", "url": "${url}" },
{ "id": "pre", "type": "preprocess", "role": "filter", "dst_w": 640, "dst_h": 640 },
{ "id": "ai", "type": "ai_yolo", "role": "filter", "model_path": "/models/yolov8n.rknn", "conf": 0.5 },
{ "id": "osd", "type": "osd", "role": "filter" },
{ "id": "pub", "type": "publish", "role": "sink", "path": "/live/${name}" }
],
"edges": [
["in", "pre"],
["pre", "ai"],
["ai", "osd"],
["osd", "pub"]
]
}
}
```
#### 5.3.2 实例与 override禁用某些节点
```json
"instances": [
{
"name": "cam_01",
"template": "standard_security",
"params": {
"url": "rtsp://192.168.1.101/stream1",
"name": "office"
},
"override": {
"nodes": {
"ai": { "enable": true },
"osd": { "enable": true }
}
}
},
{
"name": "cam_02_only_transcode",
"template": "standard_security",
"params": {
"url": "rtsp://192.168.1.102/stream1",
"name": "transcoder"
},
"override": {
"nodes": {
"ai": { "enable": false },
"osd": { "enable": false }
}
}
}
]
```
> GraphMgr 在加载时将模板 + 实例 merge 成具体的 graph节点 ID 会按实例名做前缀防冲突)。
### 5.4 热更新与回滚(简要)
- 通过 inotify 监控 `config.json`
- 检测到变更时:
1. 读取新配置 → JSON Schema 校验;
2. 构建新的图对象dry run包括插件加载与节点实例化
3. 与旧图做 diff
- 能 `UpdateConfig` 的节点优先调用 `UpdateConfig`
- 需要重建的节点:先创建新节点并预热(如加载模型),然后做 **边的原子切换**
4. 对旧节点:依次调用 `Drain()``Stop()`
5. 若任意步骤失败:回滚到旧配置,并输出错误日志。
- 保留上一份有效配置,支持手动回滚。
---
## 六、功能模块定义(插件类型)
> 下表是“典型插件类型”,后续可以扩展更多。
### 6.1 输入与前处理
| 节点类型 | 功能描述 | 关键参数 | 硬件依赖 |
| :------------- | :------------------------------- | :------------------------- | :--------------- |
| `input_rtsp` | 拉取 RTSP 流,断线重连 | `url`, `reconnect_sec` | MPP VDEC / 网络 |
| `input_file` | 读取本地 MP4/MKV 文件循环播放 | `path`, `loop` | MPP VDEC |
| `preprocess` | 缩放、裁剪、NV12→RGB/BGR 等 | `dst_w`, `dst_h`, `format` | RGA / GPU |
### 6.2 AI 分析
| 节点类型 | 功能描述 | 关键参数 | 硬件依赖 |
| :----------- | :------------------------- | :----------------------------------- | :------- |
| `ai_yolo` | 通用目标检测 | `model_path`, `conf`, `nms` | NPU(RKNN) |
| `ai_pose` | 关键点检测(可选扩展) | `model_path` | NPU |
| `ai_custom` | 自定义 AI 算法 | `model_path`, `custom_param` 等 | NPU |
> 所有 AI 节点通过 **AiScheduler** 使用 NPU不直接持有 NPU 句柄。
### 6.3 业务逻辑与输出
| 节点类型 | 功能描述 | 关键参数 | 硬件依赖 |
| :---------- | :--------------------------------- | :----------------------------------- | :----------------- |
| `osd` | 绘制检测框、文字等 | `draw_bbox`, `draw_text` | RGA / CPU |
| `alarm` | 报警规则(区域、时间、目标类型) | `rules`(含 ROI、时间段、阈值等 | CPU |
| `storage` | 录像MP4/TS 切片) | `mode`, `segment_sec`, `path` | CPUIO |
| `publish` | 编码并推流RTSP/HLS | `codec`, `bitrate`, `outputs` | MPP VENC + 网络 |
---
## 七、线程模型Thread Model
### 7.1 线程类型与职责
| 线程类型 | 职责 | 绑核策略(可配置) |
| :-------------- | :-------------------------------------- | :-------------------------- |
| `main` | 程序入口、配置加载、GraphMgr 调度 | 默认 CPU0 |
| `input-io` | RTSP 网络 IO | 大核/通用 |
| `decode` | 调用 MPP 解码 | 大核 |
| `preprocess` | RGA/GPU 前处理 | 视情况绑核 |
| `ai-worker` | 调度 AiScheduler异步调用 NPU | 大核 |
| `post/osd` | OSD 绘制、报警逻辑等 | 小核优先 |
| `storage` | 文件写入、切片管理 | 小核 |
| `publish` | RTSP/HLS 推流 | 小核 |
| `metrics/log` | 指标采集、日志异步写入 | 任意核 |
### 7.2 配置控制
- 节点配置中可增加字段:
```json
"cpu_affinity": [2, 3] // 可选
```
- 若未配置,由框架根据 `role` 和负载自动分配。
---
## 八、性能指标Performance Targets
| 场景 | 指标 | 目标值 |
| :------------- | :------------- | :--------------------- |
| 8×1080p@25fps | 整机总处理帧率 | ≥ 200 fps |
| 单路端到端 | 延迟 | ≤ 500 ms典型 ≤ 380 |
| NPU | 利用率 | ≥ 90% |
| 8 路全开 | CPU 占用 | ≤ 30% |
| 7×24 小时运行 | 内存泄漏 | 无明显增长(< 10MB |
测试要求(简要):
- 在实际 RK3588 设备上,使用典型 YOLO 模型和 8 路 RTSP 输入进行长稳测试。
- 统计长时间运行中的 CPU、内存、NPU 使用情况。
---
## 九、监控与运维Metrics & Ops
### 9.1 节点级指标
每个节点提供以下基本指标(通过 HTTP / Prometheus 等暴露):
- `node_input_fps` / `node_output_fps`
- `queue_length`(入队/出队队列长度)
- `frame_drop_count`
- `error_count`
- `avg_process_time_ms`Process 平均处理耗时)
### 9.2 图 / 通道级指标
- 通道状态running / error / disabled
- 报警次数 / 最近报警时间
- 当前推流客户端数RTSP/HLS
- 当前录像文件信息(路径 / 大小 / 最近片段时间)
### 9.3 管理接口REST 简要)
- `GET /api/graphs`:列出所有 graph 状态
- `GET /api/graphs/{name}`:单通道详情
- `POST /api/config/reload`触发配<EFBFBD><EFBFBD><EFBFBD>重加载
- `GET /api/nodes/{id}/metrics`:查询节点指标
- `POST /api/nodes/{id}/config`:动态更新节点配置(调用 `UpdateConfig`
---
## 十、开发与部署环境
- **硬件平台**RK35884×A76 + 4×A55 + NPU + VPU + RGA
- **工具链**
- 交叉编译:`aarch64-linux-gnu-gcc 12+`
- 构建CMake ≥ 3.20 + Ninja
- **调试**
- `gdbserver` + VSCode 远程调试
- RKNN Profiler 分析 NPU 利用率
- **日志**
- `spdlog` 异步日志
- 日志级别可运行时调整(通过配置或 REST 接口)
---
## 十一、扩展与演进
1. **新增算法插件**
- 实现新的 `INode` 子类(例如 `ai_cls`, `ai_reid`)。
- 使用 `REGISTER_NODE` 编译为 `.so` 放入 `plugin_path`
- 在 `config.json` 中新增节点即可接入全流程。
2. **新增输出类型**
- 新增 `publish_webrtc`、`storage_s3` 等节点类型。
- 不改动上游图结构,只调整 sink 部分。
3. **分布式扩展(后续版本)**
- 引入 ZeroMQ / NanoMSG将远端设备作为特殊节点处理`remote_sink`)。
- 中控只维护抽象图,实际在多台 RK3588 设备上分布执行。
---

View File

@ -0,0 +1,20 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(TOOLCHAIN_PREFIX aarch64-linux-gnu CACHE STRING "Cross compiler prefix")
set(RK3588_SYSROOT "$ENV{RK3588_SYSROOT}" CACHE PATH "RK3588 sysroot path")
if(NOT RK3588_SYSROOT)
message(FATAL_ERROR "RK3588_SYSROOT environment variable must point to the SDK sysroot")
endif()
set(CMAKE_SYSROOT ${RK3588_SYSROOT})
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_FIND_ROOT_PATH ${RK3588_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

28
configs/sample_cam1.json Normal file
View File

@ -0,0 +1,28 @@
{
"graphs": [
{
"name": "cam1",
"nodes": [
{
"id": "in_cam1",
"type": "input_rtsp",
"role": "source",
"enable": true,
"url": "rtsp://user:pass@ip/stream1"
},
{
"id": "pub_cam1",
"type": "publish",
"role": "sink",
"enable": true,
"outputs": [
{ "proto": "rtsp", "port": 8554, "path": "/live/cam1" }
]
}
],
"edges": [
["in_cam1", "pub_cam1"]
]
}
]
}

25
include/frame/frame.h Normal file
View File

@ -0,0 +1,25 @@
#pragma once
#include <cstdint>
namespace rk3588 {
enum class PixelFormat {
NV12,
YUV420,
RGB,
BGR,
UNKNOWN
};
struct Frame {
int width = 0;
int height = 0;
PixelFormat format = PixelFormat::UNKNOWN;
int dma_fd = -1;
uint64_t pts = 0;
uint64_t frame_id = 0;
};
} // namespace rk3588

21
include/version.h Normal file
View File

@ -0,0 +1,21 @@
#pragma once
#ifndef RK_PROJECT_VERSION
#define RK_PROJECT_VERSION "0.0.0-dev"
#endif
#ifndef RK_GIT_SHA
#define RK_GIT_SHA "nogit"
#endif
namespace rk3588 {
inline const char* ProjectVersion() {
return RK_PROJECT_VERSION;
}
inline const char* GitSha() {
return RK_GIT_SHA;
}
} // namespace rk3588

2
samples/CMakeLists.txt Normal file
View File

@ -0,0 +1,2 @@
add_subdirectory(mpp_decode_demo)
add_subdirectory(rknn_infer_demo)

View File

@ -0,0 +1,48 @@
if(NOT ENABLE_RK_DEMOS)
add_executable(mpp_decode_demo
main.cpp)
target_link_libraries(mpp_decode_demo PRIVATE project_options)
else()
set(MPP_SRC_ROOT ${RK_MPP_ROOT})
set(MPP_TEST_SOURCE ${MPP_SRC_ROOT}/test/mpi_dec_test.c)
set(MPP_UTIL_SOURCE ${MPP_SRC_ROOT}/utils/mpi_dec_utils.c)
if(NOT EXISTS ${MPP_TEST_SOURCE})
message(FATAL_ERROR "mpi_dec_test.c not found at ${MPP_TEST_SOURCE}. Verify RK_MPP_ROOT")
endif()
if(NOT EXISTS ${MPP_UTIL_SOURCE})
message(FATAL_ERROR "mpi_dec_utils.c not found at ${MPP_UTIL_SOURCE}. Verify RK_MPP_ROOT")
endif()
if(NOT RK_MPP_LIB_PATH)
message(FATAL_ERROR "Set RK_MPP_LIB_PATH to the built librockchip_mpp.so for RK3588")
endif()
if(NOT EXISTS ${RK_MPP_LIB_PATH})
message(FATAL_ERROR "RK_MPP_LIB_PATH=${RK_MPP_LIB_PATH} does not exist")
endif()
add_executable(mpp_decode_demo
${MPP_TEST_SOURCE}
${MPP_UTIL_SOURCE})
target_include_directories(mpp_decode_demo PRIVATE
${MPP_SRC_ROOT}/inc
${MPP_SRC_ROOT}/mpp
${MPP_SRC_ROOT}/osal/inc
${MPP_SRC_ROOT}/osal
${MPP_SRC_ROOT}/test
${MPP_SRC_ROOT}/utils)
target_link_libraries(mpp_decode_demo PRIVATE project_options
${RK_MPP_LIB_PATH}
pthread
dl
m)
set_target_properties(mpp_decode_demo PROPERTIES LINKER_LANGUAGE C)
endif()
install(TARGETS mpp_decode_demo RUNTIME DESTINATION bin)
if(ENABLE_RK_DEMOS AND EXISTS ${RK_MPP_LIB_PATH})
install(FILES ${RK_MPP_LIB_PATH} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

View File

@ -0,0 +1,20 @@
#include <filesystem>
#include <iostream>
#include <string>
int main(int argc, char** argv) {
if (argc < 3) {
std::cerr << "Usage: mpp_decode_demo <input.h264> <output.yuv|/dev/null>\n";
std::cerr << "This placeholder builds without RKMPP. To run the real demo, "
<< "enable RKMPP toolchain and link against Rockchip MPP SDK." << std::endl;
return 1;
}
std::filesystem::path input = argv[1];
std::filesystem::path output = argv[2];
std::cout << "[RKMPP Placeholder] Pretending to decode " << input << " -> " << output
<< std::endl;
std::cout << "Integrate Rockchip's MPP sample sources here when the SDK is available." << std::endl;
return 0;
}

View File

@ -0,0 +1,44 @@
if(NOT ENABLE_RK_DEMOS)
add_executable(rknn_infer_demo
main.cpp)
target_link_libraries(rknn_infer_demo PRIVATE project_options)
else()
set(RKNN_DEMO_SRC ${RK_RKNN_ROOT}/examples/rknn_api_demo/src/rknn_create_mem_demo.cpp)
if(NOT EXISTS ${RKNN_DEMO_SRC})
message(FATAL_ERROR "rknn_create_mem_demo.cpp not found at ${RKNN_DEMO_SRC}. Verify RK_RKNN_ROOT")
endif()
if(NOT EXISTS ${RKNN_RUNTIME_INCLUDE_DIR})
message(FATAL_ERROR "RKNN_RUNTIME_INCLUDE_DIR ${RKNN_RUNTIME_INCLUDE_DIR} not found")
endif()
if(NOT EXISTS ${RKNN_RUNTIME_LIB_DIR})
message(FATAL_ERROR "RKNN_RUNTIME_LIB_DIR ${RKNN_RUNTIME_LIB_DIR} not found")
endif()
set(RKNNRT_LIB ${RKNN_RUNTIME_LIB_DIR}/librknnrt.so)
if(NOT EXISTS ${RKNNRT_LIB})
message(FATAL_ERROR "librknnrt.so not found in ${RKNN_RUNTIME_LIB_DIR}")
endif()
add_executable(rknn_infer_demo
${RKNN_DEMO_SRC})
target_include_directories(rknn_infer_demo PRIVATE
${RKNN_RUNTIME_INCLUDE_DIR}
${RK_RKNN_ROOT}/examples/3rdparty/stb)
target_link_directories(rknn_infer_demo PRIVATE ${RKNN_RUNTIME_LIB_DIR})
target_link_libraries(rknn_infer_demo PRIVATE project_options rknnrt pthread dl m)
if(EXISTS ${RKNN_MODEL_PATH})
install(FILES ${RKNN_MODEL_PATH} DESTINATION ${CMAKE_INSTALL_DATADIR}/rk3588-media-server/models)
endif()
if(EXISTS ${RKNN_SAMPLE_IMAGE})
install(FILES ${RKNN_SAMPLE_IMAGE} DESTINATION ${CMAKE_INSTALL_DATADIR}/rk3588-media-server/samples)
endif()
install(FILES ${RKNNRT_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(TARGETS rknn_infer_demo RUNTIME DESTINATION bin)

View File

@ -0,0 +1,20 @@
#include <filesystem>
#include <iostream>
#include <string>
int main(int argc, char** argv) {
if (argc < 3) {
std::cerr << "Usage: rknn_infer_demo <model.rknn> <image.jpg>\n";
std::cerr << "This placeholder does not invoke RKNN APIs. "
<< "Link against the RKNN runtime to perform real inference." << std::endl;
return 1;
}
std::filesystem::path model = argv[1];
std::filesystem::path image = argv[2];
std::cout << "[RKNN Placeholder] Would run inference with model " << model
<< " on image " << image << std::endl;
std::cout << "Hook up the official RKNN demo sources to interact with the NPU." << std::endl;
return 0;
}

21
scripts/build_board.sh Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(dirname "$0")/.."
BUILD_DIR=${BUILD_DIR:-build/rk3588}
INSTALL_PREFIX=${INSTALL_PREFIX:-${BUILD_DIR}/install}
BUILD_TYPE=${BUILD_TYPE:-Release}
TOOLCHAIN_FILE=${TOOLCHAIN_FILE:-"$ROOT_DIR/cmake/toolchain/aarch64-rk3588.cmake"}
if [[ -z "${RK3588_SYSROOT:-}" ]]; then
echo "RK3588_SYSROOT environment variable must be set" >&2
exit 1
fi
cmake -S "$ROOT_DIR" -B "$BUILD_DIR" \
-G Ninja \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build "$BUILD_DIR"
cmake --install "$BUILD_DIR" --prefix "$INSTALL_PREFIX"

11
scripts/build_host.sh Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
BUILD_DIR=${BUILD_DIR:-build/host}
BUILD_TYPE=${BUILD_TYPE:-RelWithDebInfo}
cmake -S "$(dirname "$0")/.." -B "$BUILD_DIR" \
-G Ninja \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
cmake --build "$BUILD_DIR"

56
scripts/run_on_board.sh Normal file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage: run_on_board.sh --host <ip> --user <name> --build-dir <dir>
Copies build artifacts (pass the install directory for best results) to the RK3588 board and runs sanity commands.
EOF
}
HOST=""
USER="root"
BUILD_DIR="build/rk3588"
while [[ $# -gt 0 ]]; do
case "$1" in
--host)
HOST="$2"; shift 2;;
--user)
USER="$2"; shift 2;;
--build-dir)
BUILD_DIR="$2"; shift 2;;
-h|--help)
usage; exit 0;;
*)
echo "Unknown arg: $1" >&2
usage; exit 1;;
esac
done
if [[ -z "$HOST" ]]; then
echo "--host is required" >&2
exit 1
fi
ARTIFACT_DIR="$BUILD_DIR"
if [[ ! -d "$ARTIFACT_DIR" ]]; then
echo "Build directory $ARTIFACT_DIR not found" >&2
exit 1
fi
REMOTE_DIR="/tmp/rk3588_media_server"
scp -r "$ARTIFACT_DIR" "$USER@$HOST:$REMOTE_DIR"
ssh "$USER@$HOST" <<EOF
set -e
cd $REMOTE_DIR
echo "--- Running media-server --version ---"
./media-server --version || true
echo "--- Running mpp_decode_demo (dry-run) ---"
./mpp_decode_demo || true
echo "--- Running rknn_infer_demo (dry-run) ---"
./rknn_infer_demo || true
EOF

49
src/main.cpp Normal file
View File

@ -0,0 +1,49 @@
#include <iostream>
#include <string>
#include <string_view>
#include "media_server_app.h"
#include "version.h"
namespace {
void PrintUsage() {
std::cout << "Usage: media-server [--config <path>] [--version]\n";
}
void PrintVersion() {
std::cout << "RK3588 Media Server v" << rk3588::ProjectVersion()
<< " (git " << rk3588::GitSha() << ")\n";
}
} // namespace
int main(int argc, char** argv) {
std::string config_path = "configs/sample_cam1.json";
bool show_version = false;
for (int i = 1; i < argc; ++i) {
std::string_view arg{argv[i]};
if (arg == "--version") {
show_version = true;
} else if ((arg == "--config" || arg == "-c") && i + 1 < argc) {
config_path = argv[++i];
} else if (arg == "--help" || arg == "-h") {
PrintUsage();
return 0;
} else {
std::cerr << "Unknown argument: " << arg << "\n";
PrintUsage();
return 1;
}
}
if (show_version) {
PrintVersion();
return 0;
}
PrintVersion();
rk3588::MediaServerApp app(config_path);
return app.Start();
}

16
src/media_server_app.cpp Normal file
View File

@ -0,0 +1,16 @@
#include "media_server_app.h"
#include <iostream>
namespace rk3588 {
MediaServerApp::MediaServerApp(std::string config_path)
: config_path_(std::move(config_path)) {}
int MediaServerApp::Start() {
std::cout << "[MediaServerApp] config=" << config_path_
<< " (pipeline execution not yet implemented)\n";
return 0;
}
} // namespace rk3588

17
src/media_server_app.h Normal file
View File

@ -0,0 +1,17 @@
#pragma once
#include <string>
namespace rk3588 {
class MediaServerApp {
public:
explicit MediaServerApp(std::string config_path);
int Start();
private:
std::string config_path_;
};
} // namespace rk3588

1
third_party/.gitkeep vendored Normal file
View File

@ -0,0 +1 @@

91
third_party/mpp/.gitignore vendored Normal file
View File

@ -0,0 +1,91 @@
#
# cache files
#
*~
*.swp
*.gc??
#
# gnu global files
#
GPATH
GRTAGS
GSYMS
GTAGS
ID
#
# GNU Autotools
#
aclocal.m4
autom4te.cache
config.h
config.h.in
config.h-new
config.log
config.status
config.guess
config.sub
config.rpath
configure
libtool
stamp-h
stamp-h.in
stamp-h1
ltmain.sh
missing
mkinstalldirs
compile
install-sh
depcomp
autoregen.sh
ABOUT-NLS
/INSTALL
_stdint.h
.dirstamp
/m4
.deps
.libs
*.lo
*.la
*.o
Makefile.in
Makefile
/m4
tmp-orc.c
*orc.h
#
# VS
#
Build
*.user
*.suo
*.ipch
*.sdf
*.opensdf
*.DS_Store
/test-driver
*.log
*.trs
/subprojects
#
# Building cache
#
/build
/mpp/version.h
#
# Debian
#
/obj-arm-linux-gnueabihf/
/obj-aarch64-linux-gnu/
#
# VSCode
#
.vscode/
.code-workspace

332
third_party/mpp/Android.bp vendored Normal file
View File

@ -0,0 +1,332 @@
cc_defaults {
name: "mpp_defaults",
cflags: [
"-DENABLE_FASTPLAY_ONCE",
"-DHAVE_AV1D",
"-DHAVE_AVS2D",
"-DHAVE_AVSD",
"-DHAVE_H263D",
"-DHAVE_H264D",
"-DHAVE_H264E",
"-DHAVE_H265D",
"-DHAVE_H265E",
"-DHAVE_JPEGD",
"-DHAVE_JPEGE",
"-DHAVE_MPEG2D",
"-DHAVE_MPEG4D",
"-DHAVE_VP8D",
"-DHAVE_VP8E",
"-DHAVE_VP9D",
"-DHAVE_VPROC",
"-Wno-implicit-fallthrough",
"-Wno-pointer-arith",
"-Wno-typedef-redefinition",
"-Wno-unused-variable",
],
local_include_dirs: [
"mpp/base/inc",
"mpp/common",
"mpp/codec/inc",
"mpp/codec/dec/common",
"mpp/codec/enc/h264",
"mpp/codec/enc/h265",
"mpp/vproc/inc",
"mpp/hal/inc",
"mpp/hal/common",
"mpp/hal/common/av1",
"mpp/hal/common/h265",
"mpp/hal/common/h264",
"mpp/hal/common/jpeg",
"mpp/hal/rkenc/common",
"mpp/hal/rkenc/h265e",
"mpp/hal/rkenc/h264e",
"mpp/hal/rkenc/jpege",
"mpp/hal/rkdec/inc",
"mpp/hal/rkdec/av1d",
"mpp/hal/vpu/common",
"mpp/hal/vpu/jpege",
"mpp/hal/vpu/av1d",
"mpp/hal/vpu/h264e",
"mpp/inc",
"osal",
"osal/inc",
"osal/allocator",
"osal/driver/inc",
"kmpp/inc",
"kmpp/base/inc",
"inc",
],
generated_headers: ["mpp_version_header"],
}
filegroup {
name: "mpp_base_srcs",
srcs: [
"mpp/base/*.cpp",
"mpp/base/*.c",
],
}
filegroup {
name: "mpp_codec_srcs",
srcs: [
"mpp/codec/*.cpp",
"mpp/codec/dec/**/*.cpp",
"mpp/codec/dec/**/*.c",
"mpp/codec/enc/**/*.cpp",
"mpp/codec/enc/**/*.c",
"mpp/codec/rc/*.cpp",
"mpp/codec/rc/*.c",
],
}
filegroup {
name: "mpp_hal_srcs",
srcs: [
"mpp/hal/*.cpp",
"mpp/hal/common/**/*.c",
"mpp/hal/common/**/*.cpp",
"mpp/hal/vpu/**/*.c",
"mpp/hal/vpu/**/*.cpp",
"mpp/hal/rkdec/**/*.c",
"mpp/hal/rkdec/**/*.cpp",
"mpp/hal/rkenc/common/*.c",
"mpp/hal/rkenc/h264e/hal_h264e_vepu541.c",
"mpp/hal/rkenc/h264e/hal_h264e_vepu580.c",
"mpp/hal/rkenc/h264e/hal_h264e_vepu540c.c",
"mpp/hal/rkenc/h264e/hal_h264e_vepu510.c",
"mpp/hal/rkenc/h264e/hal_h264e_vepu511.c",
"mpp/hal/rkenc/h265e/hal_h265e_vepu541.c",
"mpp/hal/rkenc/h265e/hal_h265e_vepu580.c",
"mpp/hal/rkenc/h265e/hal_h265e_vepu540c.c",
"mpp/hal/rkenc/h265e/hal_h265e_vepu510.c",
"mpp/hal/rkenc/h265e/hal_h265e_vepu511.c",
"mpp/hal/rkenc/jpege/hal_jpege_vepu540c.c",
"mpp/hal/rkenc/jpege/hal_jpege_vepu511.c",
"mpp/hal/rkenc/jpege/hal_jpege_vpu720.c",
"mpp/hal/dummy/*.c",
],
}
filegroup {
name: "mpp_vproc_srcs",
srcs: [
"mpp/vproc/*.cpp",
"mpp/vproc/iep/*.cpp",
"mpp/vproc/iep2/*.c",
"mpp/vproc/rga/*.cpp",
"mpp/vproc/vdpp/*.c",
"mpp/vproc/vdpp/*.cpp",
],
}
filegroup {
name: "mpp_kmpp_srcs",
srcs: [
"kmpp/base/*.c",
"kmpp/*.c"
],
}
filegroup {
name: "mpp_osal_srcs",
srcs: [
"osal/*.cpp",
"osal/*.c",
"osal/allocator/*.c",
"osal/android/*.c",
"osal/driver/*.c",
"osal/driver/*.cpp",
],
}
genrule {
name: "mpp_version_header",
srcs: ["build/cmake/version.in"],
out: ["version.h"],
cmd: "VERSION_INFO=`cd hardware/rockchip/libmpp; git log -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s\"`;" +
"HISTORY_0=`cd hardware/rockchip/libmpp; git log HEAD~0 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_1=`cd hardware/rockchip/libmpp; git log HEAD~1 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_2=`cd hardware/rockchip/libmpp; git log HEAD~2 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_3=`cd hardware/rockchip/libmpp; git log HEAD~3 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_4=`cd hardware/rockchip/libmpp; git log HEAD~4 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_5=`cd hardware/rockchip/libmpp; git log HEAD~5 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_6=`cd hardware/rockchip/libmpp; git log HEAD~6 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_7=`cd hardware/rockchip/libmpp; git log HEAD~7 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_8=`cd hardware/rockchip/libmpp; git log HEAD~8 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"HISTORY_9=`cd hardware/rockchip/libmpp; git log HEAD~9 -1 --oneline --date=short --pretty=format:\"%h author: %<|(30)%an %cd %s %d\"`;" +
"sed -e \"s|@VERSION_INFO@|\\\"$$VERSION_INFO\\\"|g\" " +
" -e \"s|@VERSION_CNT@|10|g\" " +
" -e \"s|@VERSION_HISTORY_0@|\\\"$$HISTORY_0\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_1@|\\\"$$HISTORY_1\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_2@|\\\"$$HISTORY_2\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_3@|\\\"$$HISTORY_3\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_4@|\\\"$$HISTORY_4\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_5@|\\\"$$HISTORY_5\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_6@|\\\"$$HISTORY_6\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_7@|\\\"$$HISTORY_7\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_8@|\\\"$$HISTORY_8\\\"|g\" " +
" -e \"s|@VERSION_HISTORY_9@|\\\"$$HISTORY_9\\\"|g\" " +
" $(in)>$(out)",
}
cc_library_static {
name: "libmpputils-static",
srcs: [
"utils/*.c",
],
export_include_dirs: [
"utils",
],
defaults: [
"mpp_defaults",
],
}
cc_library_headers {
name: "libmpp_headers",
export_include_dirs: [
"inc",
"osal/inc",
],
vendor_available: true,
}
cc_library {
name: "libmpp",
srcs: [
"mpp/*.cpp",
":mpp_base_srcs",
":mpp_codec_srcs",
":mpp_vproc_srcs",
":mpp_kmpp_srcs",
":mpp_hal_srcs",
":mpp_osal_srcs",
],
export_include_dirs: [
"inc",
"osal/inc",
],
shared_libs: [
"liblog",
],
defaults: [
"mpp_defaults",
],
vendor_available: true,
}
cc_library {
name: "libvpu",
srcs: [
"mpp/legacy/vpu.c",
"mpp/legacy/vpu_api.cpp",
"mpp/legacy/vpu_api_legacy.cpp",
"mpp/legacy/vpu_api_mlvec.cpp",
"mpp/legacy/vpu_mem_legacy.c",
"mpp/legacy/rk_list.cpp",
"mpp/legacy/ppOp.cpp",
"mpp/mpp_info.cpp",
],
export_include_dirs: [
"inc"
],
shared_libs: [
"libmpp",
],
defaults: [
"mpp_defaults",
],
vendor_available: true,
}
cc_test {
name: "mpp_info",
srcs: ["test/mpp_info_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_dec",
srcs: ["test/mpi_dec_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_dec_mt",
srcs: ["test/mpi_dec_mt_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_dec_nt",
srcs: ["test/mpi_dec_nt_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_enc",
srcs: ["test/mpi_enc_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_enc_mt",
srcs: ["test/mpi_enc_mt_test.cpp"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_rc2",
srcs: ["test/mpi_rc2_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_dec_multi",
srcs: ["test/mpi_dec_multi_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_dec_slt",
srcs: ["test/mpi_dec_slt_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}
cc_test {
name: "mpi_enc_slt",
srcs: ["test/mpi_enc_slt_test.c"],
shared_libs: ["libmpp"],
static_libs: ["libmpputils-static"],
defaults: ["mpp_defaults"],
}

761
third_party/mpp/CHANGELOG.md vendored Normal file
View File

@ -0,0 +1,761 @@
## 1.0.11 (2025-09-10)
### Feature
- [mpp_trie]: Add info name max length record
- [mpp_enc_cfg]: Separate init function
- [mpp]: Add jpeg roi function for RV1126B
- [kmpp]: Add jpeg roi function for kmpp
- [kmpp]: Set chan_fd to init cfg
- [kmpp]: Replace frame_infos with kmpp_frame
- [kmpp_frame]: Add self_meta in kmpp_frame
- [kmpp_buffer]: Add ioctl to inc ref and flush
- [mpp_meta]: Add more frame buffer key to meta
- [base]: Add toml function
- [base]: Use enc cfg obj
- [smart_v3]: Add new frame qp interface
- [kmpp]: Add KmppMeta module
- [kmpp]: Add KmppBuffer module
- [kmpp_obj]: Add priv prop support for objdef
### Fix
- [h265e]: Remove unused buffer
- [mpp]: Add null check for sync pkt buffer
- [mpp_meta]: Add user data deep copy support
- [mpp_meta]: Add KEY_NPU_UOBJ_FLAG and KEY_NPU_SOBJ_FLAG
- [kmpp_obj]: Fix obj ioctl typo
- [mpp_trie]: Fix get err node issue
- [vdpp] Fix building tests against musl libc
- [script]: Prepend bash with /usr/bin/env
- [kmpp_buffer]: Close fd when deinit
- [mpp_thread]: Fix thread name is not set
- Rename FFmpeg to FF for sdk release request
- [kmpp_obj]: Fix kmpp obj get by sptr
- [h265d]: Ensure the DTS is transmitted to the frame
- [kmpp_obj]: Rename kmpp_obj_impl_put func
- [kmpp_obj]: Fix kmpp frm/pkt self meta erro
- [h264e_api_v2]: Fix bit_real calc in skip mode
- [h264d]: Fix fast play mode not working in shell environment.
- [kmpp_frame]: Remove unnecessary logs
- [enc_test]: Set input block mode in init kcfg
- [hal_h265e]: Fix nal type in tsvc mode
- [h265d]: Fix log issue
- [vepu511]: Add tune stat update
- [kmpp_obj]: Update tbl after objdef registration
- [mpp_cfg_io]: Add more mpp_cfg_io function
- [kmpp_obj]: Fix grp_cfg and buf_cfg leak in kmpp_obj_test
- [vproc]: Fix unit tests cannot be disabled
### Docs
- Update 1.0.11 CHANGELOG.md
### Refactor
- [sys_cfg]: Refactor C++ sys_cfg to C
- [test]: Refactor C++ test file to C
- [osal]: Refactor C++ osal file to C
- [rc]: Refactor C++ rc/rc_base to C
- [enc]: Use KmppShmPtr to represent osd buffer
- [kmpp]: Fix kmpp obj compilation warning
- [rc_api]: Refactor C++ rc_api to C
### Test
- [mpi_enc_test]: Add jpeg roi test
### Chore
- [dec_test]: Remove unused code
- [mpp_singleton]: Update name print
- [hal]: Organize the relevant processes for vepu fmt
- Rename Dolby for sdk release requirement
- [kmpp_meta]: Disable failure log
- [mpp_enc_cfg]: Add base:smart_en option
- [kmpp_obj]: Add is_kobj query function
- [rc_smt]: Adjust code style for rc_smt
## 1.0.10 (2025-06-23)
### Feature
- [mpp_log]: Add long log (llog) function
- [mpp_buffer]: Add mpp_buffer discard function
- [build]: add Android.bp support
- [kmpp_packet]: Add kmpp_packet interface
- [mpp_log]: Add external callback support
- [kmpp_obj]: Refactor kmpp_obj helper
- [kmpp_obj]: Add more kmpp_obj property
- [kmpp_obj]: Add object update function
- [kmpp_obj]: Add userspace objdef functions
- [osal]: Add mpp_singleton module
- [mpp_cfg_io]: Add mpp cfg io module
- [kmpp]: Add kmpp_frame_test
### Fix
- [h265d]: Fix yuv400 decode error
- [h265d]: Fix GDR stream decoding
- [kmpp_obj]: Undef KMPP_OBJ_SGLN_ID macro
- [osal]: Fix timeout expire too soon issue
- [cmake]: Fix static build issue
- [vp8e]: Remove unused vp8e_rc file
- [h265d_rkv]: Fix dec err after cut streams
- [mpp_singleton]: fix init order issue
- [mpp_dec]: Fix compile warning
- [h265d_parser]: Fix slice header parse
- [mpp_sys_cfg]: afbc calc support yuv444sp_10bit
- [kmpp_obj]: Update helper macro
- [h263d]: Fix missing initializer for field problem
- [enc_utils]: Remove duplicate option
- [kmpp_obj]: Remove extra print in helper
- [avsd_plus]: Fix page fault when filtering field data
- [h265d_vdpu384a]: Fix CABAC error detection issue.
- [mpp_sys_cfg]: Fix stride issue on resolution change
- [vepu_540c]: Reduce print hw_status when irq ret
- [mpp_sys_cfg]: Fix ver_stride calc issue
- [sys_cfg]: Fix ver stride calculation issue.
- [vepu541]: Add warning for unsupport nv21/nv42
- [avs2d]: fix vertical stride config
- Revert "fix[mpp_enc_impl]: fix rc cfg for jpeg enc"
- [h265d_ps]: Suppress YUV444 unsupported warning logs
- [mpp_cfg]: Fix function define on C++ field
- [h264e_dpb]: fix walk_len when refs_dryrun
- [av1d_vdpu383]: fix segid page fault issue
- [allocator]: Fix misc buffer group flag issue
- [h265d_parser]: fix startcode finder for 00 00 00 xx case
- [kmpp]: Fix eos frame with NULL buffer issue
- [utils]: Remove duplicate assignments
- [mpi_enc_test]: Sync mdc config of RV1126B
- [sys_cfg]: Avoid frequent environment variable access.
- [mpp_enc]: Add avc rc parameter set
- [h265d_vdpu383]: Fix CABAC error detection issue.
- [mpi]: Fix typo
- [h264_vdpu384a]: Fix error proc issue
- [h265e]: Correct tile syntax elements at PPS
- [mpp]: Add atf set, atf value 0~3
- [mpp_enc_cfg]: Add lambda_idx_i and lambda_idx_p
- [mpp_enc]: Add encoder speed mode setup
- [test]: Add qbias_arr and aq_rnge_arr init
- [packet]: fix packet partition and eoi logic
- [mpp]: add qpmap_en and enc_spd
- [cmake]: Fix double object include issue
- [sys_cfg]: Align to CTU64 to avoid info change.
- [mpp]: Fix compile warning with ipc sdk toolchain
### Docs
- Update 1.0.10 CHANGELOG.md
### Refactor
- [base]: Refactor C++ mpp_enc_cfg to C
- [base]: Refactor C++ mpp_meta to C
- [base]: Refactor C++ mpp_packet to C
- [base]: Refactor C++ mpp_frame to C
- [base]: Refactor C++ mpp_buffer to C
- [mpp_mem_pool]: Add exit leak pool print
- [osal]: Refactor C++ mpp_server to C
- [osal]: Refactor more module from C++ to C
- [mpp_trace]: Refactor C++ mpp_trace to C
- [mpp_runtime]: Refactor C++ mpp_runtime to C
- [mpp_soc]: Refactor C++ mpp_soc to C
- [mpp_platform]: Refactor C++ mpp_platform to C
- [mem_pool]: Refactor C++ mem_pool to C
- [mpp_mem]: Refactor C++ mpp_mem to C
- [kmpp]: Replace venc_packet with KmppPacket
- [osal/linux/os_log]: Use C constructor.
- [base]: Remove MppDecCfgImpl
- [base]: Refactor mpp_trie from C++ to C
- [mpp_cfg_io]: Change cfg to trie interface
### Test
- [osal]: Add libc and OS compatibility checking
- [resolution]: Add resolution test tool
### Chore
- [kmpp]: Modify kmpp_objs init / deinit order
- [kmpp_obj]: Add from objs device macro
- [kmpp_obj]: Add more obj function
- [kmpp_obj]: Update flag calculation macro
- [utils]: Add fbc frame data dump
- A fix for company release requirement
- [kmpp]: Remove get packet failed log
## 1.0.9 (2025-04-03)
### Feature
- [kmpp_frame]: Add KmppFrame module
- [vepu_511]: Add rv1126b 265e/264e/jpge support
- [mpp_meta]: Add osd_data3 fmt for 1103b/1126b
- [kmpp_obj]: Sync to new KmppEntry share object
- [err_proc]: Add a new command: DIS_ERR_CLR_MARK
- [mpi_enc_test]: Support enc for kmpp flow
- [kmpp_obj]: Add more kmpp_obj functions
- [vdpu384a]: Support RV1126B new features
- [mpp_soc]: Support rv1126b soc
- [kmpp_obj]: Sync to new kmpp_meta
- [kmpp_obj]: Sync to loctbl without flag_type
- [mpp_buf_slot]: buf_slot add coded width alignment config
- [h265d]: Add vdpu383 hevc yuv444_10bit support
- [vproc]: Add more log for debugging
- [mpp]: Support kmpp access
- [kmpp]: Add kmpp module
- [rk_mpi_cmd]: Merge cmds from mpp_interface
- [build]: Add --toolchain to config toolchain for linux
- [mpp_meta]: Use trie to index the meta key
- [mpp_packet]: Add realease callback info
- [kmpp_obj]: Update to new objdef query mode
- [mpp_trie]: Allow empty name trie for import
- [enc]: Support setting temporal_id
- [mpp_enc_cfg]: Merge enc cfgs from mpp_interface
- [mpp_sys_cfg_st]: Provide packaging for use on products
- [mpp_sys_cfg]: Add raster/tile/fbc buffer alignment
- [mpp_sys_cfg]: Support sys_cfg buffer alignment
- [kmpp_obj]: Add kmpp_obj_get_hnd func
- [mpp_venc_kcfg]: Add mpp_venc_kcfg module
### Fix
- [sys_cfg]: Add debug info
- [sys_cfg]: fix fbc ver stride calc issue
- [sys_cfg]: Fix external configuration stride issue
- [sys_cfg]: Support alignment for mpeg2/mpeg4/h263/vp8.
- [sys_cfg]: AVC is aligned to ctu to avoid info change
- [sys_cfg]: Fix RK3399 hor/ver stride calculation issue.
- [sys_cfg]: Fix HAL layer buffer alignment issue
- [h264d]: Recovery only takes effect when no IDR frames present
- [hal_jpege_api]: Fix jpege api path judgment
- [vdpp]: Fix vdpp blk_size calculation.
- [mpp_venc_kcfg]: Revert to mpp interface
- [cmake]: Fix kmpp_base symbol missing
- [av1_syntax]: Fix array out-of-bounds issue.
- [build]: fix build failure with CMake 4.0
- [vepu_511]: Speed grade configuration of 0.67
- [mpp_frame]: Add rk_fbc fmt for 1126b
- [jpegd_rkv]: New JPEG IP supports tile 4x4 output by default.
- [jpeg_rkv]: New JPEG IP defaults to no RGB support.
- [hal_rcb]: Fix rcb buf size calc issue
- [kmpp_obj]: Fix rockit compile error
- [avsd]: Skip redundant zeros between fields inside one picture
- [av1]: parameter is 16 bits
- [base]: Fix strncpy compile warning
- [hal_h265e_vepu580]: Fix overflow status check
- [kmpp]: Fix channel dup issue
- [os_log]: Modify default log option for linux
- [kmpp_obj]: Fix warning on arm32
- [kmpp]: Set KEY_OUTPUT_INTRA meta to packet
- [sys_cfg]: Align rk3399 h_stride to an odd multiple of 265.
- [mpp_sys]: Fix old IP vertical alignment to 16 issue
- [kmpp_obj]: Disable /dev/kmpp_objs not found log
- [mpp_soc]: Fix cap_fbc for rv1126b
- [sys_cfg]: Optimize comparison information printing.
- [sys_cfg]: Print comparison information only once.
- [mpp_meta]: Fix compile error
- [vepu510]: Mark frame first part when split slice out
- [hdr_meta]: Fix hdr format for av1
- [mpp_sys_cfg]: Fix align pixel stride on rk3576
- [vproc]: fix height out of boundary problem
- [mpp_sys_cfg]: Fix abnormal stride calculation.
- [h264d]: disable ref erorr when decode recovery frame period
- [jpege_vpu720]: Correct encoded size config
- [buf_slot]: Correct coding mistakes.
- [build]: Avoid exporting toolchain to system PATH
- [mpp_enc]: Fix some exceptions when force pskip
- [kmpp]: Fill pts/dts/flag to MppPacket
- [vproc]: fix frame output disorder problem
- [vproc]: Fix field disordered problem
- [mpp_enc_cfg]: Remove a redundant atr_str
- []: Fix abnormal FBC info issue in Info Change
- [h264d]: Fix segment fault problem
- [vproc]: Fix error info missed problem
- [vproc]: Fix output blank buffer problem
- [fbc]: Fix RK3588 av1 FBC usage issue
- [sys_cfg/buf_slot]: support yuv422sp 10bit
- [mpp_enc_cfg]: Add sao_bit_ratio from mpp_interface
- [buf_slot]: Correct coding mistakes.
- [mpp_venc_kcfg]: Get objdef at runtime
- [jpegd]: Avoid buffer overrun
- [sys_cfg/buf_slot]: fix fbc yuv444sp buf calculation issue
- [kmpp_obj]: Add extern C
### Docs
- Update 1.0.9 CHANGELOG.md
### Refactor
- [kmpp]: Move kmpp to seperate directory
- [mpp_trie]: Replace root import
- [mpp_enc_cfg]: Adjust cu_qp_delta_depth
### Chore
- [mpp_buf_slot]: Modify sys_cfg mismatch print
## 1.0.8 (2024-12-30)
### Feature
- [enc]: Add switch for disable IDR encoding when FPS changed.
- [test]: Add PSNR info for video encoder
- [mpp_buf_slots]: Add coding attribute to buf slots
- [mpp_sys_cfg]: Add mpp_sys_cfg function
- [dec_nt_test]: Support jpeg decoding on decode
- [mpp_dec]: Add jpeg put/get decode support
- [mpp_obj]: Add mpp_obj for kernel object
- [mpp_trie]: Add functions for import / export
- [rk_type.h]: Add kernel driver compat define
- [mpp_dec]: add control for select codec device
- [mpp_dec]: support hdr10plus dynamic metadata parse
- [hal_avsd]: enable hw dec timeout
- [vpu_api]: Support configuration to disable decoding errors
- [enc]: Support use frame meta to cfg pskip
- [vepu510]: Add scaling list regs setup
### Fix
- [enc]: Fix CPB size not enough problem
- [m4v_parser]: Fix split_parse setting failure issue
- [mpp_trie]: Remove a redundant variables from log
- [mpp_enc]: Set frm type in pkt meta
- [mpp_sys_cfg]: Fix compile warning
- [rc_smt]: Fix the variable overflow issue
- [h264e_sps]: fix constraint_set3_flag flag issue
- [vpu_legacy]: Fix vpu fbc configuration issue
- [mpp_buffer]: Fix buffer put log
- [mpp_mem_pool]: Record pool buffer allocator caller
- [mpp]: Fix input_task_count for async enc
- [av1d]: Fix uninitialized fbc_hdr_stride issue
- [cfg]: fix cfg test segment fault problem
- [drm]: Call drop master by default
- [vepu580]: fix is_yuv/is_fbc typo
- [misc]: Fix compile on 32bit platform
- [jpegd]: replace packet size with stream length
- [av1_vdpu383]: Fix the CDF issue between GOPs
- [mpp_enc_impl]: fix rc cfg for jpeg enc
- [av1_vdpu383]: fix cdf usage issue
- [hal_h265d]: Avoid reg offset duplicate setting issue
- [vepu580]: fix incorrect color range problem
- [buf_slots]: Fix the issue of fmt conv during info change
- [h264d]: force reset matrix coefficients when parse unknown value
- [h264d]: Parse hdr parameters on enable_hdr_meta enabled
- [h264d_parser]: Fix pps parsing issue
- [hal_vdpu383]: fix fbc hor_stride mismatch issue
- [hal_vepu580]: re-get roi buf when resolution switch
- [hal_vepu541]: re-get roi buf when resolution switch
- [iep2]: Remove unnessary log on init failed
- [h264_dpb]: Add env variables to force fast play mode
- [h265e_slice]: fix compilation warning
- [hal_avs2d_vdpu383]: handle scene reference frame
- [debain]: fix typo in compat version
- [debian]: Update debian control
- [debain]: Update debian/control
- [debain]: Update compat to 10
- [h264e_pps]: add pic_scaling_matrix_present check
- [h2645d_sei]: fix read byte overflow error
- [m2vd]: Fix refer frame error on beginning
- [vdpu383]: fix err detection mask issue
- [test]: Fix AQ table error
- [vepu580]: Add md info internal buffer
- [vepu580]: Add ATF weight adjust switch for H.265
- [tune]: Replace qpmap_en with deblur_en
- [vepu580]: Adjust frame-level QP for VI frame
- [hal_jpegd]: fix huffman table selection
- [h265]: fix pskip when enable tile mode
- [smt_rc]: Fix first frame QP error
- [h264d]: fix no output for mvc stream
- [vepu580]: Fix motion level assignment error
- [avsd]: Fix attach dev error issue
- [h265d]: Fix conformance window offsets for chroma formats
- [test]: Fix mdinfo size according to soc type
- [h265d_vdpu383]: fix dec err when ps_update_flag=0
- [vepu510]: Sync code from enc_tune branch
- [mpp_cfg]: Fix compile warning
- [h265d]: fix output err causeby refs cleard
- [h264d]: remove error check for B frame has only one ref
- [test]: Fix test demo stuck issue
### Docs
- Update 1.0.8 CHANGELOG.md
- update doc for fast play
### Refactor
- [hal]: Update the reg offset setting method.
- [mpi]: Add ops name when assign for reading friendly
- [av1d_vdpu383]: Regs definition sync with other protocols.
- [vproc]: Refactor iep2 progress
- [h265]: unify calculation tile width
### Chore
- [hal_jpegd]: Remove reset / flush functions
- [test]: Use put/get in mpi_dec_test for jpeg
- [MppPacket]: Add caller log on check failure
## 1.0.7 (2024-09-04)
### Feature
- [rc_smt]: Add rc container for smart mode
- [vepu580]: Optimization to improve VMAF
- [vepu580]: Optimize hal processing for smart encoding
- [vepu580]: Add qpmap and rc container interface
- [vepu510]: Add anti-smear regs setup for H.264
- [vepu510]: Add H.264 tuning setup
- [vepu510]: Sync code from enc_tune branch
- [vepu510]: Sync code from enc_tune branch
- [vepu510]: Sync code from enc_tune branch
- [mpp_trie]: Add trie context filling feature
- [mpp_trie]: Add trie tag and shrink feature
- [h264d]: support hdr meta parse
- [h265e]: Support force mark & use ltr
- [vpu_api]: support yuv444sp decode ouput pixel format
### Fix
- [h265d]: fix infochange loss when two sps continuous
- [hal_h264e]: Fix CAVLC encode smartP stream err
- [mpi_enc_test]: Remove redundant code about smart encoding
- [h264e_sps]: fix the default value of max mv length
- [enc_roi]: Fix cu_map init in vepu_54x_roi
- [hal_vp9]: Optimize prob memory usage
- [hal_h265d]: Allow reference missing for GDR
- [osal]: Fix mpp_mem single instance issue
- [hal_vp9d_com]: Fixed memory leak issue
- [hal_h265d]: Avoid risk of segment fault
- [hal_h265d]: fix error slot index marking
- [h265d]: Adjust condition of scan type judgement
- [mpp_hdr]: Fix buffer overflow issue
- [mpp_buffer]: Synchronous log addition point
- [hal_vepu]: fix split regs assignment
- [vepu580]: poll max set to 1 on split out lowdelay mode
- [mpp_common]: fix compile err on F_DUPFD_CLOEXEC not defined
- [h265d]: return error on sps/pps read failure
- [build]: The first toolchains is selected by default
- [265e]:Fix the st refernce frame err in tsvc
- [av1d]: when MetaData found then it is new frame
- [m2vd]: Fix seq_head check error
- [h265e_vepu510]: Fix a memory leak
- [h265d]: auto output frame in dpb when ready
- [m2vd]: Remove ref frame when info changed
- [mpp_meta]: Missing data in the instance
- [mpp_bitread]: Fix negative shift error
- [osal]: fix 128 odd plus 64 bytes alignment
- [h265d_parser]: Fix fmt configuration issue
- [hal_av1d_vdpu383]: modify av1 segid wr/rd base config
- [h265d_parser]: Fix fmt configuration issue
- [hal_av1d_vdpu383]: add segid reg base config
### Docs
- Update 1.0.7 CHANGELOG.md
- [readme]: Add more repo info
### Refactor
- [mpp_cfg]: Refactor MppTrie and string cfg
### Chore
- [mpp_mem]: Add mpp_realloc_size
- [mpp_cfg]: Remove some unused code
- fix compile warning
## 1.0.6 (2024-06-12)
### Feature
- [vdpu383]: refine rcb info setup
- [enc_265]: Support get Largest Code Unit size
- [mpp_dec_cfg]: Add disable dpb check config
- [vdpu383]: support 8K downscale mode
### Fix
- [drm]: Fix permission check issue on GKI kernel
- [hal_h265e]: Amend 510 tid and sync cache
- [hal_h265e]: Fix nalu type avoid stream warning
- [h265e]: Fix vps/sps max temparal layers val
- [hal_jpeg_vdpu1]: fix dec failed on RK3036 problem
- [osal]: rv1109/rv1126 vcodec_type mismatch problem
- [h264e_vepu2]: Adjust inter favor table
- [h264d]: fix drop packets after reset when err stream
- [h265d]: Allow filtering of consecutive start code
- [hal_h264d_vdpu383]: fix spspps update issue
- [mpp]: fix mpp frame leak when async enc
- [enc]: Add use_lt_idx to output packet meta
- [hal_h265e]: fix sse_sum get err
- [mpp_enc_async]: fix mpp packet leak when thread quit
- [enc_roi]: Support ROI cfg under CQP mode
- [hal]: Fix the lib interdependence issue
- [vepu_510]: fix same log type when enc feedback
- [mpp_buffer]: fix dec/inc ref_count in multi threads
- [mpp_enc_async]: fix debreath not work on async flow
- [base]: fix AV1 and AVS2 string info missing problem
- [mpp]: Add encoder input/output pts log
- [hal_vepu580/510]: fix split out err when pass1 frame
- [hal]: Fix target link issue
- [hal_enc]: Fix lib dependency issue
- [hal_h265d_vdpu383]: fix ref_err mark for special poc
- [rc2_test]: fix pkt buffer overflow error
- [enc_utils]: Support read odd resolution image
- [allocator]: fix on invalid DMA heap allocator
- [hal_h265e_vepu580]: fix reg config err for 2pass
- [jpegd_vdpu]: Adjust file dump path
- [mpp_common]: fix 128 odd plus 64 alignment
- [cmake]: fix static build
- [vdpu383]: Update vdpu383 error detection
### Docs
- Update 1.0.6 CHANGELOG.md
### Refactor
- [hal_jpegd]: init devices at hal_jpegd_api
- [dec]: get deocder capability via common routine
- [hal_av1d]: Migrate av1d from vpu to rkdec
### Chore
- [h265d]: Reduce malloc/free frequency of vps
- [mpp_service]: fix typo err
- [hal_h265d]: use INT_MAX for poc distance initiation
- [cmake]: remove duplicate code
## 1.0.5 (2024-04-19)
### Feature
- [vdpu383]: align hor stride to 128 odds + 64 byte
- [vdpu383]: support 2x2 scale down
- [mpp_buffer]: Add MppBuffer attach/detach func
- [mpp_dev]: Add fd attach/detach operation
- [vdpp]: Add libvdpp for hwpq
- [vdpp]: Add capacity check function
- [cmake]: Add building static library
- [vdpp_test]: Add vdpp slt testcase
- [av1d]: Add tile4x4 frame format support
- [mpp_enc_cfg]: Add H.265 tier config
- [jpeg]: Add VPU720 JPEG support
- [enc]: Add config entry for output chroma format
- [vdpu383]: Add vdpu383 av1 module
- [vdpu383]: Add vdpu383 vp9 module
- [vdpu383]: Add vdpu383 avs2 module
- [vdpu383]: Add vdpu383 H.264 module
- [vdpu383]: Add vdpu383 H.265 module
- [vdpu383]: Add vdpu383 common module
- [vdpp]: Add vdpp2 for rk3576
- [vdpp]: Add vdpp module and vdpp_test
- [vepu_510]: Add vepu510 h265e support
- [vepu_510]: Add vepu510 h264e support
- [mpp_frame]: Add tile format flag
- [vepu_510] add vepu 510 common for H264 & h265
- [mpp_soc]: support rk3576 soc
### Fix
- [avs2d_vdpu383]: Optimise dec result
- [vdpu383]: Fix compiler warning
- [vdpp]: Fix dmsr reg size imcompat error
- [vdpu383]: hor stride alignment fix for vdpu383
- [h265d_ref]: fix set fbc output fmt not effect issue
- [vdpu383]: Fix memory out of bounds issue
- [h264d_vdpu383]: Fix global parameter config issue
- [avs2_parse]: add colorspace config to mpp_frame
- [hal_h264e]:fix crash after init vepu buffer failure
- [vpu_api]: Fix frame format and eos cfg
- [av1d_vdpu383]: fix fbc hor_stride error
- [av1d_parser]: fix fmt error for 10bit HDR source
- [avs2d]: fix stuck when seq_end shows at pkt tail
- [av1d_vdpu]: Fix forced 8bit output failure issue
- [enc_async]: Invalidate cache for output buffer
- [hal_av1d_vdpu383]: memleak for cdf_bufs
- [av1d_vdpu383]: fix rcb buffer size
- [vp9d_vdpu383]: Fix segid config issue
- [vepu510]: Add split low delay output mode support
- [avs2d_vdpu383]: Fix declaring shadow local variables issue
- [av1]: Fix global config issue
- [hal_av1d]: Delte cdf unused value
- [av1]: Fix av1 display abnormality issue
- [avs2d]: Remove a unnecessary log
- [vepu510]: Adjust regs assignment
- [hal_jpegd]: Add stream buffer flush
- [265e_api]: Support cons_intra_pred_flag cfg
- [mpp_enc]: Add device attach/detach on enc flow
- [mpp_dec]: Add device attach/detach on dec flow
- [vdpp]: Add error detection
- [hal_265e_510]: modify srgn_max & rime_lvl val
- [vdpu383]: spspps data not need copy all range ppsid
- [vpu_api_legacy]: fix frame CodingType err
- [av1]: Fix 10bit source display issue
- [mpp_enc]: Expand the hdr_buf size
- [av1]: Fix delta_q value read issue
- [vdpu383]: Enable error detection
- [ext_dma]: fix mmap permission error
- [jpege_vpu720]: sync cache before return task
- [mpp_buffer]: fix buffer type assigning
- [vepu510]: Configure reg of Subjective param
- [vepu510]: Checkout and optimize 510 reg.h
- [mpp_dec]: Optimize HDR meta process
- [av1d]: Fix scanlist calc issue
- [h265e]: fix the profile tier cfg
- [av1d]: Fix av1d ref stride error
- [hal_h265e_vepu510]: Add cudecis reg cfg
- [av1d]: Only rk3588 support 10bit translate to 8bit
- [vp9d]: Fix vp9 hor stride issue
- [rc]: Add i quality delta cfg on fixqp mode
- [hal_h265d]: Fix filter col rcb buffer size calc
- [av1d]: Fix compiler warning
- [h264d]: Fix error mvc stream crash issue
- [hal_h264e]: Fix qp err when fixqp mode
- [h264d]: Fix H.264 error chroma_format_idc
- [vdpu383]: Fix av1 rkfbc output error
- [av1d]: Fix compatibility issues
- [hal_h264d_vdpu383]: Reduce mpp_put_bits calls
- Fix clerical error
- [avs2d]: Fix get ref_frm slot idx error
- [vdpu383]: Fix av1 global params bit pos issue
- [vdpp]: fix sharp config error
- [hal_av1d]: fix av1 dec err for rk3588
- [vdpu383]: Fix av1 global params issue
- [vepu510]: Fix camera record stuck issue
- [utils]: fix read and write some YUV format
- [mpp_bitput]: fix put bits overflow
- [mpp_service]: fix rcb info env config
- [vepu510]: Fix compile warning
- [hal_vp9d]: fix colmv size calculator err
- [avsd]: Fix the ref_frm slot idx erro in fast mode.
### Docs
- Update 1.0.5 CHANGELOG.md
- [mpp_frame]: Add MppFrameFormat description
### Refactor
- [hal_av2sd]: refactor hal_api assign flow
- [hal_h264d]: refactor hal_api assign flow
- Using soc_type for compare instead of soc_name
### Chore
- [hal_h264e]: clean some unused code
## 1.0.4 (2024-02-07)
### Feature
- [vpu_api_legacy]: Support RGB24 setup
- [avsd]: keep codec type if not avs+
- [mpi_enc_test]: add YUV400 fmt support
- [mpp_enc]: Add YUV400 support for vepu580/540
### Fix
- [h265e]: fix hw stream size check error
- [hal_vdpu]: unify colmv buffer size calculation
- [vproc]: Fix deadlock in vproc thread
- [h265e]: disable tmvp by default
- [h265e]: Amend temporal_id to stream
- [mpp_dump]: add YUV420SP_10BIT format dump
- [hal_h265d]: Fix register length for rk3328/rk3328H
- [hal_avsd]: Fix crash on no buffer decoded
- [mpp_enc]: allow vp8 to cfg force idr frame
- [m2vd]: fix unindentical of input and output pts list
- [h265e_vepu580]: fix SIGSEGV when reencoding
- [mpp_dmabuf]: fix align cache line size calculate err
- [h265e_vepu580]: flush cache for the first tile
- [dmabuf]: Disable dmabuf partial sync function
- [iep_test]: use internal buffer group
- [common]: Add mpp_dup function
- [h265e]: Adapter RK3528 when encoding P frame skip
- [h265e]: fix missing end_of_slice_segment_flag problem
- [hal_av1d_vdpu]: change rkv_hor_align to 16 align
- [av1d_parser]: set color info per frame
- [jpegd]: add sof marker check when parser done
### Docs
- Update 1.0.4 CHANGELOG.md
### Chore
- [script]: add rebuild and clean for build
- [mpp_enc_roi_utils]: change file format dos to unix
## 1.0.3 (2023-12-08)
### Feature
- [dec_test]: Add buffer mode option
- [mpp_dmabuf]: Add dmabuf sync operation
- [jpege]: Allow rk3588 jpege 4 tasks async
- [rc_v2]: Support flex fps rate control
### Fix
- [av1d_api]: fix loss last frame when empty eos
- [h265e_dpb]: do not check frm status when pass1
- [hal_bufs]: clear buffer when hal_bufs get failed
- [dma-buf]: Add dma-buf.h for old ndk compiling
- [enc]: Fix sw enc path segment_info issue
- [cmake]: Remove HAVE_DRM option
- [m2vd]: update frame period on frame rate code change
- [test]: Fix mpi_enc_mt_test error
- [dma_heap]: add dma heap uncached node checking
- [mpp_mem]: Fix MEM_ALIGNED macro error
- [mpeg4_api]: fix drop frame when two stream switch
- [script]: fix shift clear input parameter error
- [hal_h265e_vepu541]: fix roi buffer variables incorrect use
### Docs
- Update 1.0.3 CHANGELOG.md
### Refactor
- [allocator]: Refactor allocator flow
### Chore
- [vp8d]: optimize vp8d debug
- [mpp_enc]: Encoder changes to cacheable buffer
- [mpp_dec]: Decoder changes to cacheable buffer
- [mpp_dmabuf]: Add dmabuf ioctl unit test
## 1.0.2 (2023-11-01)
### Feature
- [mpp_lock]: Add spinlock timing statistic
- [mpp_thread]: Add simple thread
- add more enc info to meta
### Fix
- [vepu540c]: fix h265 config
- [h264d]: Optimize sps check error
- [utils]: adjust format range constraint
- [h264d]: fix mpp split eos process err
- [h264d]: add errinfo for 4:4:4 lossless mode
- [h264d]: fix eos not updated err
- [camera_source]: Fix memory double-free issue
- [mpp_dec]:fix mpp_destroy crash
- [mpp_enc]: Fix async multi-thread case error
- [jpeg_dec]: Add parse & gen_reg err check for jpeg dec
- [h265e_vepu580]: fix tile mode cfg
- [vp9d]: Fix AFBC to non-FBC mode switch issue
- [h264e_dpb]: fix modification_of_pic_nums_idc error issue
- [allocator]: dma_heap allocator has the highest priority
- [camera_source]: enumerate device and format
- [utils]: fix hor_stride 24 aligned error
### Docs
- Update 1.0.2 CHANGELOG.md
- Add mpp developer guide markdown
### Chore
- [scipt]: Update changelog.sh
## 1.0.1 (2023-09-28)
### Feature
- [venc]: Modify fqp init value to invalid.
- [vepu580]: Add frm min/max qp and scene_mode cmd param
- [venc]: Add qbias for rkvenc encoder
- Support fbc mode change on info change stage
- [hal_vepu5xx]: Expand color transform for 540c
- Add rk3528a support
### Fix
- [mpp_enc_impl]: fix some error values without return an error
- [av1d_cbs]: fix read 32bit data err
- [Venc]: Fix jpeg and vpx fqp param error.
- [h265e_vepu580]: dual cores concurrency problem
- [hal_h264e_vepu]: terminate task if not support
- [vdpu_34x]: disable cabac err check for rk3588
- [enc]: fix duplicate idr frame
- [h264e_amend]: fix slice read overread issue
- [hal_jpegd]: add pp feature check
- [enc]: fix duplicate sps/pps information
- [h264e_slice]: fix pic_order_cnt_lsb wrap issue
- [hal_h264e_vepu540c]: fix reg configuration
- [hal_h264e_vepu540c]: Amend slice header
- [h264d]: fix crash on check reflist
- [hal_vp9d]: not support fast mode for rk3588
- [h264d]: fix frame output order when dpb full
- [mpp_frame]: setup color default UNSPECIFIED instead 0
- [hal_h264d]: adjust position of env_get
- [h264e_slice]: fix pic_order_cnt_lsb wrap issue
- [hal_avs2d]: fix some issue
- fix redundant prefix NALU amended problem
- [hal_jpegd]: fix rgb out_fmt mismatch error
- [utils]: fix convert format error
- [h265e]: check input profile_idc
- [hal_h264e_vepu580]: fix SEGV on GDR setting
- [h264d]: fix TSVC decode assert error.
- [hal_vepu580]: fix comiple issue
- [h264d]: fix MVC DPB allocation
- [h264d]: fix SEI packet parsing
- [hal_vp8e]: fix entropy init
- [mpp_soc]: fix rk356x vepu2 capability
### Docs
- Add 1.0.1 CHANGELOG.md
- update readme.txt
### Refactor
- move same tables to common module
## 1.0.0 (2023-07-26)
### Docs
- Add 1.0.0 CHANGELOG.md

377
third_party/mpp/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,377 @@
# ----------------------------------------------------------------------------
# Root CMake file for Rockchip Media Process Platform (MPP)
#
# - 10:34 2015/7/27: Initial version <herman.chen@rock-chips.com>
#
# ----------------------------------------------------------------------------
# vim: syntax=cmake
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
if(NOT CMAKE_BUILD_TYPE)
# default to Release build for GCC builds
set(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
message(STATUS "cmake version ${CMAKE_VERSION}")
# Search packages for host system instead of packages for target system
# in case of cross compilation these macro should be defined by toolchain file
if(NOT COMMAND find_host_package)
macro(find_host_package)
find_package(${ARGN})
endmacro()
endif()
if(NOT COMMAND find_host_program)
macro(find_host_program)
find_program(${ARGN})
endmacro()
endif()
project (rk_mpp)
cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckCXXCompilerFlag)
# setup output library name
# Linux default name - rockchip_mpp and rockchip_vpu
# Android default name - mpp and vpu
# For historical reason libraries on Android is named as mpp and vpu. But for
# better naming rule on Linux it should add vendor prefix.
# So we use this ugly method to avoid massive maintain issue.
if (NOT MPP_PROJECT_NAME)
set(MPP_PROJECT_NAME rockchip_mpp)
endif()
set(MPP_STATIC ${MPP_PROJECT_NAME}_static)
set(MPP_SHARED ${MPP_PROJECT_NAME})
if (NOT VPU_PROJECT_NAME)
set(VPU_PROJECT_NAME rockchip_vpu)
endif()
set(VPU_STATIC ${VPU_PROJECT_NAME}_static)
set(VPU_SHARED ${VPU_PROJECT_NAME})
# ----------------------------------------------------------------------------
# set property to classify library kinds
# ----------------------------------------------------------------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
# ----------------------------------------------------------------------------
# enable test in this project
# ----------------------------------------------------------------------------
option(BUILD_TEST "enable test binary building)" ON)
# ----------------------------------------------------------------------------
# export json compile commands
# ----------------------------------------------------------------------------
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
# ----------------------------------------------------------------------------
# System architecture detection
# ----------------------------------------------------------------------------
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
set(X86_ALIASES x86 i386 i686 x86_64 amd64)
list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
if("${CMAKE_C_COMPILER}" MATCHES "-buildroot-[^/]+$")
message(STATUS "Detected Buildroot toolchain")
# Use buildroot toolchain's default architecture settings
elseif("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
message(STATUS "Detected x86 system processor")
set(X86 true)
add_definitions(-DARCH_X86=1)
if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
set(X64 true)
add_definitions(-DARCH_X64=1)
message(STATUS "Define X86_64 to 1")
endif()
elseif(${SYSPROC} STREQUAL "armv6l")
message(STATUS "Detected ARMv6 system processor")
set(ARM true)
set(ARMEABI_V6 true)
elseif(${SYSPROC} STREQUAL "armv7-a")
message(STATUS "Detected ARMv7 system processor")
set(ARM true)
set(ARMEABI_V7A true)
elseif(${SYSPROC} STREQUAL "armv7-a_hardfp" OR ${SYSPROC} STREQUAL "armv7l")
message(STATUS "Detected ARMv7 system processor")
set(ARM true)
set(ARMEABI_V7A_HARDFP true)
elseif(${SYSPROC} STREQUAL "aarch64" OR ${SYSPROC} STREQUAL "armv8-a")
message(STATUS "Detected ARMv8 system processor")
set(ARM true)
set(ARMEABI_V8 true)
else()
message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
endif()
if(UNIX)
SET(PLATFORM_LIBS pthread)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(PLATFORM_LIBS ${PLATFORM_LIBS} rt)
endif()
endif(UNIX)
# ----------------------------------------------------------------------------
# Compiler detection
# ----------------------------------------------------------------------------
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CLANG true)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(GCC true)
endif()
if(GCC)
if(ARM)
if(ARMEABI_V6)
add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
elseif(ARMEABI_V7A)
add_definitions(-march=armv7-a -mfloat-abi=softfp -mfpu=neon)
elseif(ARMEABI_V7A_HARDFP)
add_definitions(-march=armv7-a -mfloat-abi=hard -mfpu=neon)
elseif(ARMEABI_V8)
add_definitions(-march=armv8-a)
endif()
else()
if(X86 AND NOT X64)
add_definitions(-march=i686)
endif()
endif()
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
# remove -g option for high version ndk
string(REGEX REPLACE "-g[^ ]*" "" TMP "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "[ ]+" " " CMAKE_C_FLAGS "${TMP}")
string(REGEX REPLACE "-g[^ ]*" "" TMP "${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE "[ ]+" " " CMAKE_CXX_FLAGS "${TMP}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG")
else()
add_definitions(-g)
endif()
# disable multichar warning
add_definitions(-Wno-multichar)
# add PIC flag
add_definitions(-fPIC)
# disable exception for C++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
# save intermediate files
# add_definitions(-save-temps)
# check library mvec
find_library(LMVEC_LIB mvec)
if(LMVEC_LIB)
set(LIBM mvec m)
set(MPP_PKGCONFIG_DEPENDENT_LIBS "-lmvec -lm")
else()
set(LIBM m)
set(MPP_PKGCONFIG_DEPENDENT_LIBS "-lm")
add_definitions(-fno-builtin-pow)
endif()
# for libary linking
set(BEGIN_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
option(ASAN_CHECK "enable Address Sanitizer (Asan)" OFF)
if(ASAN_CHECK)
add_definitions(-fsanitize=address -static-libasan -g)
set(ASAN_LIB libasan.a dl rt m)
set(ASAN_BIN dl rt m)
endif(ASAN_CHECK)
endif(GCC)
# ----------------------------------------------------------------------------
# Create git version information
# ----------------------------------------------------------------------------
set(VERSION_CNT 0)
set(VERSION_MAX_CNT 9)
set(VERSION_INFO "\"unknown mpp version for missing VCS info\"")
foreach (CNT RANGE ${VERSION_MAX_CNT})
set(VERSION_HISTORY_${CNT} "NULL")
endforeach(CNT)
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
find_host_package(Git)
if(GIT_FOUND)
# get current version info
set(GIT_LOG_FORMAT "%h author: %<|(30)%an %cd %s")
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --oneline --date=short --pretty=format:${GIT_LOG_FORMAT}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE EXEC_OUT
ERROR_VARIABLE EXEC_ERROR
RESULT_VARIABLE EXEC_RET
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
if (NOT EXEC_RET)
set(VERSION_INFO ${EXEC_OUT})
message(STATUS "current version:")
message(STATUS "${VERSION_INFO}")
string(REPLACE "\"" "\\\"" VERSION_INFO ${VERSION_INFO})
set(VERSION_INFO "\"${VERSION_INFO}\"")
else()
message(STATUS "git ret ${EXEC_RET}")
message(STATUS "${EXEC_ERROR}")
endif()
set(GIT_LOG_FORMAT "%h author: %<|(30)%an %cd %s %d")
# get history version information
# setup logs
message(STATUS "git version history:")
foreach (CNT RANGE ${VERSION_MAX_CNT})
execute_process(COMMAND ${GIT_EXECUTABLE} log HEAD~${CNT} -1 --oneline --date=short --pretty=format:${GIT_LOG_FORMAT}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE EXEC_OUT
ERROR_VARIABLE EXEC_ERROR
RESULT_VARIABLE EXEC_RET
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
if (NOT EXEC_RET)
set(VERSION_LOG ${EXEC_OUT})
string(REPLACE "\"" "\\\"" VERSION_LOG ${VERSION_LOG})
message(STATUS ${VERSION_LOG})
set(VERSION_HISTORY_${CNT} "\"${VERSION_LOG}\"")
math(EXPR VERSION_CNT "${VERSION_CNT}+1")
endif()
endforeach(CNT)
message(STATUS "total ${VERSION_CNT} git version recorded")
endif()
# add git hooks
if (EXISTS "${PROJECT_SOURCE_DIR}/tools/hooks/")
set(GIT_HOOK_SRC "${PROJECT_SOURCE_DIR}/tools/hooks/")
if(EXISTS "${PROJECT_SOURCE_DIR}/.git/hooks")
set(GIT_HOOK_DST "${PROJECT_SOURCE_DIR}/.git/hooks/")
file(COPY ${GIT_HOOK_SRC} DESTINATION ${GIT_HOOK_DST})
message(STATUS "Install git hooks done")
endif(EXISTS "${PROJECT_SOURCE_DIR}/.git/hooks")
endif(EXISTS "${PROJECT_SOURCE_DIR}/tools/hooks/")
endif(EXISTS "${PROJECT_SOURCE_DIR}/.git")
configure_file(
"${PROJECT_SOURCE_DIR}/build/cmake/version.in"
"${PROJECT_SOURCE_DIR}/mpp/version.h"
)
# ----------------------------------------------------------------------------
# Build options
# ----------------------------------------------------------------------------
find_package(PkgConfig)
INCLUDE(GNUInstallDirs)
pkg_search_module(PTHREAD pthread)
# ----------------------------------------------------------------------------
# Set Warning as Error
# ----------------------------------------------------------------------------
option(WARNINGS_AS_ERRORS "Stop compiles on first warning" OFF)
if(WARNINGS_AS_ERRORS)
if(GCC)
add_definitions(-Werror)
elseif(MSVC)
add_definitions(/WX)
endif()
endif(WARNINGS_AS_ERRORS)
# ----------------------------------------------------------------------------
# look for stdint.h
# ----------------------------------------------------------------------------
if(MSVC)
check_include_files(stdint.h HAVE_STDINT_H)
if(NOT HAVE_STDINT_H)
include_directories(osal/windows)
endif(NOT HAVE_STDINT_H)
endif(MSVC)
# ----------------------------------------------------------------------------
# Share library option
# ----------------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build shared library" ON)
# ----------------------------------------------------------------------------
# scan all LOG_TAG for log information and generate module header file
# ----------------------------------------------------------------------------
set( module_list "" )
file ( GLOB_RECURSE ALL_SRC . *.c;*.cpp )
foreach( files ${ALL_SRC} )
file( STRINGS ${files} module_tag_line REGEX "MODULE_TAG( )+\".+\"" )
if(module_tag_line)
string( REGEX REPLACE "^(.)* MODULE_TAG( )+\"(.*)\"" \\3 module_tag ${module_tag_line} )
list( APPEND module_list ${module_tag} )
endif()
endforeach()
list( SORT module_list )
list( LENGTH module_list module_size )
#message(STATUS "module_list: ${module_list}")
#message(STATUS "module_size: ${module_size}")
# ----------------------------------------------------------------------------
# Start module definition
# ----------------------------------------------------------------------------
# project overall include file
include_directories(inc)
# small utile functions for test case
include_directories(utils)
# ----------------------------------------------------------------------------
# osal library
# ----------------------------------------------------------------------------
# Operation System Abstract Layer (OSAL) include
include_directories(osal/inc)
# OSAL is needed on all platform, do not need option
add_subdirectory(osal)
# Media Process Platform include
include_directories(mpp/inc)
include_directories(mpp/base/inc)
# Kernel Media Process Platform include
include_directories(kmpp/inc)
include_directories(kmpp/base/inc)
# ----------------------------------------------------------------------------
# utils for test case
# ----------------------------------------------------------------------------
add_subdirectory(utils)
# ----------------------------------------------------------------------------
# Kernel Media Process Platform library
# ----------------------------------------------------------------------------
add_subdirectory(kmpp)
# ----------------------------------------------------------------------------
# Media Process Platform library
# ----------------------------------------------------------------------------
add_subdirectory(mpp)
# ----------------------------------------------------------------------------
# test / demo
# ----------------------------------------------------------------------------
add_subdirectory(test)
# ----------------------------------------------------------------------------
# install headers
# ----------------------------------------------------------------------------
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/rockchip"
FILES_MATCHING PATTERN "*.h"
)
# ----------------------------------------------------------------------------
# pkgconfig
# ----------------------------------------------------------------------------
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/rockchip_mpp.pc.cmake"
"${CMAKE_BINARY_DIR}/rockchip_mpp.pc" @ONLY)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/rockchip_vpu.pc.cmake"
"${CMAKE_BINARY_DIR}/rockchip_vpu.pc" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/rockchip_mpp.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
install(FILES "${CMAKE_BINARY_DIR}/rockchip_vpu.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")

183
third_party/mpp/LICENSES/Apache-2.0 vendored Normal file
View File

@ -0,0 +1,183 @@
Valid-License-Identifier: Apache-2.0
SPDX-URL: https://spdx.org/licenses/Apache-2.0.html
Usage-Guide:
To use the Apache License version 2.0 put the following SPDX tag/value
pair into a comment according to the placement guidelines in the
licensing rules documentation:
SPDX-License-Identifier: Apache-2.0
License-Text:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the
copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other
entities that control, are controlled by, or are under common control with
that entity. For the purposes of this definition, "control" means (i) the
power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source,
and configuration files.
"Object" form shall mean any form resulting from mechanical transformation
or translation of a Source form, including but not limited to compiled
object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form,
made available under the License, as indicated by a copyright notice that
is included in or attached to the work (an example is provided in the
Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form,
that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent, as
a whole, an original work of authorship. For the purposes of this License,
Derivative Works shall not include works that remain separable from, or
merely link (or bind by name) to the interfaces of, the Work and Derivative
Works thereof.
"Contribution" shall mean any work of authorship, including the original
version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for
inclusion in the Work by the copyright owner or by an individual or Legal
Entity authorized to submit on behalf of the copyright owner. For the
purposes of this definition, "submitted" means any form of electronic,
verbal, or written communication sent to the Licensor or its
representatives, including but not limited to communication on electronic
mailing lists, source code control systems, and issue tracking systems that
are managed by, or on behalf of, the Licensor for the purpose of discussing
and improving the Work, but excluding communication that is conspicuously
marked or otherwise designated in writing by the copyright owner as "Not a
Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on
behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
reproduce, prepare Derivative Works of, publicly display, publicly
perform, sublicense, and distribute the Work and such Derivative Works
in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this
License, each Contributor hereby grants to You a perpetual, worldwide,
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
this section) patent license to make, have made, use, offer to sell,
sell, import, and otherwise transfer the Work, where such license
applies only to those patent claims licensable by such Contributor that
are necessarily infringed by their Contribution(s) alone or by
combination of their Contribution(s) with the Work to which such
Contribution(s) was submitted. If You institute patent litigation
against any entity (including a cross-claim or counterclaim in a
lawsuit) alleging that the Work or a Contribution incorporated within
the Work constitutes direct or contributory patent infringement, then
any patent licenses granted to You under this License for that Work
shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or
Derivative Works thereof in any medium, with or without modifications,
and in Source or Object form, provided that You meet the following
conditions:
a. You must give any other recipients of the Work or Derivative Works a
copy of this License; and
b. You must cause any modified files to carry prominent notices stating
that You changed the files; and
c. You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and attribution notices
from the Source form of the Work, excluding those notices that do not
pertain to any part of the Derivative Works; and
d. If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained within
such NOTICE file, excluding those notices that do not pertain to any
part of the Derivative Works, in at least one of the following
places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if
provided along with the Derivative Works; or, within a display
generated by the Derivative Works, if and wherever such third-party
notices normally appear. The contents of the NOTICE file are for
informational purposes only and do not modify the License. You may
add Your own attribution notices within Derivative Works that You
distribute, alongside or as an addendum to the NOTICE text from the
Work, provided that such additional attribution notices cannot be
construed as modifying the License.
You may add Your own copyright statement to Your modifications and may
provide additional or different license terms and conditions for use,
reproduction, or distribution of Your modifications, or for any such
Derivative Works as a whole, provided Your use, reproduction, and
distribution of the Work otherwise complies with the conditions stated
in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any
Contribution intentionally submitted for inclusion in the Work by You to
the Licensor shall be under the terms and conditions of this License,
without any additional terms or conditions. Notwithstanding the above,
nothing herein shall supersede or modify the terms of any separate
license agreement you may have executed with Licensor regarding such
Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to
in writing, Licensor provides the Work (and each Contributor provides
its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied, including, without limitation,
any warranties or conditions of TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your
exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether
in tort (including negligence), contract, or otherwise, unless required
by applicable law (such as deliberate and grossly negligent acts) or
agreed to in writing, shall any Contributor be liable to You for
damages, including any direct, indirect, special, incidental, or
consequential damages of any character arising as a result of this
License or out of the use or inability to use the Work (including but
not limited to damages for loss of goodwill, work stoppage, computer
failure or malfunction, or any and all other commercial damages or
losses), even if such Contributor has been advised of the possibility of
such damages.
9. Accepting Warranty or Additional Liability. While redistributing the
Work or Derivative Works thereof, You may choose to offer, and charge a
fee for, acceptance of support, warranty, indemnity, or other liability
obligations and/or rights consistent with this License. However, in
accepting such obligations, You may act only on Your own behalf and on
Your sole responsibility, not on behalf of any other Contributor, and
only if You agree to indemnify, defend, and hold each Contributor
harmless for any liability incurred by, or claims asserted against, such
Contributor by reason of your accepting any such warranty or additional
liability.
END OF TERMS AND CONDITIONS

30
third_party/mpp/LICENSES/MIT vendored Normal file
View File

@ -0,0 +1,30 @@
Valid-License-Identifier: MIT
SPDX-URL: https://spdx.org/licenses/MIT.html
Usage-Guide:
To use the MIT License put the following SPDX tag/value pair into a
comment according to the placement guidelines in the licensing rules
documentation:
SPDX-License-Identifier: MIT
License-Text:
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

14
third_party/mpp/debian/.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
/.debhelper/
/debhelper-build-stamp
/files
/librockchip-mpp-dev.substvars
/librockchip-mpp-dev/
/librockchip-mpp-static.substvars
/librockchip-mpp-static/
/librockchip-mpp1.substvars
/librockchip-mpp1/
/rockchip-mpp-demos.substvars
/rockchip-mpp-demos/
/librockchip-vpu0.substvars
/librockchip-vpu0/
/tmp/

6
third_party/mpp/debian/README.Debian vendored Normal file
View File

@ -0,0 +1,6 @@
mpp for Debian
--------------
<possible notes regarding this package - if none, delete this file>
-- Randy Li <randy.li@rock-chips.com> Wed, 03 Aug 2016 08:14:14 +0000

10
third_party/mpp/debian/README.source vendored Normal file
View File

@ -0,0 +1,10 @@
mpp for Debian
--------------
<this file describes information about the source package, see Debian policy
manual section 4.14. You WILL either need to modify or delete this file>
-- Randy Li <randy.li@rock-chips.com> Wed, 03 Aug 2016 08:14:14 +0000

256
third_party/mpp/debian/changelog vendored Normal file
View File

@ -0,0 +1,256 @@
mpp (1.5.0-1) stable; urgency=critical
* [mpp_enc_impl]: Cleanup hal_task on empty eos task
...
-- Caesar Wang <wxt@rock-chips.com> Thu, 20 May 2021 09:40:00 +0800
mpp (1.4.0-1) stable; urgency=critical
[ Herman Chen ]
* [vp8d]: Remove unused table
[ timkingh.huang ]
* [h264e]: add SSE parameter check
[ Herman Chen ]
* [h264e]: Add qp min/max limit by bps max/min
[ timkingh.huang ]
* [h264e]: limit bit rate on movement scene
[ leo.ding ]
* [h264e]: fix bug: vepu1 h264 encode
* [h264d]: fix bug: when judge whether is end of frame
[ Herman Chen ]
* [rc]: Add bps information print
* [test]: Fix rc2 test rc_mode error
[ leo.ding ]
* [h264e]: fix bug: vepu h264 encode rate control
[ Herman Chen ]
* [osal]: Change mpp time print to us
* [h264e_rkv]: Fix error qp prev update
[ leo.ding ]
* [jpege]: add vepu1 jpeg encode support
* [osal]: linux: add -ldl -lct to link relative library
[ Herman Chen ]
* [oasl]: Add lock timing test
* [base]: Add mpp/base/test for task en/dequeue demo
[ Randy Li ]
* [jpege]: fix some compiler warnings
* [jpegd]: fix the compiler warnings and hide some symbols
* [osal]: fixup for a compiler warning
* [allocator]: force using drm allocator in Linux platform
* [vpu]: use the platform function to open device node
* [vp8d]: fix the vdpu2 decoding error
[ leo.ding ]
* [hal_vp9d]: change stride align to 256 odds
[ Randy Li ]
* [m2vd]: a various of fixup
[ Herman Chen ]
* [h264e]: Fix QP stuck error
[ timkingh.huang ]
* [h264e]: record rate control parameter
* [h264e]: tidy code
[ leo.ding ]
* [h264e]: fix bps check failed when mpi setup to fix_qp mode
[ Randy Li ]
* [jpege]: fixup mpp device
* Revert "[osal]: linux: add -ldl -lct to link relative library"
[ leo.ding ]
* [h265d]: fix bug: when has no short_rps, it should be has no rps
[ Randy Li ]
* [mpp_dec]: remove obsoleted code and format comments
* [mpp]: fixup for the deadlock in decoding
[ ayaka ]
* [test]: add timeout poll type sample code
[ leo.ding ]
* [h265d]: fix bug: malloc buffer matching
[ timkingh.huang ]
* [h264e]: fix rate-control bug
* [h264e]: allocate buffers before encoding
[ sliver.chen ]
* [h264]: fix xrgb encode bug
[ sayon.chen ]
* [h265d]: hiding the vps_id information
[ Randy Li ]
* [h264d]: add supporting for the interlace mode
[ leo.ding ]
* [mpg4d]: update spit mode in prepare
[ ZhouJing ]
* [m4vd]: add m4v decoder support for vdpu1
[ Randy Li ]
* [mpg4d]: fixup the compiler warnings
* .gitignore: ignore those debian generated files
[ timkingh.huang ]
* [h264e]: fix rate control bug
[ Randy Li ]
* [h264d]: move some variables to its scope
* [h264d]: handle svc_extension correctly
[ leo.ding ]
* [vpu_api_legacy]: disprese MPP_DEC_SET_FRAME_INFO function to each codec.
[ Randy Li ]
* [mpp]: wake up the parser thread in the correct place
[ sliver.chen ]
* [test]: add README.md for mpi unit test
* [test]: modify to avoid encode dead loop
[ leo.ding ]
* [avsd]: fix bugs: when video is field
* [mpp_buf_slot]: fix bug: should return the info_set frame back
* [avsd]: add dpb error marking
[ Randy Li ]
* [osal]: fixup for build in linux
* [mpp]: move header files into header directory
[ timkingh.huang ]
* [h264e]: add command of MPP_ENC_SET_QP_RANGE
* [h264e]: Clear OSD data when zero region number
[ sliver.chen ]
* [m2vd]: add m2vd parser mode
[ leo.ding ]
* [mpg4d]: fix hiding bugs when split mode
[ Herman Chen ]
* [base]: Remove misc buffer group creation
* [base]: Disable default print on exit
[ leo.ding ]
* [vpu_api]: add vpuCodecContext parameters
[ Randy Li ]
* [mpp_frame]: add complex formats and more comments
[ leo.ding ]
* [vp9d]: fix error: opening device should close, when deinit
[ Randy Li ]
* h264e: add supporting for more input pixel format
* [drm]: fix a various of bugs in drm allocator
* [drm]: use mmap() in native way for GNU Linux target
[ timkingh.huang ]
* [jpegd]: just scan parts of markers for rv1108
[ sliver.chen ]
* [h264e]: fix h264 xrgb encode bug
[ Herman Chen ]
* [ioctl]: Add compatible patch for different kernel
[ sayon.chen ]
* [rkvenc] modfiy ratecontrol to be more smooth
[ Randy Li ]
* [ion]: file descriptor for the external buffer
[ Herman Chen ]
* [hal_vp9d]: Fix buffer alignment conflict
[ sliver.chen ]
* [test]: add err info check when decode
* [osal]: force mpp use drm buffer when HAVE_DRM are defined.
[ timkingh.huang ]
* [h264e]: rate control for all intra stream
[ Randy Li ]
* [osal]: add queue data type
* [mpp]: use the blokcing queue on the input
* [mpp_list]: release the blocked thread at reset
[ leo.ding ]
* [hal_h264d]: add command for switch hard_mode
[ Randy Li ]
* [mpp]: silent lots of message
* [mpp_buf_slot]: return an error code when stride is invalid
* [jpegd]: stop the future work when the parser is error
* [osal]: add rk3036 platform
* [mpp]: rename and update build rules
* [legacy]: rename mpp legacy library
* [pkgconfig]: offer a sample for pkgconfig
* [build]: a simple build rules
-- Randy Li <randy.li@rock-chips.com> Tue, 21 Nov 2017 07:35:23 +0000
mpp (1.3.1-1) testing; urgency=medium
* [allocator]: force using drm allocator in Linux platform
* [mpp_buffer]: access the index field of buffer info
* [mpi]: decode_put_packet() would return the internal error
* [meta]: use fourcc format to store the meta data for those enum types
* [drm]: use mmap64() in native way for GNU Linux target
* [mpp/hal/vp8d]: rename and add device type info
* [mpp/hal/vp8d]: add support for VDPU1
* [mpp_frame]: export more functions to MppFrame fields
* [h264d]: make H.264 common data and functions together
* [h264d]: move the register table into the other file
* [test]: fix the align problem in decode_advanced()
* [jpegd] rename to its device type
* [jpegd]: isolate the common functions
* [jpegd]: add support for VDPU1
-- Randy Li <randy.li@rock-chips.com> Thu, 09 Mar 2017 09:52:21 +0000
mpp (1.3.0-1) testing; urgency=medium
* [mpp]: a fixup for wrong place scope symbols
* .gitignore: the intial version of gitignore
* build: support cross build in debian
* mpp: add pkgconfig file
* debian: support install for multiarch
* debian: add debian build rules
* utils: move the header files to common include directories
* osal: match system implementation with pre-defined marco
* osal: rename the directory of windows implementation
* osal: build: update the build system
* osal: build: use system default thread library
* osal: build: test: do not install unit test
* mpp: move header files into header directory
* mpp: test: build: rename the mpp library name in unit test
* mpp: legacy: rename mpp legacy library as rockchip_vpu
* mpp: build: update build rules
* build: a simple build rules
* mpp: install mpp library to target
* build: install development files
* build: add pkgconfig support
-- Randy Li <randy.li@rock-chips.com> Wed, 08 Feb 2017 08:37:49 +0000
mpp (73f2ee87a7f836daa6d09b3f65e5abd8e1380318-1) unstable; urgency=low
* The origin version from algorithmn group
-- Randy Li <randy.li@rock-chips.com> Sun, 05 Feb 2017 03:14:14 +0000

1
third_party/mpp/debian/compat vendored Normal file
View File

@ -0,0 +1 @@
10

30
third_party/mpp/debian/control vendored Normal file
View File

@ -0,0 +1,30 @@
Source: mpp
Priority: optional
Maintainer: Randy Li <randy.li@rock-chips.com>
Build-Depends: debhelper (>= 10), cmake, dh-exec
Standards-Version: 3.9.5
Section: libs
Homepage: http://www.rock-chips.com
#Vcs-Git: git://anonscm.debian.org/collab-maint/mpp.git
#Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/mpp.git;a=summary
Package: librockchip-mpp-dev
Section: libdevel
Architecture: any
Depends: librockchip-mpp1 (= ${binary:Version}), ${misc:Depends}
Description: Media Process Platform
Package: librockchip-mpp1
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Media Process Platform
Package: librockchip-vpu0
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Media Process Platform
Package: rockchip-mpp-demos
Architecture: any
Depends: librockchip-mpp1 (= ${binary:Version}), librockchip-vpu0 (= ${binary:Version}), ${misc:Depends}
Description: Media Process Platform Demos

44
third_party/mpp/debian/copyright vendored Normal file
View File

@ -0,0 +1,44 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Media Process Platform (MPP) module
Source: https://github.com/rockchip-linux/mpp
Files: *
Copyright: 2015 Herman Chen <herman.chen@rock-chips.com>
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2016 Randy Li <randy.li@rock-chips.com>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.

2
third_party/mpp/debian/docs vendored Normal file
View File

@ -0,0 +1,2 @@
readme.txt
readme.txt

View File

@ -0,0 +1,3 @@
#! /usr/bin/dh-exec
usr/include/*
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/*

View File

@ -0,0 +1,3 @@
#! /usr/bin/dh-exec
usr/lib/${DEB_HOST_MULTIARCH}/librockchip_mpp.so
usr/lib/${DEB_HOST_MULTIARCH}/librockchip_mpp.so.*

View File

@ -0,0 +1,3 @@
#! /usr/bin/dh-exec
usr/lib/${DEB_HOST_MULTIARCH}/librockchip_vpu.so
usr/lib/${DEB_HOST_MULTIARCH}/librockchip_vpu.so.*

View File

@ -0,0 +1,2 @@
#! /usr/bin/dh-exec
usr/bin/*

32
third_party/mpp/debian/rules vendored Normal file
View File

@ -0,0 +1,32 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
export CMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt
endif
# main packaging script based on dh7 syntax
%:
dh $@ --parallel --buildsystem=cmake
# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-DARM_MIX_32_64=ON

1
third_party/mpp/debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,112 @@
MPP (Media Process Platform) design (2016.10.12)
================================================================================
The mpp is a middleware library for Rockchip SoC's cross platform media process.
The main purpose of mpp is to provide very high performance, high flexibility
and expansibility on multimedia (mainly video and image) process.
The design target of mpp is to connect different Rockchip hardware kernel driver
and different userspace application.
Rockchip has two sets of hardware kernel driver.
The first one is vcodec_service/vpu_service/mpp_service which is a high
performance stateless frame base hardware kernel driver. This driver supports
all available codecs that hardware can provide. This driver is used on Android/
Linux.
The second one is v4l2 driver which is developed for ChromeOS. It currently
supports H.264/H.265/vp8/vp9. This driver is used on ChomeOS/Linux.
Mpp plans to support serval userspace applications including OpenMax,
gstreamer, libva.
Feature explaination
================================================================================
1. Cross Platform
The target OS platform including Android, Linux, ChromeOS and windows. Mpp uses
cmake to compile on different platform.
2. High Performance
Mpp supports sync / async interface to reduce the time blocked in interface. And
mpp internally make hardware and software run parallelly. When hardware is
running sofware will prepare next hardware task at the same time.
3. High Flexibility
mpi (Media Process Interface) is easy to extend by different control function.
The input/output element packet/frame/buffer is easy to extend different
components.
System Diagram
================================================================================
+---------------------------------------+
| |
| OpenMax / gstreamer / libva |
| |
+---------------------------------------+
+-------------------- MPP ----------------------+
| |
| +-------------------------+ +--------+ |
| | | | | |
| | MPI / MPP | | | |
| | buffer queue manage | | | |
| | | | | |
| +-------------------------+ | | |
| | | |
| +-------------------------+ | | |
| | | | | |
| | codec | | OSAL | |
| | decoder / encoder | | | |
| | | | | |
| +-------------------------+ | | |
| | | |
| +-----------+ +-----------+ | | |
| | | | | | | |
| | parser | | HAL | | | |
| | control | | reg_gen | | | |
| | | | | | | |
| +-----------+ +-----------+ +--------| |
| |
+-------------------- MPP ----------------------+
+---------------------------------------+
| |
| kernel |
| RK vcodec_service / v4l2 |
| |
+---------------------------------------+
Mpp is composed of four main sub-modules:
OSAL (Operation System Abstraction Layer)
This module shutters the differences between different operation systems and
provide basic components including memory, time, thread, log and hardware memory
allocator.
MPI (Media Process Interface) / MPP
This module is on charge of interaction with external user. Mpi layer has two
ways for user. The simple way - User can use put/get packet/frame function set.
The advanced way - User has to config MppTask and use dequeue/enqueue function
set to communicate with mpp. MppTask can carry different meta data and complete
complex work.
Codec (encoder / decoder)
This module implements the high efficiency internal work flow. The codec module
provides a general call flow for different video format. Software process will
be separated from hardware specified process. The software will communicate with
hardware with a common task interface which combines the buffer information and
codec specified infomation.
Parser/Controller and hal (Hardware Abstraction Layer)
This layer provides the implement function call of different video format and
different hardware. For decoder parser provide the video stream parse function
and output format related syntax structure to hal. The hal will translate the
syntax structure to register set on different hardware. Current hal supports
vcodec_service kernel driver and plan to support v4l2 driver later.

View File

@ -0,0 +1,70 @@
Hardware kernel driver design (2016.10.17)
================================================================================
Rockchip has two sets of hardware kernel driver.
The first one is vcodec_service/vpu_service/mpp_service which is a high
performance stateless frame base hardware kernel driver. This driver supports
all available codecs that hardware can provide. This driver is used on Android/
Linux.
Here is the vcodec_service kernel driver framework diagram.
+-------------+ +-------------+ +-------------+
| client A | | client B | | client C |
+-------------+ +-------------+ +-------------+
userspace
+------------------------------------------------------------------------------+
kernel
+-------------+ +-------------+ +-------------+
| session A | | session B | | session C |
+-------------+ +-------------+ +-------------+
| | | | | |
waiting done waiting done waiting done
| | | | | |
+---+---+ +---+---+ +---+---+ +---+---+ +---+---+
| task3 | | task0 | | task1 | | task0 | | task0 |
+---+---+ +-------+ +-------+ +-------+ +---+---+
| |
+---+---+ +---+---+
| task2 | | task1 |
+-------+ +-------+
+-----------+
| service |
+---------+-----------+---------+
| | |
waiting running done
| | |
+-----+-----+ +-----+-----+ +-----+-----+
| task A2 | | task A1 | | task C0 |
+-----+-----+ +-----------+ +-----+-----+
| |
+-----+-----+ +-----+-----+
| task B1 | | task C1 |
+-----+-----+ +-----+-----+
| |
+-----+-----+ +-----+-----+
| task A3 | | task A0 |
+-----------+ +-----+-----+
|
+-----+-----+
| task B0 |
+-----------+
The principle of this design is to separate user task handling and hardware
resource management and minimize the kernel serial process time between two
hardware process operation.
The driver uses session as communication channel. Each userspace client (client)
will have a kernel session. Client will commit tasks to session. Then hardware
is managed by service (vpu_service/vcodec_service). Service will provide the
ability to process tasks in sessions.
When client commits a task to kernel the task will be set to waiting status and
link to both session waiting list and service waiting list. Then service will
get task from waiting list to running list and run. When hardware finishs a task
the task will be moved to done list and put to both service done list and
session done list. Finally client will get the finished task from session.

View File

@ -0,0 +1,57 @@
Mpp buffer design (2016.10.12)
================================================================================
Mpp buffer is the warpper of the buffer used by hardware. Hardware usually can
not use the buffer malloc by cpu. Then we design MppBuffer for different memory
allocator on different platform. Currently it is designed for ion buffer on
Android and drm buffer on Linux. Later may support vb2_buffer in v4l2 devices.
In order to manage buffer usage in different user mpp buffer module introduces
MppBufferGroup as bufffer manager. All MppBuffer will connect to its manager.
MppBufferGroup provides allocator service and buffer reuse ability.
Different MppBufferGroup has different allocator. And besides normal malloc/free
function the allocator can also accept buffer from external file descriptor.
MppBufferGroup has two lists, unused buffer list and used buffer list. When
buffer is free buffer will not be released immediately. Buffer will be moved to
unused list for later reuse. There is a good reason for doing so. When video
resolution comes to 4K the buffer size will be above 12M. It will take a long
time to allocate buffer and generate map table for it. So reusing the buffer
will save the allocate/free time.
Here is the diagram of Mpp buffer status transaction.
+----------+ +---------+
| create | | commit |
+-----+----+ +----+----+
| |
| |
| +----v----+
+----------+ unused <-----------+
| +---------+ |
| | | |
| | | |
+-----v----+ | | +-----+----+
| malloc | | | | free |
+----------+ | | +----------+
| inc_ref | +---------+ | dec_ref |
+-----+----+ +-----^----+
| |
| |
| +---------+ |
+----------> used +-----------+
+---------+
| |
| |
| |
| |
| |
+----^----+
|
|
+----+----+
| import |
+---------+

View File

@ -0,0 +1,117 @@
MPP task design (2017.4.7)
================================================================================
Mpp task is the contain component for transaction with external user in advanced
mode. The target of advanced mode is to provide flexible, multiple input/output
content for extension.
Mpp task has mpp_meta as the rich content carrier. Mpp meta uses KEY and value
pair for extension. One task can carries multiple data into or out of mpp.
The typical case is encoder with OSD and motion detection. One task may contain
OSD buffer, motion detection buffer, frame buffer and stream buffer as input and
output stream buffer and motion detection buffer with data. And this case can
also be used on decoder if decoder wants to output some side information.
Mpp task transaction
================================================================================
1. Mpp task queue
Mpp task queue is the manager of tasks. Due to user may incorrectly use the task
we choose the design that hold all task inside mpp. Task queue will create and
release task. But task queue will not interact with user directly. We use port
and task status to control the transaction.
2. Mpp port
Mpp port is the transaction interface of task queue. External user and internal
worker thread will use mpp_port_poll / mpp_port_dequeue / mpp_port_enqueue
interface to poll / dequeue / enqueue the task task queue. Mpp advanced mode is
using port to connect external user, interface storage and internal process
thread. Each task queue has two port: input port and output port. And from a
global view the task will always flow from input port to output port.
3. Mpp task status
There are four status for one task. Mpp use list_head to represent the status.
INPUT_PORT : Initial status for input port user to dequeue. Or when output port
successfully enqueue a task then the task is on this status.
INPUT_HOLD : When input port user successfully dequeue a task then the task is
on this status.
OUTPUT_PORT: When input port user successfully enqueue a task then the task is
on OUTPUT_PORT status. And this task is ready for dequeue from
output port.
OUTPUT_HOLD: When output port user successfully dequeue a task then the task is
on this status.
4. Mpp task / port transaction
There are three transaction functions on a port: poll / dequeue / enqueue.
When port user call the transaction function task will be transfer from one
status to next status. The status transform flow is unidirectional from input
port to output port.
The overall relationship graph of task / port / status is shown below.
1. task queue
+------------------------------+
| |
+----+----+ +--------------+ +----+----+
| 4 | | 3 | | 2.1 |
+--------+ dequeue <--+ status <--+ enqueue <---------+
| | | | INPUT_PORT | | | |
| +---------+ | | +---------+ |
+------v-----+ | | +--------------+ | | +------+------+
| 3 | | 2 | | 2 | | 3 |
| status | | input | | output | | status |
| INPUT_HOLD | | port | | port | | OUTPUT_HOLD |
| | | | | | | |
+------+-----+ | | +--------------+ | | +------^------+
| +---------+ | 3 | +---------+ |
| | 4 | | status | | 2.1 | |
+--------> enqueue +--> INPUT_PORT +--> dequeue +---------+
| | | | | |
+----+----+ +--------------+ -----+----+
| |
+------------------------------+
Mpp task transaction of a complete work flow
================================================================================
On advanced mode mpp uses two task queue: input task queue and output task
queue.
Input task queue connects input side external user to internal worker thread.
Output task queue connects internal worker thread to output side external user.
Then there will be three threads to parallelize internal process and external
transation. This will maximize mpp efficiency.
The work flow is demonstrated as below graph.
+-------------------+ +-------------------+
| input side user | | output side user |
+----^---------+----+ +----^---------+----+
| | | |
+----+----+----v----+ +----+----+----v----+
| dequeue | enqueue | | dequeue | enqueue |
+----^----+----+----+ +----^----+----+----+
| | | |
+----+---------+----+ MPP +----+---------v----+
+---+ input port +-----------+ output port +---+
| +-------------------+ +-------------------+ |
| | input task queue | | output task queue | |
| +-------------------+ +-------------------+ |
| | output port | | input port | |
| +----+---------^----+ +----+---------^----+ |
| | | | | |
| +----v----+----+----+ +----v----+----+----+ |
| | dequeue | enqueue | | dequeue | enqueue | |
| +----+----+----^----+ +----+----+----^----+ |
| | | | | |
| +----v---------+---------------------v---------+----+ |
| | internal work thread | |
| +---------------------------------------------------+ |
| |
+-----------------------------------------------------------+

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Some files were not shown because too many files have changed in this diff Show More