From ed089a5fe650a585f45699daeefe92b7c2113cba Mon Sep 17 00:00:00 2001 From: El Date: Wed, 15 Apr 2026 08:44:37 +0000 Subject: [PATCH] VNC-151 Refactor libyuv usage --- CMakeLists.txt | 2 +- common/rfb/CMakeLists.txt | 12 ++++-------- common/rfb/encoders/FFMPEGHWEncoder.cxx | 2 -- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af1cdde..ab653f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,7 +218,7 @@ endif() set(HAVE_PAM ${ENABLE_PAM}) option(DEBUG_FFMPEG "Debug ffmpeg" OFF) -option(ENABLE_LIBYUV "Enable libyuv conversion support" ON) +option(ENABLE_XDAMAGE "Enable XDamage" OFF) # Check for SSE2 check_cxx_compiler_flag(-msse2 COMPILER_SUPPORTS_SSE2) diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index 090faf2..e1fb99f 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -152,15 +152,11 @@ else () set(RFB_LIBRARIES ${RFB_LIBRARIES} ${TBB_LIBRARIES}) endif () -if (ENABLE_LIBYUV) - find_library(LIBYUV_LIBRARY NAMES yuv) - #pkg_check_modules(LIBYUV libyuv) - if (NOT LIBYUV_LIBRARY) - message(FATAL_ERROR "ENABLE_LIBYUV=ON but libyuv was not found") - endif () - - set(RFB_DEFINITIONS ${RFB_DEFINITIONS} LIBYUV_CONVERSION) +find_library(LIBYUV_LIBRARY NAMES yuv) +if (LIBYUV_LIBRARY) set(RFB_LIBRARIES ${RFB_LIBRARIES} ${LIBYUV_LIBRARY}) +else () + message(FATAL_ERROR "libyuv was not found") endif () add_library(rfb STATIC ${RFB_SOURCES}) diff --git a/common/rfb/encoders/FFMPEGHWEncoder.cxx b/common/rfb/encoders/FFMPEGHWEncoder.cxx index 3681409..9fa3dc2 100644 --- a/common/rfb/encoders/FFMPEGHWEncoder.cxx +++ b/common/rfb/encoders/FFMPEGHWEncoder.cxx @@ -329,7 +329,6 @@ namespace rfb { int err{}; -#if defined(LIBYUV_CONVERSION) DEBUG_LOG(vlog, "Converting ARGB to NV12: src_stride=%d, dst_linesize[0]=%d, dst_linesize[1]=%d, dst_width=%d, dst_height=%d", src_stride_bytes, frame->linesize[0], frame->linesize[1], dst_width, dst_height); @@ -339,7 +338,6 @@ namespace rfb { return false; } DEBUG_LOG(vlog, "ARGB to NV12 conversion successful"); -#endif frame->pts = pts++; auto *hw_frame = hw_frame_guard.get();