refactor(hwcodec): 精简FFmpeg编译配置并移除解码器

- 优化FFmpeg编译选项,禁用不需要的库(avformat/swscale/swresample/avfilter等)
- 禁用所有解码器和大部分编码器,只保留实际使用的H264/H265/VP8/VP9编码器
- 移除hwcodec解码器模块,MJPEG解码改用libyuv实现
- 移除MJPEG编码器支持
- x86_64添加libmfx支持QSV编码器
- 修复H265 RKMPP编码器支持YUYV直接输入
This commit is contained in:
mofeng-git
2026-01-02 12:31:11 +08:00
parent 04e62d1e3f
commit be4de59f3b
13 changed files with 258 additions and 794 deletions

View File

@@ -12,7 +12,6 @@ use std::ffi::c_int;
include!(concat!(env!("OUT_DIR"), "/ffmpeg_ram_ffi.rs"));
pub mod decode;
pub mod encode;
pub enum Priority {
@@ -52,7 +51,6 @@ impl CodecInfo {
let mut vp8: Option<CodecInfo> = None;
let mut vp9: Option<CodecInfo> = None;
let mut av1: Option<CodecInfo> = None;
let mut mjpeg: Option<CodecInfo> = None;
for coder in coders {
match coder.format {
@@ -96,14 +94,6 @@ impl CodecInfo {
}
None => av1 = Some(coder),
},
DataFormat::MJPEG => match &mjpeg {
Some(old) => {
if old.priority > coder.priority {
mjpeg = Some(coder)
}
}
None => mjpeg = Some(coder),
},
}
}
CodecInfos {
@@ -112,7 +102,6 @@ impl CodecInfo {
vp8,
vp9,
av1,
mjpeg,
}
}
@@ -147,13 +136,6 @@ impl CodecInfo {
priority: Priority::Soft as _,
}),
av1: None,
mjpeg: Some(CodecInfo {
name: "mjpeg".to_owned(),
mc_name: Default::default(),
format: MJPEG,
hwdevice: AV_HWDEVICE_TYPE_NONE,
priority: Priority::Soft as _,
}),
}
}
}
@@ -165,7 +147,6 @@ pub struct CodecInfos {
pub vp8: Option<CodecInfo>,
pub vp9: Option<CodecInfo>,
pub av1: Option<CodecInfo>,
pub mjpeg: Option<CodecInfo>,
}
impl CodecInfos {