The transition started with no from-frame, so BlendFrame returned the new scene at once. Start now requests a capture and the frame pump supplies its last output on the next tick. Test: TransitionFadeTests. Docs: ai.md, TASKS.md. Not pushed.
27 lines
775 B
C#
27 lines
775 B
C#
using ytLive.Services;
|
|
using Xunit;
|
|
|
|
namespace ytLive.Tests;
|
|
|
|
public class TransitionFadeTests
|
|
{
|
|
[Fact]
|
|
public void Fade_Without_A_From_Frame_Requests_Capture_And_Blends_Once_Supplied()
|
|
{
|
|
var transition = new TransitionService();
|
|
var to = new VideoFrame(2, 2, Enumerable.Repeat((byte)255, 16).ToArray());
|
|
var from = new VideoFrame(2, 2, new byte[16]);
|
|
|
|
transition.Start(TransitionType.Fade, 300, null);
|
|
Assert.True(transition.CaptureRequested);
|
|
|
|
transition.SupplyFromFrame(from);
|
|
Assert.False(transition.CaptureRequested);
|
|
|
|
transition.Tick(150);
|
|
var blended = transition.BlendFrame(to);
|
|
Assert.NotSame(to, blended);
|
|
Assert.NotEqual((byte)255, blended.BgraPixels[0]);
|
|
}
|
|
}
|