Commit Graph
1981 Commits
Author SHA1 Message Date
Mike-Solar 5c8f80480d UI: flatten preferences behavior tabs and add node parameter editor shortcut
- Move Behavior-General options (hover focus, slider ladder, scroll zooms)
  into the General preferences tab.
- Move Behavior-Audio option (audio scrubbing) into the Audio preferences tab.
- Promote remaining Behavior categories (Timeline, Playback, Project, Nodes,
  Rendering) to top-level sidebar entries without the 'Behavior - ' prefix.
- Update Chinese translations for the new sidebar titles and fill unfinished
  Behavior tab strings.

NodeView:
- Remove double-click jump-to-parameter-editor behavior; keep expand/collapse.
- Add right-click context menu item 'Show in Parameter Editor'.
- Add Shift+P shortcut bound to the same action.

Render:
- Fix crash in PreviewAutoCacher::ClearSingleFrameRenders when proxy playback
  causes a render ticket to finish synchronously before the watcher pointer is
  returned. Defer the watcher Finished signal via queued connection so the
  caller can safely register the watcher before it is deleted.
2026-07-13 10:19:30 +08:00
Mike-Solar f57ffa482f Flatten Behavior preferences into sidebar categories and scroll to node on double-click
Behavior preferences used a nested QTreeWidget with groups like General,
Audio, Timeline, etc. Replace it with one tab per group in the left sidebar
so users can jump directly to a category without expanding a secondary menu.

Also wire double-clicking a node in the node graph to emit a selection
signal with its context, causing the parameter panel to scroll to that
node's parameters (in addition to showing/raising the panel as before).
2026-07-13 10:19:30 +08:00
Mike-Solar b3c124fe7a Default viewer display transform to config display/view instead of input colorspace
When no explicit color transform was set, ManagedDisplayWidget fell back to
the project's default input colorspace. For scene-referred reference spaces
like ACEScg / Linear this produced a raw, greenish image on the viewer
instead of a monitor-ready picture. Default to the OCIO config's default
display and view so the viewer looks correct out of the box, while still
honoring any Color Space / Display / View choice the user makes from the
context menu.
2026-07-13 10:19:30 +08:00
Mike-Solar 43599dba9e Add batch proxy menu to Project Explorer and persist Use Proxy state
The Project Explorer previously only had an old Pre-Cache submenu that
required choosing a sequence. Replace it with the same Proxy menu that
the timeline uses:

- Generate Proxy: batch-generates proxies for all selected footage items
  that have an enabled video stream, using ProxyManager and the current
  proxy settings.
- Use Proxy: checkable toggle that enables/disables proxy playback for the
  selected footage.
- Reveal Proxy / Delete Proxy: consistent with the timeline context menu.

Also make Footage::SaveCustom() write the <proxy> element whenever
proxy_enabled_ is true, even if proxy_path_ is empty, and load it back
in LoadCustom(). This preserves the user's Use Proxy preference across
project saves so it is restored on the next open.

Translation files updated with lupdate; zh_CN and zh_TW translations for
the new Project Explorer strings (and the matching timeline strings) are
filled in.
2026-07-13 10:19:30 +08:00
Mike-Solar 8d3bde5a50 Implement software scope rendering for backend-neutral display paths
The Waveform, Vectorscope and Histogram panels were black when running on
the Vulkan / backend-neutral render path because ScopeBase::OnPaint()
returned early with a TODO. The viewer emits GPU textures that live in the
viewer's own renderer; on Vulkan each ManagedDisplayWidget has a separate
device, so those textures cannot be sampled directly.

Fix by:

- Adding a backend-neutral branch in ScopeBase::OnPaint() that downloads the
  reference texture (cross-renderer if needed), color-manages it into a U8
  offscreen texture, downloads it to a QImage, and draws via QPainter.
- Adding a pure virtual DrawScopeSoftware() to ScopeBase and implementing it
  for WaveformScope, VectorscopeScope and HistogramScope.
- Fixing the managed_tex_up_to_date_ flag that was never set to true in the
  OpenGL path, which caused the color-managed scope texture to be recreated
  on every paint.

All gtest suites pass.
2026-07-13 10:19:30 +08:00
Mike-Solar 468b6f1d1b Fix playback backup timer interval and waveform-only prequeue
- The playback backup timer was using timebase_dbl() in seconds as its
  QTimer interval, which truncated to 0 ms for normal frame rates. This
  caused the timer to fire continuously and starve the event loop when
  the video display was hidden, e.g. in Show Waveform Only mode, freezing
  the UI and stopping the playhead. Multiply by 1000 to use milliseconds.
