Skip to content

Code audit (Oct 2026): deprecated APIs, stability and performance follow-ups #179

Open

Description

@mcoliver

From a read-only audit of the core code (src/lib, src/bin, src/plugins; vendored code excluded). Each item was checked against the code. Items already fixed are in #175, #176, #177 and #178.

Effort: S = under a day, M = a few days, L = a week or more.

Do first

  • Turn deprecation warnings back on (S, then M to fix what appears). cmake/defaults/cxx_clang_defaults.cmake sets -Wno-deprecated-declarations for every clang target, which hides deprecation warnings from Qt, AppKit/CGL, <codecvt> and the Python C API on macOS. Narrow it, and add QT_WARN_DEPRECATED_UP_TO.

Deprecated APIs

  • Python C API (S–M). PyInterface.cpp: Py_InitializeEx + PySys_SetArgvEx + PyEval_InitThreads. Move to PyConfig / Py_InitializeFromConfig. Also free the Py_DecodeLocale argv. In py-interp/main.cpp, Py_SetProgramName and a PyConfig that is built but never used. PyModule_AddObject → PyModule_AddObjectRef.
  • <codecvt> / wstring_convert (S). Deprecated in C++17, removed in C++26. Replace with MultiByteToWideChar / WideCharToMultiByte (follows fix(windows): convert UTF-8 paths to UTF-16, not UCS-2 #178).
  • C++17 leftovers (S). throw() specs in Mu, stl_ext, TwkContainer → noexcept. Update the vendored utfcpp copies, which derive from std::iterator. Replace the OpenCL device VLA in ImageRenderer.cpp with a std::vector.
  • Qt 6 (S). QMouseEvent::pos() in RvBottomViewToolBar.cpp and utvprof VisMainWindow.cpp → position(). canConvert(QVariant::String) in RvFileDialog.cpp → canConvert<QString>(). 28 string-based SIGNAL(stateChanged(int)) connects: QCheckBox::stateChanged is deprecated in Qt 6.9, and string connects fail silently, so switch to pointer-to-member connects.
  • Drop CY2023 / Qt 5 (M). Still a supported build option, with 31 RV_VFX_CY2023 branches in core plus MuQt5. Removing it deletes the remaining Qt 5 code paths.
  • macOS dead code (S).
    • CGDesktopVideoDevice.cpp isn't compiled, but its header is still included, and it uses CGDisplayIOServicePort / CGDisplayCapture / CGLSetFullScreenOnDisplay.
    • DisplayLink (CVDisplayLink, deprecated in macOS 15) is created for every document but never started, while useExternalVSyncTiming(true) turns off Session's own vsync bookkeeping. Either drop both, or port to CADisplayLink.
    • DarwinBundle reports the macOS version as 10.(darwin-4), e.g. "10.23" on macOS 27.
  • OpenCL histogram (M–L). OpenCL has been deprecated on macOS since 10.14, and CL/GL sharing assumes a current CGL context. Move it to a GLSL compute or Metal kernel.
  • Boost.Thread → std (M–L). About 25 core files. Also drop <boost/asio.hpp>, which VideoDevice.cpp includes only for host_name().
  • FFmpeg debug code (S). The DBL() debug block in MovieFFMpeg.cpp uses the removed AVFrame::pkt_duration. It's compiled out today, but turning on debug output breaks the build.

Stability

  • GL program caches (M). PaintCommand.cpp and BasicGLProgram.cpp keep process-wide static program caches that aren't keyed by GL context or share group and aren't locked. Stale IDs can be used after a context is recreated, or on unshared output/presentation contexts.
  • NSAutoreleasePool (S). IONSImage.mm skips [pool release] on its throw paths. DarwinBundle keeps a pool alive for the app's whole lifetime. Convert both to @autoreleasepool.
  • IPGraph::evaluate (S). On CacheFullExc, the retry swallows every exception and returns EvalBufferNeedsRefill with a possibly null image.
  • MovieFFMpeg (S). audioFrame->ch_layout = … is a shallow copy. Use av_channel_layout_copy.

Performance

  • Hardware decode copies (M). On hardware decode, each frame allocates two AVFrames and a new FrameBuffer, then copies twice (hw transfer, then copy/sws). Reuse the frames per track, pool the FrameBuffers, and transfer straight into FrameBuffer planes where the layouts match.
  • OpenCL histogram buffers (S). Buffers and CL images are created and destroyed on every render (there's an existing TODO). Cache them by size.
  • Windows cache-thread probe (S). The caching thread allocates and frees a 64 MB probe block on every iteration, a 32-bit-era workaround. Remove it on x64.

Checked and clean

  • FFmpeg: no removed APIs (ch_layout, send/receive and get_supported_config are all current).
  • OCIO and OIIO: current 2.x / unique_ptr APIs.
  • Python: no removed stdlib modules.
  • C strings and threads: no unsafe C string or temp-file functions in non-vendored C++, and no detached threads.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions