major remote desktop improvements

This commit is contained in:
KingKDot
2026-07-30 00:22:08 -05:00
parent a68172538d
commit 095a119bf4
35 changed files with 984 additions and 120 deletions
@@ -93,6 +93,9 @@ func TestCaptureDisplayDXGI(t *testing.T) {
func TestDirectVideoKeyframeDue(t *testing.T) {
now := (10 * time.Second).Nanoseconds()
previousInterval := videoKeyframeEvery
videoKeyframeEvery = 5 * time.Second
defer func() { videoKeyframeEvery = previousInterval }()
tests := []struct {
name string
@@ -102,7 +105,8 @@ func TestDirectVideoKeyframeDue(t *testing.T) {
}{
{name: "explicit request", requested: true, last: now, want: true},
{name: "first frame", last: 0, want: true},
{name: "periodic keyframes disabled", last: now - (30 * time.Second).Nanoseconds(), want: false},
{name: "periodic keyframe due", last: now - (30 * time.Second).Nanoseconds(), want: true},
{name: "periodic keyframe not due", last: now - time.Second.Nanoseconds(), want: false},
}
for _, test := range tests {
@@ -112,4 +116,9 @@ func TestDirectVideoKeyframeDue(t *testing.T) {
}
})
}
videoKeyframeEvery = 0
if directVideoKeyframeDue(false, now, now-(30*time.Second).Nanoseconds()) {
t.Fatal("periodic keyframe fired while the interval was disabled")
}
}