- If PlayInternal has neither video nor audio to prequeue, call
  FinishPlayPreprocess immediately so the backup timer starts and the
  playhead advances even in waveform-only mode with no audio.
2026-07-13 10:19:30 +08:00
Mike-Solar 094f4a8e44 Fix audio waveform view scene rect and timebase refresh
- AudioWaveformView now uses the video frame rate as its timebase
  (falling back to the default sequence frame rate), preventing the
  enormous scene rect that froze the UI when it previously used the
  audio sample rate.
- Call UpdateSceneRect() after changing the waveform timebase so the
  QGraphicsScene bounds are recomputed immediately.
- Refresh the waveform view's viewer/timebase whenever the waveform
  visibility mode changes, ensuring the correct timebase is applied
  even if the node was connected earlier with a different setting.
2026-07-13 10:19:30 +08:00
Mike-Solar 282a06b777 Default to full-resolution preview and fix audio-waveform freeze
- Use a divider of 1 (full resolution) for new sequences and for
  footage-derived viewer parameters instead of the auto-downscaling
  heuristic, so the viewer defaults to full-res preview.
- In AudioWaveformView, base the view timebase on the video frame rate
  when video is present; fall back to the audio sample rate only for
  audio-only sources. Using the audio sample rate as the view timebase
  created an enormous scene rect (time * sample_rate * scale), which
  froze the waveform view and stalled playback updates when showing
  the audio waveform.
2026-07-13 10:19:30 +08:00
Mike-Solar 0969e2adc5 Add diagnostics for proxy toggle synchronization
Add temporary qDebug logging to Footage, ProjectCopier,
RenderWorkerPool, and TimelineWidget to trace why Use Proxy cannot be
 toggled and why proxy footage may still be used after disabling.
2026-07-13 10:19:30 +08:00
Mike-Solar cf32fcfee1 Add configurable proxy settings and a menu entry
- Extend ProxyManager::ProxyParams with crf and preset, and update
  ProxyTask/ProxyParamsEqual to use them.
- Add global config keys ProxyWidth, ProxyHeight, ProxyCRF, ProxyPreset.
- Add a Proxy Settings group to Preferences -> Disk with width/height/CRF/preset
  controls.
- Read proxy settings from config when generating proxies from the timeline.
- Add Tools -> Proxy Settings... menu entry that opens Preferences on the Disk tab.
- Add ConfigDialogBase::SetCurrentTab() so PreferencesDialog can start on a
  specific tab.
2026-07-13 10:19:30 +08:00
Mike-Solar 94250a7690 Fix proxy decoding path and add proxy generation diagnostics
- RenderWorkerPool::DecodeInputFrame now uses the proxy filename/decoder/stream
  from FootageJob when a proxy is attached, so generated proxies are actually
  used during render.
- Add qDebug/qWarning logging to TimelineWidget::GenerateProxiesForSelectedClips
  and ProxyTask::Run to diagnose why Generate Proxy appears to do nothing.
2026-07-13 10:19:30 +08:00
Mike-Solar f6211f97a5 Fix render worker reuse and stabilize out-of-process video rendering 2026-07-13 10:19:30 +08:00
Mike-Solar e77de49406 add Comments 2026-07-13 10:19:30 +08:00
Mike-Solar 3c9592da45 完成Vulkan渲染后端 2026-07-13 10:19:30 +08:00
Mike-Solar 225f8505c2 feat(render): dynamic OpenGL/Vulkan backend split and backend-neutral viewer
- Extract libolive-rendercore static library to minimize backend link boundary.
- Add DynamicRenderer adapter with C ABI (oakgl/oakvulkan shared libs).
- Make OAK_ENABLE_DYNAMIC_RENDER_BACKEND default ON with OpenGL fallback.
- Implement VulkanRenderer prototype (textures, shaders, UBO blit, readback).
- Add backend-neutral viewer readback path (offscreen -> QImage -> QPainter).
- Refactor PluginRenderer to be renderer-agnostic; OFX plugins fall back to CPU
  path on non-OpenGL backends while preserving OpenGL render path.
