fix(render-node): match job sizes per encoder; blank batch entries name no preset
A node announced one size limit, the largest of all its encoders (managed MJPEG at 65535 px), so it claimed H.264 jobs larger than its H.264 encoder takes. Each offered encoder now carries its own limit and the server matches codec and size per encoder; the node-wide limit is the largest offered one, for encoders that announce none. A hand-written batch with null or blank entries no longer throws when a job is posted or examined. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
6 files changed
+55
-15
No files matched your search
@@ -76,11 +76,12 @@ public static class ProcessingJobs
|
||||
];
|
||||
}
|
||||
|
||||
/// <summary>The batch presets of an export besides its own, each once.</summary>
|
||||
/// <summary>The batch presets of an export besides its own, each once (blank entries of a hand-written batch are skipped).</summary>
|
||||
internal static IEnumerable<string> BatchPresets(ExportSettings export)
|
||||
{
|
||||
var main = ExportResolver.Resolve(export).BasePresetId;
|
||||
return export.Batch.Distinct(StringComparer.OrdinalIgnoreCase).Where(id => !id.Equals(main, StringComparison.OrdinalIgnoreCase));
|
||||
return export.Batch.Where(id => !string.IsNullOrWhiteSpace(id)).Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Where(id => !id.Equals(main, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>A batch preset rendered with its own values, named and placed like the export it belongs to.</summary>
|
||||
|
||||
@@ -73,15 +73,15 @@ public sealed class RenderNodeClient : IAsyncDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The encoders this node offers: every single-file capability of the host's providers, hardware ones only when the
|
||||
/// user lets renders use them (<see cref="ProcessingOptions.AllowsHardware"/>).
|
||||
/// The encoders this node offers, each with its largest output: every single-file capability of the host's
|
||||
/// providers, hardware ones only when the user lets renders use them (<see cref="ProcessingOptions.AllowsHardware"/>).
|
||||
/// </summary>
|
||||
public IReadOnlyList<NodeEncoder> Encoders =>
|
||||
[
|
||||
.. _processing.Encoders.SelectMany(p => p.Capabilities)
|
||||
.Where(c => VideoCodecInfo.DefaultContainer(c.Codec) != ContainerFormat.ImageSequence
|
||||
&& (!c.Hardware || _processing.AllowsHardware(ExportResolver.CustomId)))
|
||||
.Select(c => new NodeEncoder(ProcessingJobs.CodecName(c.Codec), c.Name, c.Hardware, c.SupportsTenBit)),
|
||||
.Select(c => new NodeEncoder(ProcessingJobs.CodecName(c.Codec), c.Name, c.Hardware, c.SupportsTenBit, c.MaxWidth, c.MaxHeight)),
|
||||
];
|
||||
|
||||
/// <summary>Completes when the node has stopped: asked to, or refused by the server (signed out, no render-node right,
|
||||
@@ -107,9 +107,10 @@ public sealed class RenderNodeClient : IAsyncDisposable
|
||||
/// <summary>Registers this node (again) and returns its id.</summary>
|
||||
public async Task<Guid> RegisterAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var capabilities = _processing.Encoders.SelectMany(p => p.Capabilities).ToList();
|
||||
var request = new RegisterNodeRequest(_options.ClientName, Encoders, capabilities.Count > 0 ? capabilities.Max(c => c.MaxWidth) : 0,
|
||||
capabilities.Count > 0 ? capabilities.Max(c => c.MaxHeight) : 0);
|
||||
// Each encoder carries its own limit; the node-wide one (for servers that read only that) is the largest offered.
|
||||
var encoders = Encoders;
|
||||
var request = new RegisterNodeRequest(_options.ClientName, encoders, encoders.Select(e => e.MaxWidth).DefaultIfEmpty().Max(),
|
||||
encoders.Select(e => e.MaxHeight).DefaultIfEmpty().Max());
|
||||
var node = await _client.RegisterNodeAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
_nodeId = node.Id;
|
||||
return node.Id;
|
||||
|
||||
Reference in new issue
Block a user