mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-12 18:44:25 +08:00
feat: 新增 Amlogic AMLENC 硬件编码支持
- 新增动态加载及 ABI 校验的 AMLENC H.264/H.265 编码器 - 注册 Amlogic 后端并扩展编码器自检 - 并行执行 MJPEG 解码与 AMLENC 编码 - 复用 NV12 缓冲区并移除冗余帧初始化 - 优化低延迟帧分发及 RTCP 关键帧恢复 - 动态调整 AMLENC 码率尚未完成,效果不佳
This commit is contained in:
@@ -14,5 +14,29 @@ pub fn encoder_type_to_backend(encoder: EncoderType) -> Option<EncoderBackend> {
|
||||
EncoderType::Amf => Some(EncoderBackend::Amf),
|
||||
EncoderType::Rkmpp => Some(EncoderBackend::Rkmpp),
|
||||
EncoderType::V4l2m2m => Some(EncoderBackend::V4l2m2m),
|
||||
EncoderType::Amlogic => Some(EncoderBackend::Amlogic),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn maps_amlogic_config_to_backend() {
|
||||
assert_eq!(
|
||||
encoder_type_to_backend(EncoderType::Amlogic),
|
||||
Some(EncoderBackend::Amlogic)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn amlogic_config_json_round_trip() {
|
||||
let json = serde_json::to_string(&EncoderType::Amlogic).unwrap();
|
||||
assert_eq!(json, "\"amlogic\"");
|
||||
assert_eq!(
|
||||
serde_json::from_str::<EncoderType>(&json).unwrap(),
|
||||
EncoderType::Amlogic
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user