From 9687faac67cc8f268675b86c8dfcfbf19933fe8b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 6 Jun 2026 12:29:35 -0400 Subject: [PATCH] refactor: remove dead FfmpegCamera::imagePixFormat field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The field was assigned in three branches of the constructor (always to the same value as Camera::pixelFormat) and never read anywhere. Unlike LocalCamera, FfmpegCamera doesn't run a sws_scale step at the Camera layer — libavcodec hands frames to the pipeline directly — so there's no separate capture-vs-image format distinction to track. Drop the redundant assignments and the member declaration. The canonical camera-side format is now exclusively Camera::pixelFormat (via Camera::PixelFormat()). refs #4788 Co-Authored-By: Claude Opus 4.7 (1M context) --- src/zm_ffmpeg_camera.cpp | 3 --- src/zm_ffmpeg_camera.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 7e60c9d96..728b419da 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -96,15 +96,12 @@ FfmpegCamera::FfmpegCamera( * will receive correct colours and subpixel order */ if ( zm_is_rgb32(pixelFormat) ) { subpixelorder = ZM_SUBPIX_ORDER_RGBA; - imagePixFormat = AV_PIX_FMT_RGBA; pixelFormat = AV_PIX_FMT_RGBA; } else if ( zm_is_rgb24(pixelFormat) ) { subpixelorder = ZM_SUBPIX_ORDER_RGB; - imagePixFormat = AV_PIX_FMT_RGB24; pixelFormat = AV_PIX_FMT_RGB24; } else if ( pixelFormat == AV_PIX_FMT_GRAY8 ) { subpixelorder = ZM_SUBPIX_ORDER_NONE; - imagePixFormat = AV_PIX_FMT_GRAY8; pixelFormat = AV_PIX_FMT_GRAY8; } else { Panic("Unexpected pixel format %d (%s); legacy colours=%d subpixelorder=%d", diff --git a/src/zm_ffmpeg_camera.h b/src/zm_ffmpeg_camera.h index e45f5516e..611cbc386 100644 --- a/src/zm_ffmpeg_camera.h +++ b/src/zm_ffmpeg_camera.h @@ -54,8 +54,6 @@ class FfmpegCamera : public Camera { int frameCount; - _AVPIXELFORMAT imagePixFormat; - bool use_hwaccel; //will default to on if hwaccel specified, will get turned off if there is a failure #if HAVE_LIBAVUTIL_HWCONTEXT_H AVBufferRef *hw_device_ctx = nullptr;