mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-13 19:14:24 +08:00
perf(video): 并行解码 MJPEG 并丢弃积压帧
按可用 CPU 数量启动独立 MJPEG 解码线程,通过无缓冲通道分发任务;线程全忙时丢弃新帧,按序列号拒绝过时解码结果。 复用帧缓冲池,在线程启动失败时回退到采集线程解码,并更新并行解码说明及工作线程数量测试。
This commit is contained in:
@@ -190,8 +190,8 @@ fn create_mjpeg_decoder(resolution: Resolution) -> Result<(MjpegDecoderKind, Pix
|
||||
}
|
||||
|
||||
/// V4L2 M2M hardware encoding and libjpeg-turbo use independent CPU/hardware
|
||||
/// resources. Decode MJPEG in the capture worker so encoding the previous NV12
|
||||
/// frame can overlap with decoding the next frame.
|
||||
/// resources. Decode MJPEG outside the encoder worker so encoding the previous
|
||||
/// NV12 frame can overlap with decoding subsequent frames.
|
||||
pub(super) fn should_parallel_decode_mjpeg(config: &SharedVideoPipelineConfig) -> bool {
|
||||
if !config.input_format.is_compressed()
|
||||
|| !matches!(
|
||||
|
||||
Reference in New Issue
Block a user