- Add Renderer::AttachOutputTexture/DetachOutputTexture and C ABI forwards.
- Update docs/zh/render-backend-dynamic-plan.md for Phase 3/4/5.
2026-07-13 10:19:29 +08:00
Mike-Solar 76a98e5a93 Route viewer through dynamic backend in experimental builds 2026-07-13 10:19:29 +08:00
Mike-Solar 8ae8e3a159 Implement proxy media workflow 2026-07-13 10:19:29 +08:00
Mike-Solar 9c1fba4932 Add timeline audio sync actions 2026-07-13 10:19:29 +08:00
Mike-Solar 08b1c6d562 Implement audio sync foundations 2026-07-13 10:19:29 +08:00
Mike-Solar cac5a40b58 Implement color LUT v0.4 features 2026-06-07 00:24:08 +08:00
Mike-Solar f731470c0f fix macOS timer bug 2026-06-03 17:49:21 +08:00
孙羽 00f57533e6 Add null checks for color processing functions 2026-05-28 18:21:42 +08:00
Mike-Solar a0abf9cfb0 Fixed: fixed black screen when pulling playhead back. 2026-05-21 16:29:39 +08:00
Mike-Solar 2a84027ff9 fix(renderer): macOS TBDR cross-context sync and OFX instance thread-safety
This commit fixes crashes (SIGSEGV in CImg blur_bilateral) and black-frame
corruption artifacts during playback and scrubbing on macOS Apple Silicon.

Root cause analysis:
1. macOS uses Tile-Based Deferred Rendering (TBDR). glFlush() does not
   guarantee tile memory writeback, causing glReadPixels to read incomplete
   tiles (black/corrupted frames) and cache them to disk.
2. Olive uses multiple shared OpenGL contexts (RenderProcessor contexts vs.
   thread-local PluginRenderer context). glFinish() only waits for the
   current context, not the shared context that produced the texture. CPU
   readback in PluginRenderer could read partially-rendered tiles.
3. OlivePluginInstance and OliveClipInstance are not thread-safe. Concurrent
   RenderProcessors could corrupt internal QMap/images_ and params_ via
   setInputTexture/renderAction races.

Fixes:
- OpenGLRenderer::Flush() on macOS now uses glFinish() unconditionally.
- OpenGLRenderer::DownloadFromTexture() and OpenGLRenderer::Blit() insert
  glFinish() before readback/detach to ensure tile writeback completes.
- PluginRenderer::RenderPlugin() now acquires a per-instance mutex to
  serialize concurrent OFX render calls.
- Before CPU readback in PluginRenderer, flush the renderer that originally
  produced each input texture, ensuring cross-context synchronization.
- RenderProcessor::ProcessVideoFootage() flushes after BlitColorManaged.
- Add black-frame detection in ProcessVideoCacheJob() to auto-purge TBDR-
   corrupted cache files.
- Add diagnostic qDebug() logging in viewer, decoder, renderer, and plugin
  paths to aid future debugging.
2026-05-17 14:54:49 +08:00
Mike-Solar 3845c31b37 perf(plugin): eliminate GPU↔CPU ping-pong in OFX render path
This commit removes redundant readbacks and uploads in the OpenFX
  plugin pipeline, achieving zero-copy rendering for GL-capable
  plugins and reducing CPU path overhead.

  PluginRenderer (OpenGL path):
  - Skip ReadbackTextureToFrame + ConvertFrameIfNeeded + Upload after
    plugin render. The destination texture is already valid on GPU.
  - Pass readback_cpu=false to setInputTexture() so input textures are
    provided via loadTexture() (GL texture IDs) instead of being
    downloaded to CPU Image buffers.
  - Remove duplicate ReadbackTextureToFrame block between
    getClipPreferences and the second setInputTexture call.

  OliveClipInstance:
  - Add optional bool readback_cpu=true to setInputTexture(). When
    false, only params and input_textures_ are updated; CPU readback
    and memcpy into Image are skipped.
  - Add pruneImagesCache() to prevent unbounded growth of images_.
    Input clips are limited to 8 cached frames; output clips are
    left untouched.

  Micro-optimizations:
  - Replace per-row memcpy loops with single block memcpy when
    src/dst strides are contiguous (common case in Olive pipeline).
  - Remove dead GL_PREAMBLE macro definition.

  fix(viewer): resolve playback head lag, frozen frames, and pause delay

  Three playback pipeline behavioral issues are fixed:

  1. Prequeue blocked playhead start:
     Reduce kVideoPlaybackInterval from 0.5s to 0.1s. This lowers
     prequeue length from 15–30 frames to 3–6 frames, so the
     playback timer starts much sooner after pressing Play.

  2. Frozen display during playback:
     Relax the hard frame-drop logic in RendererGeneratedFrameForQueue.
     When the queue has fewer than 2 frames, keep late frames instead
     of dropping them, preventing the viewer from freezing entirely
     when rendering cannot keep up with playback speed.

  3. Delayed frame update after pause:
     Cancel in-flight render tickets in PauseInternal() before
     deleting queue watchers. Previously the render thread continued
     processing stale playback frames, blocking the single-frame
     render requested by UpdateTextureFromNode().
