Apply export color transform in render worker

The export color transform was passed to RenderTask as a ColorProcessor,
but the worker IPC render_frame message never carried it. The worker
always set the ticket's coloroutput to null, so frames were returned in
the project's reference space and encoded without the chosen output
transform (e.g. Rec.709 / sRGB), causing the exported video to look
wrongly tinted.

Serialize the ColorTransform through the render_frame control message
and reconstruct the ColorProcessor on the worker side before rendering.
Also expose ColorTransform as a Qt metatype so it can be stored in a
ticket QVariant.
This commit is contained in:
2026-07-13 10:19:30 +08:00
parent 43599dba9e
commit d66779d281
10 changed files with 73 additions and 9 deletions
+8 -4
View File
@@ -43,7 +43,8 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
FrameHashCache *cache, const QSize &force_size,
const QMatrix4x4 &force_matrix,
PixelFormat force_format, int force_channel_count,
ColorProcessorPtr force_color_output)
ColorProcessorPtr force_color_output,
const ColorTransform &force_color_transform)
{
QMetaObject::invokeMethod(RenderManager::instance(),
"SetAggressiveGarbageCollection",
@@ -91,7 +92,7 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
i < maximum_rendered_frames && iterator.GetNext(&next_frame); i++) {
StartTicket(&watcher_thread, manager, next_frame, mode, cache,
force_size, force_matrix, force_format, force_channel_count,
force_color_output);
force_color_output, force_color_transform);
}
bool result = true;
@@ -224,7 +225,8 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
if (iterator.GetNext(&next_frame)) {
StartTicket(&watcher_thread, manager, next_frame, mode,
cache, force_size, force_matrix, force_format,
force_channel_count, force_color_output);
force_channel_count, force_color_output,
force_color_transform);
}
}
@@ -313,7 +315,8 @@ void RenderTask::StartTicket(QThread *watcher_thread, ColorManager *manager,
FrameHashCache *cache, const QSize &force_size,
const QMatrix4x4 &force_matrix,
PixelFormat force_format, int force_channel_count,
ColorProcessorPtr force_color_output)
ColorProcessorPtr force_color_output,
const ColorTransform &force_color_transform)
{
RenderManager::RenderVideoParams rvp(viewer_->GetConnectedTextureOutput(),
video_params_, audio_params_, time,
@@ -323,6 +326,7 @@ void RenderTask::StartTicket(QThread *watcher_thread, ColorManager *manager,
rvp.force_matrix = force_matrix;
rvp.force_format = force_format;
rvp.force_color_output = force_color_output;
rvp.force_color_transform = force_color_transform;
rvp.force_channel_count = force_channel_count;
if (cache) {