feat: export panel and Render menu, playback options, videos library (owner review 1 phase 5) (#27)
CI / Build and test (push) Successful in 9m41s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m49s
CI / PostgreSQL 16 integration (push) Successful in 8m51s
CI / PostgreSQL 17 integration (push) Successful in 9m48s
CI / Docker image (push) Successful in 54s
Release / Server image (push) Successful in 1m39s
CI / Build and test (push) Successful in 9m41s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m49s
CI / PostgreSQL 16 integration (push) Successful in 8m51s
CI / PostgreSQL 17 integration (push) Successful in 9m48s
CI / Docker image (push) Successful in 54s
Release / Server image (push) Successful in 1m39s
Owner review 1 R3, R8, R9. A grouped Export step and Render menu; encoding, playback (reverse, boomerang, loops, fades, hold) and still frames; one videos library on the desktop and the server with a verified trash and copies to a videos folder. Closes #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #27.
This commit is contained in:
1 parent
188b2c2e55
commit
728ffa35cb
729 files changed
+26954
-1652
No files matched your search
@@ -0,0 +1,59 @@
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Video;
|
||||
using Chronos.Data.Processing;
|
||||
using Chronos.Protocol;
|
||||
using Chronos.Server.Jobs;
|
||||
using Chronos.Testing;
|
||||
|
||||
namespace Chronos.Server.Tests.Jobs;
|
||||
|
||||
/// <summary>Owner review 1, phase 5: a job that plays back, or saves a still, goes only to a node that reads settings format 3.</summary>
|
||||
[Category("server")]
|
||||
public sealed class PlaybackRoutingTests
|
||||
{
|
||||
private static readonly ExportSettings Mjpeg = new()
|
||||
{
|
||||
Preset = new Auto<string>().WithManual("mjpeg-avi"),
|
||||
Overrides = new ExportOverrides { Width = 96, Height = 64 },
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void APlaybackJobIsNeverGivenToAFormatTwoNode()
|
||||
{
|
||||
var sequence = new Sequence { Id = Guid.CreateVersion7(), ArchiveId = Guid.CreateVersion7(), Folder = "Roof", Title = "Roof" };
|
||||
var playing = ProcessingJobs.ReadRender(ProcessingJobs.Render(sequence, Mjpeg with { Playback = new PlaybackSettings { Loops = 3 } }, 96, 64,
|
||||
new ProjectSettings()).ParametersJson).Parameters;
|
||||
var plain = ProcessingJobs.ReadRender(ProcessingJobs.Render(sequence, Mjpeg, 96, 64, new ProjectSettings()).ParametersJson).Parameters;
|
||||
Assert.Equal((3, 1), (playing.RequiredSettingsFormat, plain.RequiredSettingsFormat));
|
||||
|
||||
RegisterNodeRequest Node(int format) => new("node", [new NodeEncoder("mjpeg", "managed", false, false)], 0, 0, format);
|
||||
Assert.False(RenderNodeService.Renders(Node(2), playing), "a format-2 node would render it forward once");
|
||||
Assert.True(RenderNodeService.Renders(Node(3), playing));
|
||||
Assert.True(RenderNodeService.Renders(Node(2), plain));
|
||||
|
||||
// A still needs format 3 too (and an image codec no node encodes).
|
||||
var still = ProcessingJobs.ReadRender(ProcessingJobs.Still(sequence, Mjpeg, VideoCodec.JpegSequence, 0, null, 96, 64, new ProjectSettings()).ParametersJson).Parameters;
|
||||
Assert.False(RenderNodeService.Renders(Node(2) with { Encoders = [new NodeEncoder(still.Codec, "managed", false, false)] }, still));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SettingsWrittenInFormatThreeNeverGoToAFormatTwoNodeEvenWhenTheJobDoesNotPlayBack()
|
||||
{
|
||||
// The sequence's own export plays back, so its settings text is stamped version 3; the job's preset does not.
|
||||
var stored = new ProjectSettings { Export = Mjpeg with { Playback = new PlaybackSettings { Loops = 3 } } }.ToJson();
|
||||
var read = ProcessingJobs.ReadSettings(stored)!;
|
||||
var sequence = new Sequence { Id = Guid.CreateVersion7(), ArchiveId = Guid.CreateVersion7(), Folder = "Roof", Title = "Roof" };
|
||||
var job = ProcessingJobs.ReadRender(ProcessingJobs.Render(sequence, Mjpeg, 96, 64, new ProjectSettings()).ParametersJson).Parameters;
|
||||
Assert.Equal(1, job.RequiredSettingsFormat);
|
||||
|
||||
var routed = ProcessingJobs.Routed(job, read, 96, 64);
|
||||
var split = ProcessingJobs.Split(job, 96, 64, read);
|
||||
|
||||
Assert.Equal(3, routed.RequiredSettingsFormat);
|
||||
Assert.True(split.All(p => p.RequiredSettingsFormat == 3));
|
||||
RegisterNodeRequest Node(int format) => new("node", [new NodeEncoder("mjpeg", "managed", false, false)], 0, 0, format);
|
||||
Assert.False(RenderNodeService.Renders(Node(2), routed), "a format-2 node cannot parse the settings it would be handed");
|
||||
Assert.True(RenderNodeService.Renders(Node(3), routed));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user