2026-05-16 16:45:13 +08:00
Mike-Solar e85c6cf60a fix: OFX param instance lifecycle and thread-safety fixes
- Fix SIGSEGV in PluginMisc.Keyer by linking Param::SetInstance to instances.
    Olive's custom param instances (IntegerInstance, DoubleInstance, etc.) were
    not passing the SetInstance pointer to the OpenFX HostSupport base class,
    leaving _paramSetInstance as nullptr. When Keyer called paramSetValue during
    createInstanceAction, the suite function dereferenced the null pointer in
    paramChangedByPlugin(). Now newParam() passes 'this' to every constructor.

  - Fix render-thread crash when OFX plugins set params during rendering.
    MinOFX calls paramSetValue inside createInstanceAction from the render
    thread. SubmitUndoCommand() used to push undo commands directly to
    UndoStack, which modifies QAction state (GUI-only). Added IsGuiThread()
    check: non-GUI threads execute redo_now() and discard the command without
    touching the undo stack.

  - Enable PluginMisc.MergeOver and PluginMisc.Keyer integration tests.
    MergeOver now supplies both Source and Bg textures; Keyer uses U16 format.
    Both pass in the full test suite.

  - Make ViewerQueue thread-safe with QMutex around AppendTimewise/PurgeBefore.
    Adds copy ctor and assignment to support mutex-per-instance semantics.
2026-05-14 22:32:34 +08:00
Mike-Solar 4aa4d59770 feat: hide non-texture OFX params from node graph + host coordinate standardization
Hide non-texture OFX params from node graph
  --------------------------------------------
  OFX plugins like ColorCorrect expose dozens of scalar parameters as
  node inputs, making nodes extremely tall and pushing Source/Mask far
  down. Previously attempted via kInputFlagHidden, but that also hid
  them from the parameter panel.

  Fix: move the filter to NodeViewItem::IsInputValid() instead.
  For OFX plugin nodes (getPluginInstance() != nullptr), only
  kTexture inputs are rendered as ports. Scalar parameters remain
  fully visible in the parameter panel.

  Files: app/widget/nodeview/nodeviewitem.cpp
         app/node/plugins/Plugin.cpp

  Standardize OFX host coordinate system
  --------------------------------------
  Olive's OFX host had partial and inconsistent coordinate handling.

  1. Fix Project coordinate methods
     - getProjectSize() / getProjectExtent() / getProjectOffset()
       now multiply X by pixel_aspect_ratio(), returning canonical
       coordinates per the OFX spec.

  2. Fix Clip default RoD
     - OliveClipInstance::getRegionOfDefinition() default now returns
       {0, 0, width*PAR, height} instead of raw pixel coords.

  3. Add parameter coordinate system conversion
     - DoubleInstance / Double2DInstance / Double3DInstance now check
       _descriptor.getDefaultCoordinateSystem().
     - For kOfxParamCoordinatesNormalised:
         get: internal pixel value -> normalised (divide by extent)
         set: normalised plugin value -> pixel (multiply by extent)
     - DefaultValueForParam() also converts normalised defaults to
       canonical before storing in Node, keeping Olive internal/UI
       values consistently in pixel space.

  Files: app/pluginSupport/OlivePluginInstance.cpp
         app/pluginSupport/OliveClip.cpp
         app/pluginSupport/paraminstance.h
         app/node/plugins/Plugin.cpp
