Transitions: fade starts from the outgoing picture (was an instant cut)
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.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user