mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-11-09 07:23:14 +00:00
fix(export): allow native cursor overlay routing
This commit is contained in:
1 parent
97abaa4f4e
commit
32708ce122
3 files changed
+86
-8
No files matched your search
@@ -440,6 +440,34 @@ describe("buildExperimentalNvidiaCudaStaticLayoutArgs", () => {
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
it("passes cursor telemetry and atlas assets to the CUDA wrapper", () => {
|
||||
const args = buildExperimentalNvidiaCudaStaticLayoutArgs(
|
||||
createNvidiaCudaSkipOptions({
|
||||
cursorTelemetryPath: "cursor-telemetry.json",
|
||||
cursorSize: 96,
|
||||
cursorAtlasPath: "cursor-atlas.png",
|
||||
cursorAtlasMetadataPath: "cursor-atlas.tsv",
|
||||
}),
|
||||
"output.mp4",
|
||||
"work",
|
||||
);
|
||||
|
||||
expect(args).toEqual(
|
||||
expect.arrayContaining([
|
||||
"--cursor-json",
|
||||
"cursor-telemetry.json",
|
||||
"--cursor-height",
|
||||
"96",
|
||||
"--cursor-style",
|
||||
"external",
|
||||
"--cursor-atlas-png",
|
||||
"cursor-atlas.png",
|
||||
"--cursor-atlas-metadata",
|
||||
"cursor-atlas.tsv",
|
||||
]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildNativeStaticLayoutTimelineSegments", () => {
|
||||
|
||||
@@ -130,6 +130,58 @@ describe("ModernVideoExporter native static-layout eligibility", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("allows cursor overlay native static-layout without the experimental native flag", () => {
|
||||
const exporter = createExporter({
|
||||
experimentalNativeExport: false,
|
||||
showCursor: true,
|
||||
cursorTelemetry: [
|
||||
{ timeMs: 0, cx: 0.25, cy: 0.35 },
|
||||
{ timeMs: 1_000, cx: 0.5, cy: 0.55 },
|
||||
],
|
||||
});
|
||||
|
||||
expect(
|
||||
exporter.getNativeStaticLayoutSkipReason(
|
||||
{
|
||||
audioMode: "copy-source",
|
||||
audioSourcePath: "recording.mp4",
|
||||
},
|
||||
videoInfo,
|
||||
60,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("reports frame overlays as the remaining native overlay blocker", () => {
|
||||
const exporter = createExporter({ frame: "macbook" });
|
||||
|
||||
expect(
|
||||
exporter.getNativeStaticLayoutSkipReason(
|
||||
{
|
||||
audioMode: "copy-source",
|
||||
audioSourcePath: "recording.mp4",
|
||||
},
|
||||
videoInfo,
|
||||
60,
|
||||
),
|
||||
).toBe("unsupported-frame-overlay");
|
||||
});
|
||||
|
||||
it("reports background blur as the remaining native overlay blocker", () => {
|
||||
const exporter = createExporter({ backgroundBlur: 12 });
|
||||
|
||||
expect(
|
||||
exporter.getNativeStaticLayoutSkipReason(
|
||||
{
|
||||
audioMode: "copy-source",
|
||||
audioSourcePath: "recording.mp4",
|
||||
},
|
||||
videoInfo,
|
||||
60,
|
||||
),
|
||||
).toBe("unsupported-background-blur");
|
||||
});
|
||||
|
||||
it("rejects native static-layout when speed edits do not have a native timeline map", () => {
|
||||
const speedRegions: SpeedRegion[] = [
|
||||
{ id: "speed-1", startMs: 1_000, endMs: 4_000, speed: 1.5 },
|
||||
|
||||
@@ -1207,14 +1207,12 @@ export class ModernVideoExporter {
|
||||
return "unsupported-webcam-source";
|
||||
}
|
||||
|
||||
const hasCursorOverlay =
|
||||
this.config.showCursor === true && (this.config.cursorTelemetry ?? []).length > 0;
|
||||
if (
|
||||
this.config.frame ||
|
||||
this.config.backgroundBlur > 0 ||
|
||||
(hasCursorOverlay && this.config.experimentalNativeExport !== true)
|
||||
) {
|
||||
return "dynamic-overlay-present";
|
||||
if (this.config.frame) {
|
||||
return "unsupported-frame-overlay";
|
||||
}
|
||||
|
||||
if (this.config.backgroundBlur > 0) {
|
||||
return "unsupported-background-blur";
|
||||
}
|
||||
|
||||
return this.isDefaultCropRegion() ? null : "non-default-crop";
|
||||
|
||||
Reference in new issue
Block a user