2026-05-14 21:54:18 +08:00
Mike-Solar b2de04962d feat: heuristic semantic display for OFX RGBA parameters
ColorCorrectOFX and similar plugins declare per-channel controls
  (Gamma, Contrast, Saturation, Gain, Offset) as kOfxParamTypeRGBA.
  Olive previously mapped every RGBA param to NodeValue::kColor and
  rendered it as a ColorButton, which is semantically wrong for
  adjustment sliders.

  This commit adds heuristic semantic detection to distinguish
  "true color" inputs (color pickers) from "per-channel scalar"
  inputs (float sliders):

    - label/hint/name keywords ("gamma", "contrast", "gain", ...)
    - display range outside [0, 1]
    - uniform default values across all channels

  The detected semantic ("color" or "scalar") is stored as the
  node input property "color_semantic".  The display range and hint
  are also persisted as "min" / "max" / "tooltip".

  NodeParamViewWidgetBridge now branches on "color_semantic":
    - "scalar"  → 4× FloatSlider (reuses existing ProcessSlider /
      keyframe-track logic, since kColor already splits into 4 tracks)
    - otherwise → ColorButton (unchanged)

  All 4 test suites pass.
2026-05-14 20:50:45 +08:00
Mike-Solar 43ba1c4642 fix ofx plugin bug 2026-05-14 20:26:17 +08:00
Mike-Solar eb79be87a4 add smoke test 2026-04-12 01:26:41 +08:00
Mike-Solar 843b8762f6 fix audio bug 2026-04-12 01:08:22 +08:00
Mike-Solar bfb1b2fce4 update copyright back 2026-01-16 21:22:05 +08:00
Mike-Solar e851653fa3 尝试修复粉紫屏未果 2026-01-16 21:11:24 +08:00
Mike-Solar 4d393f3d23 尝试解决插件bug 2026-01-10 18:56:58 +08:00
Mike-Solar 8ed5660faf solve some bugs 2026-01-05 18:01:13 +08:00
Mike-Solar 6b64abb1fa Limit import files 2026-01-05 16:36:43 +08:00
Mike-Solar b8669f6a11 Change project name; 2026-01-05 16:22:26 +08:00
Mike-Solar cdc66d1a02 fix no video shown 2026-01-05 13:52:02 +08:00
Mike-Solar cad331eb2c Fix compile errors 2026-01-05 01:50:05 +08:00
Mike-Solar e1938a14e0 Finish TODO 6 and 7 2026-01-04 23:16:10 +08:00
Mike-Solar 1b29bd147e Add missing param instance types (String, Double3D/Integer3D, Group/Page, Custom/Bytes) and mapping to node inputs. app/pluginSupport/OlivePluginInstance.cpp, app/node/plugins/Plugin.cpp 2026-01-04 22:53:26 +08:00
Mike-Solar f191486375 Implement multi-input OFX clip wiring and texture handling
Store PluginJob input values for lookup
Add per-clip texture inputs on plugin nodes
Map input clips to textures during render (with Source fallback)
2026-01-04 22:30:41 +08:00
Mike Solar 27ee6067cc Merge remote-tracking branch 'origin/plugin' into plugin
# Conflicts:
#	ext/KDDockWidgets
2025-12-13 21:46:12 +08:00
Mike Solar 22fd521951 Merge branch 'refs/heads/dev' into plugin
# Conflicts:
#	.gitmodules
#	CMakeLists.txt
#	ext/core
2025-12-13 21:45:46 +08:00
Mike-Solar f317e0e173 Add null checks for timebase in TimeScaledObject and fix background color assignment in ViewerDisplayWidget 2025-11-24 10:33:38 +08:00
Mike-Solar 1e33a31b73 Update FFmpeg handling and focus management
Refactor FFmpeg frame processing and improve focus management in panels. Add memory sanitization for debug builds and update KDDockWidgets integration.
2025-11-23 16:35:09 +08:00
Mike-Solar 5aaa49c515 Add push button support for OFX plugins
This commit adds support for push buttons in OFX plugins by:

- Adding `kPushButton` to `NodeValue` enum
- Implementing `pushButtonClicked` slot in `PluginNode`
- Creating `NodeParamButton` widget for UI representation
- Updating `paraminstance.h` to handle push button instances
- Modifying `nodeparamviewwidgetbridge.cpp` to connect push button signals
2025-11-10 13:57:04 +08:00
Mike-Solar c71b20bb95 add: add 3 functions. Provide the way to get current audio and video params. 2025-09-14 20:43:56 +08:00
Mike Solar 6fdfd03ffd update: update copyright 2025-08-05 17:12:49 +08:00
Mike Solar 74f73ab3be change: change code style to Linux style except indent. 2025-08-03 03:09:40 +08:00