mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
chore(deps): upgrade all dependencies, toolchains and images (#2825)
This commit is contained in:
1 parent
56e04e7b53
commit
3b552e00ef
510 files changed
+23614
-37473
No files matched your search
+71
-59
@@ -4,30 +4,30 @@ version = 4
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.13.0"
|
||||
version = "2.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
||||
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.4"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
||||
|
||||
[[package]]
|
||||
name = "convert_case"
|
||||
version = "0.11.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49"
|
||||
checksum = "1af709f1f33454bf52eadfc8c78b3b9ef9cb26fb54d16dc9cd9a7299f899fd1b"
|
||||
dependencies = [
|
||||
"unicode-segmentation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "1.0.7"
|
||||
version = "1.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01334b89b69ff726750c5ce5073fc8bd860e99aa9a8fc5ca11b04730e3aee97a"
|
||||
checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d"
|
||||
|
||||
[[package]]
|
||||
name = "fluxer_encoder_ring"
|
||||
@@ -69,9 +69,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d"
|
||||
checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
@@ -84,9 +84,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-channel"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
|
||||
checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
@@ -94,15 +94,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
|
||||
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
|
||||
|
||||
[[package]]
|
||||
name = "futures-executor"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d"
|
||||
checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-task",
|
||||
@@ -111,38 +111,38 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-io"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
|
||||
checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
|
||||
checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 3.0.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-sink"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
|
||||
checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
|
||||
|
||||
[[package]]
|
||||
name = "futures-task"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
|
||||
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
|
||||
|
||||
[[package]]
|
||||
name = "futures-util"
|
||||
version = "0.3.32"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
|
||||
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
@@ -157,9 +157,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.186"
|
||||
version = "0.2.189"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
||||
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
@@ -182,19 +182,20 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.8.1"
|
||||
version = "2.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
|
||||
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||
|
||||
[[package]]
|
||||
name = "napi"
|
||||
version = "3.9.1"
|
||||
version = "3.12.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad513ff22558f1830b595ea6eb4091da48145d09a222ce157e781896f78be0b9"
|
||||
checksum = "2ca373b1769db491f38386d57a882b9a21debb2dcd17c0d3e16d02ec311a1d7c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"ctor",
|
||||
"futures",
|
||||
"libc",
|
||||
"napi-build",
|
||||
"napi-sys",
|
||||
"nohash-hasher",
|
||||
@@ -203,42 +204,42 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "napi-build"
|
||||
version = "2.3.2"
|
||||
version = "2.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9c366d2c8c60b86fa632df75f745509b52f9128f91a6bad4c796e44abb505e1"
|
||||
checksum = "709388aa95cadd11adda653ab6d8ebe5733144acd2b111fa7b2da8a0bf0f16a7"
|
||||
|
||||
[[package]]
|
||||
name = "napi-derive"
|
||||
version = "3.5.6"
|
||||
version = "3.6.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b3f766e04667e6da0e181e2da4f85475d5a6513b7cf6a80bea184e224a5b42"
|
||||
checksum = "76117d85c6ccd9f07102daf39931c7229934483008276d84ecb7c19aa50dfe69"
|
||||
dependencies = [
|
||||
"convert_case",
|
||||
"ctor",
|
||||
"napi-derive-backend",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "napi-derive-backend"
|
||||
version = "5.0.4"
|
||||
version = "6.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d5af30503edf933ce7377cf6d4c877a62b0f1107ea05585f1b5e430e88d5baf"
|
||||
checksum = "4c1c87a71568f3fe5c736b10878ff55064b250bb4ea4b48c8055713e07b9e463"
|
||||
dependencies = [
|
||||
"convert_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"semver",
|
||||
"syn",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "napi-sys"
|
||||
version = "3.2.2"
|
||||
version = "3.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f5bcdf71abd3a50d00b49c1c2c75251cb3c913777d6139cd37dabc093a5e400"
|
||||
checksum = "4d29a242104e456960e6c6479847570be731c1a92b8f8c05ddfb5439e5c09915"
|
||||
dependencies = [
|
||||
"libloading",
|
||||
]
|
||||
@@ -280,18 +281,18 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.106"
|
||||
version = "1.0.107"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
||||
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.45"
|
||||
version = "1.0.47"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
||||
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
@@ -307,9 +308,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "2.1.2"
|
||||
version = "2.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
|
||||
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
@@ -331,15 +332,26 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.15.1"
|
||||
version = "1.16.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
||||
checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.117"
|
||||
version = "2.0.119"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
||||
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "3.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -348,15 +360,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.24"
|
||||
version = "1.0.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-segmentation"
|
||||
version = "1.13.2"
|
||||
version = "1.13.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c"
|
||||
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
@@ -411,7 +423,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -422,7 +434,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -12,8 +12,8 @@ resolver = "2"
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
napi = {version = "3.9.1", default-features = false, features = ["dyn-symbols", "napi8"]}
|
||||
napi-derive = "3.5.6"
|
||||
napi = {version = "3.12.6", default-features = false, features = ["dyn-symbols", "napi8"]}
|
||||
napi-derive = "3.6.7"
|
||||
fluxer_screen_frame_bus = {path = "../screen-frame-bus"}
|
||||
fluxer_encoder_ring = {path = "../encoder-ring"}
|
||||
parking_lot = "0.12"
|
||||
@@ -53,4 +53,4 @@ windows-sys = {version = "0.61.2", features = [
|
||||
]}
|
||||
|
||||
[build-dependencies]
|
||||
napi-build = "2.3.2"
|
||||
napi-build = "2.4.3"
|
||||
@@ -194,113 +194,103 @@ describe('win-game-capture loader wrapper -- binding-absent fallback path', () =
|
||||
if (hasBindingHook) winGameCapture.__setBindingForTests(null);
|
||||
}
|
||||
|
||||
test(
|
||||
'isSupported() is false when no binding is loaded',
|
||||
{skip: hasBindingHook ? false : 'no __setBindingForTests hook'},
|
||||
() => {
|
||||
forceNoBinding();
|
||||
assert.equal(winGameCapture.isSupported(), false);
|
||||
},
|
||||
);
|
||||
test('isSupported() is false when no binding is loaded', {
|
||||
skip: hasBindingHook ? false : 'no __setBindingForTests hook',
|
||||
}, () => {
|
||||
forceNoBinding();
|
||||
assert.equal(winGameCapture.isSupported(), false);
|
||||
});
|
||||
|
||||
test(
|
||||
'getAvailability() returns the {available:false, ...} shape when no binding is loaded',
|
||||
{skip: hasBindingHook ? false : 'no __setBindingForTests hook'},
|
||||
() => {
|
||||
forceNoBinding();
|
||||
const availability = winGameCapture.getAvailability();
|
||||
assert.equal(availability.available, false);
|
||||
assert.equal(availability.backend, 'windows-game-capture');
|
||||
assert.equal(typeof availability.reason, 'string');
|
||||
},
|
||||
);
|
||||
test('getAvailability() returns the {available:false, ...} shape when no binding is loaded', {
|
||||
skip: hasBindingHook ? false : 'no __setBindingForTests hook',
|
||||
}, () => {
|
||||
forceNoBinding();
|
||||
const availability = winGameCapture.getAvailability();
|
||||
assert.equal(availability.available, false);
|
||||
assert.equal(availability.backend, 'windows-game-capture');
|
||||
assert.equal(typeof availability.reason, 'string');
|
||||
});
|
||||
|
||||
test(
|
||||
'constructing ScreenCapture without a binding throws',
|
||||
{skip: hasBindingHook ? false : 'no __setBindingForTests hook'},
|
||||
() => {
|
||||
forceNoBinding();
|
||||
assert.throws(() => new winGameCapture.ScreenCapture({sourceId: '1'}));
|
||||
try {
|
||||
new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
assert.fail('expected ScreenCapture constructor to throw without a binding');
|
||||
} catch (error) {
|
||||
assert.ok(error instanceof Error);
|
||||
}
|
||||
},
|
||||
);
|
||||
test('constructing ScreenCapture without a binding throws', {
|
||||
skip: hasBindingHook ? false : 'no __setBindingForTests hook',
|
||||
}, () => {
|
||||
forceNoBinding();
|
||||
assert.throws(() => new winGameCapture.ScreenCapture({sourceId: '1'}));
|
||||
try {
|
||||
new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
assert.fail('expected ScreenCapture constructor to throw without a binding');
|
||||
} catch (error) {
|
||||
assert.ok(error instanceof Error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('win-game-capture loader wrapper -- injected fake binding', () => {
|
||||
test(
|
||||
'listSources() forwards sanitized screen/window sources from the native binding',
|
||||
{skip: injectionSkip},
|
||||
async () => {
|
||||
const {binding} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const sources = await winGameCapture.listSources();
|
||||
assert.deepEqual(sources, [
|
||||
{
|
||||
kind: 'screen',
|
||||
id: 'screen:0:0',
|
||||
name: 'Display 1',
|
||||
width: 2560,
|
||||
height: 1440,
|
||||
targetPid: undefined,
|
||||
},
|
||||
{
|
||||
kind: 'window',
|
||||
id: 'window:5050:0',
|
||||
name: 'Fixture',
|
||||
width: 1280,
|
||||
height: 720,
|
||||
targetPid: 4242,
|
||||
},
|
||||
]);
|
||||
},
|
||||
);
|
||||
test('listSources() forwards sanitized screen/window sources from the native binding', {
|
||||
skip: injectionSkip,
|
||||
}, async () => {
|
||||
const {binding} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const sources = await winGameCapture.listSources();
|
||||
assert.deepEqual(sources, [
|
||||
{
|
||||
kind: 'screen',
|
||||
id: 'screen:0:0',
|
||||
name: 'Display 1',
|
||||
width: 2560,
|
||||
height: 1440,
|
||||
targetPid: undefined,
|
||||
},
|
||||
{
|
||||
kind: 'window',
|
||||
id: 'window:5050:0',
|
||||
name: 'Fixture',
|
||||
width: 1280,
|
||||
height: 720,
|
||||
targetPid: 4242,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
test(
|
||||
'start() forwards sourceId/kind/dims/frameRate/captureId and the capture options',
|
||||
{skip: injectionSkip},
|
||||
async () => {
|
||||
const {binding, calls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({
|
||||
sourceId: '987654',
|
||||
sourceKind: 'game',
|
||||
width: 1600,
|
||||
height: 900,
|
||||
frameRate: 60,
|
||||
captureId: 'capture-1',
|
||||
test('start() forwards sourceId/kind/dims/frameRate/captureId and the capture options', {
|
||||
skip: injectionSkip,
|
||||
}, async () => {
|
||||
const {binding, calls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({
|
||||
sourceId: '987654',
|
||||
sourceKind: 'game',
|
||||
width: 1600,
|
||||
height: 900,
|
||||
frameRate: 60,
|
||||
captureId: 'capture-1',
|
||||
colorRange: 'full',
|
||||
colorSpace: 'rec709',
|
||||
showCursorClicks: true,
|
||||
captureRect: {x: 10, y: 20, width: 300, height: 200},
|
||||
});
|
||||
capture.on('error', () => {});
|
||||
const result = await capture.start();
|
||||
assert.equal(calls.length, 1);
|
||||
assert.deepEqual(calls[0], {
|
||||
sourceId: '987654',
|
||||
sourceKind: 'game',
|
||||
width: 1600,
|
||||
height: 900,
|
||||
frameRate: 60,
|
||||
captureId: 'capture-1',
|
||||
captureOptions: {
|
||||
colorRange: 'full',
|
||||
colorSpace: 'rec709',
|
||||
showCursorClicks: true,
|
||||
captureRect: {x: 10, y: 20, width: 300, height: 200},
|
||||
});
|
||||
capture.on('error', () => {});
|
||||
const result = await capture.start();
|
||||
assert.equal(calls.length, 1);
|
||||
assert.deepEqual(calls[0], {
|
||||
sourceId: '987654',
|
||||
sourceKind: 'game',
|
||||
width: 1600,
|
||||
height: 900,
|
||||
frameRate: 60,
|
||||
captureId: 'capture-1',
|
||||
captureOptions: {
|
||||
colorRange: 'full',
|
||||
colorSpace: 'rec709',
|
||||
showCursorClicks: true,
|
||||
captureRect: {x: 10, y: 20, width: 300, height: 200},
|
||||
},
|
||||
});
|
||||
assert.equal(result.pixelFormat, 'bgra');
|
||||
assert.equal(result.width, 1600);
|
||||
assert.equal(result.height, 900);
|
||||
assert.equal(result.frameRate, 60);
|
||||
},
|
||||
);
|
||||
},
|
||||
});
|
||||
assert.equal(result.pixelFormat, 'bgra');
|
||||
assert.equal(result.width, 1600);
|
||||
assert.equal(result.height, 900);
|
||||
assert.equal(result.frameRate, 60);
|
||||
});
|
||||
|
||||
test('native start() takes no hook or injection arguments', {skip: injectionSkip}, async () => {
|
||||
const {binding, calls} = makeFakeBinding();
|
||||
@@ -410,41 +400,37 @@ describe('win-game-capture loader wrapper -- injected fake binding', () => {
|
||||
assert.equal(calls.length, 1);
|
||||
});
|
||||
|
||||
test(
|
||||
'fails before native start when a native frame sink is required but missing',
|
||||
{skip: injectionSkip},
|
||||
async () => {
|
||||
const {binding, calls, frameSinkHandleCalls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({
|
||||
sourceId: '42',
|
||||
sourceKind: 'window',
|
||||
nativeFrameSinkRequired: true,
|
||||
});
|
||||
capture.on('error', () => {});
|
||||
test('fails before native start when a native frame sink is required but missing', {
|
||||
skip: injectionSkip,
|
||||
}, async () => {
|
||||
const {binding, calls, frameSinkHandleCalls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({
|
||||
sourceId: '42',
|
||||
sourceKind: 'window',
|
||||
nativeFrameSinkRequired: true,
|
||||
});
|
||||
capture.on('error', () => {});
|
||||
|
||||
await assert.rejects(() => capture.start(), /native frame sink handle is required/i);
|
||||
assert.deepEqual(frameSinkHandleCalls, []);
|
||||
assert.deepEqual(calls, []);
|
||||
},
|
||||
);
|
||||
await assert.rejects(() => capture.start(), /native frame sink handle is required/i);
|
||||
assert.deepEqual(frameSinkHandleCalls, []);
|
||||
assert.deepEqual(calls, []);
|
||||
});
|
||||
|
||||
test(
|
||||
'game sourceKind starts without a hook path because capture no longer injects',
|
||||
{skip: injectionSkip},
|
||||
async () => {
|
||||
const {binding, calls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({
|
||||
sourceId: '7',
|
||||
sourceKind: 'game',
|
||||
});
|
||||
capture.on('error', () => {});
|
||||
await capture.start();
|
||||
assert.equal(calls.length, 1, 'native start must be called for game capture without a hook');
|
||||
assert.equal(calls[0].sourceKind, 'game');
|
||||
},
|
||||
);
|
||||
test('game sourceKind starts without a hook path because capture no longer injects', {
|
||||
skip: injectionSkip,
|
||||
}, async () => {
|
||||
const {binding, calls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({
|
||||
sourceId: '7',
|
||||
sourceKind: 'game',
|
||||
});
|
||||
capture.on('error', () => {});
|
||||
await capture.start();
|
||||
assert.equal(calls.length, 1, 'native start must be called for game capture without a hook');
|
||||
assert.equal(calls[0].sourceKind, 'game');
|
||||
});
|
||||
|
||||
test('lifecycle "error" emits an Error event', {skip: injectionSkip}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
@@ -489,100 +475,90 @@ describe('win-game-capture loader wrapper -- injected fake binding', () => {
|
||||
assert.equal(closed, 0);
|
||||
});
|
||||
|
||||
test(
|
||||
'non-fatal "diagnostic" lifecycle re-emits as a diagnostic event WITHOUT stopping',
|
||||
{skip: injectionSkip},
|
||||
() => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const diags = [];
|
||||
let closed = 0;
|
||||
capture.on('diagnostic', (message) => diags.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback('diagnostic', 'fell back to CPU readback');
|
||||
assert.deepEqual(diags, ['fell back to CPU readback']);
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
},
|
||||
);
|
||||
test('non-fatal "diagnostic" lifecycle re-emits as a diagnostic event WITHOUT stopping', {
|
||||
skip: injectionSkip,
|
||||
}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const diags = [];
|
||||
let closed = 0;
|
||||
capture.on('diagnostic', (message) => diags.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback('diagnostic', 'fell back to CPU readback');
|
||||
assert.deepEqual(diags, ['fell back to CPU readback']);
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
});
|
||||
|
||||
test(
|
||||
'lifecycle "error" in the real napi [type, message] array shape emits an Error event',
|
||||
{skip: injectionSkip},
|
||||
() => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const errors = [];
|
||||
capture.on('error', (err) => errors.push(err));
|
||||
natives[0].lifecycleCallback(['error', 'DXGI device removed']);
|
||||
assert.equal(errors.length, 1);
|
||||
assert.ok(errors[0] instanceof Error);
|
||||
assert.equal(errors[0].message, 'DXGI device removed');
|
||||
},
|
||||
);
|
||||
test('lifecycle "error" in the real napi [type, message] array shape emits an Error event', {
|
||||
skip: injectionSkip,
|
||||
}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const errors = [];
|
||||
capture.on('error', (err) => errors.push(err));
|
||||
natives[0].lifecycleCallback(['error', 'DXGI device removed']);
|
||||
assert.equal(errors.length, 1);
|
||||
assert.ok(errors[0] instanceof Error);
|
||||
assert.equal(errors[0].message, 'DXGI device removed');
|
||||
});
|
||||
|
||||
test(
|
||||
'lifecycle "closed" in the napi array shape stops the native capture and emits closed once',
|
||||
{skip: injectionSkip},
|
||||
async () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
let closed = 0;
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback(['closed', '']);
|
||||
await Promise.resolve();
|
||||
await capture.stop();
|
||||
assert.equal(closed, 1);
|
||||
assert.equal(natives[0].stopCount, 1);
|
||||
},
|
||||
);
|
||||
test('lifecycle "closed" in the napi array shape stops the native capture and emits closed once', {
|
||||
skip: injectionSkip,
|
||||
}, async () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
let closed = 0;
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback(['closed', '']);
|
||||
await Promise.resolve();
|
||||
await capture.stop();
|
||||
assert.equal(closed, 1);
|
||||
assert.equal(natives[0].stopCount, 1);
|
||||
});
|
||||
|
||||
test(
|
||||
'lifecycle "stalled" in the napi array shape re-emits as a stalled event WITHOUT stopping',
|
||||
{skip: injectionSkip},
|
||||
() => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const stalls = [];
|
||||
let closed = 0;
|
||||
capture.on('stalled', (message) => stalls.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback(['stalled', 'frame counter frozen while focused']);
|
||||
assert.deepEqual(stalls, ['frame counter frozen while focused']);
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
},
|
||||
);
|
||||
test('lifecycle "stalled" in the napi array shape re-emits as a stalled event WITHOUT stopping', {
|
||||
skip: injectionSkip,
|
||||
}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const stalls = [];
|
||||
let closed = 0;
|
||||
capture.on('stalled', (message) => stalls.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback(['stalled', 'frame counter frozen while focused']);
|
||||
assert.deepEqual(stalls, ['frame counter frozen while focused']);
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
});
|
||||
|
||||
test(
|
||||
'lifecycle "diagnostic" (injected via <method>) in the napi array shape re-emits WITHOUT stopping',
|
||||
{skip: injectionSkip},
|
||||
() => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const diags = [];
|
||||
let closed = 0;
|
||||
capture.on('diagnostic', (message) => diags.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback(['diagnostic', 'game capture injected via set-windows-hook']);
|
||||
assert.deepEqual(diags, ['game capture injected via set-windows-hook']);
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
},
|
||||
);
|
||||
test('lifecycle "diagnostic" (injected via <method>) in the napi array shape re-emits WITHOUT stopping', {
|
||||
skip: injectionSkip,
|
||||
}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const diags = [];
|
||||
let closed = 0;
|
||||
capture.on('diagnostic', (message) => diags.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback(['diagnostic', 'game capture injected via set-windows-hook']);
|
||||
assert.deepEqual(diags, ['game capture injected via set-windows-hook']);
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
});
|
||||
|
||||
test('getDiagnostics() passes the native snapshot through', {skip: injectionSkip}, () => {
|
||||
const {binding, diagnostics} = makeFakeBinding();
|
||||
@@ -624,16 +600,14 @@ describe('win-game-capture loader wrapper -- injected fake binding', () => {
|
||||
assert.deepEqual(priorityCalls, [{type: 'elevate', processId: 1234, priorityClass: undefined}]);
|
||||
});
|
||||
|
||||
test(
|
||||
'elevateGpuSchedulingPriority rejects unsupported priority classes before binding calls',
|
||||
{skip: injectionSkip},
|
||||
() => {
|
||||
const {binding, priorityCalls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
assert.equal(winGameCapture.elevateGpuSchedulingPriority(1234, 'normal'), false);
|
||||
assert.deepEqual(priorityCalls, []);
|
||||
},
|
||||
);
|
||||
test('elevateGpuSchedulingPriority rejects unsupported priority classes before binding calls', {
|
||||
skip: injectionSkip,
|
||||
}, () => {
|
||||
const {binding, priorityCalls} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
assert.equal(winGameCapture.elevateGpuSchedulingPriority(1234, 'normal'), false);
|
||||
assert.deepEqual(priorityCalls, []);
|
||||
});
|
||||
|
||||
test('lifecycle fallback "error" (next-strategy=...) re-emits as a fatal error event', {skip: injectionSkip}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
@@ -650,29 +624,27 @@ describe('win-game-capture loader wrapper -- injected fake binding', () => {
|
||||
assert.equal(winGameCapture.parseFallbackRecommendation(errors[0].message), 'dxgi-duplication');
|
||||
});
|
||||
|
||||
test(
|
||||
'lifecycle fallback "diagnostic" (upgrade, next-strategy=...) re-emits WITHOUT stopping',
|
||||
{skip: injectionSkip},
|
||||
() => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const diags = [];
|
||||
let closed = 0;
|
||||
capture.on('diagnostic', (message) => diags.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback([
|
||||
'diagnostic',
|
||||
'upgrade: window-gdi -> dxgi-duplication (window-gdi has been stable) [next-strategy=dxgi-duplication]',
|
||||
]);
|
||||
assert.equal(diags.length, 1);
|
||||
assert.equal(winGameCapture.parseFallbackRecommendation(diags[0]), 'dxgi-duplication');
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
},
|
||||
);
|
||||
test('lifecycle fallback "diagnostic" (upgrade, next-strategy=...) re-emits WITHOUT stopping', {
|
||||
skip: injectionSkip,
|
||||
}, () => {
|
||||
const {binding, natives} = makeFakeBinding();
|
||||
winGameCapture.__setBindingForTests(binding);
|
||||
const capture = new winGameCapture.ScreenCapture({sourceId: '1'});
|
||||
const diags = [];
|
||||
let closed = 0;
|
||||
capture.on('diagnostic', (message) => diags.push(message));
|
||||
capture.on('closed', () => {
|
||||
closed += 1;
|
||||
});
|
||||
natives[0].lifecycleCallback([
|
||||
'diagnostic',
|
||||
'upgrade: window-gdi -> dxgi-duplication (window-gdi has been stable) [next-strategy=dxgi-duplication]',
|
||||
]);
|
||||
assert.equal(diags.length, 1);
|
||||
assert.equal(winGameCapture.parseFallbackRecommendation(diags[0]), 'dxgi-duplication');
|
||||
assert.equal(natives[0].stopCount, 0);
|
||||
assert.equal(closed, 0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('win-game-capture loader wrapper -- parseFallbackRecommendation', () => {
|
||||
|
||||
Reference in new issue
Block a user