From 5d805b85ad5e45d55f0e202c26df1480d171c3e8b580c89900332c9a1263581f Mon Sep 17 00:00:00 2001 From: copecone Date: Fri, 9 Oct 2026 20:24:28 +0900 Subject: [PATCH] Refactor `FFmpegNativeDecoder` --- Util/FFmpeg/FFmpegNativeDecoder.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Util/FFmpeg/FFmpegNativeDecoder.cs b/Util/FFmpeg/FFmpegNativeDecoder.cs index a1b8c5f..0e525bb 100644 --- a/Util/FFmpeg/FFmpegNativeDecoder.cs +++ b/Util/FFmpeg/FFmpegNativeDecoder.cs @@ -68,7 +68,7 @@ internal sealed unsafe class FFmpegNativeDecoder : IDisposable /// /// Candidate hardware device configuration discovered via avcodec_get_hw_config. /// - private struct HwConfigCandidate + private record struct HwConfigCandidate { public AVHWDeviceType DeviceType; public AVPixelFormat PixelFormat; @@ -475,6 +475,7 @@ internal sealed unsafe class FFmpegNativeDecoder : IDisposable /// True if hardware decoding was successfully configured and opened; false to fall back. private bool TryInitializeHwDecoder(AVCodec* decoder, AVStream* stream) { + // ReSharper disable once InconsistentNaming // Collect all supported hardware configs from decoder const int AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01; var candidates = new List(); @@ -1012,6 +1013,7 @@ internal sealed unsafe class FFmpegNativeDecoder : IDisposable /// /// Reads the next video frame and copies its NV12 Y and interleaved UV channel data to unmanaged memory pointers. /// + // ReSharper disable once InconsistentNaming public bool TryReadNV12Frame( IntPtr yBuffer, int yStride, IntPtr uvBuffer, int uvStride, @@ -1064,6 +1066,7 @@ internal sealed unsafe class FFmpegNativeDecoder : IDisposable /// For native YUV420P sources, color conversion is bypassed and memory is copied directly. /// Non-YUV420P frames (including NV12 from HW decoding) or mismatched dimensions are converted via libswscale. /// + // ReSharper disable once InconsistentNaming public bool TryReadYUV420PFrame( byte* yBuffer, int yStride, byte* uBuffer, int uStride,