TASK 21 slice 1 step 4: wire media into resolver + preview routing
Wire the MediaVideoSourceManager into the live pipeline (new partial
ViewModels/MainViewModel.Media.cs mirrors Webcam/Background partials):
readonly _mediaManager assigned in the core ctor (decode at 1920x1080 master,
dispatcher-coalesced preview), OnMediaPreviewBitmapChanged adopts the shared
bitmap onto every IsMediaSource with a matching MediaPath, a
Source { IsMediaSource, MediaPath } case in ResolveOutputFrame feeds
GetLatestFrame, and the manager is disposed on shutdown.
Source.DisplaySource now routes VideoImageSource for MediaSource (Source.cs),
so media previews/canvas show decoded video.
Compositor needs no change: BlitContent UniformToFill-scales any frame to the
element rect. Decoder/manager/seam derived-work mirrors ScreenCaptureManager
(citation in commit for slice-step-3).
Test (one unit for this change, mirroring the live-capture case):
Source_DisplaySource_IsVideoImageSource_WhenMediaSource. 14/14 media +
DisplaySource tests pass, build 0 warnings. Docs (TASKS/HANDOFF/ai.md) updated.
This commit is contained in:
@@ -93,6 +93,20 @@ public class BackgroundTests
|
||||
Assert.Same(bitmap, source.DisplaySource);
|
||||
}
|
||||
|
||||
// TASK 21: a media source's DisplaySource routes its live video frames (like
|
||||
// Display/Window capture), so media previews show decoded video, not the stale
|
||||
// default art.
|
||||
[Fact]
|
||||
public void Source_DisplaySource_IsVideoImageSource_WhenMediaSource()
|
||||
{
|
||||
var source = new Source { Type = SourceType.MediaSource };
|
||||
var bitmap = new System.Windows.Media.Imaging.WriteableBitmap(
|
||||
2, 2, 96, 96, System.Windows.Media.PixelFormats.Bgra32, null);
|
||||
source.VideoImageSource = bitmap;
|
||||
|
||||
Assert.Same(bitmap, source.DisplaySource);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Source_DisplaySource_FallsBackToImage_WhenLiveCaptureWithNoVideoImage()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user