feat: add webcam frame diagnostics to debug gray block issue
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -257,6 +257,13 @@ public sealed class SceneCompositor
|
||||
var ew = (float)element.Width;
|
||||
var eh = (float)element.Height;
|
||||
var isRound = element.ClipShape == ClipShape.Round;
|
||||
|
||||
// Webcam diagnostic: Log when webcam frames are processed
|
||||
if (element is WebcamSceneConfig)
|
||||
{
|
||||
AppLog.Write($"Compositor webcam: {frame.Width}x{frame.Height}, IsOpaque={frame.IsOpaque}, element={element.GetType().Name}");
|
||||
}
|
||||
|
||||
// All rect-placed elements route through the paste cache (take-9 lesson): the
|
||||
// IsOpaque bypass kept re-sampling the webcam (~156k px) EVERY tick even when
|
||||
// the device frame had not changed; an opaque source rasterizes to an opaque
|
||||
|
||||
@@ -317,8 +317,16 @@ public sealed class MediaCaptureFrameSource : ICameraFrameSource
|
||||
}
|
||||
|
||||
// MediaCapture video carries no alpha plane — the OS fills 255.
|
||||
FrameAvailable?.Invoke(new VideoFrame(bitmap.PixelWidth, bitmap.PixelHeight, pixels)
|
||||
{ IsOpaque = true, Epoch = ++_epoch });
|
||||
var frame = new VideoFrame(bitmap.PixelWidth, bitmap.PixelHeight, pixels)
|
||||
{ IsOpaque = true, Epoch = ++_epoch };
|
||||
|
||||
// Diagnostic: Log frame properties for compositor debugging
|
||||
if ((now - _lastAlphaProbe).TotalSeconds >= 5.0)
|
||||
{
|
||||
AppLog.Write($"Webcam frame emit: {frame.Width}x{frame.Height}, IsOpaque={frame.IsOpaque}, Epoch={frame.Epoch}");
|
||||
}
|
||||
|
||||
FrameAvailable?.Invoke(frame);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user