mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-08 22:53:42 -04:00
fix: handle YUVJ422P/YUV422P in zm_colours_from_pixformat
MJPEG decoder outputs AV_PIX_FMT_YUVJ422P which was not handled by zm_colours_from_pixformat, causing "Unknown pixelformat 13 yuvj422p" errors and leaving imagePixFormat stale — resulting in random image corruption. Add YUV422P and YUVJ422P cases to zm_colours_from_pixformat and zm_bytes_per_pixel in zm_pixformat.h. refs #4735 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,11 @@ inline bool zm_colours_from_pixformat(AVPixelFormat fmt,
|
||||
colours = ZM_COLOUR_GRAY8;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_YUVJ420P;
|
||||
return true;
|
||||
case AV_PIX_FMT_YUV422P:
|
||||
case AV_PIX_FMT_YUVJ422P:
|
||||
colours = ZM_COLOUR_GRAY8; // Y-plane is 1 byte/pixel
|
||||
subpixelorder = ZM_SUBPIX_ORDER_NONE;
|
||||
return true;
|
||||
case AV_PIX_FMT_RGB24:
|
||||
colours = ZM_COLOUR_RGB24;
|
||||
subpixelorder = ZM_SUBPIX_ORDER_RGB;
|
||||
@@ -97,6 +102,8 @@ inline unsigned int zm_bytes_per_pixel(AVPixelFormat fmt) {
|
||||
case AV_PIX_FMT_GRAY8:
|
||||
case AV_PIX_FMT_YUV420P:
|
||||
case AV_PIX_FMT_YUVJ420P:
|
||||
case AV_PIX_FMT_YUV422P:
|
||||
case AV_PIX_FMT_YUVJ422P:
|
||||
return 1;
|
||||
case AV_PIX_FMT_RGB24:
|
||||
case AV_PIX_FMT_BGR24:
|
||||
|
||||
Reference in New Issue
Block a user