Commit Graph
5 Commits
Author SHA1 Message Date
yuanyuanxiang 82f59b2469 Fix: Make the x264 opt-out real, and unchain libyuv from it
DISABLE_X264_FOR_TEST never actually removed the x264 dependency. Two
separate reasons:

1. X264Encoder.h included <x264/x264.h> unconditionally and only pulled in
   common/config.h afterwards, so the macro was not even visible at the point
   where it mattered. The class also carried x264_t / x264_picture_t /
   x264_param_t members, so the header was required to compile regardless of
   the switch. Moving the config.h include to the top and splitting the class
   declaration in two fixes it: with the switch on, the class is a stub with
   no x264 types at all, and open() returns false so EncoderFactory falls
   through. The open(x264_param_t*) overload is dropped in that branch; it had
   no callers outside X264Encoder.cpp.

2. libyuv was collateral damage. Its only #pragma comment(lib) lived inside
   the #else branch of the x264 switch, but CFFmpegAV1Encoder.cpp and
   CFFmpegH264Encoder.cpp both call libyuv::RGB24ToI420 / ARGBToNV12 /
   I420ToNV12 without carrying a pragma of their own. Turning x264 off
   therefore dropped libyuv too and the link failed with LNK2001 on those
   three symbols. libyuv is BSD-3 and unrelated to x264: the pragma is now
   unconditional in X264Encoder.cpp, and CFFmpegH264Encoder.cpp declares it
   alongside its ffmpeg libs so the encoder pair is self-sufficient.

Verified with Release x64 builds of both ServerDll and ghost:

  switches 0/0, compress/ intact          -> builds
  switch x264=1, compress/x264 deleted    -> builds (was LNK2001 before)
  switches 1/1, both dirs deleted         -> builds

So a compliant build needs neither the x264 library nor its headers.

Note for anyone flipping these switches: do a full rebuild, not an
incremental one. config.h reaches X264Encoder.cpp indirectly through
X264Encoder.h, which the .tlog dependency tracking does not record, so an
incremental build happily links a stale object against a freshly compiled one
and reports bogus LNK2001 errors.
2026-10-30 11:04:44 +01:00
yuanyuanxiang 8c7f612449 Feature: Implement H.264 and AV1 hardware encoding for remote control
Remark: Need to update FFmpeg static libraries to take effort
2026-05-30 00:12:38 +02:00
yuanyuanxiang c0a632a4c6 Compliance: Add building option to disable x264 and ffmpeg 2026-05-27 18:58:29 +02:00
yuanyuanxiang 571ec7d80c Fix: Add AVX2 runtime check and optional x264 compilation 2026-05-14 13:39:44 +02:00
yuanyuanxiang 5a325a202b Init: Migrate SimpleRemoter (Since v1.3.1) to Gitea 2026-04-19 22:55:21 +02:00