diff --git a/src/video/pipeline/encoder_state.rs b/src/video/pipeline/encoder_state.rs index dafbdc53..02e9a032 100644 --- a/src/video/pipeline/encoder_state.rs +++ b/src/video/pipeline/encoder_state.rs @@ -231,9 +231,9 @@ fn create_mjpeg_decoder(resolution: Resolution) -> Result<(MjpegDecoderKind, Pix Ok((libyuv_mjpeg_decoder(resolution), PixelFormat::Nv12)) } -/// AMLENC 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. +/// Amlogic hardware encoders 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. pub(super) fn should_parallel_decode_mjpeg(config: &SharedVideoPipelineConfig) -> bool { if !config.input_format.is_compressed() || !matches!( @@ -248,7 +248,12 @@ pub(super) fn should_parallel_decode_mjpeg(config: &SharedVideoPipelineConfig) - Some(backend) => registry.encoder_with_backend(config.output_codec, backend), None => registry.best_available_encoder(config.output_codec), }; - selected.is_some_and(|encoder| encoder.backend == EncoderBackend::Amlogic) + selected.is_some_and(|encoder| { + matches!( + encoder.backend, + EncoderBackend::Amlogic | EncoderBackend::V4l2m2m + ) + }) } pub(super) fn build_encoder_state( diff --git a/src/video/pipeline/shared.rs b/src/video/pipeline/shared.rs index 81012293..8fb51921 100644 --- a/src/video/pipeline/shared.rs +++ b/src/video/pipeline/shared.rs @@ -636,7 +636,7 @@ impl SharedVideoPipeline { let mut encoder_config = config.clone(); if parallel_mjpeg_decode { encoder_config.input_format = PixelFormat::Nv12; - info!("Using capture-thread libyuv MJPEG decode with parallel AMLENC encoding"); + info!("Using capture-thread libyuv MJPEG decode with parallel hardware encoding"); } let mut encoder_state = build_encoder_state(&encoder_config)?; let _ = self.running.send(true);