merge: proxy and decode-tier fixes (V-1, V-24, V-25, V-26, V-27, V-28)
Merge branch fix2/proxies-tiers into the verification branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
28 files changed
+1049
-92
No files matched your search
@@ -161,6 +161,13 @@ public sealed record DeepAnalysisReport
|
||||
/// <summary>Suggested hero frame: sharp, well exposed, near golden hour or mid-sequence, not excluded.</summary>
|
||||
public int? HeroIndex { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Frames measured from their proxies, ascending, because the analysing host cannot decode their originals (HEIF on the
|
||||
/// server, BRIEF §2.3); null when none were. An unreadable verdict on a frame read from its original no longer holds
|
||||
/// once the frame is read from a proxy.
|
||||
/// </summary>
|
||||
public int[]? ProxyFrames { get; init; }
|
||||
|
||||
public IReadOnlyList<DeepFinding> Findings { get; init; } = [];
|
||||
|
||||
public string ToJson() => JsonSerializer.Serialize(this, DeepAnalysisJson.Default.DeepAnalysisReport);
|
||||
|
||||
@@ -57,10 +57,12 @@ public static class SequenceFrames
|
||||
/// <param name="damaged">For the unavailable tier: whether that proves the file unreadable. False when the host has no
|
||||
/// native decoder for the format, so a client or render node with one (or a proxy) may still produce its pixels: the
|
||||
/// tier is kept and <see cref="FrameFlags.Undecodable"/> is left as it was.</param>
|
||||
public static SidecarFrame WithTier(SidecarFrame frame, FileTier tier, bool damaged = true)
|
||||
/// <param name="proxied">Whether the host takes the frame's pixels from its proxy (an original it cannot decode, whose
|
||||
/// proxy is there): see <see cref="WithProxy"/>.</param>
|
||||
public static SidecarFrame WithTier(SidecarFrame frame, FileTier tier, bool damaged = true, bool proxied = false)
|
||||
{
|
||||
var flags = frame.Flags & ~(FrameFlags.PreviewOnly | FrameFlags.Undecodable);
|
||||
if (tier.Tier == DecodeTier.EmbeddedPreview) flags |= FrameFlags.PreviewOnly;
|
||||
if (tier.Tier == DecodeTier.EmbeddedPreview) flags |= proxied ? FrameFlags.None : FrameFlags.PreviewOnly;
|
||||
else if (tier.Tier == DecodeTier.Unavailable) flags |= damaged ? FrameFlags.Undecodable : frame.Flags & FrameFlags.Undecodable;
|
||||
var (w, h) = tier.Tier == DecodeTier.EmbeddedPreview && tier.Width > 0 && tier.Height > 0
|
||||
? PixelConvert.OrientedSize(tier.Width, tier.Height, frame.Orientation)
|
||||
@@ -68,6 +70,16 @@ public static class SequenceFrames
|
||||
return frame with { Tier = tier.Tier, Flags = flags, PreviewW = Positive(w), PreviewH = Positive(h) };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The frame with <see cref="FrameFlags.PreviewOnly"/> following its proxy, for a host that takes the pixels of the
|
||||
/// frame's original from its proxy (HEIF on the server, BRIEF §2.3, §8.1): an embedded-preview frame is read from its
|
||||
/// preview, so preview-only, only while <paramref name="proxied"/> is false. The tier and the preview size stay the
|
||||
/// original's; other tiers are left as they are.
|
||||
/// </summary>
|
||||
public static SidecarFrame WithProxy(SidecarFrame frame, bool proxied) => frame.Tier != DecodeTier.EmbeddedPreview
|
||||
? frame
|
||||
: frame with { Flags = proxied ? frame.Flags & ~FrameFlags.PreviewOnly : frame.Flags | FrameFlags.PreviewOnly };
|
||||
|
||||
private static int? Positive(int? value) => value > 0 ? value : null;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -117,7 +117,8 @@ public sealed record SidecarFrame
|
||||
|
||||
/// <summary>
|
||||
/// Decode tier of the file (BRIEF §8.2) as the host that indexed or decoded it last found it; omitted until it is
|
||||
/// known. <see cref="FrameFlags.PreviewOnly"/> and <see cref="FrameFlags.Undecodable"/> follow it.
|
||||
/// known. <see cref="FrameFlags.PreviewOnly"/> (unless that host reads the frame from its proxy) and
|
||||
/// <see cref="FrameFlags.Undecodable"/> follow it.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(TolerantEnumConverter<DecodeTier>))]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
|
||||
Reference in new issue
Block a user