mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-12 11:34:01 +00:00
Compare commits
921
Commits
appimage_kms
...
SDL3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
231a67946d | ||
|
|
5290305944 | ||
|
|
3a22a01aef | ||
|
|
d1f3b98a1f | ||
|
|
a37020b974 | ||
|
|
13b2b28c2f | ||
|
|
dd2a99a96b | ||
|
|
edd7a134d8 | ||
|
|
ffa87c5f01 | ||
|
|
15e337fff8 | ||
|
|
707dd3cb83 | ||
|
|
98f6a09991 | ||
|
|
103f988dbf | ||
|
|
2257cb0cef | ||
|
|
b6a3369243 | ||
|
|
4af9623727 | ||
|
|
515db03fe5 | ||
|
|
e44d097683 | ||
|
|
9936085aee | ||
|
|
3279d9c3f6 | ||
|
|
3531fe0a4f | ||
|
|
6ce02616f0 | ||
|
|
13880353d8 | ||
|
|
ec69dad8d7 | ||
|
|
72ae324d71 | ||
|
|
901cbd255c | ||
|
|
2a63ad53d7 | ||
|
|
9b3d4c1ad7 | ||
|
|
054e334066 | ||
|
|
6d023c2dfa | ||
|
|
0e2d5bf441 | ||
|
|
023b6b2772 | ||
|
|
6f39d120cb | ||
|
|
9cf305865b | ||
|
|
6b11f43302 | ||
|
|
5a1ef55767 | ||
|
|
76deafbd7b | ||
|
|
f786e94c7b | ||
|
|
1caee721e8 | ||
|
|
accd30176f | ||
|
|
7721fa6d7c | ||
|
|
8e295aab00 | ||
|
|
4838a75c58 | ||
|
|
c5ec8c0fdb | ||
|
|
b266f61ba6 | ||
|
|
d1dffdc34c | ||
|
|
268f8db26b | ||
|
|
de28eda266 | ||
|
|
3e9e497203 | ||
|
|
96fb6ee5e9 | ||
|
|
02853e74ba | ||
|
|
46910cf774 | ||
|
|
b1c77ff80e | ||
|
|
92ee4a3046 | ||
|
|
6ec0c79899 | ||
|
|
1c281ee3fc | ||
|
|
e2b7cbfe62 | ||
|
|
67e89d9e16 | ||
|
|
bbf6d9722a | ||
|
|
34549864ad | ||
|
|
1303a700e0 | ||
|
|
25132a1f7b | ||
|
|
7074463d0f | ||
|
|
99311403fa | ||
|
|
8b50eea485 | ||
|
|
302dca6c0c | ||
|
|
f756be87ff | ||
|
|
9d99ecbca6 | ||
|
|
1475bdfbba | ||
|
|
69a3406d4a | ||
|
|
7e17d82ee5 | ||
|
|
153db55519 | ||
|
|
4290a54ffa | ||
|
|
a6e549471c | ||
|
|
04edfdc4ca | ||
|
|
db30faf602 | ||
|
|
cdb610f121 | ||
|
|
e404722e7c | ||
|
|
1840c47751 | ||
|
|
3bd571bc90 | ||
|
|
224153e230 | ||
|
|
ef12850867 | ||
|
|
caf322d934 | ||
|
|
9043e8f663 | ||
|
|
76fd502262 | ||
|
|
9186feca80 | ||
|
|
df814fef4a | ||
|
|
d2b3bc962f | ||
|
|
876375f7e9 | ||
|
|
e662e93a53 | ||
|
|
7c6954b5f6 | ||
|
|
416003248b | ||
|
|
6d6cd6fc35 | ||
|
|
17448c02b0 | ||
|
|
f3a75e8e76 | ||
|
|
7da085480c | ||
|
|
bed3a6ecd8 | ||
|
|
e01c42153c | ||
|
|
9df65cb814 | ||
|
|
fddb4881fb | ||
|
|
5765c254cd | ||
|
|
ea724a05a6 | ||
|
|
369f614b59 | ||
|
|
8606b2c95e | ||
|
|
fafddddfe0 | ||
|
|
1bb16be183 | ||
|
|
8e2aa87c4f | ||
|
|
2aea070d93 | ||
|
|
37ace0060e | ||
|
|
28b4272123 | ||
|
|
19660174b7 | ||
|
|
2beaf10ea5 | ||
|
|
665352ec95 | ||
|
|
ab791cf4c8 | ||
|
|
ef7dff32aa | ||
|
|
9227ebfec9 | ||
|
|
f138827cdf | ||
|
|
e25919e0f9 | ||
|
|
99749d4730 | ||
|
|
9e811f54f1 | ||
|
|
0bb0d27d64 | ||
|
|
ede5ab8671 | ||
|
|
6c6f808365 | ||
|
|
dd9569913b | ||
|
|
778eb07c5f | ||
|
|
e2ffeae3f6 | ||
|
|
eb6d16fdcf | ||
|
|
e548697a36 | ||
|
|
c707dab70a | ||
|
|
da0244c538 | ||
|
|
ff332d45f8 | ||
|
|
9e92c07cb7 | ||
|
|
7f009a4b8e | ||
|
|
8ac378f467 | ||
|
|
82ec773119 | ||
|
|
3580286807 | ||
|
|
e226091c19 | ||
|
|
074b4520e5 | ||
|
|
de30eeaa66 | ||
|
|
fe9282e7d9 | ||
|
|
45ccd1a811 | ||
|
|
52583f5c71 | ||
|
|
952ebcd0d2 | ||
|
|
d5a198b764 | ||
|
|
b5b2731d5f | ||
|
|
d085722911 | ||
|
|
2e29ef8d74 | ||
|
|
34fa7167b1 | ||
|
|
27b173b76b | ||
|
|
d73df12367 | ||
|
|
725e51f9b3 | ||
|
|
0c6689a5b4 | ||
|
|
32115c639e | ||
|
|
17a2548480 | ||
|
|
753deb915f | ||
|
|
7d6f4135d5 | ||
|
|
622ec843ff | ||
|
|
5c18bf1608 | ||
|
|
d184730a82 | ||
|
|
335ed0e8e6 | ||
|
|
0abb9fd7c2 | ||
|
|
1a1ce05959 | ||
|
|
93408386ae | ||
|
|
415b512c75 | ||
|
|
d389f9a6e9 | ||
|
|
ba01558bc5 | ||
|
|
dff02eab7d | ||
|
|
ecfcedad58 | ||
|
|
e76780e105 | ||
|
|
1d1fa0577b | ||
|
|
a9d7c8e495 | ||
|
|
ffdf683597 | ||
|
|
ac0e1098b9 | ||
|
|
35695642d5 | ||
|
|
e458682a23 | ||
|
|
fbe5e6f01f | ||
|
|
52756e7f45 | ||
|
|
0f57abf6f8 | ||
|
|
94943d2865 | ||
|
|
c3bd7edc4e | ||
|
|
b6bb96223d | ||
|
|
f07f3c843a | ||
|
|
7712a2dce4 | ||
|
|
d86e13a3a7 | ||
|
|
3aaa09bb7d | ||
|
|
377abf2155 | ||
|
|
d3219ae24a | ||
|
|
bd60b873ec | ||
|
|
3abf925810 | ||
|
|
d5cbcc8199 | ||
|
|
640ac3f9fe | ||
|
|
83811e2a07 | ||
|
|
31641f5246 | ||
|
|
d7bc735edc | ||
|
|
b59de38e0b | ||
|
|
17af71fe7a | ||
|
|
a0c77d0ad8 | ||
|
|
ec7137e693 | ||
|
|
1b56f28fd4 | ||
|
|
486c46781b | ||
|
|
6397031e46 | ||
|
|
e7a2d9f44d | ||
|
|
ee5d0acc1f | ||
|
|
6a5a69cabd | ||
|
|
cd7391f908 | ||
|
|
d6d28f1afd | ||
|
|
5a6620a9ae | ||
|
|
5a47ddca33 | ||
|
|
b58f021fc8 | ||
|
|
12b93337d1 | ||
|
|
807fc6b31c | ||
|
|
959080aa95 | ||
|
|
18a772aeba | ||
|
|
9bdd17f1c3 | ||
|
|
3d1967bd1e | ||
|
|
469bd32bde | ||
|
|
351b4edf0c | ||
|
|
a0a8b70bc1 | ||
|
|
e07f069222 | ||
|
|
47ccd1e481 | ||
|
|
96fba43186 | ||
|
|
9e7c212c6d | ||
|
|
e67d83e097 | ||
|
|
4474f815af | ||
|
|
e130a15037 | ||
|
|
845ef147c9 | ||
|
|
fb17c15cfd | ||
|
|
bb74cedf59 | ||
|
|
9af6906380 | ||
|
|
c1ae3cceda | ||
|
|
e1e3bd512f | ||
|
|
cf3ff32340 | ||
|
|
2c98deeae3 | ||
|
|
a572681737 | ||
|
|
e78b389bc0 | ||
|
|
83ec929758 | ||
|
|
9117f6565e | ||
|
|
aa33432c81 | ||
|
|
e25d9b0da2 | ||
|
|
0dfa8a7b53 | ||
|
|
85a9f85c54 | ||
|
|
ed68f920f1 | ||
|
|
f9a4498f9b | ||
|
|
4d1acf2e30 | ||
|
|
db4739b82d | ||
|
|
38bf833708 | ||
|
|
364093aef8 | ||
|
|
6d220a9062 | ||
|
|
abec8b3fe1 | ||
|
|
93ed985043 | ||
|
|
23c737cab9 | ||
|
|
cb850f013a | ||
|
|
6bd964a094 | ||
|
|
419c788ab5 | ||
|
|
a412100a11 | ||
|
|
0531666f38 | ||
|
|
c096238998 | ||
|
|
211fec0ff0 | ||
|
|
58e27875ae | ||
|
|
954e6608a1 | ||
|
|
1cd588f25c | ||
|
|
ebfe035a18 | ||
|
|
6f22ed13c1 | ||
|
|
4aa2b8570c | ||
|
|
fe6562e31c | ||
|
|
654e386263 | ||
|
|
76d0eb6b63 | ||
|
|
02d867fe09 | ||
|
|
76ff53f09f | ||
|
|
37d92dee16 | ||
|
|
afbc49e39a | ||
|
|
d1ccd19fcc | ||
|
|
ebe270bec5 | ||
|
|
784234c857 | ||
|
|
6a85996b4a | ||
|
|
c6710f93dc | ||
|
|
5e46c4ec2b | ||
|
|
011feab6ce | ||
|
|
f8c5d3c0ce | ||
|
|
74d452bf35 | ||
|
|
fd2ff61a40 | ||
|
|
8a87a09947 | ||
|
|
cf544a8703 | ||
|
|
0e1190a059 | ||
|
|
f2535f1e6e | ||
|
|
cefa567f95 | ||
|
|
9be782ae8e | ||
|
|
610e07d4bd | ||
|
|
75eb921a04 | ||
|
|
97bd515b11 | ||
|
|
a45695a22a | ||
|
|
0d67fd1ff0 | ||
|
|
a093a0ae59 | ||
|
|
c9ad8ffa69 | ||
|
|
9987914ebb | ||
|
|
fbfd6fb462 | ||
|
|
bec053e3cf | ||
|
|
d364b24378 | ||
|
|
8c67586cd0 | ||
|
|
89a628a0dd | ||
|
|
4fb9681b7f | ||
|
|
c13128ca1d | ||
|
|
ceca83346b | ||
|
|
fc6c51c75a | ||
|
|
161d91acf8 | ||
|
|
06ef10a2ad | ||
|
|
7b29b22192 | ||
|
|
289a7165b3 | ||
|
|
62011c37f4 | ||
|
|
919e44b29b | ||
|
|
32be1b158b | ||
|
|
f635860afd | ||
|
|
3b078f095b | ||
|
|
72fc7ea31a | ||
|
|
f4edd1e63a | ||
|
|
6011384afe | ||
|
|
896456a8ac | ||
|
|
8959ddbeb6 | ||
|
|
767215fce5 | ||
|
|
3ef05f3a35 | ||
|
|
12624bc5c4 | ||
|
|
5bd0dea85d | ||
|
|
80242f2e90 | ||
|
|
cf3e328f9d | ||
|
|
150002d4d4 | ||
|
|
b972a22459 | ||
|
|
db06239018 | ||
|
|
bdc7d53515 | ||
|
|
7f83b79c19 | ||
|
|
47b3aff352 | ||
|
|
679f237c1b | ||
|
|
3d8de56f25 | ||
|
|
801cebbbc7 | ||
|
|
66fb0465c4 | ||
|
|
8bbc9b2c57 | ||
|
|
be7694dd8b | ||
|
|
ce8b24dfa7 | ||
|
|
75ddac54c5 | ||
|
|
b01a83ff39 | ||
|
|
c3e886fbcc | ||
|
|
e20d56041e | ||
|
|
114074bfd8 | ||
|
|
e44e29e7eb | ||
|
|
03663d5552 | ||
|
|
dce2a857f7 | ||
|
|
61f71a318e | ||
|
|
646ce2bf66 | ||
|
|
2bbae90e2c | ||
|
|
bb8e229814 | ||
|
|
9ed8252cc6 | ||
|
|
2cef09471b | ||
|
|
2d15382e31 | ||
|
|
770872238d | ||
|
|
2a05b890d8 | ||
|
|
481f23b6e9 | ||
|
|
4e7107a09e | ||
|
|
0223394725 | ||
|
|
058739321c | ||
|
|
708bec2937 | ||
|
|
c939537c5c | ||
|
|
9497657c83 | ||
|
|
d4050f3a4f | ||
|
|
c74c4ef041 | ||
|
|
d75663052d | ||
|
|
8f2db99406 | ||
|
|
6a58dbb05e | ||
|
|
8aeb976128 | ||
|
|
7d51a4b67d | ||
|
|
f7d412e3bf | ||
|
|
4469c7fae3 | ||
|
|
ee95efc0f1 | ||
|
|
3ddc8ad68a | ||
|
|
333d97160e | ||
|
|
aac5ad3fd0 | ||
|
|
1ef083c952 | ||
|
|
c63b918bb2 | ||
|
|
4dba4ad538 | ||
|
|
83fcad6bd1 | ||
|
|
e08178474d | ||
|
|
f374e88bac | ||
|
|
3cb169ea26 | ||
|
|
58f87e39a9 | ||
|
|
b1c8005d1a | ||
|
|
f8a2e22a18 | ||
|
|
7ea118fbae | ||
|
|
2149024c35 | ||
|
|
f5d71c8c9a | ||
|
|
e108a05895 | ||
|
|
ea8bccd508 | ||
|
|
bca919c48c | ||
|
|
511ffe03b5 | ||
|
|
413993ab6f | ||
|
|
948b9c818a | ||
|
|
cf615ea88d | ||
|
|
2d1e16fe50 | ||
|
|
089c3d3ad3 | ||
|
|
63e3fa6609 | ||
|
|
8a7fa7e559 | ||
|
|
989a90a0f7 | ||
|
|
a707720577 | ||
|
|
eef270de26 | ||
|
|
0ac765bc32 | ||
|
|
e76551cb64 | ||
|
|
4fd902a0d3 | ||
|
|
9cba449092 | ||
|
|
905b2ecf9e | ||
|
|
53c2c612c9 | ||
|
|
8ffadde9cc | ||
|
|
f569bf633c | ||
|
|
6eb5e07007 | ||
|
|
f07201baa9 | ||
|
|
9120fd01a8 | ||
|
|
c14cc70a6a | ||
|
|
a66f91ae3c | ||
|
|
7e4fddbe62 | ||
|
|
0ff9f8c55a | ||
|
|
6f710faa8e | ||
|
|
2127e1d90b | ||
|
|
9d73aa6b4a | ||
|
|
a2f23b7053 | ||
|
|
5974980aff | ||
|
|
6fa53691aa | ||
|
|
49e0679864 | ||
|
|
0976bc39b3 | ||
|
|
facd6e4e56 | ||
|
|
d2dc0aa1b1 | ||
|
|
aa74e6930b | ||
|
|
b7811bf196 | ||
|
|
18130fd8de | ||
|
|
b6d4f97e96 | ||
|
|
0dd0112518 | ||
|
|
5711e6064e | ||
|
|
517b684f85 | ||
|
|
39465f6d8a | ||
|
|
738813cbac | ||
|
|
c2778e040a | ||
|
|
1efdeeb9dc | ||
|
|
b01dfea343 | ||
|
|
e143293e91 | ||
|
|
f420dc740a | ||
|
|
2e532224b7 | ||
|
|
cb8366a7e5 | ||
|
|
fee54a9d76 | ||
|
|
dc556d3c9b | ||
|
|
4fed3802aa | ||
|
|
f7bb4611e9 | ||
|
|
57791eec62 | ||
|
|
e1e3d8e710 | ||
|
|
654be492a0 | ||
|
|
1df0da4d4a | ||
|
|
1dd6cdb567 | ||
|
|
edfb3cfdc8 | ||
|
|
c6a8f44640 | ||
|
|
b7301d4415 | ||
|
|
4d668702b5 | ||
|
|
f4b0f4d78f | ||
|
|
7100262e09 | ||
|
|
e516943d53 | ||
|
|
fd41226cdd | ||
|
|
47b04eee3e | ||
|
|
24ee6f96e1 | ||
|
|
6e34c21175 | ||
|
|
64789ea8bc | ||
|
|
2ac7176787 | ||
|
|
b968886594 | ||
|
|
2f9c44103b | ||
|
|
e9ed4940cd | ||
|
|
85b5845ebb | ||
|
|
6f4db913aa | ||
|
|
2d20c711a6 | ||
|
|
2e829bc85f | ||
|
|
acddc3cabd | ||
|
|
a16647f16c | ||
|
|
3e3f384218 | ||
|
|
45a98a391a | ||
|
|
c9992201ce | ||
|
|
80062d262e | ||
|
|
652f7a7710 | ||
|
|
7e7e50ada2 | ||
|
|
87eba9bb89 | ||
|
|
da1fcd49fc | ||
|
|
c98289a9e7 | ||
|
|
1d0b65f798 | ||
|
|
3094185cd6 | ||
|
|
aaff04167b | ||
|
|
21bba02e6f | ||
|
|
f60e724167 | ||
|
|
7551e90899 | ||
|
|
715429c13c | ||
|
|
7976189d56 | ||
|
|
47d1eff45d | ||
|
|
073df32b01 | ||
|
|
e8ec7efa5c | ||
|
|
f08cdae2b4 | ||
|
|
1389d29d8c | ||
|
|
d4bfde7906 | ||
|
|
fe73c36958 | ||
|
|
a97f6d90f4 | ||
|
|
0735f164a8 | ||
|
|
9de0c215ba | ||
|
|
56474822f7 | ||
|
|
98b18d89eb | ||
|
|
78ea79b95a | ||
|
|
acbe503c12 | ||
|
|
0261c41574 | ||
|
|
c8182dfab3 | ||
|
|
2eee9c019f | ||
|
|
9ed40b5d9f | ||
|
|
ebc4c71c72 | ||
|
|
dec5a6370e | ||
|
|
519858b708 | ||
|
|
8fcc4cf7fe | ||
|
|
2f78350696 | ||
|
|
85d4037a89 | ||
|
|
d165bf7498 | ||
|
|
94d821a4a9 | ||
|
|
6a854f7a64 | ||
|
|
d76675f4b1 | ||
|
|
4a7e43ccb6 | ||
|
|
b53333d1ba | ||
|
|
f1f3c8bfb9 | ||
|
|
e580e7c672 | ||
|
|
a62fd96269 | ||
|
|
a1d592bb87 | ||
|
|
83f5f6cefc | ||
|
|
9166e70524 | ||
|
|
41f8fa95fe | ||
|
|
b140c21ed9 | ||
|
|
863712cb6e | ||
|
|
43f0aa7f06 | ||
|
|
12535d8142 | ||
|
|
8cf6a8bc98 | ||
|
|
7073dd26de | ||
|
|
66bfd2fad8 | ||
|
|
bb444f306a | ||
|
|
626fba4a8f | ||
|
|
9dc96bda58 | ||
|
|
1a2f1ed620 | ||
|
|
50255dd896 | ||
|
|
c8b9fda258 | ||
|
|
bb41732e59 | ||
|
|
7d9b984747 | ||
|
|
7404e5fce2 | ||
|
|
dc5414bd0d | ||
|
|
d147d36867 | ||
|
|
7763ec3c5c | ||
|
|
c61083ccd9 | ||
|
|
841aeccd6b | ||
|
|
bfcd373eec | ||
|
|
202ef41894 | ||
|
|
f112edc3c3 | ||
|
|
05fd7b18b9 | ||
|
|
9764174070 | ||
|
|
6b0370f0bc | ||
|
|
2e4313e7c3 | ||
|
|
2684d1874a | ||
|
|
882539a700 | ||
|
|
42960b7bf1 | ||
|
|
333f978186 | ||
|
|
e7e9df3261 | ||
|
|
24dbc96fe5 | ||
|
|
abc391f32a | ||
|
|
a589e8e3de | ||
|
|
39fa9a91b8 | ||
|
|
e10d98fb79 | ||
|
|
d17cdbda93 | ||
|
|
2252abefbf | ||
|
|
ce60a146dc | ||
|
|
cd4a6f3e17 | ||
|
|
fc5e1ed5d8 | ||
|
|
d70b98075e | ||
|
|
a4d9952061 | ||
|
|
45e4dfe09c | ||
|
|
34ba9063ad | ||
|
|
d5e2d59fe9 | ||
|
|
d39bdb28d6 | ||
|
|
8bf5622d21 | ||
|
|
9cafd5e099 | ||
|
|
d1b3bfd700 | ||
|
|
e60caf06f9 | ||
|
|
a243c6bb90 | ||
|
|
10523a7e27 | ||
|
|
ea06ec0133 | ||
|
|
e287ebcded | ||
|
|
2ee90289a1 | ||
|
|
193df861d1 | ||
|
|
9055496a19 | ||
|
|
5424576f73 | ||
|
|
a81c6a1c5e | ||
|
|
53a572a4a4 | ||
|
|
df283d80c6 | ||
|
|
b6d203b6dd | ||
|
|
ef988cc8af | ||
|
|
ba46905243 | ||
|
|
df0c4c8208 | ||
|
|
e5aaa1fc53 | ||
|
|
8b6df34d8b | ||
|
|
7a719aa886 | ||
|
|
9af58af5e4 | ||
|
|
b945c8c2dc | ||
|
|
2165f56aee | ||
|
|
e42de9d155 | ||
|
|
7fd95b9de2 | ||
|
|
a42c85802e | ||
|
|
cb3730100d | ||
|
|
7a04d2ad2c | ||
|
|
1f93976919 | ||
|
|
0b7505f109 | ||
|
|
392ca2d8b7 | ||
|
|
68daa90b7e | ||
|
|
fb39ad896e | ||
|
|
cb199054e3 | ||
|
|
7cf77211b0 | ||
|
|
a3d1e9a117 | ||
|
|
755c7c9895 | ||
|
|
45b5136233 | ||
|
|
f16b5cd337 | ||
|
|
21cda8141d | ||
|
|
90f26dfa45 | ||
|
|
ba507d8046 | ||
|
|
5639bcc0f5 | ||
|
|
4cd030582d | ||
|
|
7908076b39 | ||
|
|
ca91f9b702 | ||
|
|
0e86af1c9b | ||
|
|
c5ad84e2ee | ||
|
|
bfb5d6e8fe | ||
|
|
d63b0b5978 | ||
|
|
5e6b60bae0 | ||
|
|
65b6885c61 | ||
|
|
e8ceaa4085 | ||
|
|
db2b120b68 | ||
|
|
5f315d0093 | ||
|
|
016b212ff7 | ||
|
|
bccffe09e2 | ||
|
|
a0365c8e1c | ||
|
|
38156c9f7f | ||
|
|
640db09a64 | ||
|
|
5baa8c680a | ||
|
|
e1c4a488ed | ||
|
|
332d4433c4 | ||
|
|
f5d535b1ef | ||
|
|
35e226273c | ||
|
|
90e25e60d6 | ||
|
|
80659160d3 | ||
|
|
5de29928cd | ||
|
|
c65cea0f66 | ||
|
|
b3cfdbb835 | ||
|
|
9c15cceee7 | ||
|
|
8a0142bd0f | ||
|
|
3d6e05d8c0 | ||
|
|
ddf0e6a935 | ||
|
|
51852f044e | ||
|
|
17cad6b3ca | ||
|
|
8912869077 | ||
|
|
a2697634ba | ||
|
|
1bfb798107 | ||
|
|
cf60568f53 | ||
|
|
ddd18fdaf6 | ||
|
|
b04bb30930 | ||
|
|
e41aaf980b | ||
|
|
46df6601a1 | ||
|
|
5eb8b97469 | ||
|
|
8cd0536fb1 | ||
|
|
99a6789720 | ||
|
|
92670cc051 | ||
|
|
89cbbfc291 | ||
|
|
31869a7da2 | ||
|
|
68c6d6c932 | ||
|
|
e4e140fa53 | ||
|
|
b9709d0825 | ||
|
|
324e3dffa0 | ||
|
|
dd9de3fcb4 | ||
|
|
6710d0561a | ||
|
|
a30f97db0d | ||
|
|
cae666b834 | ||
|
|
5970ca49e9 | ||
|
|
6ae6218043 | ||
|
|
8e3e19a7f7 | ||
|
|
e3d51fd7f7 | ||
|
|
95f5c1d104 | ||
|
|
02a14069a3 | ||
|
|
394f28339e | ||
|
|
411998d4e3 | ||
|
|
371906445e | ||
|
|
34d91e58c0 | ||
|
|
f3f25bec7a | ||
|
|
08d74bea75 | ||
|
|
63f917b317 | ||
|
|
448633ec3c | ||
|
|
09ce3c9ce4 | ||
|
|
8fcc98102b | ||
|
|
e14075b464 | ||
|
|
ca89d14ec8 | ||
|
|
3f51998065 | ||
|
|
6e5b6a1a5c | ||
|
|
660f6c5bbf | ||
|
|
5034bd72ed | ||
|
|
5b7c144796 | ||
|
|
e45b6b9b85 | ||
|
|
245f242fb8 | ||
|
|
a6fccf93d1 | ||
|
|
3dcab90752 | ||
|
|
30a5f405f5 | ||
|
|
bad1c9628e | ||
|
|
1ab7bca43f | ||
|
|
7d0a53773c | ||
|
|
789236ee8f | ||
|
|
21cba0b080 | ||
|
|
31eb0891e5 | ||
|
|
a13f8e7937 | ||
|
|
5bfe56472f | ||
|
|
16a9ed682e | ||
|
|
59cae610d2 | ||
|
|
29ac7893d7 | ||
|
|
c8aeca8ace | ||
|
|
3da505c4c6 | ||
|
|
06bc05b708 | ||
|
|
a3dc9593c2 | ||
|
|
18a271a0ec | ||
|
|
cebd3bf751 | ||
|
|
cb04925c6e | ||
|
|
b7a340bd00 | ||
|
|
2a0f837120 | ||
|
|
d00bdff495 | ||
|
|
7e9c977b3d | ||
|
|
1629151528 | ||
|
|
24295197bd | ||
|
|
807dd84daa | ||
|
|
17848c097c | ||
|
|
563b760d31 | ||
|
|
8465a27a97 | ||
|
|
255cbd1e7e | ||
|
|
7717749b72 | ||
|
|
9e4337babf | ||
|
|
6771877a84 | ||
|
|
a860bd8dd5 | ||
|
|
704ce4ff0c | ||
|
|
21edcc8113 | ||
|
|
125738f13d | ||
|
|
02c781b8f4 | ||
|
|
453fe6aea0 | ||
|
|
e0fb7dfd14 | ||
|
|
c4012225c2 | ||
|
|
1750243537 | ||
|
|
84fc5f3008 | ||
|
|
8a224fbae4 | ||
|
|
e6c4332445 | ||
|
|
0928d1fab2 | ||
|
|
40dd588bef | ||
|
|
472e8ee92e | ||
|
|
c55af7fff3 | ||
|
|
7a39daf179 | ||
|
|
8d087ba5b1 | ||
|
|
c7a30d8728 | ||
|
|
1f678cafba | ||
|
|
579e0bc464 | ||
|
|
7f36dc5aad | ||
|
|
a7c2026128 | ||
|
|
7b0d67ebbe | ||
|
|
63f0910eac | ||
|
|
b16cf9fcc5 | ||
|
|
5501d7bc6b | ||
|
|
413ef42a34 | ||
|
|
a1694ab951 | ||
|
|
fbbbd5e0b8 | ||
|
|
f8c7e2ee41 | ||
|
|
2a4af0bc2c | ||
|
|
d24db13e9d | ||
|
|
bc68aad67b | ||
|
|
9e8a4cab7b | ||
|
|
3679964cf8 | ||
|
|
225ec1a87f | ||
|
|
071c76c06a | ||
|
|
d77a255721 | ||
|
|
26ee1aee25 | ||
|
|
b047395938 | ||
|
|
483a601867 | ||
|
|
c4bc2f6adf | ||
|
|
439e8fe33f | ||
|
|
99885f5b4b | ||
|
|
78b522ec1d | ||
|
|
dbfa5a9358 | ||
|
|
3910b3862a | ||
|
|
3b8e3b7d5c | ||
|
|
6129000dde | ||
|
|
65b274d695 | ||
|
|
a13dd0076b | ||
|
|
cc026c995c | ||
|
|
81cfacaa3d | ||
|
|
fabebc05d2 | ||
|
|
07a97bab03 | ||
|
|
69ac810c82 | ||
|
|
3f4609dc6e | ||
|
|
1ddb529d26 | ||
|
|
ab6b88073c | ||
|
|
ad3ed97472 | ||
|
|
07e902fe95 | ||
|
|
eb781ce689 | ||
|
|
555a65c8ea | ||
|
|
58429f4172 | ||
|
|
e2692a0abd | ||
|
|
d218c43edf | ||
|
|
fae9813127 | ||
|
|
adc56d4ee5 | ||
|
|
f982e33fab | ||
|
|
9ab4479fcf | ||
|
|
3e330b7929 | ||
|
|
ecddada150 | ||
|
|
0c828cbb37 | ||
|
|
84a32f8c16 | ||
|
|
4ee36fd405 | ||
|
|
0802609fd8 | ||
|
|
de88176995 | ||
|
|
aca82f400a | ||
|
|
54bb6fe527 | ||
|
|
c1f663cec1 | ||
|
|
aaf59c2d01 | ||
|
|
692942e5be | ||
|
|
f4acd629a1 | ||
|
|
0ff8a44ec3 | ||
|
|
c6d8f6e618 | ||
|
|
1baa23cc43 | ||
|
|
3be696e6bb | ||
|
|
3cfcb01603 | ||
|
|
d39a29759c | ||
|
|
bf4332b9e7 | ||
|
|
feaae7b684 | ||
|
|
be7852dfc0 | ||
|
|
b0804ce048 | ||
|
|
aa7d5fa924 | ||
|
|
b4cab12e9d | ||
|
|
133dda2de0 | ||
|
|
ef5605ae39 | ||
|
|
9b29b2702e | ||
|
|
abafa270e5 | ||
|
|
15852ccf81 | ||
|
|
a427ecd029 | ||
|
|
77228dcb2c | ||
|
|
3948cfe495 | ||
|
|
36218b54f8 | ||
|
|
be2f4433db | ||
|
|
dd5d36cf07 | ||
|
|
685136d98f | ||
|
|
852937421e | ||
|
|
a5389b7be5 | ||
|
|
1b96b18bc0 | ||
|
|
e9edad6f8c | ||
|
|
f8a6012c3a | ||
|
|
e103f6c9b6 | ||
|
|
9daf7b5a36 | ||
|
|
d6142e1af0 | ||
|
|
b0491210ff | ||
|
|
91d8550290 | ||
|
|
dfaaa7d72a | ||
|
|
5174a4f58a | ||
|
|
b9c73df488 | ||
|
|
f99f1f6441 | ||
|
|
1ec1f5d3be | ||
|
|
713db06a05 | ||
|
|
a0adcbd90b | ||
|
|
b94776421c | ||
|
|
79c1043063 | ||
|
|
cfabae17c0 | ||
|
|
71a1d25e90 | ||
|
|
c2d7b835fb | ||
|
|
f72888ce6f | ||
|
|
30f474d253 | ||
|
|
216f274a92 | ||
|
|
5ea79efe4b | ||
|
|
197c1ba21b | ||
|
|
95c4a24d99 | ||
|
|
f5f23a7c22 | ||
|
|
c469576460 | ||
|
|
0001bb0e4c | ||
|
|
56f184393f | ||
|
|
85777e85fa | ||
|
|
c750ec3cc7 | ||
|
|
c75b781d3f | ||
|
|
8aa42ff1d9 | ||
|
|
63a5bc5e12 | ||
|
|
e0b7b6dc3d | ||
|
|
3d7ecf98c2 | ||
|
|
ad5581c620 | ||
|
|
69af991772 | ||
|
|
2bb2745f91 | ||
|
|
5f682bb45f | ||
|
|
48bcb6b9a6 | ||
|
|
092c0a7392 | ||
|
|
4e8618c512 | ||
|
|
c51a69c0dc | ||
|
|
2480849f39 | ||
|
|
6bfe40607d | ||
|
|
a1c350a537 | ||
|
|
f732b1978e | ||
|
|
d3a542bac4 | ||
|
|
b12724db02 | ||
|
|
f8f5e8e869 | ||
|
|
0733f06103 | ||
|
|
6fdaa6ee8a | ||
|
|
f10b547a49 | ||
|
|
38396b2691 | ||
|
|
220f50ebe4 | ||
|
|
c989133d27 | ||
|
|
6c339551eb | ||
|
|
ef23a80b16 | ||
|
|
a521093731 | ||
|
|
747d3eedf1 | ||
|
|
fd563726f0 | ||
|
|
62136a1a96 | ||
|
|
cf16c31d38 | ||
|
|
0f5d4aa72f | ||
|
|
d8dbe77427 | ||
|
|
0e5670d50d | ||
|
|
22924a1e92 | ||
|
|
dbbb1bd8a1 | ||
|
|
5c838b2fc5 | ||
|
|
3a094d4ba8 | ||
|
|
5d11c1ea6a | ||
|
|
a7e2e15eac | ||
|
|
585a0ca1f4 |
@@ -37,12 +37,13 @@ List the games you've tried that exhibit the issue. To see if the issue is game-
|
||||
- OS: [e.g. Windows 10 1809]
|
||||
- Moonlight Version: [e.g. v0.9.0]
|
||||
- GPU: [e.g. Intel HD Graphics 520]
|
||||
- Linux package type (if applicable): [e.g. Flatpak]
|
||||
|
||||
**Server PC details (please complete the following information)**
|
||||
- OS: [e.g. Windows 10 1809]
|
||||
- GeForce Experience version: [e.g. 3.16.0.140]
|
||||
- Nvidia GPU driver: [e.g. 417.35]
|
||||
- Antivirus and firewall software: [e.g. Windows Defender and Windows Firewall]
|
||||
- Sunshine or GeForce Experience version: [e.g. Sunshine v0.21.0]
|
||||
- GPU: [e.g. AMD Radeon RX 7900 XT]
|
||||
- GPU driver: [e.g. 24.1.1]
|
||||
|
||||
**Moonlight Logs (please attach)**
|
||||
- On Windows, `Moonlight-###.log` files can be found in `%TEMP%`. Simply type that into the File Explorer path field to navigate there.
|
||||
|
||||
@@ -158,17 +158,6 @@ private:
|
||||
L"EZFRD32.dll",
|
||||
L"EZFRD64.dll",
|
||||
|
||||
// These are the newer dList DLLs for Optimus hybrid graphics DDI.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/display/hybrid-system-ddi
|
||||
//
|
||||
// We forcefully block them from loading because Optimus has a bug that
|
||||
// deadlocks DXVA2 when we present with D3DPRESENT_DONOTWAIT. This will prevent
|
||||
// Optimus from ever using the dGPU even if the user has requested it.
|
||||
// https://github.com/moonlight-stream/moonlight-qt/issues/240
|
||||
// https://github.com/moonlight-stream/moonlight-qt/issues/235
|
||||
L"nvdlist.dll",
|
||||
L"nvdlistx.dll",
|
||||
|
||||
// These are the older dList/AppInit DLLs for Optimus hybrid graphics DDI.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/display/hybrid-system-ddi
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Moonlight PC
|
||||
|
||||
[Moonlight PC](https://moonlight-stream.org) is an open source PC client for NVIDIA GameStream, as used by the NVIDIA Shield.
|
||||
[Moonlight PC](https://moonlight-stream.org) is an open source PC client for NVIDIA GameStream and [Sunshine](https://github.com/LizardByte/Sunshine).
|
||||
|
||||
Moonlight also has mobile versions for [Android](https://github.com/moonlight-stream/moonlight-android) and [iOS](https://github.com/moonlight-stream/moonlight-ios).
|
||||
|
||||
@@ -12,53 +12,61 @@ You can follow development on our [Discord server](https://moonlight-stream.org/
|
||||
|
||||
## Features
|
||||
- Hardware accelerated video decoding on Windows, Mac, and Linux
|
||||
- Supports streaming at up to 120 FPS (high refresh rate monitor recommended)
|
||||
- Supports streaming at 720p, 1080p, 1440p, 4K, and the client PC's native screen resolution
|
||||
- H.264, HEVC, and AV1 codec support (AV1 requires Sunshine and a supported host GPU)
|
||||
- YUV 4:4:4 support (Sunshine only)
|
||||
- HDR streaming support
|
||||
- 7.1 surround sound audio support
|
||||
- 10-point multitouch support (Sunshine only)
|
||||
- Gamepad support with force feedback and motion controls for up to 16 players
|
||||
- Support for both pointer capture (for games) and direct mouse control (for remote desktop)
|
||||
- Support for passing system-wide keyboard shortcuts like Alt+Tab to the host
|
||||
- Direct touchscreen mouse control
|
||||
- HEVC support for better image quality at reduced bandwidth
|
||||
- Gamepad support with force feedback for up to 4 players
|
||||
|
||||
## Downloads
|
||||
- [Windows, macOS, and Steam Link](https://github.com/moonlight-stream/moonlight-qt/releases)
|
||||
- [Snap (for Ubuntu-based Linux distros)](https://snapcraft.io/moonlight)
|
||||
- [Flatpak (for other Linux distros)](https://flathub.org/apps/details/com.moonlight_stream.Moonlight)
|
||||
- [AppImage](https://github.com/moonlight-stream/moonlight-qt/releases)
|
||||
- [Raspberry Pi 4](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-Raspberry-Pi-4)
|
||||
- [Raspberry Pi 4 and 5](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-Raspberry-Pi-4)
|
||||
- [Generic ARM 32-bit and 64-bit Debian packages](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-ARM%E2%80%90based-Single-Board-Computers) (not for Raspberry Pi)
|
||||
- [Experimental RISC-V Debian packages](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-RISC%E2%80%90V-Single-Board-Computers)
|
||||
- [NVIDIA Jetson and Nintendo Switch (Ubuntu L4T)](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-Linux4Tegra-(L4T)-Ubuntu)
|
||||
|
||||
#### Special Thanks
|
||||
|
||||
[](https://cloudsmith.com)
|
||||
|
||||
Hosting for Moonlight's Raspberry Pi and L4T package repositories is graciously provided for free by [Cloudsmith](https://cloudsmith.com).
|
||||
Hosting for Moonlight's Debian and L4T package repositories is graciously provided for free by [Cloudsmith](https://cloudsmith.com).
|
||||
|
||||
## Building
|
||||
|
||||
### Windows Build Requirements
|
||||
* Qt 5.15 SDK or later
|
||||
* Windows 7 or later
|
||||
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) (Community edition is fine)
|
||||
* Select **MSVC 2019** option during Qt installation. MinGW is not supported.
|
||||
* Qt 6.7 SDK or later (earlier versions may work but are not officially supported)
|
||||
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) (Community edition is fine)
|
||||
* Select **MSVC** option during Qt installation. MinGW is not supported.
|
||||
* [7-Zip](https://www.7-zip.org/) (only if building installers for non-development PCs)
|
||||
* [WiX Toolset](https://wixtoolset.org/releases/v3-14-0-5722/) v3.14.0.5722 or later (only if building installers for non-development PCs)
|
||||
* Graphics Tools (only if running debug builds)
|
||||
* Install "Graphics Tools" in the Optional Features page of the Windows Settings app.
|
||||
* Alternatively, run `dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0` and reboot.
|
||||
|
||||
### macOS Build Requirements
|
||||
* Qt 6.2 SDK or later
|
||||
* macOS Mojave (10.14) or later
|
||||
* Xcode 13
|
||||
* Qt 6.7 SDK or later (earlier versions may work but are not officially supported)
|
||||
* Xcode 14 or later (earlier versions may work but are not officially supported)
|
||||
* [create-dmg](https://github.com/sindresorhus/create-dmg) (only if building DMGs for use on non-development Macs)
|
||||
|
||||
### Linux/Unix Build Requirements
|
||||
* Qt 5.9 SDK or later
|
||||
* Qt 6 is recommended, but Qt 5.9 or later is also supported (replace `qmake6` with `qmake` when using Qt 5).
|
||||
* GCC or Clang
|
||||
* FFmpeg 4.0 or later
|
||||
* Install the required packages:
|
||||
* Debian/Ubuntu: `libegl1-mesa-dev libgl1-mesa-dev libopus-dev libqt5svg5-dev libsdl2-dev libsdl2-ttf-dev libssl-dev libavcodec-dev libva-dev libvdpau-dev libxkbcommon-dev qt5-default qt5-qmake qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev wayland-protocols qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2`
|
||||
* RedHat/Fedora: `openssl-devel SDL2-devel SDL2_ttf-devel ffmpeg-devel qt5-qtsvg-devel qt5-qtquickcontrols2-devel libva-devel libvdpau-devel opus-devel pulseaudio-libs-devel alsa-lib-devel`
|
||||
* FFmpeg 4.0+ is required to build. If your distro doesn't package FFmpeg 4.0 or later, you can build and install it from source on https://ffmpeg.org/
|
||||
* Debian/Ubuntu:
|
||||
* Base Requirements: `libegl1-mesa-dev libgl1-mesa-dev libopus-dev libsdl2-dev libsdl2-ttf-dev libssl-dev libavcodec-dev libavformat-dev libswscale-dev libva-dev libvdpau-dev libxkbcommon-dev wayland-protocols libdrm-dev`
|
||||
* Qt 6 (Recommended): `qt6-base-dev qt6-declarative-dev libqt6svg6-dev qml6-module-qtquick-controls qml6-module-qtquick-templates qml6-module-qtquick-layouts qml6-module-qtqml-workerscript qml6-module-qtquick-window qml6-module-qtquick`
|
||||
* Qt 5: `qtbase5-dev qt5-qmake qtdeclarative5-dev qtquickcontrols2-5-dev qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2 qtwayland5`
|
||||
* RedHat/Fedora (RPM Fusion repo required):
|
||||
* Base Requirements: `openssl-devel SDL2-devel SDL2_ttf-devel ffmpeg-devel libva-devel libvdpau-devel opus-devel pulseaudio-libs-devel alsa-lib-devel libdrm-devel`
|
||||
* Qt 6 (Recommended): `qt6-qtsvg-devel qt6-qtdeclarative-devel`
|
||||
* Qt 5: `qt5-qtsvg-devel qt5-qtquickcontrols2-devel`
|
||||
* Building the Vulkan renderer requires a `libplacebo-dev`/`libplacebo-devel` version of at least v7.349.0 and FFmpeg 6.1 or later.
|
||||
|
||||
### Steam Link Build Requirements
|
||||
* [Steam Link SDK](https://github.com/ValveSoftware/steamlink-sdk) cloned on your build system
|
||||
@@ -68,16 +76,17 @@ Hosting for Moonlight's Raspberry Pi and L4T package repositories is graciously
|
||||
1. Install the latest Qt SDK (and optionally, the Qt Creator IDE) from https://www.qt.io/download
|
||||
* You can install Qt via Homebrew on macOS, but you will need to use `brew install qt --with-debug` to be able to create debug builds of Moonlight.
|
||||
* You may also use your Linux distro's package manager for the Qt SDK as long as the packages are Qt 5.9 or later.
|
||||
* This step is not required for building on Steam Link, because the Steam Link SDK includes Qt 5.9.
|
||||
* This step is not required for building on Steam Link, because the Steam Link SDK includes Qt 5.14.
|
||||
2. Run `git submodule update --init --recursive` from within `moonlight-qt/`
|
||||
3. Open the project in Qt Creator or build from qmake on the command line.
|
||||
* To build a binary for use on non-development machines, use the scripts in the `scripts` folder.
|
||||
* For Windows builds, use `scripts\build-arch.bat` and `scripts\generate-bundle.bat`. Execute these scripts from the root of the repository within a Qt command prompt. Ensure WiX and 7-Zip binary directories are in your `%PATH%`.
|
||||
* For Windows builds, use `scripts\build-arch.bat` and `scripts\generate-bundle.bat`. Execute these scripts from the root of the repository within a Qt command prompt. Ensure 7-Zip binary directory is on your `%PATH%`.
|
||||
* For macOS builds, use `scripts/generate-dmg.sh`. Execute this script from the root of the repository and ensure Qt's `bin` folder is in your `$PATH`.
|
||||
* For Steam Link builds, run `scripts/build-steamlink-app.sh` from the root of the repository.
|
||||
* To build from the command line for development use, run `qmake moonlight-qt.pro` then `make debug` or `make release`
|
||||
* To create an embedded build for a single-purpose device, use `qmake "CONFIG+=embedded" moonlight-qt.pro` and build normally.
|
||||
* To build from the command line for development use on macOS or Linux, run `qmake6 moonlight-qt.pro` then `make debug` or `make release`
|
||||
* To create an embedded build for a single-purpose device, use `qmake6 "CONFIG+=embedded" moonlight-qt.pro` and build normally.
|
||||
* This build will lack windowed mode, Discord/Help links, and other features that don't make sense on an embedded device.
|
||||
* For platforms with poor GPU performance, add `"CONFIG+=gpuslow"` to prefer direct KMSDRM rendering over GL/Vulkan renderers. Direct KMSDRM rendering can use dedicated YUV/RGB conversion and scaling hardware rather than slower GPU shaders for these operations.
|
||||
|
||||
## Contribute
|
||||
1. Fork us
|
||||
|
||||
+18
-2
@@ -5,7 +5,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Moonlight</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Stream games from your NVIDIA GameStream-enabled PC</string>
|
||||
<string>Stream games and other applications from another PC</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>moonlight</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -17,11 +17,27 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.14</string>
|
||||
<string>11.0.0</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
<true/>
|
||||
<key>GCSupportedGameControllers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>ProfileName</key>
|
||||
<string>ExtendedGamepad</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>GCSupportsControllerUserInteraction</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>Moonlight uses the local network to connect to your gaming PC for streaming.</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>VERSION</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
|
||||
+1
-1
Submodule app/SDL_GameControllerDB updated: 2ab959b3f9...e5a5fa2ac6
@@ -0,0 +1,320 @@
|
||||
#include "SDL_compat.h"
|
||||
|
||||
#include <SDL_syswm.h>
|
||||
|
||||
void* SDLC_Win32_GetHwnd(SDL_Window* window)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_WINDOWS
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_WINDOWS) {
|
||||
return info.info.win.window;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* SDLC_MacOS_GetWindow(SDL_Window* window)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_COCOA) {
|
||||
return info.info.cocoa.window;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* SDLC_X11_GetDisplay(SDL_Window* window)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_X11
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_X11) {
|
||||
return info.info.x11.display;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned long SDLC_X11_GetWindow(SDL_Window* window)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_X11
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_X11) {
|
||||
return info.info.x11.window;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* SDLC_Wayland_GetDisplay(SDL_Window* window)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_WAYLAND
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_WAYLAND) {
|
||||
return info.info.wl.display;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* SDLC_Wayland_GetSurface(SDL_Window* window)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_WAYLAND
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_WAYLAND) {
|
||||
return info.info.wl.surface;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int SDLC_KMSDRM_GetFd(SDL_Window* window)
|
||||
{
|
||||
#if defined(SDL_VIDEO_DRIVER_KMSDRM) && SDL_VERSION_ATLEAST(2, 0, 15)
|
||||
SDL_SysWMinfo info;
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_KMSDRM) {
|
||||
return info.info.kmsdrm.drm_fd;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int SDLC_KMSDRM_GetDevIndex(SDL_Window* window)
|
||||
{
|
||||
#if defined(SDL_VIDEO_DRIVER_KMSDRM) && SDL_VERSION_ATLEAST(2, 0, 15)
|
||||
SDL_SysWMinfo info;
|
||||
SDL_VERSION(&info.version);
|
||||
if (!SDL_GetWindowWMInfo(window, &info)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetWindowWMInfo() failed: %s",
|
||||
SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (info.subsystem == SDL_SYSWM_KMSDRM) {
|
||||
return info.info.kmsdrm.dev_index;
|
||||
}
|
||||
#else
|
||||
(void)window;
|
||||
#endif
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
SDLC_VideoDriver SDLC_GetVideoDriver(void)
|
||||
{
|
||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
||||
return SDLC_VIDEO_WIN32;
|
||||
#elif defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
return SDLC_VIDEO_MACOS;
|
||||
#else
|
||||
const char* videoDriver = SDL_GetCurrentVideoDriver();
|
||||
if (SDL_strcmp(videoDriver, "x11") == 0) {
|
||||
return SDLC_VIDEO_X11;
|
||||
}
|
||||
else if (SDL_strcmp(videoDriver, "wayland") == 0) {
|
||||
return SDLC_VIDEO_WAYLAND;
|
||||
}
|
||||
else if (SDL_strcmp(videoDriver, "kmsdrm") == 0) {
|
||||
return SDLC_VIDEO_KMSDRM;
|
||||
}
|
||||
else {
|
||||
SDL_assert(0);
|
||||
return SDLC_VIDEO_UNKNOWN;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool SDLC_IsFullscreen(SDL_Window* window)
|
||||
{
|
||||
return !!(SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN);
|
||||
}
|
||||
|
||||
bool SDLC_IsFullscreenExclusive(SDL_Window* window)
|
||||
{
|
||||
return (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN;
|
||||
}
|
||||
|
||||
bool SDLC_IsFullscreenDesktop(SDL_Window* window)
|
||||
{
|
||||
return (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
}
|
||||
|
||||
void SDLC_EnterFullscreen(SDL_Window* window, bool exclusive)
|
||||
{
|
||||
SDL_SetWindowFullscreen(window, exclusive ? SDL_WINDOW_FULLSCREEN : SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
}
|
||||
|
||||
void SDLC_LeaveFullscreen(SDL_Window* window)
|
||||
{
|
||||
SDL_SetWindowFullscreen(window, 0);
|
||||
}
|
||||
|
||||
SDL_Window* SDLC_CreateWindowWithFallback(const char *title,
|
||||
int x, int y, int w, int h,
|
||||
Uint32 requiredFlags,
|
||||
Uint32 optionalFlags)
|
||||
{
|
||||
SDL_Window* window = SDL_CreateWindow(title, x, y, w, h, requiredFlags | optionalFlags);
|
||||
if (!window) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Failed to create window with optional flags: %s",
|
||||
SDL_GetError());
|
||||
|
||||
// Try the fallback flags now
|
||||
window = SDL_CreateWindow(title, x, y, w, h, requiredFlags);
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
void SDLC_FlushWindowEvents(void)
|
||||
{
|
||||
SDL_FlushEvent(SDL_WINDOWEVENT);
|
||||
}
|
||||
|
||||
SDL_JoystickID* SDL_GetGamepads(int *count)
|
||||
{
|
||||
int numJoysticks = SDL_NumJoysticks();
|
||||
SDL_JoystickID* ids = SDL_calloc(numJoysticks + 1, sizeof(SDL_JoystickID));
|
||||
|
||||
int numGamepads = 0;
|
||||
for (int i = 0; i < numJoysticks; i++) {
|
||||
if (SDL_IsGameController(i)) {
|
||||
ids[numGamepads++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (count != NULL) {
|
||||
*count = numGamepads;
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
SDL_JoystickID* SDL_GetJoysticks(int *count)
|
||||
{
|
||||
int numJoysticks = SDL_NumJoysticks();
|
||||
SDL_JoystickID* ids = SDL_calloc(numJoysticks + 1, sizeof(SDL_JoystickID));
|
||||
|
||||
for (int i = 0; i < numJoysticks; i++) {
|
||||
ids[i] = i;
|
||||
}
|
||||
|
||||
if (count != NULL) {
|
||||
*count = numJoysticks;
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
SDL_DisplayID * SDL_GetDisplays(int *count)
|
||||
{
|
||||
int numDisplays = SDL_GetNumVideoDisplays();
|
||||
SDL_DisplayID* ids = SDL_calloc(numDisplays + 1, sizeof(SDL_DisplayID));
|
||||
|
||||
for (int i = 0; i < numDisplays; i++) {
|
||||
ids[i] = i;
|
||||
}
|
||||
|
||||
if (count != NULL) {
|
||||
*count = numDisplays;
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
const SDL_DisplayMode * SDL_GetWindowFullscreenMode(SDL_Window *window)
|
||||
{
|
||||
static SDL_DisplayMode mode;
|
||||
|
||||
if (SDL_GetWindowDisplayMode(window, &mode) == 0) {
|
||||
return &mode;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,303 @@
|
||||
//
|
||||
// Compatibility header for older versions of SDL.
|
||||
// Include this instead of SDL.h directly.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <SDL.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// This is a pure C header for compatibility with SDL.h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// These SLDC_* functions and constants are special SDL-like things
|
||||
// used to abstract certain SDL2 vs SDL3 differences.
|
||||
void* SDLC_Win32_GetHwnd(SDL_Window* window);
|
||||
void* SDLC_MacOS_GetWindow(SDL_Window* window);
|
||||
void* SDLC_X11_GetDisplay(SDL_Window* window);
|
||||
unsigned long SDLC_X11_GetWindow(SDL_Window* window);
|
||||
void* SDLC_Wayland_GetDisplay(SDL_Window* window);
|
||||
void* SDLC_Wayland_GetSurface(SDL_Window* window);
|
||||
int SDLC_KMSDRM_GetFd(SDL_Window* window);
|
||||
int SDLC_KMSDRM_GetDevIndex(SDL_Window* window);
|
||||
|
||||
typedef enum {
|
||||
SDLC_VIDEO_UNKNOWN,
|
||||
SDLC_VIDEO_WIN32,
|
||||
SDLC_VIDEO_MACOS,
|
||||
SDLC_VIDEO_X11,
|
||||
SDLC_VIDEO_WAYLAND,
|
||||
SDLC_VIDEO_KMSDRM,
|
||||
} SDLC_VideoDriver;
|
||||
SDLC_VideoDriver SDLC_GetVideoDriver();
|
||||
|
||||
bool SDLC_IsFullscreen(SDL_Window* window);
|
||||
bool SDLC_IsFullscreenExclusive(SDL_Window* window);
|
||||
bool SDLC_IsFullscreenDesktop(SDL_Window* window);
|
||||
void SDLC_EnterFullscreen(SDL_Window* window, bool exclusive);
|
||||
void SDLC_LeaveFullscreen(SDL_Window* window);
|
||||
|
||||
SDL_Window* SDLC_CreateWindowWithFallback(const char *title,
|
||||
int x, int y, int w, int h,
|
||||
Uint32 requiredFlags,
|
||||
Uint32 optionalFlags);
|
||||
|
||||
void SDLC_FlushWindowEvents();
|
||||
|
||||
#define SDLC_SUCCESS(x) ((x) == 0)
|
||||
#define SDLC_FAILURE(x) ((x) != 0)
|
||||
|
||||
// SDL_FRect wasn't added until 2.0.10
|
||||
#if !SDL_VERSION_ATLEAST(2, 0, 10)
|
||||
typedef struct SDL_FRect
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float w;
|
||||
float h;
|
||||
} SDL_FRect;
|
||||
#endif
|
||||
|
||||
#ifndef SDL_THREAD_PRIORITY_TIME_CRITICAL
|
||||
#define SDL_THREAD_PRIORITY_TIME_CRITICAL SDL_THREAD_PRIORITY_HIGH
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_VIDEO_X11_FORCE_EGL
|
||||
#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER
|
||||
#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED
|
||||
#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE
|
||||
#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE
|
||||
#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_WINDOWS_USE_D3D9EX
|
||||
#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS
|
||||
#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_MOUSE_RELATIVE_SCALING
|
||||
#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_AUDIO_DEVICE_APP_NAME
|
||||
#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_APP_NAME
|
||||
#define SDL_HINT_APP_NAME "SDL_APP_NAME"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_MOUSE_AUTO_CAPTURE
|
||||
#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE"
|
||||
#endif
|
||||
|
||||
#ifndef SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP
|
||||
#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"
|
||||
#endif
|
||||
|
||||
// SDL3 renamed hints
|
||||
#define SDL_HINT_VIDEO_FORCE_EGL SDL_HINT_VIDEO_X11_FORCE_EGL
|
||||
|
||||
// Events
|
||||
#define SDL_EVENT_QUIT SDL_QUIT
|
||||
#define SDL_EVENT_CLIPBOARD_UPDATE SDL_CLIPBOARDUPDATE
|
||||
#define SDL_EVENT_GAMEPAD_ADDED SDL_CONTROLLERDEVICEADDED
|
||||
#define SDL_EVENT_GAMEPAD_REMAPPED SDL_CONTROLLERDEVICEREMAPPED
|
||||
#define SDL_EVENT_GAMEPAD_REMOVED SDL_CONTROLLERDEVICEREMOVED
|
||||
#define SDL_EVENT_GAMEPAD_SENSOR_UPDATE SDL_CONTROLLERSENSORUPDATE
|
||||
#define SDL_EVENT_GAMEPAD_BUTTON_DOWN SDL_CONTROLLERBUTTONDOWN
|
||||
#define SDL_EVENT_GAMEPAD_BUTTON_UP SDL_CONTROLLERBUTTONUP
|
||||
#define SDL_EVENT_GAMEPAD_AXIS_MOTION SDL_CONTROLLERAXISMOTION
|
||||
#define SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN SDL_CONTROLLERTOUCHPADDOWN
|
||||
#define SDL_EVENT_GAMEPAD_TOUCHPAD_UP SDL_CONTROLLERTOUCHPADUP
|
||||
#define SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION SDL_CONTROLLERTOUCHPADMOTION
|
||||
#define SDL_EVENT_JOYSTICK_ADDED SDL_JOYDEVICEADDED
|
||||
#define SDL_EVENT_JOYSTICK_REMOVED SDL_JOYDEVICEREMOVED
|
||||
#define SDL_EVENT_JOYSTICK_BATTERY_UPDATED SDL_JOYBATTERYUPDATED
|
||||
#define SDL_EVENT_FINGER_DOWN SDL_FINGERDOWN
|
||||
#define SDL_EVENT_FINGER_MOTION SDL_FINGERMOTION
|
||||
#define SDL_EVENT_FINGER_UP SDL_FINGERUP
|
||||
#define SDL_EVENT_KEY_DOWN SDL_KEYDOWN
|
||||
#define SDL_EVENT_KEY_UP SDL_KEYUP
|
||||
#define SDL_EVENT_MOUSE_BUTTON_DOWN SDL_MOUSEBUTTONDOWN
|
||||
#define SDL_EVENT_MOUSE_BUTTON_UP SDL_MOUSEBUTTONUP
|
||||
#define SDL_EVENT_MOUSE_MOTION SDL_MOUSEMOTION
|
||||
#define SDL_EVENT_MOUSE_WHEEL SDL_MOUSEWHEEL
|
||||
#define SDL_EVENT_RENDER_DEVICE_RESET SDL_RENDER_DEVICE_RESET
|
||||
#define SDL_EVENT_RENDER_TARGETS_RESET SDL_RENDER_TARGETS_RESET
|
||||
#define SDL_EVENT_USER SDL_USEREVENT
|
||||
|
||||
#define SDL_EVENT_WINDOW_FOCUS_GAINED SDL_WINDOWEVENT_FOCUS_GAINED
|
||||
#define SDL_EVENT_WINDOW_FOCUS_LOST SDL_WINDOWEVENT_FOCUS_LOST
|
||||
#define SDL_EVENT_WINDOW_MOUSE_ENTER SDL_WINDOWEVENT_ENTER
|
||||
#define SDL_EVENT_WINDOW_MOUSE_LEAVE SDL_WINDOWEVENT_LEAVE
|
||||
#define SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED SDL_WINDOWEVENT_SIZE_CHANGED
|
||||
#define SDL_EVENT_WINDOW_SHOWN SDL_WINDOWEVENT_SHOWN
|
||||
#define SDL_EVENT_WINDOW_DISPLAY_CHANGED SDL_WINDOWEVENT_DISPLAY_CHANGED
|
||||
|
||||
#define SDL_BUTTON_MASK(x) SDL_BUTTON(x)
|
||||
|
||||
#define gbutton cbutton
|
||||
#define gaxis caxis
|
||||
#define gdevice cdevice
|
||||
#define gsensor csensor
|
||||
#define gtouchpad ctouchpad
|
||||
|
||||
#define fingerID fingerId
|
||||
#define touchID touchId
|
||||
|
||||
#define KEY_DOWN(x) ((x)->state == SDL_PRESSED)
|
||||
#define KEY_KEY(x) ((x)->keysym.sym)
|
||||
#define KEY_MOD(x) ((x)->keysym.mod)
|
||||
#define KEY_SCANCODE(x) ((x)->keysym.scancode)
|
||||
|
||||
// Gamepad
|
||||
#define SDL_INIT_GAMEPAD SDL_INIT_GAMECONTROLLER
|
||||
|
||||
#define SDL_GAMEPAD_BUTTON_SOUTH SDL_CONTROLLER_BUTTON_A
|
||||
#define SDL_GAMEPAD_BUTTON_EAST SDL_CONTROLLER_BUTTON_B
|
||||
#define SDL_GAMEPAD_BUTTON_WEST SDL_CONTROLLER_BUTTON_X
|
||||
#define SDL_GAMEPAD_BUTTON_NORTH SDL_CONTROLLER_BUTTON_Y
|
||||
#define SDL_GAMEPAD_BUTTON_LEFT_SHOULDER SDL_CONTROLLER_BUTTON_LEFTSHOULDER
|
||||
#define SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
|
||||
#define SDL_GAMEPAD_BUTTON_DPAD_UP SDL_CONTROLLER_BUTTON_DPAD_UP
|
||||
#define SDL_GAMEPAD_BUTTON_DPAD_DOWN SDL_CONTROLLER_BUTTON_DPAD_DOWN
|
||||
#define SDL_GAMEPAD_BUTTON_DPAD_LEFT SDL_CONTROLLER_BUTTON_DPAD_LEFT
|
||||
#define SDL_GAMEPAD_BUTTON_DPAD_RIGHT SDL_CONTROLLER_BUTTON_DPAD_RIGHT
|
||||
#define SDL_GAMEPAD_BUTTON_START SDL_CONTROLLER_BUTTON_START
|
||||
#define SDL_GAMEPAD_BUTTON_TOUCHPAD SDL_CONTROLLER_BUTTON_TOUCHPAD
|
||||
|
||||
#define SDL_GAMEPAD_BINDTYPE_AXIS SDL_CONTROLLER_BINDTYPE_AXIS
|
||||
#define SDL_GAMEPAD_BINDTYPE_BUTTON SDL_CONTROLLER_BINDTYPE_BUTTON
|
||||
#define SDL_GAMEPAD_BINDTYPE_HAT SDL_CONTROLLER_BINDTYPE_HAT
|
||||
#define SDL_GAMEPAD_BINDTYPE_NONE SDL_CONTROLLER_BINDTYPE_NONE
|
||||
|
||||
#define SDL_GAMEPAD_AXIS_LEFTX SDL_CONTROLLER_AXIS_LEFTX
|
||||
#define SDL_GAMEPAD_AXIS_LEFTY SDL_CONTROLLER_AXIS_LEFTY
|
||||
#define SDL_GAMEPAD_AXIS_RIGHTX SDL_CONTROLLER_AXIS_RIGHTX
|
||||
#define SDL_GAMEPAD_AXIS_RIGHTY SDL_CONTROLLER_AXIS_RIGHTY
|
||||
#define SDL_GAMEPAD_AXIS_LEFT_TRIGGER SDL_CONTROLLER_AXIS_TRIGGERLEFT
|
||||
#define SDL_GAMEPAD_AXIS_RIGHT_TRIGGER SDL_CONTROLLER_AXIS_TRIGGERRIGHT
|
||||
|
||||
// SDL_OpenGamepad() not defined due to differing semantics
|
||||
SDL_JoystickID* SDL_GetGamepads(int *count);
|
||||
#define SDL_OpenGamepad(x) SDL_GameControllerOpen(x)
|
||||
#define SDL_CloseGamepad(x) SDL_GameControllerClose(x)
|
||||
#define SDL_GetGamepadMapping(x) SDL_GameControllerMapping(x)
|
||||
#define SDL_GetGamepadName(x) SDL_GameControllerName(x)
|
||||
#define SDL_GetGamepadVendor(x) SDL_GameControllerGetVendor(x)
|
||||
#define SDL_GetGamepadProduct(x) SDL_GameControllerGetProduct(x)
|
||||
#define SDL_GetGamepadJoystick(x) SDL_GameControllerGetJoystick(x)
|
||||
#define SDL_GamepadHasButton(x, y) SDL_GameControllerHasButton(x, y)
|
||||
#define SDL_GamepadHasSensor(x, y) SDL_GameControllerHasSensor(x, y)
|
||||
#define SDL_SetGamepadPlayerIndex(x, y) SDL_GameControllerSetPlayerIndex(x, y)
|
||||
#define SDL_GamepadSensorEnabled(x, y) SDL_GameControllerIsSensorEnabled(x, y)
|
||||
#define SDL_SetGamepadSensorEnabled(x, y, z) SDL_GameControllerSetSensorEnabled(x, y, z)
|
||||
#define SDL_GetNumGamepadTouchpads(x) SDL_GameControllerGetNumTouchpads(x)
|
||||
#define SDL_SetGamepadLED(x, r, g, b) SDL_GameControllerSetLED(x, r, g, b)
|
||||
#define SDL_RumbleGamepad(x, y, z, w) SDL_GameControllerRumble(x, y, z, w)
|
||||
#define SDL_RumbleGamepadTriggers(x, y, z, w) SDL_GameControllerRumbleTriggers(x, y, z, w)
|
||||
#define SDL_GetGamepadAxis(x, y) SDL_GameControllerGetAxis(x, y)
|
||||
#define SDL_GetGamepadType(x) SDL_GameControllerGetType(x)
|
||||
#define SDL_IsGamepad(x) SDL_IsGameController(x)
|
||||
|
||||
#define SDL_GAMEPAD_TYPE_STANDARD SDL_CONTROLLER_TYPE_UNKNOWN
|
||||
#define SDL_GAMEPAD_TYPE_VIRTUAL SDL_CONTROLLER_TYPE_VIRTUAL
|
||||
#define SDL_GAMEPAD_TYPE_XBOX360 SDL_CONTROLLER_TYPE_XBOX360
|
||||
#define SDL_GAMEPAD_TYPE_XBOXONE SDL_CONTROLLER_TYPE_XBOXONE
|
||||
#define SDL_GAMEPAD_TYPE_PS3 SDL_CONTROLLER_TYPE_PS3
|
||||
#define SDL_GAMEPAD_TYPE_PS4 SDL_CONTROLLER_TYPE_PS4
|
||||
#define SDL_GAMEPAD_TYPE_PS5 SDL_CONTROLLER_TYPE_PS5
|
||||
#define SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT
|
||||
#define SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
|
||||
#define SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT
|
||||
#define SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO
|
||||
|
||||
// SDL_OpenGamepad() not defined due to differing semantics
|
||||
SDL_JoystickID* SDL_GetJoysticks(int *count);
|
||||
#define SDL_OpenJoystick(x) SDL_JoystickOpen(x)
|
||||
#define SDL_CloseJoystick(x) SDL_JoystickClose(x)
|
||||
#define SDL_GetJoystickID(x) SDL_JoystickInstanceID(x)
|
||||
#define SDL_GetJoystickGUID(x) SDL_JoystickGetGUID(x)
|
||||
#define SDL_GetJoystickPowerLevel(x) SDL_JoystickCurrentPowerLevel(x)
|
||||
#define SDL_GetNumJoystickAxes(x) SDL_JoystickNumAxes(x)
|
||||
#define SDL_GetNumJoystickBalls(x) SDL_JoystickNumBalls(x)
|
||||
#define SDL_GetNumJoystickButtons(x) SDL_JoystickNumButtons(x)
|
||||
#define SDL_GetNumJoystickHats(x) SDL_JoystickNumHats(x)
|
||||
#define SDL_GetJoystickGUIDForID(x) SDL_JoystickGetDeviceGUID(x)
|
||||
|
||||
typedef SDL_ControllerAxisEvent SDL_GamepadAxisEvent;
|
||||
typedef SDL_ControllerButtonEvent SDL_GamepadButtonEvent;
|
||||
typedef SDL_ControllerSensorEvent SDL_GamepadSensorEvent;
|
||||
typedef SDL_ControllerTouchpadEvent SDL_GamepadTouchpadEvent;
|
||||
typedef SDL_ControllerDeviceEvent SDL_GamepadDeviceEvent;
|
||||
typedef SDL_GameController SDL_Gamepad;
|
||||
typedef SDL_GameControllerButton SDL_GamepadButton;
|
||||
|
||||
// Audio
|
||||
#define SDL_AUDIO_F32 AUDIO_F32SYS
|
||||
|
||||
#define SDL_ResumeAudioDevice(x) SDL_PauseAudioDevice(x, 0)
|
||||
|
||||
// Atomics
|
||||
#define SDL_GetAtomicInt(x) SDL_AtomicGet(x)
|
||||
#define SDL_SetAtomicInt(x, y) SDL_AtomicSet(x, y)
|
||||
#define SDL_GetAtomicPointer(x) SDL_AtomicGetPtr(x)
|
||||
#define SDL_SetAtomicPointer(x, y) SDL_AtomicSetPtr(x, y)
|
||||
|
||||
#define SDL_LockSpinlock(x) SDL_AtomicLock(x)
|
||||
#define SDL_TryLockSpinlock(x) SDL_AtomicTryLock(x)
|
||||
#define SDL_UnlockSpinlock(x) SDL_AtomicUnlock(x)
|
||||
|
||||
typedef SDL_atomic_t SDL_AtomicInt;
|
||||
|
||||
// Video
|
||||
#define SDL_KMOD_CTRL KMOD_CTRL
|
||||
#define SDL_KMOD_ALT KMOD_ALT
|
||||
#define SDL_KMOD_SHIFT KMOD_SHIFT
|
||||
#define SDL_KMOD_GUI KMOD_GUI
|
||||
|
||||
#define SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_WINDOW_ALLOW_HIGHDPI
|
||||
|
||||
#define SDL_SetWindowFullscreenMode(x, y) SDL_SetWindowDisplayMode(x, y)
|
||||
#define SDL_GetDisplayForWindow(x) SDL_GetWindowDisplayIndex(x)
|
||||
#define SDL_GetRenderViewport(x, y) SDL_RenderGetViewport(x, y)
|
||||
#define SDL_DestroySurface(x) SDL_FreeSurface(x)
|
||||
#define SDL_RenderTexture(x, y, z, w) SDL_RenderCopy(x, y, z, w)
|
||||
#define SDL_GetPrimaryDisplay() (0)
|
||||
|
||||
#define SDL_CreateSurfaceFrom(w, h, fmt, pixels, pitch) SDL_CreateRGBSurfaceWithFormatFrom(pixels, w, h, SDL_BITSPERPIXEL(fmt), pitch, fmt)
|
||||
|
||||
#define SDLC_DEFAULT_RENDER_DRIVER -1
|
||||
|
||||
typedef int SDL_DisplayID;
|
||||
SDL_DisplayID * SDL_GetDisplays(int *count);
|
||||
const SDL_DisplayMode * SDL_GetWindowFullscreenMode(SDL_Window *window);
|
||||
|
||||
// Misc
|
||||
#define SDL_GetNumLogicalCPUCores() SDL_GetCPUCount()
|
||||
#define SDL_IOFromConstMem(x, y) SDL_RWFromConstMem(x, y)
|
||||
#define SDL_SetCurrentThreadPriority(x) SDL_SetThreadPriority(x)
|
||||
#define SDL_GUIDToString(x, y, z) SDL_JoystickGetGUIDString(x, y, z)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+197
-71
@@ -12,10 +12,13 @@ include(../globaldefs.pri)
|
||||
|
||||
# Precompile QML files to avoid writing qmlcache on portable versions.
|
||||
# Since this binds the app against the Qt runtime version, we will only
|
||||
# do this for Windows and Mac, since they ship with the Qt runtime.
|
||||
win32|macx {
|
||||
CONFIG(release, debug|release) {
|
||||
CONFIG += qtquickcompiler
|
||||
# do this for Windows and Mac (when disable-prebuilts is not defined),
|
||||
# since they always ship with the matching build of the Qt runtime.
|
||||
!disable-prebuilts {
|
||||
win32|macx {
|
||||
CONFIG(release, debug|release) {
|
||||
CONFIG += qtquickcompiler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,85 +51,133 @@ win32 {
|
||||
|
||||
INCLUDEPATH += $$PWD/../libs/windows/include
|
||||
LIBS += ws2_32.lib winmm.lib dxva2.lib ole32.lib gdi32.lib user32.lib d3d9.lib dwmapi.lib dbghelp.lib
|
||||
|
||||
# Work around a conflict with math.h inclusion between SDL and Qt 6
|
||||
DEFINES += _USE_MATH_DEFINES
|
||||
}
|
||||
macx {
|
||||
macx:!disable-prebuilts {
|
||||
INCLUDEPATH += $$PWD/../libs/mac/include
|
||||
INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2.framework/Versions/A/Headers
|
||||
INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2_ttf.framework/Versions/A/Headers
|
||||
LIBS += -L$$PWD/../libs/mac/lib -F$$PWD/../libs/mac/Frameworks
|
||||
|
||||
# QMake doesn't handle framework-style includes correctly on its own
|
||||
QMAKE_CFLAGS += -F$$PWD/../libs/mac/Frameworks
|
||||
QMAKE_CXXFLAGS += -F$$PWD/../libs/mac/Frameworks
|
||||
QMAKE_OBJECTIVE_CFLAGS += -F$$PWD/../libs/mac/Frameworks
|
||||
}
|
||||
|
||||
unix:!macx {
|
||||
unix:if(!macx|disable-prebuilts) {
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += openssl sdl2 SDL2_ttf opus
|
||||
PKGCONFIG += openssl sdl2 SDL2_ttf
|
||||
|
||||
packagesExist(libavcodec) {
|
||||
PKGCONFIG += libavcodec libavutil
|
||||
CONFIG += ffmpeg
|
||||
|
||||
packagesExist(libva) {
|
||||
packagesExist(libva-x11) {
|
||||
CONFIG += libva-x11
|
||||
}
|
||||
packagesExist(libva-wayland) {
|
||||
CONFIG += libva-wayland
|
||||
}
|
||||
packagesExist(libva-drm) {
|
||||
CONFIG += libva-drm
|
||||
}
|
||||
CONFIG += libva
|
||||
}
|
||||
|
||||
packagesExist(vdpau) {
|
||||
CONFIG += libvdpau
|
||||
}
|
||||
|
||||
packagesExist(mmal) {
|
||||
PKGCONFIG += mmal
|
||||
CONFIG += mmal
|
||||
}
|
||||
|
||||
packagesExist(libdrm) {
|
||||
PKGCONFIG += libdrm
|
||||
CONFIG += libdrm
|
||||
}
|
||||
|
||||
packagesExist(ffnvcodec) {
|
||||
PKGCONFIG += ffnvcodec
|
||||
CONFIG += cuda
|
||||
}
|
||||
# We have our own optimized libopus.a for Steam Link
|
||||
if(!config_SL|disable-prebuilts) {
|
||||
PKGCONFIG += opus
|
||||
}
|
||||
|
||||
packagesExist(wayland-client) {
|
||||
DEFINES += HAS_WAYLAND
|
||||
PKGCONFIG += wayland-client
|
||||
}
|
||||
!disable-ffmpeg {
|
||||
packagesExist(libavcodec) {
|
||||
PKGCONFIG += libavcodec libavutil libswscale
|
||||
CONFIG += ffmpeg
|
||||
|
||||
packagesExist(x11) {
|
||||
DEFINES += HAS_X11
|
||||
PKGCONFIG += x11
|
||||
!disable-libva {
|
||||
packagesExist(libva) {
|
||||
!disable-x11 {
|
||||
packagesExist(libva-x11) {
|
||||
CONFIG += libva-x11
|
||||
}
|
||||
}
|
||||
!disable-wayland {
|
||||
packagesExist(libva-wayland) {
|
||||
CONFIG += libva-wayland
|
||||
}
|
||||
}
|
||||
!disable-libdrm {
|
||||
packagesExist(libva-drm) {
|
||||
CONFIG += libva-drm
|
||||
}
|
||||
}
|
||||
CONFIG += libva
|
||||
}
|
||||
}
|
||||
|
||||
!disable-libvdpau {
|
||||
packagesExist(vdpau) {
|
||||
CONFIG += libvdpau
|
||||
}
|
||||
}
|
||||
|
||||
!disable-mmal {
|
||||
packagesExist(mmal) {
|
||||
PKGCONFIG += mmal
|
||||
CONFIG += mmal
|
||||
}
|
||||
}
|
||||
|
||||
!disable-libdrm {
|
||||
packagesExist(libdrm) {
|
||||
PKGCONFIG += libdrm
|
||||
CONFIG += libdrm
|
||||
}
|
||||
}
|
||||
|
||||
!disable-cuda {
|
||||
packagesExist(ffnvcodec) {
|
||||
PKGCONFIG += ffnvcodec
|
||||
CONFIG += cuda
|
||||
}
|
||||
}
|
||||
|
||||
!disable-libplacebo {
|
||||
packagesExist(libplacebo) {
|
||||
PKGCONFIG += libplacebo
|
||||
CONFIG += libplacebo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
!disable-wayland {
|
||||
packagesExist(wayland-client) {
|
||||
CONFIG += wayland
|
||||
PKGCONFIG += wayland-client
|
||||
}
|
||||
}
|
||||
|
||||
!disable-x11 {
|
||||
packagesExist(x11) {
|
||||
DEFINES += HAS_X11
|
||||
PKGCONFIG += x11
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
win32 {
|
||||
LIBS += -llibssl -llibcrypto -lSDL2 -lSDL2_ttf -lavcodec -lavutil -lopus -ldxgi -ld3d11
|
||||
CONFIG += ffmpeg
|
||||
LIBS += -llibssl -llibcrypto -lSDL2 -lSDL2_ttf -lavcodec -lavutil -lswscale -lopus -ldxgi -ld3d11 -llibplacebo
|
||||
CONFIG += ffmpeg libplacebo
|
||||
}
|
||||
win32:!winrt {
|
||||
CONFIG += soundio discord-rpc
|
||||
}
|
||||
macx {
|
||||
LIBS += -lssl -lcrypto -lavcodec.59 -lavutil.57 -lopus -framework SDL2 -framework SDL2_ttf
|
||||
LIBS += -lobjc -framework VideoToolbox -framework AVFoundation -framework CoreVideo -framework CoreGraphics -framework CoreMedia -framework AppKit -framework Metal
|
||||
!disable-prebuilts {
|
||||
LIBS += -lssl.3 -lcrypto.3 -lavcodec.61 -lavutil.59 -lswscale.8 -lopus -framework SDL2 -framework SDL2_ttf
|
||||
CONFIG += discord-rpc
|
||||
}
|
||||
|
||||
LIBS += -lobjc -framework VideoToolbox -framework AVFoundation -framework CoreVideo -framework CoreGraphics -framework CoreMedia -framework AppKit -framework Metal -framework QuartzCore
|
||||
|
||||
# For libsoundio
|
||||
LIBS += -framework CoreAudio -framework AudioUnit
|
||||
|
||||
CONFIG += ffmpeg soundio discord-rpc
|
||||
CONFIG += ffmpeg soundio
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
SDL_compat.c \
|
||||
backend/nvaddress.cpp \
|
||||
backend/nvapp.cpp \
|
||||
cli/pair.cpp \
|
||||
main.cpp \
|
||||
backend/computerseeker.cpp \
|
||||
backend/identitymanager.cpp \
|
||||
@@ -137,6 +188,7 @@ SOURCES += \
|
||||
backend/boxartmanager.cpp \
|
||||
backend/richpresencemanager.cpp \
|
||||
cli/commandlineparser.cpp \
|
||||
cli/listapps.cpp \
|
||||
cli/quitstream.cpp \
|
||||
cli/startstream.cpp \
|
||||
settings/compatfetcher.cpp \
|
||||
@@ -163,8 +215,10 @@ SOURCES += \
|
||||
wm.cpp
|
||||
|
||||
HEADERS += \
|
||||
SDL_compat.h \
|
||||
backend/nvaddress.h \
|
||||
backend/nvapp.h \
|
||||
cli/pair.h \
|
||||
settings/compatfetcher.h \
|
||||
settings/mappingfetcher.h \
|
||||
utils.h \
|
||||
@@ -177,6 +231,7 @@ HEADERS += \
|
||||
backend/boxartmanager.h \
|
||||
backend/richpresencemanager.h \
|
||||
cli/commandlineparser.h \
|
||||
cli/listapps.h \
|
||||
cli/quitstream.h \
|
||||
cli/startstream.h \
|
||||
settings/streamingpreferences.h \
|
||||
@@ -202,16 +257,18 @@ ffmpeg {
|
||||
DEFINES += HAVE_FFMPEG
|
||||
SOURCES += \
|
||||
streaming/video/ffmpeg.cpp \
|
||||
streaming/video/ffmpeg-renderers/genhwaccel.cpp \
|
||||
streaming/video/ffmpeg-renderers/sdlvid.cpp \
|
||||
streaming/video/ffmpeg-renderers/pacer/pacer.cpp \
|
||||
streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp
|
||||
streaming/video/ffmpeg-renderers/swframemapper.cpp \
|
||||
streaming/video/ffmpeg-renderers/pacer/pacer.cpp
|
||||
|
||||
HEADERS += \
|
||||
streaming/video/ffmpeg.h \
|
||||
streaming/video/ffmpeg-renderers/renderer.h \
|
||||
streaming/video/ffmpeg-renderers/genhwaccel.h \
|
||||
streaming/video/ffmpeg-renderers/sdlvid.h \
|
||||
streaming/video/ffmpeg-renderers/pacer/pacer.h \
|
||||
streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.h
|
||||
streaming/video/ffmpeg-renderers/swframemapper.h \
|
||||
streaming/video/ffmpeg-renderers/pacer/pacer.h
|
||||
}
|
||||
libva {
|
||||
message(VAAPI renderer selected)
|
||||
@@ -233,7 +290,7 @@ libva-wayland {
|
||||
PKGCONFIG += libva-wayland
|
||||
DEFINES += HAVE_LIBVA_WAYLAND
|
||||
}
|
||||
libva-wayland {
|
||||
libva-drm {
|
||||
message(VAAPI DRM support enabled)
|
||||
|
||||
PKGCONFIG += libva-drm
|
||||
@@ -252,6 +309,18 @@ mmal {
|
||||
DEFINES += HAVE_MMAL
|
||||
SOURCES += streaming/video/ffmpeg-renderers/mmal.cpp
|
||||
HEADERS += streaming/video/ffmpeg-renderers/mmal.h
|
||||
|
||||
# We suppress EGL usage when MMAL is available because MMAL has
|
||||
# significantly better performance than EGL on the Pi. Setting
|
||||
# this option allows EGL usage even if built with MMAL support.
|
||||
#
|
||||
# It is highly recommended to also build with 'gpuslow' to avoid
|
||||
# EGL being preferred if direct DRM rendering is available.
|
||||
allow-egl-with-mmal {
|
||||
message(Allowing EGL usage with MMAL enabled)
|
||||
|
||||
DEFINES += ALLOW_EGL_WITH_MMAL
|
||||
}
|
||||
}
|
||||
libdrm {
|
||||
message(DRM renderer selected)
|
||||
@@ -262,7 +331,7 @@ libdrm {
|
||||
|
||||
linux {
|
||||
message(Master hooks enabled)
|
||||
SOURCES += masterhook.c
|
||||
SOURCES += masterhook.c masterhook_internal.c
|
||||
LIBS += -ldl
|
||||
}
|
||||
}
|
||||
@@ -272,6 +341,19 @@ cuda {
|
||||
DEFINES += HAVE_CUDA
|
||||
SOURCES += streaming/video/ffmpeg-renderers/cuda.cpp
|
||||
HEADERS += streaming/video/ffmpeg-renderers/cuda.h
|
||||
|
||||
# ffnvcodec uses libdl in cuda_load_functions()/cuda_free_functions()
|
||||
LIBS += -ldl
|
||||
}
|
||||
libplacebo {
|
||||
message(Vulkan support enabled via libplacebo)
|
||||
|
||||
DEFINES += HAVE_LIBPLACEBO_VULKAN
|
||||
SOURCES += \
|
||||
streaming/video/ffmpeg-renderers/plvk.cpp \
|
||||
streaming/video/ffmpeg-renderers/plvk_c.c
|
||||
HEADERS += \
|
||||
streaming/video/ffmpeg-renderers/plvk.h
|
||||
}
|
||||
config_EGL {
|
||||
message(EGL renderer selected)
|
||||
@@ -280,12 +362,22 @@ config_EGL {
|
||||
DEFINES += HAVE_EGL
|
||||
SOURCES += \
|
||||
streaming/video/ffmpeg-renderers/eglvid.cpp \
|
||||
streaming/video/ffmpeg-renderers/egl_extensions.cpp
|
||||
HEADERS += streaming/video/ffmpeg-renderers/eglvid.h
|
||||
streaming/video/ffmpeg-renderers/egl_extensions.cpp \
|
||||
streaming/video/ffmpeg-renderers/eglimagefactory.cpp
|
||||
HEADERS += \
|
||||
streaming/video/ffmpeg-renderers/eglvid.h \
|
||||
streaming/video/ffmpeg-renderers/eglimagefactory.h
|
||||
}
|
||||
config_SL {
|
||||
message(Steam Link build configuration selected)
|
||||
|
||||
!disable-prebuilts {
|
||||
# Link against our NEON-optimized libopus build
|
||||
LIBS += -L$$PWD/../libs/steamlink/lib
|
||||
INCLUDEPATH += $$PWD/../libs/steamlink/include
|
||||
LIBS += -lopus -larmasm -lNE10
|
||||
}
|
||||
|
||||
DEFINES += EMBEDDED_BUILD STEAM_LINK HAVE_SLVIDEO HAVE_SLAUDIO
|
||||
LIBS += -lSLVideo -lSLAudio
|
||||
|
||||
@@ -316,7 +408,9 @@ macx {
|
||||
message(VideoToolbox renderer selected)
|
||||
|
||||
SOURCES += \
|
||||
streaming/video/ffmpeg-renderers/vt.mm
|
||||
streaming/video/ffmpeg-renderers/vt_base.mm \
|
||||
streaming/video/ffmpeg-renderers/vt_avsamplelayer.mm \
|
||||
streaming/video/ffmpeg-renderers/vt_metal.mm
|
||||
|
||||
HEADERS += \
|
||||
streaming/video/ffmpeg-renderers/vt.h
|
||||
@@ -339,13 +433,35 @@ embedded {
|
||||
|
||||
DEFINES += EMBEDDED_BUILD
|
||||
}
|
||||
glslow {
|
||||
message(GL slow build)
|
||||
|
||||
DEFINES += GL_IS_SLOW
|
||||
}
|
||||
vkslow {
|
||||
message(Vulkan slow build)
|
||||
|
||||
DEFINES += VULKAN_IS_SLOW
|
||||
}
|
||||
gpuslow {
|
||||
message(GPU slow build)
|
||||
|
||||
DEFINES += GL_IS_SLOW VULKAN_IS_SLOW
|
||||
}
|
||||
wayland {
|
||||
message(Wayland extensions enabled)
|
||||
|
||||
DEFINES += HAS_WAYLAND
|
||||
SOURCES += streaming/video/ffmpeg-renderers/pacer/waylandvsyncsource.cpp
|
||||
HEADERS += streaming/video/ffmpeg-renderers/pacer/waylandvsyncsource.h
|
||||
}
|
||||
|
||||
RESOURCES += \
|
||||
resources.qrc \
|
||||
qml.qrc
|
||||
|
||||
TRANSLATIONS += \
|
||||
languages/qml_zh_cn.ts \
|
||||
languages/qml_zh_CN.ts \
|
||||
languages/qml_de.ts \
|
||||
languages/qml_fr.ts \
|
||||
languages/qml_nb_NO.ts \
|
||||
@@ -360,12 +476,18 @@ TRANSLATIONS += \
|
||||
languages/qml_sv.ts \
|
||||
languages/qml_tr.ts \
|
||||
languages/qml_uk.ts \
|
||||
languages/qml_zh_Hant.ts \
|
||||
languages/qml_zh_TW.ts \
|
||||
languages/qml_el.ts \
|
||||
languages/qml_hi.ts \
|
||||
languages/qml_it.ts \
|
||||
languages/qml_pt.ts \
|
||||
languages/qml_pt_BR.ts
|
||||
languages/qml_pt_BR.ts \
|
||||
languages/qml_pl.ts \
|
||||
languages/qml_cs.ts \
|
||||
languages/qml_he.ts \
|
||||
languages/qml_ckb.ts \
|
||||
languages/qml_lt.ts \
|
||||
languages/qml_et.ts
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
QML_IMPORT_PATH =
|
||||
@@ -454,15 +576,19 @@ macx {
|
||||
APP_BUNDLE_RESOURCES.files = moonlight.icns
|
||||
APP_BUNDLE_RESOURCES.path = Contents/Resources
|
||||
|
||||
APP_BUNDLE_FRAMEWORKS.files = $$files(../libs/mac/Frameworks/*.framework, true) $$files(../libs/mac/lib/*.dylib, true)
|
||||
APP_BUNDLE_FRAMEWORKS.path = Contents/Frameworks
|
||||
|
||||
APP_BUNDLE_PLIST.files = $$OUT_PWD/Info.plist
|
||||
APP_BUNDLE_PLIST.path = Contents
|
||||
|
||||
QMAKE_BUNDLE_DATA += APP_BUNDLE_RESOURCES APP_BUNDLE_FRAMEWORKS APP_BUNDLE_PLIST
|
||||
QMAKE_BUNDLE_DATA += APP_BUNDLE_RESOURCES APP_BUNDLE_PLIST
|
||||
|
||||
QMAKE_RPATHDIR += @executable_path/../Frameworks
|
||||
!disable-prebuilts {
|
||||
APP_BUNDLE_FRAMEWORKS.files = $$files(../libs/mac/Frameworks/*.framework, true) $$files(../libs/mac/lib/*.dylib, true)
|
||||
APP_BUNDLE_FRAMEWORKS.path = Contents/Frameworks
|
||||
|
||||
QMAKE_BUNDLE_DATA += APP_BUNDLE_FRAMEWORKS
|
||||
|
||||
QMAKE_RPATHDIR += @executable_path/../Frameworks
|
||||
}
|
||||
}
|
||||
|
||||
VERSION = "$$cat(version.txt)"
|
||||
|
||||
@@ -6,16 +6,17 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
AutoUpdateChecker::AutoUpdateChecker(QObject *parent) :
|
||||
QObject(parent),
|
||||
m_Nam(this)
|
||||
QObject(parent)
|
||||
{
|
||||
m_Nam = new QNetworkAccessManager(this);
|
||||
|
||||
// Never communicate over HTTP
|
||||
m_Nam.setStrictTransportSecurityEnabled(true);
|
||||
m_Nam->setStrictTransportSecurityEnabled(true);
|
||||
|
||||
// Allow HTTP redirects
|
||||
m_Nam.setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||
m_Nam->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||
|
||||
connect(&m_Nam, &QNetworkAccessManager::finished,
|
||||
connect(m_Nam, &QNetworkAccessManager::finished,
|
||||
this, &AutoUpdateChecker::handleUpdateCheckRequestFinished);
|
||||
|
||||
QString currentVersion(VERSION_STR);
|
||||
@@ -28,12 +29,17 @@ AutoUpdateChecker::AutoUpdateChecker(QObject *parent) :
|
||||
|
||||
void AutoUpdateChecker::start()
|
||||
{
|
||||
if (!m_Nam) {
|
||||
Q_ASSERT(m_Nam);
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_DARWIN) || defined(STEAM_LINK) || defined(APP_IMAGE) // Only run update checker on platforms without auto-update
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) && QT_VERSION < QT_VERSION_CHECK(5, 15, 1) && !defined(QT_NO_BEARERMANAGEMENT)
|
||||
// HACK: Set network accessibility to work around QTBUG-80947 (introduced in Qt 5.14.0 and fixed in Qt 5.15.1)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
m_Nam.setNetworkAccessible(QNetworkAccessManager::Accessible);
|
||||
m_Nam->setNetworkAccessible(QNetworkAccessManager::Accessible);
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
|
||||
@@ -45,7 +51,7 @@ void AutoUpdateChecker::start()
|
||||
#else
|
||||
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
|
||||
#endif
|
||||
m_Nam.get(request);
|
||||
m_Nam->get(request);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -102,6 +108,11 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
|
||||
{
|
||||
Q_ASSERT(reply->isFinished());
|
||||
|
||||
// Delete the QNetworkAccessManager to free resources and
|
||||
// prevent the bearer plugin from polling in the background.
|
||||
m_Nam->deleteLater();
|
||||
m_Nam = nullptr;
|
||||
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
QTextStream stream(reply);
|
||||
|
||||
@@ -201,7 +212,7 @@ void AutoUpdateChecker::handleUpdateCheckRequestFinished(QNetworkReply* reply)
|
||||
<< QSysInfo::buildCpuArchitecture() << getPlatform() << QSysInfo::kernelVersion();
|
||||
}
|
||||
else {
|
||||
qWarning() << "Update checking failed with error: " << reply->error();
|
||||
qWarning() << "Update checking failed with error:" << reply->error();
|
||||
reply->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ private:
|
||||
QString getPlatform();
|
||||
|
||||
QVector<int> m_CurrentVersionQuad;
|
||||
QNetworkAccessManager m_Nam;
|
||||
QNetworkAccessManager* m_Nam;
|
||||
};
|
||||
|
||||
+205
-50
@@ -1,7 +1,7 @@
|
||||
#include "computermanager.h"
|
||||
#include "boxartmanager.h"
|
||||
#include "nvhttp.h"
|
||||
#include "settings/streamingpreferences.h"
|
||||
#include "nvpairingmanager.h"
|
||||
|
||||
#include <Limelight.h>
|
||||
#include <QtEndian>
|
||||
@@ -10,7 +10,10 @@
|
||||
#include <QThreadPool>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include <random>
|
||||
|
||||
#define SER_HOSTS "hosts"
|
||||
#define SER_HOSTS_BACKUP "hostsbackup"
|
||||
|
||||
class PcMonitorThread : public QThread
|
||||
{
|
||||
@@ -42,7 +45,7 @@ private:
|
||||
|
||||
// Ensure the machine that responded is the one we intended to contact
|
||||
if (m_Computer->uuid != newState.uuid) {
|
||||
qInfo() << "Found unexpected PC " << newState.name << " looking for " << m_Computer->name;
|
||||
qInfo() << "Found unexpected PC" << newState.name << "looking for" << m_Computer->name;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -141,29 +144,43 @@ private:
|
||||
NvComputer* m_Computer;
|
||||
};
|
||||
|
||||
ComputerManager::ComputerManager(QObject *parent)
|
||||
: QObject(parent),
|
||||
ComputerManager::ComputerManager(StreamingPreferences* prefs)
|
||||
: m_Prefs(prefs),
|
||||
m_PollingRef(0),
|
||||
m_MdnsBrowser(nullptr),
|
||||
m_CompatFetcher(nullptr)
|
||||
m_CompatFetcher(nullptr),
|
||||
m_NeedsDelayedFlush(false)
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
// If there's a hosts backup copy, we must have failed to commit
|
||||
// a previous update before exiting. Restore the backup now.
|
||||
int hosts = settings.beginReadArray(SER_HOSTS_BACKUP);
|
||||
if (hosts == 0) {
|
||||
// If there's no host backup, read from the primary location.
|
||||
settings.endArray();
|
||||
hosts = settings.beginReadArray(SER_HOSTS);
|
||||
}
|
||||
|
||||
// Inflate our hosts from QSettings
|
||||
int hosts = settings.beginReadArray(SER_HOSTS);
|
||||
for (int i = 0; i < hosts; i++) {
|
||||
settings.setArrayIndex(i);
|
||||
NvComputer* computer = new NvComputer(settings);
|
||||
m_KnownHosts[computer->uuid] = computer;
|
||||
m_LastSerializedHosts[computer->uuid] = *computer;
|
||||
}
|
||||
settings.endArray();
|
||||
|
||||
// Fetch latest compatibility data asynchronously
|
||||
m_CompatFetcher.start();
|
||||
|
||||
// Start the delayed flush thread to handle saveHosts() calls
|
||||
m_DelayedFlushThread = new DelayedFlushThread(this);
|
||||
m_DelayedFlushThread->start();
|
||||
|
||||
// To quit in a timely manner, we must block additional requests
|
||||
// after we receive the aboutToQuit() signal. This is neccessary
|
||||
// because NvHTTP uses aboutToQuit() to abort requests in progres
|
||||
// after we receive the aboutToQuit() signal. This is necessary
|
||||
// because NvHTTP uses aboutToQuit() to abort requests in progress
|
||||
// while quitting, however this is a one time signal - additional
|
||||
// requests would not be aborted and block termination.
|
||||
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &ComputerManager::handleAboutToQuit);
|
||||
@@ -171,6 +188,21 @@ ComputerManager::ComputerManager(QObject *parent)
|
||||
|
||||
ComputerManager::~ComputerManager()
|
||||
{
|
||||
// Stop the delayed flush thread before acquiring the lock in write mode
|
||||
// to avoid deadlocking with a flush that needs the lock in read mode.
|
||||
{
|
||||
// Wake the delayed flush thread
|
||||
m_DelayedFlushThread->requestInterruption();
|
||||
m_DelayedFlushCondition.wakeOne();
|
||||
|
||||
// Wait for it to terminate (and finish any pending flush)
|
||||
m_DelayedFlushThread->wait();
|
||||
delete m_DelayedFlushThread;
|
||||
|
||||
// Delayed flushes should have completed by now
|
||||
Q_ASSERT(!m_NeedsDelayedFlush);
|
||||
}
|
||||
|
||||
QWriteLocker lock(&m_Lock);
|
||||
|
||||
// Delete machines that haven't been resolved yet
|
||||
@@ -200,19 +232,80 @@ ComputerManager::~ComputerManager()
|
||||
}
|
||||
}
|
||||
|
||||
void DelayedFlushThread::run() {
|
||||
for (;;) {
|
||||
// Wait for a delayed flush request or an interruption
|
||||
{
|
||||
QMutexLocker locker(&m_ComputerManager->m_DelayedFlushMutex);
|
||||
|
||||
while (!QThread::currentThread()->isInterruptionRequested() && !m_ComputerManager->m_NeedsDelayedFlush) {
|
||||
m_ComputerManager->m_DelayedFlushCondition.wait(&m_ComputerManager->m_DelayedFlushMutex);
|
||||
}
|
||||
|
||||
// Bail without flushing if we woke up for an interruption alone.
|
||||
// If we have both an interruption and a flush request, do the flush.
|
||||
if (!m_ComputerManager->m_NeedsDelayedFlush) {
|
||||
Q_ASSERT(QThread::currentThread()->isInterruptionRequested());
|
||||
break;
|
||||
}
|
||||
|
||||
// Reset the delayed flush flag to ensure any racing saveHosts() call will set it again
|
||||
m_ComputerManager->m_NeedsDelayedFlush = false;
|
||||
|
||||
// Update the last serialized hosts map under the delayed flush mutex
|
||||
m_ComputerManager->m_LastSerializedHosts.clear();
|
||||
for (const NvComputer* computer : m_ComputerManager->m_KnownHosts) {
|
||||
// Copy the current state of the NvComputer to allow us to check later if we need
|
||||
// to serialize it again when attribute updates occur.
|
||||
QReadLocker computerLock(&computer->lock);
|
||||
m_ComputerManager->m_LastSerializedHosts[computer->uuid] = *computer;
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the flush
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
// First, write to the backup location
|
||||
settings.beginWriteArray(SER_HOSTS_BACKUP);
|
||||
{
|
||||
QReadLocker lock(&m_ComputerManager->m_Lock);
|
||||
int i = 0;
|
||||
for (const NvComputer* computer : m_ComputerManager->m_KnownHosts) {
|
||||
settings.setArrayIndex(i++);
|
||||
computer->serialize(settings, false);
|
||||
}
|
||||
}
|
||||
settings.endArray();
|
||||
|
||||
// Next, write to the primary location
|
||||
settings.remove(SER_HOSTS);
|
||||
settings.beginWriteArray(SER_HOSTS);
|
||||
{
|
||||
QReadLocker lock(&m_ComputerManager->m_Lock);
|
||||
int i = 0;
|
||||
for (const NvComputer* computer : m_ComputerManager->m_KnownHosts) {
|
||||
settings.setArrayIndex(i++);
|
||||
computer->serialize(settings, true);
|
||||
}
|
||||
}
|
||||
settings.endArray();
|
||||
|
||||
// Finally, delete the backup copy
|
||||
settings.remove(SER_HOSTS_BACKUP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ComputerManager::saveHosts()
|
||||
{
|
||||
QSettings settings;
|
||||
QReadLocker lock(&m_Lock);
|
||||
Q_ASSERT(m_DelayedFlushThread != nullptr && m_DelayedFlushThread->isRunning());
|
||||
|
||||
settings.remove(SER_HOSTS);
|
||||
settings.beginWriteArray(SER_HOSTS);
|
||||
int i = 0;
|
||||
for (const NvComputer* computer : m_KnownHosts) {
|
||||
settings.setArrayIndex(i++);
|
||||
computer->serialize(settings);
|
||||
}
|
||||
settings.endArray();
|
||||
// Punt to a worker thread because QSettings on macOS can take ages (> 500 ms)
|
||||
// to persist our host list to disk (especially when a host has a bunch of apps).
|
||||
QMutexLocker locker(&m_DelayedFlushMutex);
|
||||
m_NeedsDelayedFlush = true;
|
||||
m_DelayedFlushCondition.wakeOne();
|
||||
}
|
||||
|
||||
QHostAddress ComputerManager::getBestGlobalAddressV6(QVector<QHostAddress> &addresses)
|
||||
@@ -259,16 +352,15 @@ void ComputerManager::startPolling()
|
||||
return;
|
||||
}
|
||||
|
||||
StreamingPreferences prefs;
|
||||
|
||||
if (prefs.enableMdns) {
|
||||
if (m_Prefs->enableMdns) {
|
||||
// Start an MDNS query for GameStream hosts
|
||||
m_MdnsBrowser = new QMdnsEngine::Browser(&m_MdnsServer, "_nvstream._tcp.local.", &m_MdnsCache);
|
||||
m_MdnsServer.reset(new QMdnsEngine::Server());
|
||||
m_MdnsBrowser = new QMdnsEngine::Browser(m_MdnsServer.data(), "_nvstream._tcp.local.");
|
||||
connect(m_MdnsBrowser, &QMdnsEngine::Browser::serviceAdded,
|
||||
this, [this](const QMdnsEngine::Service& service) {
|
||||
qInfo() << "Discovered mDNS host:" << service.hostname();
|
||||
|
||||
MdnsPendingComputer* pendingComputer = new MdnsPendingComputer(&m_MdnsServer, service);
|
||||
MdnsPendingComputer* pendingComputer = new MdnsPendingComputer(m_MdnsServer, service);
|
||||
connect(pendingComputer, &MdnsPendingComputer::resolvedHost,
|
||||
this, &ComputerManager::handleMdnsServiceResolved);
|
||||
m_PendingResolution.append(pendingComputer);
|
||||
@@ -349,6 +441,19 @@ void ComputerManager::handleMdnsServiceResolved(MdnsPendingComputer* computer,
|
||||
computer->deleteLater();
|
||||
}
|
||||
|
||||
void ComputerManager::saveHost(NvComputer *computer)
|
||||
{
|
||||
// If no serializable properties changed, don't bother saving hosts
|
||||
QMutexLocker lock(&m_DelayedFlushMutex);
|
||||
QReadLocker computerLock(&computer->lock);
|
||||
if (!m_LastSerializedHosts.value(computer->uuid).isEqualSerialized(*computer)) {
|
||||
// Queue a request for a delayed flush to QSettings outside of the lock
|
||||
computerLock.unlock();
|
||||
lock.unlock();
|
||||
saveHosts();
|
||||
}
|
||||
}
|
||||
|
||||
void ComputerManager::handleComputerStateChanged(NvComputer* computer)
|
||||
{
|
||||
emit computerStateChanged(computer);
|
||||
@@ -358,15 +463,20 @@ void ComputerManager::handleComputerStateChanged(NvComputer* computer)
|
||||
emit quitAppCompleted(QVariant());
|
||||
}
|
||||
|
||||
// Save updated hosts to QSettings
|
||||
saveHosts();
|
||||
// Save updates to this host
|
||||
saveHost(computer);
|
||||
}
|
||||
|
||||
QVector<NvComputer*> ComputerManager::getComputers()
|
||||
{
|
||||
QReadLocker lock(&m_Lock);
|
||||
|
||||
return QVector<NvComputer*>::fromList(m_KnownHosts.values());
|
||||
// Return a sorted host list
|
||||
auto hosts = QVector<NvComputer*>::fromList(m_KnownHosts.values());
|
||||
std::stable_sort(hosts.begin(), hosts.end(), [](const NvComputer* host1, const NvComputer* host2) {
|
||||
return host1->name.toLower() < host2->name.toLower();
|
||||
});
|
||||
return hosts;
|
||||
}
|
||||
|
||||
class DeferredHostDeletionTask : public QRunnable
|
||||
@@ -390,7 +500,7 @@ public:
|
||||
m_ComputerManager->m_KnownHosts.remove(m_Computer->uuid);
|
||||
}
|
||||
|
||||
// Persist the new host list
|
||||
// Persist the new host list with this computer deleted
|
||||
m_ComputerManager->saveHosts();
|
||||
|
||||
// Delete the polling entry first. This will stop all polling threads too.
|
||||
@@ -431,16 +541,13 @@ void ComputerManager::renameHost(NvComputer* computer, QString name)
|
||||
|
||||
void ComputerManager::clientSideAttributeUpdated(NvComputer* computer)
|
||||
{
|
||||
// Persist the change
|
||||
saveHosts();
|
||||
|
||||
// Notify the UI of the state change
|
||||
handleComputerStateChanged(computer);
|
||||
}
|
||||
|
||||
void ComputerManager::handleAboutToQuit()
|
||||
{
|
||||
QWriteLocker lock(&m_Lock);
|
||||
QReadLocker lock(&m_Lock);
|
||||
|
||||
// Interrupt polling threads immediately, so they
|
||||
// avoid making additional requests while quitting
|
||||
@@ -455,7 +562,8 @@ class PendingPairingTask : public QObject, public QRunnable
|
||||
|
||||
public:
|
||||
PendingPairingTask(ComputerManager* computerManager, NvComputer* computer, QString pin)
|
||||
: m_Computer(computer),
|
||||
: m_ComputerManager(computerManager),
|
||||
m_Computer(computer),
|
||||
m_Pin(pin)
|
||||
{
|
||||
connect(this, &PendingPairingTask::pairingCompleted,
|
||||
@@ -475,25 +583,34 @@ private:
|
||||
switch (result)
|
||||
{
|
||||
case NvPairingManager::PairState::PIN_WRONG:
|
||||
emit pairingCompleted(m_Computer, "The PIN from the PC didn't match. Please try again.");
|
||||
emit pairingCompleted(m_Computer, tr("The PIN from the PC didn't match. Please try again."));
|
||||
break;
|
||||
case NvPairingManager::PairState::FAILED:
|
||||
emit pairingCompleted(m_Computer, "Pairing failed. Please try again.");
|
||||
if (m_Computer->currentGameId != 0) {
|
||||
emit pairingCompleted(m_Computer, tr("You cannot pair while a previous session is still running on the host PC. Quit any running games or reboot the host PC, then try pairing again."));
|
||||
}
|
||||
else {
|
||||
emit pairingCompleted(m_Computer, tr("Pairing failed. Please try again."));
|
||||
}
|
||||
break;
|
||||
case NvPairingManager::PairState::ALREADY_IN_PROGRESS:
|
||||
emit pairingCompleted(m_Computer, "Another pairing attempt is already in progress.");
|
||||
emit pairingCompleted(m_Computer, tr("Another pairing attempt is already in progress."));
|
||||
break;
|
||||
case NvPairingManager::PairState::PAIRED:
|
||||
// Persist the newly pinned server certificate for this host
|
||||
m_ComputerManager->saveHost(m_Computer);
|
||||
|
||||
emit pairingCompleted(m_Computer, nullptr);
|
||||
break;
|
||||
}
|
||||
} catch (const GfeHttpResponseException& e) {
|
||||
emit pairingCompleted(m_Computer, "GeForce Experience returned error: " + e.toQString());
|
||||
emit pairingCompleted(m_Computer, tr("GeForce Experience returned error: %1").arg(e.toQString()));
|
||||
} catch (const QtNetworkReplyException& e) {
|
||||
emit pairingCompleted(m_Computer, e.toQString());
|
||||
}
|
||||
}
|
||||
|
||||
ComputerManager* m_ComputerManager;
|
||||
NvComputer* m_Computer;
|
||||
QString m_Pin;
|
||||
};
|
||||
@@ -580,9 +697,10 @@ void ComputerManager::stopPollingAsync()
|
||||
m_PendingResolution.removeFirst();
|
||||
}
|
||||
|
||||
// Delete the browser to stop discovery
|
||||
// Delete the browser and server to stop discovery and refresh polling
|
||||
delete m_MdnsBrowser;
|
||||
m_MdnsBrowser = nullptr;
|
||||
m_MdnsServer.reset();
|
||||
|
||||
// Interrupt all threads, but don't wait for them to terminate
|
||||
for (ComputerPollingEntry* entry : m_PollEntries) {
|
||||
@@ -592,8 +710,8 @@ void ComputerManager::stopPollingAsync()
|
||||
|
||||
void ComputerManager::addNewHostManually(QString address)
|
||||
{
|
||||
QUrl url = QUrl::fromUserInput(address);
|
||||
if (url.isValid() && !url.host().isEmpty()) {
|
||||
QUrl url = QUrl::fromUserInput("moonlight://" + address);
|
||||
if (url.isValid() && !url.host().isEmpty() && url.scheme() == "moonlight") {
|
||||
// If there wasn't a port specified, use the default
|
||||
addNewHost(NvAddress(url.host(), url.port(DEFAULT_HTTP_PORT)), false);
|
||||
}
|
||||
@@ -611,12 +729,15 @@ public:
|
||||
: m_ComputerManager(computerManager),
|
||||
m_Address(address),
|
||||
m_MdnsIpv6Address(mdnsIpv6Address),
|
||||
m_Mdns(mdns)
|
||||
m_Mdns(mdns),
|
||||
m_AboutToQuit(false)
|
||||
{
|
||||
connect(this, &PendingAddTask::computerAddCompleted,
|
||||
computerManager, &ComputerManager::computerAddCompleted);
|
||||
connect(this, &PendingAddTask::computerStateChanged,
|
||||
computerManager, &ComputerManager::handleComputerStateChanged);
|
||||
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
|
||||
this, &PendingAddTask::handleAboutToQuit);
|
||||
}
|
||||
|
||||
signals:
|
||||
@@ -625,9 +746,20 @@ signals:
|
||||
void computerStateChanged(NvComputer* computer);
|
||||
|
||||
private:
|
||||
void handleAboutToQuit()
|
||||
{
|
||||
m_AboutToQuit = true;
|
||||
}
|
||||
|
||||
QString fetchServerInfo(NvHTTP& http)
|
||||
{
|
||||
QString serverInfo;
|
||||
|
||||
// Do nothing if we're quitting
|
||||
if (m_AboutToQuit) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
try {
|
||||
// There's a race condition between GameStream servers reporting presence over
|
||||
// mDNS and the HTTPS server being ready to respond to our queries. To work
|
||||
@@ -650,10 +782,9 @@ private:
|
||||
return serverInfo;
|
||||
} catch (...) {
|
||||
if (!m_Mdns) {
|
||||
StreamingPreferences prefs;
|
||||
int portTestResult;
|
||||
unsigned int portTestResult;
|
||||
|
||||
if (prefs.detectNetworkBlocking) {
|
||||
if (m_ComputerManager->m_Prefs->detectNetworkBlocking) {
|
||||
// We failed to connect to the specified PC. Let's test to make sure this network
|
||||
// isn't blocking Moonlight, so we can tell the user about it.
|
||||
portTestResult = LiTestClientConnectivity("qt.conntest.moonlight-stream.org", 443,
|
||||
@@ -749,16 +880,31 @@ private:
|
||||
hostAddress.isInSubnet(QHostAddress("192.168.0.0"), 16);
|
||||
|
||||
{
|
||||
// Check if this PC already exists
|
||||
QWriteLocker lock(&m_ComputerManager->m_Lock);
|
||||
// Check if this PC already exists using opportunistic read lock
|
||||
m_ComputerManager->m_Lock.lockForRead();
|
||||
NvComputer* existingComputer = m_ComputerManager->m_KnownHosts.value(newComputer->uuid);
|
||||
|
||||
// If it doesn't already exist, convert to a write lock in preparation for updating.
|
||||
//
|
||||
// NB: ComputerManager's lock protects the host map itself, not the elements inside.
|
||||
// Those are protected by their individual locks. Since we only mutate the map itself
|
||||
// when the PC doesn't exist, we need the lock in write-mode for that case only.
|
||||
if (existingComputer == nullptr) {
|
||||
m_ComputerManager->m_Lock.unlock();
|
||||
m_ComputerManager->m_Lock.lockForWrite();
|
||||
|
||||
// Since we had to unlock to lock for write, someone could have raced and added
|
||||
// this PC before us. We have to check again whether it already exists.
|
||||
existingComputer = m_ComputerManager->m_KnownHosts.value(newComputer->uuid);
|
||||
}
|
||||
|
||||
if (existingComputer != nullptr) {
|
||||
// Fold it into the existing PC
|
||||
bool changed = existingComputer->update(*newComputer);
|
||||
delete newComputer;
|
||||
|
||||
// Drop the lock before notifying
|
||||
lock.unlock();
|
||||
m_ComputerManager->m_Lock.unlock();
|
||||
|
||||
// For non-mDNS clients, let them know it succeeded
|
||||
if (!m_Mdns) {
|
||||
@@ -779,17 +925,15 @@ private:
|
||||
m_ComputerManager->startPollingComputer(newComputer);
|
||||
|
||||
// Drop the lock before notifying
|
||||
lock.unlock();
|
||||
m_ComputerManager->m_Lock.unlock();
|
||||
|
||||
// If this wasn't added via mDNS but it is a RFC 1918 IPv4 address and not a VPN,
|
||||
// go ahead and do the STUN request now to populate an external address.
|
||||
if (!m_Mdns && addressIsSiteLocalV4 && !newComputer->isReachableOverVpn()) {
|
||||
if (!m_Mdns && addressIsSiteLocalV4 && newComputer->getActiveAddressReachability() != NvComputer::RI_VPN) {
|
||||
quint32 addr;
|
||||
int err = LiFindExternalAddressIP4("stun.moonlight-stream.org", 3478, &addr);
|
||||
if (err == 0) {
|
||||
lock.relock();
|
||||
newComputer->setRemoteAddress(QHostAddress(qFromBigEndian(addr)));
|
||||
lock.unlock();
|
||||
}
|
||||
else {
|
||||
qWarning() << "STUN failed to get WAN address:" << err;
|
||||
@@ -811,6 +955,7 @@ private:
|
||||
NvAddress m_Address;
|
||||
NvAddress m_MdnsIpv6Address;
|
||||
bool m_Mdns;
|
||||
bool m_AboutToQuit;
|
||||
};
|
||||
|
||||
void ComputerManager::addNewHost(NvAddress address, bool mdns, NvAddress mdnsIpv6Address)
|
||||
@@ -821,4 +966,14 @@ void ComputerManager::addNewHost(NvAddress address, bool mdns, NvAddress mdnsIpv
|
||||
QThreadPool::globalInstance()->start(addTask);
|
||||
}
|
||||
|
||||
// TODO: Use QRandomGenerator when we drop Qt 5.9 support
|
||||
QString ComputerManager::generatePinString()
|
||||
{
|
||||
std::uniform_int_distribution<int> dist(0, 9999);
|
||||
std::random_device rd;
|
||||
std::mt19937 engine(rd());
|
||||
|
||||
return QString::asprintf("%04u", dist(engine));
|
||||
}
|
||||
|
||||
#include "computermanager.moc"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvcomputer.h"
|
||||
#include "nvpairingmanager.h"
|
||||
#include "settings/streamingpreferences.h"
|
||||
#include "settings/compatfetcher.h"
|
||||
|
||||
#include <qmdnsengine/server.h>
|
||||
@@ -15,17 +15,38 @@
|
||||
#include <QSettings>
|
||||
#include <QRunnable>
|
||||
#include <QTimer>
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
|
||||
class ComputerManager;
|
||||
|
||||
class DelayedFlushThread : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DelayedFlushThread(ComputerManager* cm)
|
||||
: m_ComputerManager(cm)
|
||||
{
|
||||
setObjectName("CM Delayed Flush Thread");
|
||||
}
|
||||
|
||||
void run();
|
||||
|
||||
private:
|
||||
ComputerManager* m_ComputerManager;
|
||||
};
|
||||
|
||||
class MdnsPendingComputer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MdnsPendingComputer(QMdnsEngine::Server* server,
|
||||
explicit MdnsPendingComputer(const QSharedPointer<QMdnsEngine::Server> server,
|
||||
const QMdnsEngine::Service& service)
|
||||
: m_Hostname(service.hostname()),
|
||||
m_Port(service.port()),
|
||||
m_Server(server),
|
||||
m_ServerWeak(server),
|
||||
m_Resolver(nullptr)
|
||||
{
|
||||
// Start resolving
|
||||
@@ -51,9 +72,15 @@ private slots:
|
||||
void handleResolvedTimeout()
|
||||
{
|
||||
if (m_Addresses.isEmpty()) {
|
||||
// Try again
|
||||
qInfo() << "Resolving" << hostname() << "timed out. Retrying...";
|
||||
resolve();
|
||||
if (m_Retries-- > 0) {
|
||||
// Try again
|
||||
qInfo() << "Resolving" << hostname() << "timed out. Retrying...";
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
qWarning() << "Giving up on resolving" << hostname() << "after repeated failures";
|
||||
cleanup();
|
||||
}
|
||||
}
|
||||
else {
|
||||
Q_ASSERT(!m_Addresses.isEmpty());
|
||||
@@ -71,10 +98,29 @@ signals:
|
||||
void resolvedHost(MdnsPendingComputer*,QVector<QHostAddress>&);
|
||||
|
||||
private:
|
||||
void cleanup()
|
||||
{
|
||||
// Delete our resolver, so we're guaranteed that nothing is referencing m_Server.
|
||||
delete m_Resolver;
|
||||
m_Resolver = nullptr;
|
||||
|
||||
// Now delete our strong reference that we held on behalf of m_Resolver.
|
||||
// The server may be destroyed after we make this call.
|
||||
m_Server.reset();
|
||||
}
|
||||
|
||||
void resolve()
|
||||
{
|
||||
delete m_Resolver;
|
||||
m_Resolver = new QMdnsEngine::Resolver(m_Server, m_Hostname);
|
||||
// Clean up any existing resolver object and server references
|
||||
cleanup();
|
||||
|
||||
// Re-acquire a strong reference if the server still exists.
|
||||
m_Server = m_ServerWeak.toStrongRef();
|
||||
if (!m_Server) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_Resolver = new QMdnsEngine::Resolver(m_Server.data(), m_Hostname);
|
||||
connect(m_Resolver, &QMdnsEngine::Resolver::resolved,
|
||||
this, &MdnsPendingComputer::handleResolvedAddress);
|
||||
QTimer::singleShot(2000, this, &MdnsPendingComputer::handleResolvedTimeout);
|
||||
@@ -82,9 +128,11 @@ private:
|
||||
|
||||
QByteArray m_Hostname;
|
||||
uint16_t m_Port;
|
||||
QMdnsEngine::Server* m_Server;
|
||||
QWeakPointer<QMdnsEngine::Server> m_ServerWeak;
|
||||
QSharedPointer<QMdnsEngine::Server> m_Server;
|
||||
QMdnsEngine::Resolver* m_Resolver;
|
||||
QVector<QHostAddress> m_Addresses;
|
||||
int m_Retries = 10;
|
||||
};
|
||||
|
||||
class ComputerPollingEntry
|
||||
@@ -166,9 +214,11 @@ class ComputerManager : public QObject
|
||||
|
||||
friend class DeferredHostDeletionTask;
|
||||
friend class PendingAddTask;
|
||||
friend class PendingPairingTask;
|
||||
friend class DelayedFlushThread;
|
||||
|
||||
public:
|
||||
explicit ComputerManager(QObject *parent = nullptr);
|
||||
explicit ComputerManager(StreamingPreferences* prefs);
|
||||
|
||||
virtual ~ComputerManager();
|
||||
|
||||
@@ -180,6 +230,8 @@ public:
|
||||
|
||||
void addNewHost(NvAddress address, bool mdns, NvAddress mdnsIpv6Address = NvAddress());
|
||||
|
||||
QString generatePinString();
|
||||
|
||||
void pairHost(NvComputer* computer, QString pin);
|
||||
|
||||
void quitRunningApp(NvComputer* computer);
|
||||
@@ -212,17 +264,24 @@ private slots:
|
||||
private:
|
||||
void saveHosts();
|
||||
|
||||
void saveHost(NvComputer* computer);
|
||||
|
||||
QHostAddress getBestGlobalAddressV6(QVector<QHostAddress>& addresses);
|
||||
|
||||
void startPollingComputer(NvComputer* computer);
|
||||
|
||||
StreamingPreferences* m_Prefs;
|
||||
int m_PollingRef;
|
||||
QReadWriteLock m_Lock;
|
||||
QMap<QString, NvComputer*> m_KnownHosts;
|
||||
QMap<QString, ComputerPollingEntry*> m_PollEntries;
|
||||
QMdnsEngine::Server m_MdnsServer;
|
||||
QHash<QString, NvComputer> m_LastSerializedHosts; // Protected by m_DelayedFlushMutex
|
||||
QSharedPointer<QMdnsEngine::Server> m_MdnsServer;
|
||||
QMdnsEngine::Browser* m_MdnsBrowser;
|
||||
QMdnsEngine::Cache m_MdnsCache;
|
||||
QVector<MdnsPendingComputer*> m_PendingResolution;
|
||||
CompatFetcher m_CompatFetcher;
|
||||
DelayedFlushThread* m_DelayedFlushThread;
|
||||
QMutex m_DelayedFlushMutex; // Lock ordering: Must never be acquired while holding NvComputer lock
|
||||
QWaitCondition m_DelayedFlushCondition;
|
||||
bool m_NeedsDelayedFlush;
|
||||
};
|
||||
|
||||
@@ -6,6 +6,13 @@ ComputerSeeker::ComputerSeeker(ComputerManager *manager, QString computerName, Q
|
||||
: QObject(parent), m_ComputerManager(manager), m_ComputerName(computerName),
|
||||
m_TimeoutTimer(new QTimer(this))
|
||||
{
|
||||
// If we know this computer, send a WOL packet to wake it up in case it is asleep.
|
||||
for (NvComputer * computer: m_ComputerManager->getComputers()) {
|
||||
if (this->matchComputer(computer)) {
|
||||
computer->wake();
|
||||
}
|
||||
}
|
||||
|
||||
m_TimeoutTimer->setSingleShot(true);
|
||||
connect(m_TimeoutTimer, &QTimer::timeout,
|
||||
this, &ComputerSeeker::onTimeout);
|
||||
|
||||
@@ -95,6 +95,14 @@ void IdentityManager::createCredentials(QSettings& settings)
|
||||
BIO_free(biokey);
|
||||
BIO_free(biocert);
|
||||
|
||||
// Check that the new keypair is valid before persisting it
|
||||
if (getSslCertificate().isNull()) {
|
||||
qFatal("Newly generated certificate is unreadable");
|
||||
}
|
||||
if (getSslKey().isNull()) {
|
||||
qFatal("Newly generated private key is unreadable");
|
||||
}
|
||||
|
||||
settings.setValue(SER_CERT, m_CachedPemCert);
|
||||
settings.setValue(SER_KEY, m_CachedPrivateKey);
|
||||
|
||||
@@ -123,10 +131,10 @@ IdentityManager::IdentityManager()
|
||||
|
||||
// We should have valid credentials now. If not, we're screwed
|
||||
if (getSslCertificate().isNull()) {
|
||||
qFatal("Newly generated certificate is unreadable");
|
||||
qFatal("Certificate is unreadable");
|
||||
}
|
||||
if (getSslKey().isNull()) {
|
||||
qFatal("Newly generated private key is unreadable");
|
||||
qFatal("Private key is unreadable");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+160
-54
@@ -21,6 +21,7 @@
|
||||
#define SER_APPLIST "apps"
|
||||
#define SER_SRVCERT "srvcert"
|
||||
#define SER_CUSTOMNAME "customname"
|
||||
#define SER_NVIDIASOFTWARE "nvidiasw"
|
||||
|
||||
NvComputer::NvComputer(QSettings& settings)
|
||||
{
|
||||
@@ -37,6 +38,7 @@ NvComputer::NvComputer(QSettings& settings)
|
||||
this->manualAddress = NvAddress(settings.value(SER_MANUALADDR).toString(),
|
||||
settings.value(SER_MANUALPORT, QVariant(DEFAULT_HTTP_PORT)).toUInt());
|
||||
this->serverCert = QSslCertificate(settings.value(SER_SRVCERT).toByteArray());
|
||||
this->isNvidiaServerSoftware = settings.value(SER_NVIDIASOFTWARE).toBool();
|
||||
|
||||
int appCount = settings.beginReadArray(SER_APPLIST);
|
||||
this->appList.reserve(appCount);
|
||||
@@ -65,12 +67,14 @@ NvComputer::NvComputer(QSettings& settings)
|
||||
|
||||
void NvComputer::setRemoteAddress(QHostAddress address)
|
||||
{
|
||||
QWriteLocker lock(&this->lock);
|
||||
|
||||
Q_ASSERT(this->externalPort != 0);
|
||||
|
||||
this->remoteAddress = NvAddress(address, this->externalPort);
|
||||
}
|
||||
|
||||
void NvComputer::serialize(QSettings& settings) const
|
||||
void NvComputer::serialize(QSettings& settings, bool serializeApps) const
|
||||
{
|
||||
QReadLocker lock(&this->lock);
|
||||
|
||||
@@ -87,9 +91,10 @@ void NvComputer::serialize(QSettings& settings) const
|
||||
settings.setValue(SER_MANUALADDR, manualAddress.address());
|
||||
settings.setValue(SER_MANUALPORT, manualAddress.port());
|
||||
settings.setValue(SER_SRVCERT, serverCert.toPem());
|
||||
settings.setValue(SER_NVIDIASOFTWARE, isNvidiaServerSoftware);
|
||||
|
||||
// Avoid deleting an existing applist if we couldn't get one
|
||||
if (!appList.isEmpty()) {
|
||||
if (!appList.isEmpty() && serializeApps) {
|
||||
settings.remove(SER_APPLIST);
|
||||
settings.beginWriteArray(SER_APPLIST);
|
||||
for (int i = 0; i < appList.count(); i++) {
|
||||
@@ -100,6 +105,21 @@ void NvComputer::serialize(QSettings& settings) const
|
||||
}
|
||||
}
|
||||
|
||||
bool NvComputer::isEqualSerialized(const NvComputer &that) const
|
||||
{
|
||||
return this->name == that.name &&
|
||||
this->hasCustomName == that.hasCustomName &&
|
||||
this->uuid == that.uuid &&
|
||||
this->macAddress == that.macAddress &&
|
||||
this->localAddress == that.localAddress &&
|
||||
this->remoteAddress == that.remoteAddress &&
|
||||
this->ipv6Address == that.ipv6Address &&
|
||||
this->manualAddress == that.manualAddress &&
|
||||
this->serverCert == that.serverCert &&
|
||||
this->isNvidiaServerSoftware == that.isNvidiaServerSoftware &&
|
||||
this->appList == that.appList;
|
||||
}
|
||||
|
||||
void NvComputer::sortAppList()
|
||||
{
|
||||
std::stable_sort(appList.begin(), appList.end(), [](const NvApp& app1, const NvApp& app2) {
|
||||
@@ -131,7 +151,8 @@ NvComputer::NvComputer(NvHTTP& http, QString serverInfo)
|
||||
this->serverCodecModeSupport = codecSupport.toInt();
|
||||
}
|
||||
else {
|
||||
this->serverCodecModeSupport = 0;
|
||||
// Assume H.264 is always supported
|
||||
this->serverCodecModeSupport = SCM_H264;
|
||||
}
|
||||
|
||||
QString maxLumaPixelsHEVC = NvHTTP::getXmlString(serverInfo, "MaxLumaPixelsHEVC");
|
||||
@@ -145,8 +166,8 @@ NvComputer::NvComputer(NvHTTP& http, QString serverInfo)
|
||||
this->displayModes = NvHTTP::getDisplayModeList(serverInfo);
|
||||
std::stable_sort(this->displayModes.begin(), this->displayModes.end(),
|
||||
[](const NvDisplayMode& mode1, const NvDisplayMode& mode2) {
|
||||
return mode1.width * mode1.height * mode1.refreshRate <
|
||||
mode2.width * mode2.height * mode2.refreshRate;
|
||||
return (uint64_t)mode1.width * mode1.height * mode1.refreshRate <
|
||||
(uint64_t)mode2.width * mode2.height * mode2.refreshRate;
|
||||
});
|
||||
|
||||
// We can get an IPv4 loopback address if we're using the GS IPv6 Forwarder
|
||||
@@ -164,7 +185,7 @@ NvComputer::NvComputer(NvHTTP& http, QString serverInfo)
|
||||
// to support dynamic HTTP WAN ports without requiring the user to manually enter the port.
|
||||
QString remotePortStr = NvHTTP::getXmlString(serverInfo, "ExternalPort");
|
||||
if (remotePortStr.isEmpty() || (this->externalPort = remotePortStr.toUShort()) == 0) {
|
||||
this->externalPort = DEFAULT_HTTP_PORT;
|
||||
this->externalPort = http.httpPort();
|
||||
}
|
||||
|
||||
QString remoteAddress = NvHTTP::getXmlString(serverInfo, "ExternalIP");
|
||||
@@ -175,6 +196,11 @@ NvComputer::NvComputer(NvHTTP& http, QString serverInfo)
|
||||
this->remoteAddress = NvAddress();
|
||||
}
|
||||
|
||||
// Real Nvidia host software (GeForce Experience and RTX Experience) both use the 'Mjolnir'
|
||||
// codename in the state field and no version of Sunshine does. We can use this to bypass
|
||||
// some assumptions about Nvidia hardware that don't apply to Sunshine hosts.
|
||||
this->isNvidiaServerSoftware = NvHTTP::getXmlString(serverInfo, "state").contains("MJOLNIR");
|
||||
|
||||
this->pairState = NvHTTP::getXmlString(serverInfo, "PairStatus") == "1" ?
|
||||
PS_PAIRED : PS_NOT_PAIRED;
|
||||
this->currentGameId = NvHTTP::getCurrentGame(serverInfo);
|
||||
@@ -187,40 +213,52 @@ NvComputer::NvComputer(NvHTTP& http, QString serverInfo)
|
||||
this->isSupportedServerVersion = CompatFetcher::isGfeVersionSupported(this->gfeVersion);
|
||||
}
|
||||
|
||||
bool NvComputer::wake()
|
||||
bool NvComputer::wake() const
|
||||
{
|
||||
if (state == NvComputer::CS_ONLINE) {
|
||||
qWarning() << name << "is already online";
|
||||
return true;
|
||||
QByteArray wolPayload;
|
||||
|
||||
{
|
||||
QReadLocker readLocker(&lock);
|
||||
|
||||
if (state == NvComputer::CS_ONLINE) {
|
||||
qWarning() << name << "is already online";
|
||||
return true;
|
||||
}
|
||||
|
||||
if (macAddress.isEmpty()) {
|
||||
qWarning() << name << "has no MAC address stored";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the WoL payload
|
||||
wolPayload.append(QByteArray::fromHex("FFFFFFFFFFFF"));
|
||||
for (int i = 0; i < 16; i++) {
|
||||
wolPayload.append(macAddress);
|
||||
}
|
||||
Q_ASSERT(wolPayload.size() == 102);
|
||||
}
|
||||
|
||||
if (macAddress.isEmpty()) {
|
||||
qWarning() << name << "has no MAC address stored";
|
||||
return false;
|
||||
}
|
||||
|
||||
const quint16 WOL_PORTS[] = {
|
||||
// Ports used as-is
|
||||
const quint16 STATIC_WOL_PORTS[] = {
|
||||
9, // Standard WOL port (privileged port)
|
||||
47998, 47999, 48000, 48002, 48010, // Ports opened by GFE
|
||||
47009, // Port opened by Moonlight Internet Hosting Tool for WoL (non-privileged port)
|
||||
};
|
||||
|
||||
// Create the WoL payload
|
||||
QByteArray wolPayload;
|
||||
wolPayload.append(QByteArray::fromHex("FFFFFFFFFFFF"));
|
||||
for (int i = 0; i < 16; i++) {
|
||||
wolPayload.append(macAddress);
|
||||
}
|
||||
Q_ASSERT(wolPayload.count() == 102);
|
||||
// Ports offset by the HTTP base port for hosts using alternate ports
|
||||
const quint16 DYNAMIC_WOL_PORTS[] = {
|
||||
47998, 47999, 48000, 48002, 48010, // Ports opened by GFE
|
||||
};
|
||||
|
||||
// Add the addresses that we know this host to be
|
||||
// and broadcast addresses for this link just in
|
||||
// case the host has timed out in ARP entries.
|
||||
QVector<QString> addressList;
|
||||
QMap<QString, quint16> addressMap;
|
||||
QSet<quint16> basePortSet;
|
||||
for (const NvAddress& addr : uniqueAddresses()) {
|
||||
addressList.append(addr.address());
|
||||
addressMap.insert(addr.address(), addr.port());
|
||||
basePortSet.insert(addr.port());
|
||||
}
|
||||
addressList.append("255.255.255.255");
|
||||
addressMap.insert("255.255.255.255", 0);
|
||||
|
||||
// Try to broadcast on all available NICs
|
||||
for (const QNetworkInterface& nic : QNetworkInterface::allInterfaces()) {
|
||||
@@ -239,31 +277,42 @@ bool NvComputer::wake()
|
||||
|
||||
// Skip IPv6 which doesn't support broadcast
|
||||
if (!addr.broadcast().isNull()) {
|
||||
addressList.append(addr.broadcast().toString());
|
||||
addressMap.insert(addr.broadcast().toString(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!allNodesMulticast.scopeId().isEmpty()) {
|
||||
addressList.append(allNodesMulticast.toString());
|
||||
addressMap.insert(allNodesMulticast.toString(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Try all unique address strings or host names
|
||||
bool success = false;
|
||||
for (QString& addressString : addressList) {
|
||||
QHostInfo hostInfo = QHostInfo::fromName(addressString);
|
||||
for (auto i = addressMap.constBegin(); i != addressMap.constEnd(); i++) {
|
||||
QHostAddress literalAddress;
|
||||
QList<QHostAddress> addressList;
|
||||
|
||||
if (hostInfo.error() != QHostInfo::NoError) {
|
||||
qWarning() << "Error resolving" << addressString << ":" << hostInfo.errorString();
|
||||
continue;
|
||||
// If this is an IPv4/IPv6 literal, don't use QHostInfo::fromName() because that will
|
||||
// try to perform a reverse DNS lookup that leads to delays sending WoL packets.
|
||||
if (literalAddress.setAddress(i.key())) {
|
||||
addressList.append(literalAddress);
|
||||
}
|
||||
else {
|
||||
QHostInfo hostInfo = QHostInfo::fromName(i.key());
|
||||
if (hostInfo.error() != QHostInfo::NoError) {
|
||||
qWarning() << "Error resolving" << i.key() << ":" << hostInfo.errorString();
|
||||
continue;
|
||||
}
|
||||
|
||||
addressList.append(hostInfo.addresses());
|
||||
}
|
||||
|
||||
// Try all IP addresses that this string resolves to
|
||||
for (QHostAddress& address : hostInfo.addresses()) {
|
||||
for (QHostAddress& address : addressList) {
|
||||
QUdpSocket sock;
|
||||
|
||||
// Send to all ports
|
||||
for (quint16 port : WOL_PORTS) {
|
||||
// Send to all static ports
|
||||
for (quint16 port : STATIC_WOL_PORTS) {
|
||||
if (sock.writeDatagram(wolPayload, address, port)) {
|
||||
qInfo().nospace().noquote() << "Sent WoL packet to " << name << " via " << address.toString() << ":" << port;
|
||||
success = true;
|
||||
@@ -272,24 +321,59 @@ bool NvComputer::wake()
|
||||
qWarning() << "Send failed:" << sock.error();
|
||||
}
|
||||
}
|
||||
|
||||
QList<quint16> basePorts;
|
||||
if (i.value() != 0) {
|
||||
// If we have a known base port for this address, use only that port
|
||||
basePorts.append(i.value());
|
||||
}
|
||||
else {
|
||||
// If this is a broadcast address without a known HTTP port, try all of them
|
||||
basePorts.append(basePortSet.values());
|
||||
}
|
||||
|
||||
// Send to all dynamic ports using the HTTP port offset(s) for this address
|
||||
for (quint16 basePort : basePorts) {
|
||||
for (quint16 port : DYNAMIC_WOL_PORTS) {
|
||||
port = (port - 47989) + basePort;
|
||||
|
||||
if (sock.writeDatagram(wolPayload, address, port)) {
|
||||
qInfo().nospace().noquote() << "Sent WoL packet to " << name << " via " << address.toString() << ":" << port;
|
||||
success = true;
|
||||
}
|
||||
else {
|
||||
qWarning() << "Send failed:" << sock.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool NvComputer::isReachableOverVpn()
|
||||
NvComputer::ReachabilityType NvComputer::getActiveAddressReachability() const
|
||||
{
|
||||
if (activeAddress.isNull()) {
|
||||
return false;
|
||||
NvAddress copyOfActiveAddress;
|
||||
|
||||
{
|
||||
QReadLocker readLocker(&lock);
|
||||
|
||||
if (activeAddress.isNull()) {
|
||||
return ReachabilityType::RI_UNKNOWN;
|
||||
}
|
||||
|
||||
// Grab a copy of the active address to avoid having to hold
|
||||
// the computer lock while doing socket operations
|
||||
copyOfActiveAddress = activeAddress;
|
||||
}
|
||||
|
||||
QTcpSocket s;
|
||||
|
||||
s.setProxy(QNetworkProxy::NoProxy);
|
||||
s.connectToHost(activeAddress.address(), activeAddress.port());
|
||||
s.connectToHost(copyOfActiveAddress.address(), copyOfActiveAddress.port());
|
||||
if (s.waitForConnected(3000)) {
|
||||
Q_ASSERT(!s.localAddress().isNull());
|
||||
Q_ASSERT(!s.peerAddress().isNull());
|
||||
|
||||
for (const QNetworkInterface& nic : QNetworkInterface::allInterfaces()) {
|
||||
// Ensure the interface is up
|
||||
@@ -308,48 +392,68 @@ bool NvComputer::isReachableOverVpn()
|
||||
if (nic.type() == QNetworkInterface::Virtual ||
|
||||
nic.type() == QNetworkInterface::Ppp) {
|
||||
// Treat PPP and virtual interfaces as likely VPNs
|
||||
return true;
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
|
||||
if (nic.maximumTransmissionUnit() != 0 && nic.maximumTransmissionUnit() < 1500) {
|
||||
// Treat MTUs under 1500 as likely VPNs
|
||||
return true;
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (nic.flags() & QNetworkInterface::IsPointToPoint) {
|
||||
// Treat point-to-point links as likely VPNs.
|
||||
// This check detects OpenVPN on Unix-like OSes.
|
||||
return true;
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if (nic.name().startsWith("iftype53_") || nic.name().startsWith("iftype131_")) {
|
||||
// Match by NDIS interface type. These values are Microsoft's recommended values for VPN connections:
|
||||
// https://learn.microsoft.com/en-US/troubleshoot/windows-client/networking/windows-connection-manager-disconnects-wlan#more-information
|
||||
//
|
||||
// The following VPNs use IF_TYPE_PROP_VIRTUAL under Windows:
|
||||
// - WireguardNT VPNs
|
||||
// - All WinTun-based VPNs (such as Slack Nebula)
|
||||
// - OpenVPN with tap-windows6
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (nic.hardwareAddress().startsWith("00:FF", Qt::CaseInsensitive)) {
|
||||
// OpenVPN TAP interfaces have a MAC address starting with 00:FF on Windows
|
||||
return true;
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
|
||||
if (nic.humanReadableName().startsWith("ZeroTier")) {
|
||||
// ZeroTier interfaces always start with "ZeroTier"
|
||||
return true;
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
|
||||
if (nic.humanReadableName().contains("VPN")) {
|
||||
// This one is just a final heuristic if all else fails
|
||||
return true;
|
||||
// This one is just a final VPN heuristic if all else fails
|
||||
return ReachabilityType::RI_VPN;
|
||||
}
|
||||
|
||||
// Didn't meet any of our VPN heuristics
|
||||
return false;
|
||||
// Didn't meet any of our VPN heuristics. Let's see if the peer address is on-link.
|
||||
Q_ASSERT(addr.prefixLength() >= 0);
|
||||
if (addr.prefixLength() >= 0 && s.localAddress().isInSubnet(s.peerAddress(), addr.prefixLength())) {
|
||||
return ReachabilityType::RI_LAN;
|
||||
}
|
||||
|
||||
// Default to unknown if nothing else matched
|
||||
return ReachabilityType::RI_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qWarning() << "No match found for address:" << s.localAddress();
|
||||
return false;
|
||||
return ReachabilityType::RI_UNKNOWN;
|
||||
}
|
||||
else {
|
||||
// If we fail to connect, just pretend that it's not a VPN
|
||||
return false;
|
||||
qWarning() << "Unable to check for reachability within 3 seconds";
|
||||
return ReachabilityType::RI_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,6 +479,7 @@ bool NvComputer::updateAppList(QVector<NvApp> newAppList) {
|
||||
|
||||
QVector<NvAddress> NvComputer::uniqueAddresses() const
|
||||
{
|
||||
QReadLocker readLocker(&lock);
|
||||
QVector<NvAddress> uniqueAddressList;
|
||||
|
||||
// Start with addresses correctly ordered
|
||||
@@ -406,7 +511,7 @@ QVector<NvAddress> NvComputer::uniqueAddresses() const
|
||||
return uniqueAddressList;
|
||||
}
|
||||
|
||||
bool NvComputer::update(NvComputer& that)
|
||||
bool NvComputer::update(const NvComputer& that)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
@@ -456,6 +561,7 @@ bool NvComputer::update(NvComputer& that)
|
||||
ASSIGN_IF_CHANGED(gfeVersion);
|
||||
ASSIGN_IF_CHANGED(appVersion);
|
||||
ASSIGN_IF_CHANGED(isSupportedServerVersion);
|
||||
ASSIGN_IF_CHANGED(isNvidiaServerSoftware);
|
||||
ASSIGN_IF_CHANGED(maxLumaPixelsHEVC);
|
||||
ASSIGN_IF_CHANGED(gpuModel);
|
||||
ASSIGN_IF_CHANGED_AND_NONNULL(serverCert);
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
#include <QSettings>
|
||||
#include <QRunnable>
|
||||
|
||||
class CopySafeReadWriteLock : public QReadWriteLock
|
||||
{
|
||||
public:
|
||||
CopySafeReadWriteLock() = default;
|
||||
|
||||
// Don't actually copy the QReadWriteLock
|
||||
CopySafeReadWriteLock(const CopySafeReadWriteLock&) : QReadWriteLock() {}
|
||||
CopySafeReadWriteLock& operator=(const CopySafeReadWriteLock &) { return *this; }
|
||||
};
|
||||
|
||||
class NvComputer
|
||||
{
|
||||
friend class PcMonitorThread;
|
||||
@@ -22,6 +32,14 @@ private:
|
||||
bool pendingQuit;
|
||||
|
||||
public:
|
||||
NvComputer() = default;
|
||||
|
||||
// Caller is responsible for synchronizing read access to the other host
|
||||
NvComputer(const NvComputer&) = default;
|
||||
|
||||
// Caller is responsible for synchronizing read access to the other host
|
||||
NvComputer& operator=(const NvComputer &) = default;
|
||||
|
||||
explicit NvComputer(NvHTTP& http, QString serverInfo);
|
||||
|
||||
explicit NvComputer(QSettings& settings);
|
||||
@@ -30,19 +48,30 @@ public:
|
||||
setRemoteAddress(QHostAddress);
|
||||
|
||||
bool
|
||||
update(NvComputer& that);
|
||||
update(const NvComputer& that);
|
||||
|
||||
bool
|
||||
wake();
|
||||
wake() const;
|
||||
|
||||
bool
|
||||
isReachableOverVpn();
|
||||
enum ReachabilityType
|
||||
{
|
||||
RI_UNKNOWN,
|
||||
RI_LAN,
|
||||
RI_VPN,
|
||||
};
|
||||
|
||||
ReachabilityType
|
||||
getActiveAddressReachability() const;
|
||||
|
||||
QVector<NvAddress>
|
||||
uniqueAddresses() const;
|
||||
|
||||
void
|
||||
serialize(QSettings& settings) const;
|
||||
serialize(QSettings& settings, bool serializeApps) const;
|
||||
|
||||
// Caller is responsible for synchronizing read access to both hosts
|
||||
bool
|
||||
isEqualSerialized(const NvComputer& that) const;
|
||||
|
||||
enum PairState
|
||||
{
|
||||
@@ -83,9 +112,11 @@ public:
|
||||
QString uuid;
|
||||
QSslCertificate serverCert;
|
||||
QVector<NvApp> appList;
|
||||
bool isNvidiaServerSoftware;
|
||||
// Remember to update isEqualSerialized() when adding fields here!
|
||||
|
||||
// Synchronization
|
||||
mutable QReadWriteLock lock;
|
||||
mutable CopySafeReadWriteLock lock;
|
||||
|
||||
private:
|
||||
uint16_t externalPort;
|
||||
|
||||
+19
-38
@@ -187,12 +187,15 @@ NvHTTP::getServerInfo(NvLogLevel logLevel, bool fastFail)
|
||||
}
|
||||
|
||||
void
|
||||
NvHTTP::launchApp(int appId,
|
||||
PSTREAM_CONFIGURATION streamConfig,
|
||||
bool sops,
|
||||
bool localAudio,
|
||||
int gamepadMask,
|
||||
QString& rtspSessionUrl)
|
||||
NvHTTP::startApp(QString verb,
|
||||
bool isGfe,
|
||||
int appId,
|
||||
PSTREAM_CONFIGURATION streamConfig,
|
||||
bool sops,
|
||||
bool localAudio,
|
||||
int gamepadMask,
|
||||
bool persistGameControllersOnDisconnect,
|
||||
QString& rtspSessionUrl)
|
||||
{
|
||||
int riKeyId;
|
||||
|
||||
@@ -201,25 +204,27 @@ NvHTTP::launchApp(int appId,
|
||||
|
||||
QString response =
|
||||
openConnectionToString(m_BaseUrlHttps,
|
||||
"launch",
|
||||
verb,
|
||||
"appid="+QString::number(appId)+
|
||||
"&mode="+QString::number(streamConfig->width)+"x"+
|
||||
QString::number(streamConfig->height)+"x"+
|
||||
// Using an FPS value over 60 causes SOPS to default to 720p60,
|
||||
// so force it to 0 to ensure the correct resolution is set. We
|
||||
// used to use 60 here but that locked the frame rate to 60 FPS
|
||||
// on GFE 3.20.3.
|
||||
QString::number(streamConfig->fps > 60 ? 0 : streamConfig->fps)+
|
||||
// on GFE 3.20.3. We don't need this hack for Sunshine.
|
||||
QString::number((streamConfig->fps > 60 && isGfe) ? 0 : streamConfig->fps)+
|
||||
"&additionalStates=1&sops="+QString::number(sops ? 1 : 0)+
|
||||
"&rikey="+QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex()+
|
||||
"&rikeyid="+QString::number(riKeyId)+
|
||||
(streamConfig->enableHdr ?
|
||||
((streamConfig->supportedVideoFormats & VIDEO_FORMAT_MASK_10BIT) ?
|
||||
"&hdrMode=1&clientHdrCapVersion=0&clientHdrCapSupportedFlagsInUint32=0&clientHdrCapMetaDataId=NV_STATIC_METADATA_TYPE_1&clientHdrCapDisplayData=0x0x0x0x0x0x0x0x0x0x0" :
|
||||
"")+
|
||||
"&localAudioPlayMode="+QString::number(localAudio ? 1 : 0)+
|
||||
"&surroundAudioInfo="+QString::number(SURROUNDAUDIOINFO_FROM_AUDIO_CONFIGURATION(streamConfig->audioConfiguration))+
|
||||
"&remoteControllersBitmap="+QString::number(gamepadMask)+
|
||||
"&gcmap="+QString::number(gamepadMask),
|
||||
"&gcmap="+QString::number(gamepadMask)+
|
||||
"&gcpersist="+QString::number(persistGameControllersOnDisconnect ? 1 : 0)+
|
||||
LiGetLaunchUrlQueryParameters(),
|
||||
LAUNCH_TIMEOUT_MS);
|
||||
|
||||
qInfo() << "Launch response:" << response;
|
||||
@@ -230,30 +235,6 @@ NvHTTP::launchApp(int appId,
|
||||
rtspSessionUrl = getXmlString(response, "sessionUrl0");
|
||||
}
|
||||
|
||||
void
|
||||
NvHTTP::resumeApp(PSTREAM_CONFIGURATION streamConfig, QString& rtspSessionUrl)
|
||||
{
|
||||
int riKeyId;
|
||||
|
||||
memcpy(&riKeyId, streamConfig->remoteInputAesIv, sizeof(riKeyId));
|
||||
riKeyId = qFromBigEndian(riKeyId);
|
||||
|
||||
QString response =
|
||||
openConnectionToString(m_BaseUrlHttps,
|
||||
"resume",
|
||||
"rikey="+QString(QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex())+
|
||||
"&rikeyid="+QString::number(riKeyId)+
|
||||
"&surroundAudioInfo="+QString::number(SURROUNDAUDIOINFO_FROM_AUDIO_CONFIGURATION(streamConfig->audioConfiguration)),
|
||||
RESUME_TIMEOUT_MS);
|
||||
|
||||
qInfo() << "Resume response:" << response;
|
||||
|
||||
// Throws if the request failed
|
||||
verifyResponseStatus(response);
|
||||
|
||||
rtspSessionUrl = getXmlString(response, "sessionUrl0");
|
||||
}
|
||||
|
||||
void
|
||||
NvHTTP::quitApp()
|
||||
{
|
||||
@@ -269,7 +250,7 @@ NvHTTP::quitApp()
|
||||
verifyResponseStatus(response);
|
||||
|
||||
// Newer GFE versions will just return success even if quitting fails
|
||||
// if we're not the original requestor.
|
||||
// if we're not the original requester.
|
||||
if (getCurrentGame(getServerInfo(NvHTTP::NVLL_ERROR)) != 0) {
|
||||
// Generate a synthetic GfeResponseException letting the caller know
|
||||
// that they can't kill someone else's stream.
|
||||
@@ -382,7 +363,7 @@ NvHTTP::verifyResponseStatus(QString xml)
|
||||
}
|
||||
}
|
||||
|
||||
throw GfeHttpResponseException(-1, "Malformed GFE XML (missing root element)");
|
||||
throw GfeHttpResponseException(-1, "Malformed XML (missing root element)");
|
||||
}
|
||||
|
||||
QImage
|
||||
@@ -551,7 +532,7 @@ NvHTTP::openConnection(QUrl baseUrl,
|
||||
if (reply->error() != QNetworkReply::NoError)
|
||||
{
|
||||
if (logLevel >= NvLogLevel::NVLL_ERROR) {
|
||||
qWarning() << command << " request failed with error " << reply->error();
|
||||
qWarning() << command << "request failed with error:" << reply->error();
|
||||
}
|
||||
|
||||
if (reply->error() == QNetworkReply::SslHandshakeFailedError) {
|
||||
|
||||
+9
-10
@@ -162,16 +162,15 @@ public:
|
||||
quitApp();
|
||||
|
||||
void
|
||||
resumeApp(PSTREAM_CONFIGURATION streamConfig,
|
||||
QString& rtspSessionUrl);
|
||||
|
||||
void
|
||||
launchApp(int appId,
|
||||
PSTREAM_CONFIGURATION streamConfig,
|
||||
bool sops,
|
||||
bool localAudio,
|
||||
int gamepadMask,
|
||||
QString& rtspSessionUrl);
|
||||
startApp(QString verb,
|
||||
bool isGfe,
|
||||
int appId,
|
||||
PSTREAM_CONFIGURATION streamConfig,
|
||||
bool sops,
|
||||
bool localAudio,
|
||||
int gamepadMask,
|
||||
bool persistGameControllersOnDisconnect,
|
||||
QString& rtspSessionUrl);
|
||||
|
||||
QVector<NvApp>
|
||||
getAppList();
|
||||
|
||||
@@ -298,8 +298,8 @@ NvPairingManager::pair(QString appVersion, QString pin, QSslCertificate& serverC
|
||||
}
|
||||
|
||||
QByteArray pairingSecret = NvHTTP::getXmlStringFromHex(respXml, "pairingsecret");
|
||||
QByteArray serverSecret = QByteArray(pairingSecret.data(), 16);
|
||||
QByteArray serverSignature = QByteArray(&pairingSecret.data()[16], 256);
|
||||
QByteArray serverSecret = pairingSecret.left(16);
|
||||
QByteArray serverSignature = pairingSecret.mid(16);
|
||||
|
||||
if (!verifySignature(serverSecret,
|
||||
serverSignature,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "utils.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QLibraryInfo>
|
||||
|
||||
#include "streaming/session.h"
|
||||
#include "streaming/streamutils.h"
|
||||
@@ -17,6 +18,7 @@ SystemProperties::SystemProperties()
|
||||
hasDesktopEnvironment = WMUtils::isRunningDesktopEnvironment();
|
||||
isRunningWayland = WMUtils::isRunningWayland();
|
||||
isRunningXWayland = isRunningWayland && QGuiApplication::platformName() == "xcb";
|
||||
usesMaterial3Theme = QLibraryInfo::version() >= QVersionNumber(6, 5, 0);
|
||||
QString nativeArch = QSysInfo::currentCpuArchitecture();
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
@@ -70,15 +72,9 @@ SystemProperties::SystemProperties()
|
||||
// and cache the results to speed up future queries on this data.
|
||||
querySdlVideoInfo();
|
||||
|
||||
Q_ASSERT(maximumStreamingFrameRate >= 60);
|
||||
Q_ASSERT(!monitorDesktopResolutions.isEmpty());
|
||||
Q_ASSERT(!monitorRefreshRates.isEmpty());
|
||||
Q_ASSERT(!monitorNativeResolutions.isEmpty());
|
||||
}
|
||||
|
||||
QRect SystemProperties::getDesktopResolution(int displayIndex)
|
||||
{
|
||||
// Returns default constructed QRect if out of bounds
|
||||
return monitorDesktopResolutions.value(displayIndex);
|
||||
Q_ASSERT(!monitorSafeAreaResolutions.isEmpty());
|
||||
}
|
||||
|
||||
QRect SystemProperties::getNativeResolution(int displayIndex)
|
||||
@@ -87,6 +83,18 @@ QRect SystemProperties::getNativeResolution(int displayIndex)
|
||||
return monitorNativeResolutions.value(displayIndex);
|
||||
}
|
||||
|
||||
QRect SystemProperties::getSafeAreaResolution(int displayIndex)
|
||||
{
|
||||
// Returns default constructed QRect if out of bounds
|
||||
return monitorSafeAreaResolutions.value(displayIndex);
|
||||
}
|
||||
|
||||
int SystemProperties::getRefreshRate(int displayIndex)
|
||||
{
|
||||
// Returns 0 if out of bounds
|
||||
return monitorRefreshRates.value(displayIndex);
|
||||
}
|
||||
|
||||
class QuerySdlVideoThread : public QThread
|
||||
{
|
||||
public:
|
||||
@@ -120,7 +128,7 @@ void SystemProperties::querySdlVideoInfoInternal()
|
||||
{
|
||||
hasHardwareAcceleration = false;
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) {
|
||||
if (SDLC_FAILURE(SDL_InitSubSystem(SDL_INIT_VIDEO))) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_InitSubSystem(SDL_INIT_VIDEO) failed: %s",
|
||||
SDL_GetError());
|
||||
@@ -131,21 +139,15 @@ void SystemProperties::querySdlVideoInfoInternal()
|
||||
// We call the internal variant because we're already in a safe thread context.
|
||||
refreshDisplaysInternal();
|
||||
|
||||
SDL_Window* testWindow = SDL_CreateWindow("", 0, 0, 1280, 720,
|
||||
SDL_WINDOW_HIDDEN | StreamUtils::getPlatformWindowFlags());
|
||||
SDL_Window* testWindow = SDLC_CreateWindowWithFallback("", 0, 0, 1280, 720,
|
||||
SDL_WINDOW_HIDDEN,
|
||||
StreamUtils::getPlatformWindowFlags());
|
||||
if (!testWindow) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Failed to create test window with platform flags: %s",
|
||||
SDL_GetError());
|
||||
|
||||
testWindow = SDL_CreateWindow("", 0, 0, 1280, 720, SDL_WINDOW_HIDDEN);
|
||||
if (!testWindow) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Failed to create window for hardware decode test: %s",
|
||||
SDL_GetError());
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
return;
|
||||
}
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Failed to create window for hardware decode test: %s",
|
||||
SDL_GetError());
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
return;
|
||||
}
|
||||
|
||||
Session::getDecoderInfo(testWindow, hasHardwareAcceleration, rendererAlwaysFullScreen, supportsHdr, maximumResolution);
|
||||
@@ -186,44 +188,27 @@ void SystemProperties::refreshDisplays()
|
||||
|
||||
void SystemProperties::refreshDisplaysInternal()
|
||||
{
|
||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) {
|
||||
if (SDLC_FAILURE(SDL_InitSubSystem(SDL_INIT_VIDEO))) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_InitSubSystem(SDL_INIT_VIDEO) failed: %s",
|
||||
SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
monitorDesktopResolutions.clear();
|
||||
monitorNativeResolutions.clear();
|
||||
|
||||
// Never let the maximum drop below 60 FPS
|
||||
maximumStreamingFrameRate = 60;
|
||||
int numDisplays = 0;
|
||||
SDL_DisplayID *displays = SDL_GetDisplays(&numDisplays);
|
||||
|
||||
SDL_DisplayMode bestMode;
|
||||
for (int displayIndex = 0; displayIndex < SDL_GetNumVideoDisplays(); displayIndex++) {
|
||||
for (int i = 0; i < numDisplays; i++) {
|
||||
SDL_DisplayMode desktopMode;
|
||||
int err;
|
||||
SDL_Rect safeArea;
|
||||
|
||||
err = SDL_GetDesktopDisplayMode(displayIndex, &desktopMode);
|
||||
if (err == 0) {
|
||||
if (StreamUtils::getNativeDesktopMode(displays[i], &desktopMode, &safeArea)) {
|
||||
if (desktopMode.w <= 8192 && desktopMode.h <= 8192) {
|
||||
monitorDesktopResolutions.insert(displayIndex, QRect(0, 0, desktopMode.w, desktopMode.h));
|
||||
}
|
||||
else {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Skipping resolution over 8K: %dx%d",
|
||||
desktopMode.w, desktopMode.h);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_GetDesktopDisplayMode() failed: %s",
|
||||
SDL_GetError());
|
||||
}
|
||||
|
||||
if (StreamUtils::getRealDesktopMode(displayIndex, &desktopMode)) {
|
||||
if (desktopMode.w <= 8192 && desktopMode.h <= 8192) {
|
||||
monitorNativeResolutions.insert(displayIndex, QRect(0, 0, desktopMode.w, desktopMode.h));
|
||||
monitorNativeResolutions.insert(i, QRect(0, 0, desktopMode.w, desktopMode.h));
|
||||
monitorSafeAreaResolutions.insert(i, QRect(0, 0, safeArea.w, safeArea.h));
|
||||
}
|
||||
else {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
@@ -233,9 +218,10 @@ void SystemProperties::refreshDisplaysInternal()
|
||||
|
||||
// Start at desktop mode and work our way up
|
||||
bestMode = desktopMode;
|
||||
for (int i = 0; i < SDL_GetNumDisplayModes(displayIndex); i++) {
|
||||
int numDisplayModes = SDL_GetNumDisplayModes(displays[i]);
|
||||
for (int i = 0; i < numDisplayModes; i++) {
|
||||
SDL_DisplayMode mode;
|
||||
if (SDL_GetDisplayMode(displayIndex, i, &mode) == 0) {
|
||||
if (SDL_GetDisplayMode(displays[i], i, &mode) == 0) {
|
||||
if (mode.w == desktopMode.w && mode.h == desktopMode.h) {
|
||||
if (mode.refresh_rate > bestMode.refresh_rate) {
|
||||
bestMode = mode;
|
||||
@@ -244,9 +230,20 @@ void SystemProperties::refreshDisplaysInternal()
|
||||
}
|
||||
}
|
||||
|
||||
maximumStreamingFrameRate = qMax(maximumStreamingFrameRate, bestMode.refresh_rate);
|
||||
// Try to normalize values around our our standard refresh rates.
|
||||
// Some displays/OSes report values that are slightly off.
|
||||
if (bestMode.refresh_rate >= 58 && bestMode.refresh_rate <= 62) {
|
||||
monitorRefreshRates.append(60);
|
||||
}
|
||||
else if (bestMode.refresh_rate >= 28 && bestMode.refresh_rate <= 32) {
|
||||
monitorRefreshRates.append(30);
|
||||
}
|
||||
else {
|
||||
monitorRefreshRates.append(bestMode.refresh_rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_free(displays);
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
}
|
||||
|
||||
@@ -23,14 +23,15 @@ public:
|
||||
Q_PROPERTY(bool hasBrowser MEMBER hasBrowser CONSTANT)
|
||||
Q_PROPERTY(bool hasDiscordIntegration MEMBER hasDiscordIntegration CONSTANT)
|
||||
Q_PROPERTY(QString unmappedGamepads MEMBER unmappedGamepads NOTIFY unmappedGamepadsChanged)
|
||||
Q_PROPERTY(int maximumStreamingFrameRate MEMBER maximumStreamingFrameRate CONSTANT)
|
||||
Q_PROPERTY(QSize maximumResolution MEMBER maximumResolution CONSTANT)
|
||||
Q_PROPERTY(QString versionString MEMBER versionString CONSTANT)
|
||||
Q_PROPERTY(bool supportsHdr MEMBER supportsHdr CONSTANT)
|
||||
Q_PROPERTY(bool usesMaterial3Theme MEMBER usesMaterial3Theme CONSTANT)
|
||||
|
||||
Q_INVOKABLE void refreshDisplays();
|
||||
Q_INVOKABLE QRect getDesktopResolution(int displayIndex);
|
||||
Q_INVOKABLE QRect getNativeResolution(int displayIndex);
|
||||
Q_INVOKABLE QRect getSafeAreaResolution(int displayIndex);
|
||||
Q_INVOKABLE int getRefreshRate(int displayIndex);
|
||||
|
||||
signals:
|
||||
void unmappedGamepadsChanged();
|
||||
@@ -50,11 +51,12 @@ private:
|
||||
bool hasBrowser;
|
||||
bool hasDiscordIntegration;
|
||||
QString unmappedGamepads;
|
||||
int maximumStreamingFrameRate;
|
||||
QSize maximumResolution;
|
||||
QList<QRect> monitorDesktopResolutions;
|
||||
QList<QRect> monitorNativeResolutions;
|
||||
QList<QRect> monitorSafeAreaResolutions;
|
||||
QList<int> monitorRefreshRates;
|
||||
QString versionString;
|
||||
bool supportsHdr;
|
||||
bool usesMaterial3Theme;
|
||||
};
|
||||
|
||||
|
||||
@@ -164,8 +164,10 @@ GlobalCommandLineParser::ParseResult GlobalCommandLineParser::parse(const QStrin
|
||||
"Starts Moonlight normally if no arguments are given.\n"
|
||||
"\n"
|
||||
"Available actions:\n"
|
||||
" list List the available apps on a host\n"
|
||||
" quit Quit the currently running app\n"
|
||||
" stream Start streaming an app\n"
|
||||
" pair Pair a new host\n"
|
||||
"\n"
|
||||
"See 'moonlight <action> --help' for help of specific action."
|
||||
);
|
||||
@@ -193,6 +195,10 @@ GlobalCommandLineParser::ParseResult GlobalCommandLineParser::parse(const QStrin
|
||||
return QuitRequested;
|
||||
} else if (action == "stream") {
|
||||
return StreamRequested;
|
||||
} else if (action == "pair") {
|
||||
return PairRequested;
|
||||
} else if (action == "list") {
|
||||
return ListRequested;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +248,58 @@ QString QuitCommandLineParser::getHost() const
|
||||
return m_Host;
|
||||
}
|
||||
|
||||
PairCommandLineParser::PairCommandLineParser()
|
||||
{
|
||||
}
|
||||
|
||||
PairCommandLineParser::~PairCommandLineParser()
|
||||
{
|
||||
}
|
||||
|
||||
void PairCommandLineParser::parse(const QStringList &args)
|
||||
{
|
||||
CommandLineParser parser;
|
||||
parser.setupCommonOptions();
|
||||
parser.setApplicationDescription(
|
||||
"\n"
|
||||
"Pair with the specified host."
|
||||
);
|
||||
parser.addPositionalArgument("pair", "pair host");
|
||||
parser.addPositionalArgument("host", "Host computer name, UUID, or IP address", "<host>");
|
||||
parser.addValueOption("pin", "4 digit pairing PIN");
|
||||
|
||||
if (!parser.parse(args)) {
|
||||
parser.showError(parser.errorText());
|
||||
}
|
||||
|
||||
parser.handleUnknownOptions();
|
||||
|
||||
// This method will not return and terminates the process if --version or
|
||||
// --help is specified
|
||||
parser.handleHelpAndVersionOptions();
|
||||
|
||||
// Verify that host has been provided
|
||||
auto posArgs = parser.positionalArguments();
|
||||
if (posArgs.length() < 2) {
|
||||
parser.showError("Host not provided");
|
||||
}
|
||||
m_Host = parser.positionalArguments().at(1);
|
||||
m_PredefinedPin = parser.value("pin");
|
||||
if (!m_PredefinedPin.isEmpty() && m_PredefinedPin.length() != 4) {
|
||||
parser.showError("PIN must be 4 digits");
|
||||
}
|
||||
}
|
||||
|
||||
QString PairCommandLineParser::getHost() const
|
||||
{
|
||||
return m_Host;
|
||||
}
|
||||
|
||||
QString PairCommandLineParser::getPredefinedPin() const
|
||||
{
|
||||
return m_PredefinedPin;
|
||||
}
|
||||
|
||||
StreamCommandLineParser::StreamCommandLineParser()
|
||||
{
|
||||
m_WindowModeMap = {
|
||||
@@ -258,6 +316,7 @@ StreamCommandLineParser::StreamCommandLineParser()
|
||||
{"auto", StreamingPreferences::VCC_AUTO},
|
||||
{"H.264", StreamingPreferences::VCC_FORCE_H264},
|
||||
{"HEVC", StreamingPreferences::VCC_FORCE_HEVC},
|
||||
{"AV1", StreamingPreferences::VCC_FORCE_AV1},
|
||||
};
|
||||
m_VideoDecoderMap = {
|
||||
{"auto", StreamingPreferences::VDS_AUTO},
|
||||
@@ -313,6 +372,9 @@ void StreamCommandLineParser::parse(const QStringList &args, StreamingPreference
|
||||
parser.addToggleOption("reverse-scroll-direction", "inverted scroll direction");
|
||||
parser.addToggleOption("swap-gamepad-buttons", "swap A/B and X/Y gamepad buttons (Nintendo-style)");
|
||||
parser.addToggleOption("keep-awake", "prevent display sleep while streaming");
|
||||
parser.addToggleOption("performance-overlay", "show performance overlay");
|
||||
parser.addToggleOption("hdr", "HDR streaming");
|
||||
parser.addToggleOption("yuv444", "YUV 4:4:4 sampling, if supported");
|
||||
parser.addChoiceOption("capture-system-keys", "capture system key combos", m_CaptureSysKeysModeMap.keys());
|
||||
parser.addChoiceOption("video-codec", "video codec", m_VideoCodecMap.keys());
|
||||
parser.addChoiceOption("video-decoder", "video decoder", m_VideoDecoderMap.keys());
|
||||
@@ -351,20 +413,20 @@ void StreamCommandLineParser::parse(const QStringList &args, StreamingPreference
|
||||
// Resolve --fps option
|
||||
if (parser.isSet("fps")) {
|
||||
preferences->fps = parser.getIntOption("fps");
|
||||
if (!inRange(preferences->fps, 30, 240)) {
|
||||
parser.showError("FPS must be in range: 30 - 240");
|
||||
if (!inRange(preferences->fps, 10, 480)) {
|
||||
fprintf(stderr, "Warning: FPS is out of the supported range (10 - 480 FPS). Performance may suffer!\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve --bitrate option
|
||||
if (parser.isSet("bitrate")) {
|
||||
preferences->bitrateKbps = parser.getIntOption("bitrate");
|
||||
if (!inRange(preferences->bitrateKbps, 500, 150000)) {
|
||||
parser.showError("Bitrate must be in range: 500 - 150000");
|
||||
if (!inRange(preferences->bitrateKbps, 500, 500000)) {
|
||||
fprintf(stderr, "Warning: Bitrate is out of the supported range (500 - 500000 Kbps). Performance may suffer!\n");
|
||||
}
|
||||
} else if (displaySet || parser.isSet("fps")) {
|
||||
preferences->bitrateKbps = preferences->getDefaultBitrate(
|
||||
preferences->width, preferences->height, preferences->fps);
|
||||
preferences->width, preferences->height, preferences->fps, preferences->enableYUV444);
|
||||
}
|
||||
|
||||
// Resolve --packet-size option
|
||||
@@ -427,6 +489,15 @@ void StreamCommandLineParser::parse(const QStringList &args, StreamingPreference
|
||||
// Resolve --keep-awake and --no-keep-awake options
|
||||
preferences->keepAwake = parser.getToggleOptionValue("keep-awake", preferences->keepAwake);
|
||||
|
||||
// Resolve --performance-overlay and --no-performance-overlay options
|
||||
preferences->showPerformanceOverlay = parser.getToggleOptionValue("performance-overlay", preferences->showPerformanceOverlay);
|
||||
|
||||
// Resolve --hdr and --no-hdr options
|
||||
preferences->enableHdr = parser.getToggleOptionValue("hdr", preferences->enableHdr);
|
||||
|
||||
// Resolve --yuv444 and --no-yuv444 options
|
||||
preferences->enableYUV444 = parser.getToggleOptionValue("yuv444", preferences->enableYUV444);
|
||||
|
||||
// Resolve --capture-system-keys option
|
||||
if (parser.isSet("capture-system-keys")) {
|
||||
preferences->captureSysKeysMode = mapValue(m_CaptureSysKeysModeMap, parser.getChoiceOptionValue("capture-system-keys"));
|
||||
@@ -468,3 +539,62 @@ QString StreamCommandLineParser::getAppName() const
|
||||
{
|
||||
return m_AppName;
|
||||
}
|
||||
|
||||
ListCommandLineParser::ListCommandLineParser()
|
||||
{
|
||||
}
|
||||
|
||||
ListCommandLineParser::~ListCommandLineParser()
|
||||
{
|
||||
}
|
||||
|
||||
void ListCommandLineParser::parse(const QStringList &args)
|
||||
{
|
||||
CommandLineParser parser;
|
||||
parser.setupCommonOptions();
|
||||
parser.setApplicationDescription(
|
||||
"\n"
|
||||
"List the available apps on the given host."
|
||||
);
|
||||
parser.addPositionalArgument("list", "list available apps");
|
||||
parser.addPositionalArgument("host", "Host computer name, UUID, or IP address", "<host>");
|
||||
|
||||
parser.addFlagOption("csv", "Print as CSV with additional information");
|
||||
parser.addFlagOption("verbose", "Displays additional information");
|
||||
|
||||
if (!parser.parse(args)) {
|
||||
parser.showError(parser.errorText());
|
||||
}
|
||||
|
||||
parser.handleUnknownOptions();
|
||||
|
||||
|
||||
m_PrintCSV = parser.isSet("csv");
|
||||
m_Verbose = parser.isSet("verbose");
|
||||
|
||||
// This method will not return and terminates the process if --version or
|
||||
// --help is specified
|
||||
parser.handleHelpAndVersionOptions();
|
||||
|
||||
// Verify that host has been provided
|
||||
auto posArgs = parser.positionalArguments();
|
||||
if (posArgs.length() < 2) {
|
||||
parser.showError("Host not provided");
|
||||
}
|
||||
m_Host = parser.positionalArguments().at(1);
|
||||
}
|
||||
|
||||
QString ListCommandLineParser::getHost() const
|
||||
{
|
||||
return m_Host;
|
||||
}
|
||||
|
||||
bool ListCommandLineParser::isPrintCSV() const
|
||||
{
|
||||
return m_PrintCSV;
|
||||
}
|
||||
|
||||
bool ListCommandLineParser::isVerbose() const
|
||||
{
|
||||
return m_Verbose;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ public:
|
||||
NormalStartRequested,
|
||||
StreamRequested,
|
||||
QuitRequested,
|
||||
PairRequested,
|
||||
ListRequested,
|
||||
};
|
||||
|
||||
GlobalCommandLineParser();
|
||||
@@ -35,6 +37,22 @@ private:
|
||||
QString m_Host;
|
||||
};
|
||||
|
||||
class PairCommandLineParser
|
||||
{
|
||||
public:
|
||||
PairCommandLineParser();
|
||||
virtual ~PairCommandLineParser();
|
||||
|
||||
void parse(const QStringList &args);
|
||||
|
||||
QString getHost() const;
|
||||
QString getPredefinedPin() const;
|
||||
|
||||
private:
|
||||
QString m_Host;
|
||||
QString m_PredefinedPin;
|
||||
};
|
||||
|
||||
class StreamCommandLineParser
|
||||
{
|
||||
public:
|
||||
@@ -55,3 +73,21 @@ private:
|
||||
QMap<QString, StreamingPreferences::VideoDecoderSelection> m_VideoDecoderMap;
|
||||
QMap<QString, StreamingPreferences::CaptureSysKeysMode> m_CaptureSysKeysModeMap;
|
||||
};
|
||||
|
||||
class ListCommandLineParser
|
||||
{
|
||||
public:
|
||||
ListCommandLineParser();
|
||||
virtual ~ListCommandLineParser();
|
||||
|
||||
void parse(const QStringList &args);
|
||||
|
||||
QString getHost() const;
|
||||
bool isPrintCSV() const;
|
||||
bool isVerbose() const;
|
||||
|
||||
private:
|
||||
QString m_Host;
|
||||
bool m_PrintCSV;
|
||||
bool m_Verbose;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
#include "listapps.h"
|
||||
|
||||
#include "backend/boxartmanager.h"
|
||||
#include "backend/computermanager.h"
|
||||
#include "backend/computerseeker.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
|
||||
#define COMPUTER_SEEK_TIMEOUT 30000
|
||||
#define APP_SEEK_TIMEOUT 10000
|
||||
|
||||
namespace CliListApps
|
||||
{
|
||||
|
||||
enum State {
|
||||
StateInit,
|
||||
StateSeekComputer,
|
||||
StateListApp,
|
||||
StateSeekApp,
|
||||
StateFailure,
|
||||
};
|
||||
|
||||
class Event
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
ComputerFound,
|
||||
ComputerUpdated,
|
||||
ComputerSeekTimedout,
|
||||
Executed,
|
||||
};
|
||||
|
||||
Event(Type type)
|
||||
: type(type), computerManager(nullptr), computer(nullptr) {}
|
||||
|
||||
Type type;
|
||||
ComputerManager *computerManager;
|
||||
NvComputer *computer;
|
||||
QString errorMessage;
|
||||
};
|
||||
|
||||
class LauncherPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(Launcher)
|
||||
|
||||
public:
|
||||
LauncherPrivate(Launcher *q) : q_ptr(q) {}
|
||||
|
||||
void handleEvent(Event event)
|
||||
{
|
||||
Q_Q(Launcher);
|
||||
NvApp app;
|
||||
|
||||
switch (event.type) {
|
||||
// Occurs when CLI main calls execute
|
||||
case Event::Executed:
|
||||
if (m_State == StateInit) {
|
||||
m_State = StateSeekComputer;
|
||||
m_ComputerManager = event.computerManager;
|
||||
|
||||
m_ComputerSeeker = new ComputerSeeker(m_ComputerManager, m_ComputerName, q);
|
||||
q->connect(m_ComputerSeeker, &ComputerSeeker::computerFound,
|
||||
q, &Launcher::onComputerFound);
|
||||
q->connect(m_ComputerSeeker, &ComputerSeeker::errorTimeout,
|
||||
q, &Launcher::onComputerSeekTimeout);
|
||||
m_ComputerSeeker->start(COMPUTER_SEEK_TIMEOUT);
|
||||
|
||||
q->connect(m_ComputerManager, &ComputerManager::computerStateChanged,
|
||||
q, &Launcher::onComputerUpdated);
|
||||
|
||||
m_BoxArtManager = new BoxArtManager(q);
|
||||
|
||||
if (m_Arguments.isVerbose()) {
|
||||
fprintf(stdout, "Establishing connection to PC...\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
// Occurs when computer search timed out
|
||||
case Event::ComputerSeekTimedout:
|
||||
if (m_State == StateSeekComputer) {
|
||||
fprintf(stderr, "%s\n", qPrintable(QString("Failed to connect to %1").arg(m_ComputerName)));
|
||||
|
||||
QCoreApplication::exit(-1);
|
||||
}
|
||||
break;
|
||||
// Occurs when searched computer is found
|
||||
case Event::ComputerFound:
|
||||
if (m_State == StateSeekComputer) {
|
||||
if (event.computer->pairState == NvComputer::PS_PAIRED) {
|
||||
m_State = StateSeekApp;
|
||||
m_Computer = event.computer;
|
||||
m_TimeoutTimer->start(APP_SEEK_TIMEOUT);
|
||||
if (m_Arguments.isVerbose()) {
|
||||
fprintf(stdout, "Loading app list...\n");
|
||||
}
|
||||
} else {
|
||||
m_State = StateFailure;
|
||||
fprintf(stderr, "%s\n", qPrintable(QObject::tr("Computer %1 has not been paired. "
|
||||
"Please open Moonlight to pair before retrieving games list.")
|
||||
.arg(event.computer->name)));
|
||||
|
||||
QCoreApplication::exit(-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// Occurs when a computer is updated
|
||||
case Event::ComputerUpdated:
|
||||
if (m_State == StateSeekApp) {
|
||||
m_Arguments.isPrintCSV() ? printAppsCSV(m_Computer->appList) : printApps(m_Computer->appList);
|
||||
|
||||
QCoreApplication::exit(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void printApps(QVector<NvApp> apps) {
|
||||
for (int i = 0; i < apps.length(); i++) {
|
||||
fprintf(stdout, "%s\n", qPrintable(apps[i].name));
|
||||
}
|
||||
}
|
||||
|
||||
void printAppsCSV(QVector<NvApp> apps) {
|
||||
fprintf(stdout, "Name, ID, HDR Support, App Collection Game, Hidden, Direct Launch, Boxart URL\n");
|
||||
for (int i = 0; i < apps.length(); i++) {
|
||||
printAppCSV(apps[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void printAppCSV(NvApp app) const
|
||||
{
|
||||
fprintf(stdout, "\"%s\",%d,%s,%s,%s,%s,\"%s\"\n", qPrintable(app.name),
|
||||
app.id,
|
||||
app.hdrSupported ? "true" : "false",
|
||||
app.isAppCollectorGame ? "true" : "false",
|
||||
app.hidden ? "true" : "false",
|
||||
app.directLaunch ? "true" : "false",
|
||||
qPrintable(m_BoxArtManager->loadBoxArt(m_Computer, app).toDisplayString()));
|
||||
}
|
||||
|
||||
Launcher *q_ptr;
|
||||
ComputerManager *m_ComputerManager;
|
||||
QString m_ComputerName;
|
||||
ComputerSeeker *m_ComputerSeeker;
|
||||
BoxArtManager *m_BoxArtManager;
|
||||
NvComputer *m_Computer;
|
||||
State m_State;
|
||||
QTimer *m_TimeoutTimer;
|
||||
ListCommandLineParser m_Arguments;
|
||||
};
|
||||
|
||||
Launcher::Launcher(QString computer, ListCommandLineParser arguments, QObject *parent)
|
||||
: QObject(parent),
|
||||
m_DPtr(new LauncherPrivate(this))
|
||||
{
|
||||
Q_D(Launcher);
|
||||
d->m_ComputerName = computer;
|
||||
d->m_State = StateInit;
|
||||
d->m_TimeoutTimer = new QTimer(this);
|
||||
d->m_TimeoutTimer->setSingleShot(true);
|
||||
d->m_Arguments = arguments;
|
||||
connect(d->m_TimeoutTimer, &QTimer::timeout,
|
||||
this, &Launcher::onComputerSeekTimeout);
|
||||
}
|
||||
|
||||
Launcher::~Launcher()
|
||||
{
|
||||
}
|
||||
|
||||
void Launcher::execute(ComputerManager *manager)
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::Executed);
|
||||
event.computerManager = manager;
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
bool Launcher::isExecuted() const
|
||||
{
|
||||
Q_D(const Launcher);
|
||||
return d->m_State != StateInit;
|
||||
}
|
||||
|
||||
void Launcher::onComputerFound(NvComputer *computer)
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::ComputerFound);
|
||||
event.computer = computer;
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
void Launcher::onComputerSeekTimeout()
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::ComputerSeekTimedout);
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
void Launcher::onComputerUpdated(NvComputer *computer)
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::ComputerUpdated);
|
||||
event.computer = computer;
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include "commandlineparser.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
class ComputerManager;
|
||||
class NvComputer;
|
||||
|
||||
namespace CliListApps
|
||||
{
|
||||
|
||||
class LauncherPrivate;
|
||||
|
||||
class Launcher : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE_D(m_DPtr, Launcher)
|
||||
|
||||
public:
|
||||
explicit Launcher(QString computer, ListCommandLineParser arguments, QObject *parent = nullptr);
|
||||
~Launcher();
|
||||
|
||||
Q_INVOKABLE void execute(ComputerManager *manager);
|
||||
Q_INVOKABLE bool isExecuted() const;
|
||||
|
||||
private slots:
|
||||
void onComputerFound(NvComputer *computer);
|
||||
void onComputerUpdated(NvComputer *computer);
|
||||
void onComputerSeekTimeout();
|
||||
|
||||
private:
|
||||
QScopedPointer<LauncherPrivate> m_DPtr;
|
||||
ListCommandLineParser m_Arguments;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
#include "pair.h"
|
||||
|
||||
#include "backend/computermanager.h"
|
||||
#include "backend/computerseeker.h"
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
|
||||
#define COMPUTER_SEEK_TIMEOUT 10000
|
||||
|
||||
namespace CliPair
|
||||
{
|
||||
|
||||
enum State {
|
||||
StateInit,
|
||||
StateSeekComputer,
|
||||
StatePairing,
|
||||
StateFailure,
|
||||
StateComplete,
|
||||
};
|
||||
|
||||
class Event
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
ComputerFound,
|
||||
Executed,
|
||||
PairingCompleted,
|
||||
Timedout,
|
||||
};
|
||||
|
||||
Event(Type type)
|
||||
: type(type), computerManager(nullptr), computer(nullptr) {}
|
||||
|
||||
Type type;
|
||||
ComputerManager *computerManager;
|
||||
NvComputer *computer;
|
||||
QString errorMessage;
|
||||
};
|
||||
|
||||
class LauncherPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(Launcher)
|
||||
|
||||
public:
|
||||
LauncherPrivate(Launcher *q) : q_ptr(q) {}
|
||||
|
||||
void handleEvent(Event event)
|
||||
{
|
||||
Q_Q(Launcher);
|
||||
|
||||
switch (event.type) {
|
||||
// Occurs when CliPair becomes visible and the UI calls launcher's execute()
|
||||
case Event::Executed:
|
||||
if (m_State == StateInit) {
|
||||
m_State = StateSeekComputer;
|
||||
m_ComputerManager = event.computerManager;
|
||||
q->connect(m_ComputerManager, &ComputerManager::pairingCompleted,
|
||||
q, &Launcher::onPairingCompleted);
|
||||
|
||||
// If we weren't provided a predefined PIN, generate one now
|
||||
if (m_PredefinedPin.isEmpty()) {
|
||||
m_PredefinedPin = m_ComputerManager->generatePinString();
|
||||
}
|
||||
|
||||
m_ComputerSeeker = new ComputerSeeker(m_ComputerManager, m_ComputerName, q);
|
||||
q->connect(m_ComputerSeeker, &ComputerSeeker::computerFound,
|
||||
q, &Launcher::onComputerFound);
|
||||
q->connect(m_ComputerSeeker, &ComputerSeeker::errorTimeout,
|
||||
q, &Launcher::onTimeout);
|
||||
m_ComputerSeeker->start(COMPUTER_SEEK_TIMEOUT);
|
||||
|
||||
emit q->searchingComputer();
|
||||
}
|
||||
break;
|
||||
// Occurs when searched computer is found
|
||||
case Event::ComputerFound:
|
||||
if (m_State == StateSeekComputer) {
|
||||
if (event.computer->pairState == NvComputer::PS_PAIRED) {
|
||||
m_State = StateFailure;
|
||||
QString msg = QObject::tr("%1 is already paired").arg(event.computer->name);
|
||||
emit q->failed(msg);
|
||||
}
|
||||
else {
|
||||
Q_ASSERT(!m_PredefinedPin.isEmpty());
|
||||
|
||||
m_State = StatePairing;
|
||||
m_ComputerManager->pairHost(event.computer, m_PredefinedPin);
|
||||
emit q->pairing(event.computer->name, m_PredefinedPin);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// Occurs when pairing operation completes
|
||||
case Event::PairingCompleted:
|
||||
if (m_State == StatePairing) {
|
||||
if (event.errorMessage.isEmpty()) {
|
||||
m_State = StateComplete;
|
||||
emit q->success();
|
||||
}
|
||||
else {
|
||||
m_State = StateFailure;
|
||||
emit q->failed(event.errorMessage);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// Occurs when computer search timed out
|
||||
case Event::Timedout:
|
||||
if (m_State == StateSeekComputer) {
|
||||
m_State = StateFailure;
|
||||
emit q->failed(QObject::tr("Failed to connect to %1").arg(m_ComputerName));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Launcher *q_ptr;
|
||||
QString m_ComputerName;
|
||||
QString m_PredefinedPin;
|
||||
ComputerManager *m_ComputerManager;
|
||||
ComputerSeeker *m_ComputerSeeker;
|
||||
NvComputer *m_Computer;
|
||||
State m_State;
|
||||
QTimer *m_TimeoutTimer;
|
||||
};
|
||||
|
||||
Launcher::Launcher(QString computer, QString predefinedPin, QObject *parent)
|
||||
: QObject(parent),
|
||||
m_DPtr(new LauncherPrivate(this))
|
||||
{
|
||||
Q_D(Launcher);
|
||||
d->m_ComputerName = computer;
|
||||
d->m_PredefinedPin = predefinedPin;
|
||||
d->m_State = StateInit;
|
||||
d->m_TimeoutTimer = new QTimer(this);
|
||||
d->m_TimeoutTimer->setSingleShot(true);
|
||||
connect(d->m_TimeoutTimer, &QTimer::timeout,
|
||||
this, &Launcher::onTimeout);
|
||||
}
|
||||
|
||||
Launcher::~Launcher()
|
||||
{
|
||||
}
|
||||
|
||||
void Launcher::execute(ComputerManager *manager)
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::Executed);
|
||||
event.computerManager = manager;
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
bool Launcher::isExecuted() const
|
||||
{
|
||||
Q_D(const Launcher);
|
||||
return d->m_State != StateInit;
|
||||
}
|
||||
|
||||
void Launcher::onComputerFound(NvComputer *computer)
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::ComputerFound);
|
||||
event.computer = computer;
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
void Launcher::onTimeout()
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::Timedout);
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
void Launcher::onPairingCompleted(NvComputer* computer, QString error)
|
||||
{
|
||||
Q_D(Launcher);
|
||||
Event event(Event::PairingCompleted);
|
||||
event.computer = computer;
|
||||
event.errorMessage = error;
|
||||
d->handleEvent(event);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
class ComputerManager;
|
||||
class NvComputer;
|
||||
class Session;
|
||||
class StreamingPreferences;
|
||||
|
||||
namespace CliPair
|
||||
{
|
||||
|
||||
class Event;
|
||||
class LauncherPrivate;
|
||||
|
||||
class Launcher : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE_D(m_DPtr, Launcher)
|
||||
|
||||
public:
|
||||
explicit Launcher(QString computer, QString predefinedPin,
|
||||
QObject *parent = nullptr);
|
||||
~Launcher();
|
||||
Q_INVOKABLE void execute(ComputerManager *manager);
|
||||
Q_INVOKABLE bool isExecuted() const;
|
||||
|
||||
signals:
|
||||
void searchingComputer();
|
||||
void pairing(QString pcName, QString pin);
|
||||
void failed(QString text);
|
||||
void success();
|
||||
|
||||
private slots:
|
||||
void onComputerFound(NvComputer *computer);
|
||||
void onPairingCompleted(NvComputer *computer, QString error);
|
||||
void onTimeout();
|
||||
|
||||
private:
|
||||
QScopedPointer<LauncherPrivate> m_DPtr;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
|
||||
#define COMPUTER_SEEK_TIMEOUT 10000
|
||||
#define COMPUTER_SEEK_TIMEOUT 30000
|
||||
#define APP_SEEK_TIMEOUT 10000
|
||||
|
||||
namespace CliStartStream
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
}
|
||||
break;
|
||||
// Occurs when the previous app quit has been completed, handles quitting errors if any
|
||||
// happended. ComputerUpdated event's handler handles session start when previous app has
|
||||
// happened. ComputerUpdated event's handler handles session start when previous app has
|
||||
// quit.
|
||||
case Event::AppQuitCompleted:
|
||||
if (m_State == StateSeekApp && !event.errorMessage.isEmpty()) {
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
QString getCurrentAppName() const
|
||||
{
|
||||
for (NvApp app : m_Computer->appList) {
|
||||
for (const NvApp& app : m_Computer->appList) {
|
||||
if (m_Computer->currentGameId == app.id) {
|
||||
return app.name;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 78261eb6e2fe728fa5d3843b5b8962b1ca559b7e Mon Sep 17 00:00:00 2001
|
||||
From: David Rosca <nowrep@gmail.com>
|
||||
Date: Sat, 16 Dec 2023 14:52:01 +0100
|
||||
Subject: [PATCH] Vulkan: Don't try to reuse old swapchain
|
||||
|
||||
---
|
||||
src/vulkan/swapchain.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/vulkan/swapchain.c b/src/vulkan/swapchain.c
|
||||
index 0646e57c..c0b07ce4 100644
|
||||
--- a/src/vulkan/swapchain.c
|
||||
+++ b/src/vulkan/swapchain.c
|
||||
@@ -612,13 +612,21 @@ static bool vk_sw_recreate(pl_swapchain sw, int w, int h)
|
||||
}
|
||||
#endif
|
||||
|
||||
+ {
|
||||
+ pl_gpu_flush(gpu);
|
||||
+ vk_wait_idle(vk);
|
||||
+ for (int i = 0; i < vk->pool_graphics->num_queues; i++)
|
||||
+ vk->QueueWaitIdle(vk->pool_graphics->queues[i]);
|
||||
+ vk->DestroySwapchainKHR(vk->dev, p->swapchain, PL_VK_ALLOC);
|
||||
+ }
|
||||
+
|
||||
// Calling `vkCreateSwapchainKHR` puts sinfo.oldSwapchain into a retired
|
||||
// state whether the call succeeds or not, so we always need to garbage
|
||||
// collect it afterwards - asynchronously as it may still be in use
|
||||
- sinfo.oldSwapchain = p->swapchain;
|
||||
+ /* sinfo.oldSwapchain = p->swapchain; */
|
||||
p->swapchain = VK_NULL_HANDLE;
|
||||
VkResult res = vk->CreateSwapchainKHR(vk->dev, &sinfo, PL_VK_ALLOC, &p->swapchain);
|
||||
- vk_dev_callback(vk, VK_CB_FUNC(destroy_swapchain), vk, vk_wrap_handle(sinfo.oldSwapchain));
|
||||
+ /* vk_dev_callback(vk, VK_CB_FUNC(destroy_swapchain), vk, vk_wrap_handle(sinfo.oldSwapchain)); */
|
||||
PL_VK_ASSERT(res, "vk->CreateSwapchainKHR(...)");
|
||||
|
||||
// Get the new swapchain images
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -4,21 +4,19 @@
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-3.0+</project_license>
|
||||
<name>Moonlight</name>
|
||||
<summary>Play games remotely from your NVIDIA GameStream-enabled PC</summary>
|
||||
<summary>Stream games and other applications from another PC running Sunshine or GeForce Experience</summary>
|
||||
|
||||
<description>
|
||||
<p>Moonlight can stream games and other applications from a PC with an NVIDIA GeForce GTX/RTX or NVIDIA Quadro GPU and GeForce/Quadro Experience installed.</p>
|
||||
<p>Moonlight can stream games and other applications from another PC with Sunshine or GeForce Experience software installed.</p>
|
||||
<p>Features include:</p>
|
||||
<ul>
|
||||
<li>Streaming at up to 4K resolution</li>
|
||||
<li>Support for up to 120 FPS streaming (high refresh rate monitor recommended)</li>
|
||||
<li>Hardware accelerated video decoding with VAAPI, VDPAU, and NVDEC support</li>
|
||||
<li>H.264, HEVC, and AV1 codec support</li>
|
||||
<li>7.1 surround sound audio support</li>
|
||||
<li>10-point multitouch support</li>
|
||||
<li>Gamepad support with force feedback for up to 16 players</li>
|
||||
<li>Support for both pointer capture (for games) and direct mouse control (for remote desktop)</li>
|
||||
<li>Support for passing system-wide keyboard shortcuts like Alt+Tab to the host</li>
|
||||
<li>Direct touchscreen mouse control</li>
|
||||
<li>HEVC support for better video compression efficiency</li>
|
||||
<li>Gamepad support with force feedback for up to 4 players</li>
|
||||
</ul>
|
||||
</description>
|
||||
|
||||
@@ -36,6 +34,222 @@
|
||||
</screenshots>
|
||||
|
||||
<releases>
|
||||
<release version="6.1.0" date="2024-09-16">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Experimental YUV 4:4:4 support for improved text clarity during remote desktop usage</li>
|
||||
<li>HDR is now supported with software decoding (requires GPU with Vulkan support)</li>
|
||||
<li>Bitrate limit can now be increased to 500 Mbps</li>
|
||||
<li>Audio decoding now uses 32-bit floating point format</li>
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed incorrect color range when streaming with AV1 from a host with an AMD GPU</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.0.1" date="2024-06-30">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>HDR to SDR tonemapping is now supported by the Vulkan renderer on Linux</li>
|
||||
</ul>
|
||||
<p>Behavior Changes:</p>
|
||||
<ul>
|
||||
<li>More time is now provided for PCs to wake up before displaying an error when starting a stream from the CLI</li>
|
||||
<li>Moonlight will no longer try to guess VA driver names when running libva 2.20 or later</li>
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed crash when the Vulkan renderer executed on a system with no Vulkan devices</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.0.0" date="2024-06-06">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>HDR is now supported on Steam Deck and other HDR-capable Linux systems using a new Vulkan-based renderer</li>
|
||||
<li>Vulkan Video decoding of H.264, HEVC, and AV1 is now supported using the new Vulkan renderer</li>
|
||||
<li>Full E2E stream encryption is now supported when streaming from Sunshine v0.22 or later</li>
|
||||
<li>Initiating a stream via the command-line will now automatically wake the target machine if it is sleeping</li>
|
||||
<li>Error codes are now displayed in the connection termination dialog</li>
|
||||
<li>Detailed PC state information is now available via the new "View Details" context menu option (similar to the Android client)</li>
|
||||
<li>The performance overlay can now be configured to be shown by default when starting a stream</li>
|
||||
</ul>
|
||||
<p>Behavior Changes:</p>
|
||||
<ul>
|
||||
<li>The selected bitrate is no longer silently adjusted by Moonlight based upon the video codec or HDR mode</li>
|
||||
<li>The selected mouse mode when starting a stream no longer influences the acceleration curve when the mouse mode is toggled using the Ctrl+Alt+Shift+M key combo while streaming</li>
|
||||
<li>Hardcoded fallback paths for VAAPI and VDPAU drivers are no longer used</li>
|
||||
<li>Per-session keys (rikey and rikeyid values) are now automatically stripped from logs</li>
|
||||
<li>Log messages will now be logged to stderr rather than stdout</li>
|
||||
<li>EGL is now always used instead of GLX for loading OpenGL in X11 environments on non-x86 platforms</li>
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Improved reliability of streaming during momentary drops of WiFi connections</li>
|
||||
<li>Improved performance with high polling rate mice</li>
|
||||
<li>Improved input latency when a gamepad is connected</li>
|
||||
<li>Added missing command-line options to control HDR and AV1 codec usage</li>
|
||||
<li>Fixed instant connection termination error when streaming over the Internet behind certain Carrier-Grade NAT devices</li>
|
||||
<li>Fixed incorrect MTU detection when streaming over the Internet without a VPN</li>
|
||||
<li>Fixed recovery of audio when no audio output device is present when the stream starts</li>
|
||||
<li>Fixed merging of gamepad state when multi-controller mode is disabled</li>
|
||||
<li>Fixed indefinitely resending mDNS queries when a host could not be resolved</li>
|
||||
<li>Fixed inability to pair when the host is not using a RSA-2048 key</li>
|
||||
<li>Updated included gamepad mappings</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="5.0.1" date="2023-11-02">
|
||||
<description>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed connection issue streaming from some hosts running GeForce Experience or Sunshine v0.20 and earlier</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="5.0.0" date="2023-10-18">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Custom FPS values</li>
|
||||
<li>Streaming using the AV1 codec from Sunshine hosts</li>
|
||||
<li>Horizontal scrolling with Sunshine hosts</li>
|
||||
<li>Native multi-touch input with Sunshine hosts</li>
|
||||
<li>Controller type information is passed to Sunshine for controller type autoselection</li>
|
||||
<li>Extended features of PS4/PS5 controllers (touchpad, battery state, gyro/accelerometer motion, and RGB LED) are natively passed to Sunshine hosts</li>
|
||||
<li>Support for up to 16 gamepads with Sunshine hosts</li>
|
||||
<li>Frame pacing support on Wayland</li>
|
||||
<li>Host-side processing latency is now displayed in the performance overlay with Sunshine hosts</li>
|
||||
<li>Window title now includes the PC name when streaming</li>
|
||||
<li>Alphabetical sorting of the PC list</li>
|
||||
<li>Updated Play and Stop button design to improve contrast with app box art</li>
|
||||
<li>The settings page automatically scrolls to the selected element when using keyboard or gamepad navigation</li>
|
||||
<li>Pressing Share+PS buttons on PS4/PS5 controllers can be used to emulate a clickpad press</li>
|
||||
<li>Improved audio quality when streaming with a high bitrate from remote hosts</li>
|
||||
<li>Increased mouse polling rate</li>
|
||||
</ul>
|
||||
<p>Behavior Changes:</p>
|
||||
<ul>
|
||||
<li>IPv6 addresses must be provided in URL-escaped form. Example: [2001:db8::1234:5678] or [2001:db8::1234:5678]:47989</li>
|
||||
<li>Default bitrate logic has been adjusted to behave better with custom resolutions and frame rates</li>
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Reduced the frequency of audio underruns (clicks and pops) by increasing audio buffer size</li>
|
||||
<li>Fixed "Quitting App" message never dismissing in some cases</li>
|
||||
<li>Fixed parsing IPv6 literals with port numbers</li>
|
||||
<li>Fixed unnecessary WiFi activity causing stream disruptions</li>
|
||||
<li>Fixed paired hosts being forgotten if Moonlight terminates while writing hosts to disk</li>
|
||||
<li>Fixed freeze when closing the stream on Windows with some software that uses DX11 hooks</li>
|
||||
<li>Fixed delayed PC wake when activating Wake-On-LAN feature</li>
|
||||
<li>Fixed Wake-on-LAN when Sunshine is running on alternate ports</li>
|
||||
<li>Fixed leak of /dev/dri fds when trying to initialize VAAPI decoder</li>
|
||||
<li>Fixed support for the Applications/Menu key</li>
|
||||
<li>Fixed automatic language detection for Simplified Chinese and Traditional Chinese</li>
|
||||
<li>Fixed streaming from Sunshine when the client PC has multiple network interfaces or IPv6 privacy extensions enabled</li>
|
||||
<li>Fixed small receive buffer causing video packet loss on some systems</li>
|
||||
<li>Fixed theme overrides causing the UI to be unusable on some systems</li>
|
||||
<li>Fixed tearing with V-Sync enabled on macOS and Linux when using the SDL renderer (software decoding and some hardware decoders)</li>
|
||||
<li>Fixed stateful V4L2 hardware decoding using h264_v4l2m2m and hevc_v4l2m2m decoders</li>
|
||||
<li>Fixed CVE-2023-42801</li>
|
||||
<li>Updated included gamepad mappings</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="4.3.1" date="2022-11-03">
|
||||
<description>
|
||||
<p>Changes:</p>
|
||||
<ul>
|
||||
<li>Fixed crash during specific patterns of audio packet loss</li>
|
||||
<li>Fixed detection of local streaming when using IPv6 addresses</li>
|
||||
<li>Windowed mode streaming now starts maximized if the GUI window was maximized</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="4.3.0" date="2022-10-28">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Improved support for GeForce Experience 3.26</li>
|
||||
<li>Improved image quality and performance when recovering from video packet loss using HEVC</li>
|
||||
<li>Improved error concealment after audio packet loss</li>
|
||||
<li>Improved UI performance when paired with many hosts or hosts with large numbers of apps</li>
|
||||
<li>Pairing with Sunshine hosts is now supported even if the host is in a streaming session</li>
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed streaming at resolutions below 720x480 with GeForce Experience 3.26</li>
|
||||
<li>Fixed window position and size being lost when toggling between full-screen and windowed mode</li>
|
||||
<li>Fixed initial window size not always respecting the stream aspect ratio</li>
|
||||
<li>Fixed unexpected error when streaming at resolutions above 4096x4096 using Sunshine</li>
|
||||
<li>Updated included gamepad mappings</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="4.2.1" date="2022-09-12">
|
||||
<description>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed streaming from hosts running Sunshine</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="4.2.0" date="2022-09-10">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Added support for pairing via the terminal</li>
|
||||
<li>Added support for listing installed apps on a host via the terminal</li>
|
||||
<li>Improved handling of V-Sync on Wayland systems to reduce latency</li>
|
||||
<li>Improved performance using the legacy non-EGL VAAPI rendering code</li>
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed native resolution detection on high DPI Wayland systems</li>
|
||||
<li>Fixed audio crackling with SDL 2.24.0 on systems using PulseAudio</li>
|
||||
<li>Updated included gamepad mappings</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="4.1.0" date="2022-05-23">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
<ul>
|
||||
<li>Overlays are now supported on the non-EGL X11 VAAPI renderer (requires RGBA subpicture support in the VAAPI driver)</li>
|
||||
<li>Cursor lock can now be disabled when in full-screen mode</li>
|
||||
</ul>
|
||||
<p>Behavior Changes:</p>
|
||||
<ul>
|
||||
<li>Moonlight can now reduce the client display resolution in full-screen mode if the current display mode doesn't have a high enough refresh rate for the selected stream frame rate</li>
|
||||
<li>When choosing a new client display resolution in full-screen mode, Moonlight will pick a display mode with the closest aspect ratio to the selected stream resolution</li>
|
||||
<li>Moonlight now defaults to borderless windowed mode on Wayland systems</li>
|
||||
|
||||
</ul>
|
||||
<p>Bugfixes:</p>
|
||||
<ul>
|
||||
<li>Fixed missing toolbar buttons in certain languages</li>
|
||||
<li>Fixed some text on the settings page not updating when the language is changed</li>
|
||||
<li>Fixed a frame pacing bug that could cause excessive frame drops</li>
|
||||
<li>Fixed the "keep display awake" setting not being saved when Moonlight restarts</li>
|
||||
<li>Fixed black screen after unmaximizing the Moonlight window on some Linux systems</li>
|
||||
<li>Updated included gamepad mappings</li>
|
||||
<li>Updated community-contributed translations from Weblate</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="4.0.0" date="2022-04-02">
|
||||
<description>
|
||||
<p>New features:</p>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Name=Moonlight
|
||||
Comment=Stream games from your NVIDIA GameStream-enabled PC
|
||||
Comment=Stream games and other applications from another PC running Sunshine or GeForce Experience
|
||||
Exec=moonlight
|
||||
Icon=moonlight
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Qt;Game;
|
||||
Keywords=nvidia;gamestream;stream;
|
||||
Keywords=nvidia;gamestream;stream;sunshine;remote play;
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
# pairing data will be lost each reboot.
|
||||
HOME=/usr/local/moonlight
|
||||
|
||||
# Enable Steam Controller detection in SDL
|
||||
# https://github.com/moonlight-stream/moonlight-qt/issues/697
|
||||
export SDL_ENABLE_STEAM_CONTROLLERS=1
|
||||
|
||||
# Renice PE_Single_CPU which seems to host A/V stuff
|
||||
renice -10 -p $(pidof PE_Single_CPU)
|
||||
|
||||
# Renice Moonlight itself to avoid preemption by background tasks
|
||||
# Write output to a logfile in /tmp
|
||||
exec nice -n -10 ./bin/moonlight > /tmp/moonlight.log
|
||||
exec nice -n -10 ./bin/moonlight > /tmp/moonlight.log 2>&1
|
||||
|
||||
+16
-14
@@ -1,5 +1,6 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
|
||||
import AppModel 1.0
|
||||
import ComputerManager 1.0
|
||||
@@ -89,7 +90,7 @@ CenteredGridView {
|
||||
|
||||
onSourceSizeChanged: {
|
||||
// Nearly all of Nvidia's official box art does not match the dimensions of placeholder
|
||||
// images, however the one known exeception is Overcooked. Therefore, we only execute
|
||||
// images, however the one known exception is Overcooked. Therefore, we only execute
|
||||
// the image size checks if this is not an app collector game. We know the officially
|
||||
// supported games all have box art, so this check is not required.
|
||||
if (!model.isAppCollectorGame &&
|
||||
@@ -121,15 +122,15 @@ CenteredGridView {
|
||||
anchors.fill: appIcon
|
||||
|
||||
sourceComponent: Item {
|
||||
ToolButton {
|
||||
RoundButton {
|
||||
anchors.horizontalCenterOffset: appIcon.isPlaceholder ? -47 : 0
|
||||
anchors.verticalCenterOffset: appIcon.isPlaceholder ? -75 : -60
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: 125
|
||||
implicitHeight: 125
|
||||
implicitWidth: 85
|
||||
implicitHeight: 85
|
||||
|
||||
Image {
|
||||
source: "qrc:/res/baseline-play_circle_filled_white-48px.svg"
|
||||
source: "qrc:/res/play_arrow_FILL1_wght700_GRAD200_opsz48.svg"
|
||||
anchors.centerIn: parent
|
||||
sourceSize {
|
||||
width: 75
|
||||
@@ -145,17 +146,19 @@ CenteredGridView {
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 3000
|
||||
ToolTip.visible: hovered
|
||||
|
||||
Material.background: "#D0808080"
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
RoundButton {
|
||||
anchors.horizontalCenterOffset: appIcon.isPlaceholder ? 47 : 0
|
||||
anchors.verticalCenterOffset: appIcon.isPlaceholder ? -75 : 60
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: 125
|
||||
implicitHeight: 125
|
||||
implicitWidth: 85
|
||||
implicitHeight: 85
|
||||
|
||||
Image {
|
||||
source: "qrc:/res/baseline-cancel-24px.svg"
|
||||
source: "qrc:/res/stop_FILL1_wght700_GRAD200_opsz48.svg"
|
||||
anchors.centerIn: parent
|
||||
sourceSize {
|
||||
width: 75
|
||||
@@ -171,6 +174,8 @@ CenteredGridView {
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 3000
|
||||
ToolTip.visible: hovered
|
||||
|
||||
Material.background: "#D0808080"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,7 +256,7 @@ CenteredGridView {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton;
|
||||
onClicked: {
|
||||
parent.onPressAndHold()
|
||||
parent.pressAndHold()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +350,7 @@ CenteredGridView {
|
||||
|
||||
function quitApp() {
|
||||
var component = Qt.createComponent("QuitSegue.qml")
|
||||
var params = {"appName": appName}
|
||||
var params = {"appName": appName, "quitRunningAppFn": function() { appModel.quitRunningApp() }}
|
||||
if (segueToStream) {
|
||||
// Store the session and app name if we're going to stream after
|
||||
// successfully quitting the old app.
|
||||
@@ -358,9 +363,6 @@ CenteredGridView {
|
||||
}
|
||||
|
||||
stackView.push(component.createObject(stackView, params))
|
||||
|
||||
// Trigger the quit after pushing the quit segue on screen
|
||||
appModel.quitRunningApp()
|
||||
}
|
||||
|
||||
onAccepted: quitApp()
|
||||
|
||||
@@ -2,6 +2,7 @@ import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
import SdlGamepadKeyNavigation 1.0
|
||||
import SystemProperties 1.0
|
||||
|
||||
// https://stackoverflow.com/questions/45029968/how-do-i-set-the-combobox-width-to-fit-the-largest-item
|
||||
ComboBox {
|
||||
@@ -38,6 +39,12 @@ ComboBox {
|
||||
popup.onAboutToShow: {
|
||||
// Switch to normal navigation for combo boxes
|
||||
SdlGamepadKeyNavigation.setUiNavMode(false)
|
||||
|
||||
// Override the popup color to improve contrast with the overridden
|
||||
// Material 2 background color set in main.qml.
|
||||
if (SystemProperties.usesMaterial3Theme) {
|
||||
popup.background.color = "#424242"
|
||||
}
|
||||
}
|
||||
|
||||
popup.onAboutToHide: {
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
import ComputerManager 1.0
|
||||
|
||||
Item {
|
||||
function onSearchingComputer() {
|
||||
stageLabel.text = qsTr("Establishing connection to PC...")
|
||||
}
|
||||
|
||||
function onPairing(pcName, pin) {
|
||||
stageLabel.text = qsTr("Pairing... Please enter '%1' on %2.").arg(pin).arg(pcName)
|
||||
}
|
||||
|
||||
function onFailed(message) {
|
||||
stageIndicator.visible = false
|
||||
errorDialog.text = message
|
||||
errorDialog.open()
|
||||
}
|
||||
|
||||
function onSuccess(appName) {
|
||||
stageIndicator.visible = false
|
||||
pairCompleteDialog.open()
|
||||
}
|
||||
|
||||
// Allow user to back out of pairing
|
||||
Keys.onEscapePressed: {
|
||||
Qt.quit()
|
||||
}
|
||||
Keys.onBackPressed: {
|
||||
Qt.quit()
|
||||
}
|
||||
Keys.onCancelPressed: {
|
||||
Qt.quit()
|
||||
}
|
||||
|
||||
StackView.onActivated: {
|
||||
if (!launcher.isExecuted()) {
|
||||
toolBar.visible = false
|
||||
|
||||
launcher.searchingComputer.connect(onSearchingComputer)
|
||||
launcher.pairing.connect(onPairing)
|
||||
launcher.failed.connect(onFailed)
|
||||
launcher.success.connect(onSuccess)
|
||||
launcher.execute(ComputerManager)
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 5
|
||||
id: stageIndicator
|
||||
|
||||
BusyIndicator {
|
||||
id: stageSpinner
|
||||
}
|
||||
|
||||
Label {
|
||||
id: stageLabel
|
||||
height: stageSpinner.height
|
||||
font.pointSize: 20
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
|
||||
ErrorMessageDialog {
|
||||
id: errorDialog
|
||||
|
||||
onClosed: {
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
|
||||
NavigableMessageDialog {
|
||||
id: pairCompleteDialog
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
|
||||
text:qsTr("Pairing completed successfully")
|
||||
standardButtons: Dialog.Ok
|
||||
onClosed: {
|
||||
Qt.quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import QtQuick 2.0
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
import ComputerManager 1.0
|
||||
import SdlGamepadKeyNavigation 1.0
|
||||
|
||||
Item {
|
||||
function onSearchingComputer() {
|
||||
@@ -26,6 +25,7 @@ Item {
|
||||
function onLaunchFailed(message) {
|
||||
errorDialog.text = message
|
||||
errorDialog.open()
|
||||
console.error(message)
|
||||
}
|
||||
|
||||
function onAppQuitRequired(appName) {
|
||||
@@ -37,10 +37,6 @@ Item {
|
||||
if (!launcher.isExecuted()) {
|
||||
toolBar.visible = false
|
||||
|
||||
// Normally this is enabled by PcView, but we will won't
|
||||
// load PcView when streaming from the command-line.
|
||||
SdlGamepadKeyNavigation.enable()
|
||||
|
||||
launcher.searchingComputer.connect(onSearchingComputer)
|
||||
launcher.searchingApp.connect(onSearchingApp)
|
||||
launcher.sessionCreated.connect(onSessionCreated)
|
||||
@@ -84,10 +80,8 @@ Item {
|
||||
|
||||
function quitApp() {
|
||||
var component = Qt.createComponent("QuitSegue.qml")
|
||||
var params = {"appName": appName}
|
||||
var params = {"appName": appName, "quitRunningAppFn": function() { launcher.quitRunningApp() }}
|
||||
stackView.push(component.createObject(stackView, params))
|
||||
// Trigger the quit after pushing the quit segue on screen
|
||||
launcher.quitRunningApp()
|
||||
}
|
||||
|
||||
onAccepted: quitApp()
|
||||
|
||||
+44
-35
@@ -6,6 +6,7 @@ import ComputerModel 1.0
|
||||
|
||||
import ComputerManager 1.0
|
||||
import StreamingPreferences 1.0
|
||||
import SystemProperties 1.0
|
||||
import SdlGamepadKeyNavigation 1.0
|
||||
|
||||
CenteredGridView {
|
||||
@@ -33,11 +34,6 @@ CenteredGridView {
|
||||
// Setup signals on CM
|
||||
ComputerManager.computerAddCompleted.connect(addComplete)
|
||||
|
||||
// This is a bit of a hack to do this here as opposed to main.qml, but
|
||||
// we need it enabled before calling getConnectedGamepads() and PcView
|
||||
// is never destroyed, so it should be okay.
|
||||
SdlGamepadKeyNavigation.enable()
|
||||
|
||||
// Highlight the first item if a gamepad is connected
|
||||
if (currentIndex == -1 && SdlGamepadKeyNavigation.getConnectedGamepads() > 0) {
|
||||
currentIndex = 0
|
||||
@@ -99,7 +95,7 @@ CenteredGridView {
|
||||
Label {
|
||||
height: searchSpinner.height
|
||||
elide: Label.ElideRight
|
||||
text: StreamingPreferences.enableMdns ? qsTr("Searching for PCs on your local network with NVIDIA GameStream enabled...")
|
||||
text: StreamingPreferences.enableMdns ? qsTr("Searching for compatible hosts on your local network...")
|
||||
: qsTr("Automatic PC discovery is disabled. Add your PC manually.")
|
||||
font.pointSize: 20
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@@ -130,12 +126,12 @@ CenteredGridView {
|
||||
id: stateIcon
|
||||
anchors.horizontalCenter: pcIcon.horizontalCenter
|
||||
anchors.verticalCenter: pcIcon.verticalCenter
|
||||
anchors.verticalCenterOffset: -15
|
||||
anchors.verticalCenterOffset: !model.online ? -18 : -16
|
||||
visible: !model.statusUnknown && (!model.online || !model.paired)
|
||||
source: !model.online ? "qrc:/res/baseline-warning-24px.svg" : "qrc:/res/baseline-lock-24px.svg"
|
||||
source: !model.online ? "qrc:/res/warning_FILL1_wght300_GRAD200_opsz24.svg" : "qrc:/res/baseline-lock-24px.svg"
|
||||
sourceSize {
|
||||
width: 75
|
||||
height: 75
|
||||
width: !model.online ? 75 : 70
|
||||
height: !model.online ? 75 : 70
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +207,18 @@ CenteredGridView {
|
||||
text: qsTr("Delete PC")
|
||||
onTriggered: {
|
||||
deletePcDialog.pcIndex = index
|
||||
// get confirmation first, actual closing is called from the dialog
|
||||
deletePcDialog.pcName = model.name
|
||||
deletePcDialog.open()
|
||||
}
|
||||
}
|
||||
NavigableMenuItem {
|
||||
parentMenu: pcContextMenu
|
||||
text: qsTr("View Details")
|
||||
onTriggered: {
|
||||
showPcDetailsDialog.pcDetails = model.details
|
||||
showPcDetailsDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,22 +236,14 @@ CenteredGridView {
|
||||
stackView.push(appView)
|
||||
}
|
||||
else {
|
||||
if (!model.busy) {
|
||||
var pin = computerModel.generatePinString()
|
||||
var pin = computerModel.generatePinString()
|
||||
|
||||
// Kick off pairing in the background
|
||||
computerModel.pairComputer(index, pin)
|
||||
// Kick off pairing in the background
|
||||
computerModel.pairComputer(index, pin)
|
||||
|
||||
// Display the pairing dialog
|
||||
pairDialog.pin = pin
|
||||
pairDialog.open()
|
||||
}
|
||||
else {
|
||||
// cannot pair while something is streaming or attempting to pair
|
||||
errorDialog.text = qsTr("You cannot pair while a previous session is still running on the host PC. Quit any running games or reboot the host PC, then try pairing again.")
|
||||
errorDialog.helpText = ""
|
||||
errorDialog.open()
|
||||
}
|
||||
// Display the pairing dialog
|
||||
pairDialog.pin = pin
|
||||
pairDialog.open()
|
||||
}
|
||||
} else if (!model.online) {
|
||||
// Using open() here because it may be activated by keyboard
|
||||
@@ -270,7 +266,7 @@ CenteredGridView {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton;
|
||||
onClicked: {
|
||||
parent.onPressAndHold()
|
||||
parent.pressAndHold()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,6 +275,12 @@ CenteredGridView {
|
||||
// the ItemDelegate and not where the mouse cursor is
|
||||
pcContextMenu.open()
|
||||
}
|
||||
|
||||
Keys.onDeletePressed: {
|
||||
deletePcDialog.pcIndex = index
|
||||
deletePcDialog.pcName = model.name
|
||||
deletePcDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
ErrorMessageDialog {
|
||||
@@ -299,7 +301,8 @@ CenteredGridView {
|
||||
|
||||
// don't allow edits to the rest of the window while open
|
||||
property string pin : "0000"
|
||||
text:qsTr("Please enter %1 on your GameStream PC. This dialog will close when pairing is completed.").arg(pin)
|
||||
text:qsTr("Please enter %1 on your host PC. This dialog will close when pairing is completed.").arg(pin)+"\n\n"+
|
||||
qsTr("If your host PC is running Sunshine, navigate to the Sunshine web UI to enter the PIN.")
|
||||
standardButtons: Dialog.Cancel
|
||||
onRejected: {
|
||||
// FIXME: We should interrupt pairing here
|
||||
@@ -309,16 +312,14 @@ CenteredGridView {
|
||||
NavigableMessageDialog {
|
||||
id: deletePcDialog
|
||||
// don't allow edits to the rest of the window while open
|
||||
property int pcIndex : -1;
|
||||
text:qsTr("Are you sure you want to remove this PC?")
|
||||
property int pcIndex : -1
|
||||
property string pcName : ""
|
||||
text: qsTr("Are you sure you want to remove '%1'?").arg(pcName)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
|
||||
function deletePc() {
|
||||
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
||||
computerModel.deleteComputer(pcIndex);
|
||||
onAccepted: {
|
||||
computerModel.deleteComputer(pcIndex)
|
||||
}
|
||||
|
||||
onAccepted: deletePc()
|
||||
}
|
||||
|
||||
NavigableMessageDialog {
|
||||
@@ -327,7 +328,7 @@ CenteredGridView {
|
||||
standardButtons: Dialog.Ok
|
||||
|
||||
onAboutToShow: {
|
||||
testConnectionDialog.text = qsTr("Moonlight is testing your network connection to determine if NVIDIA GameStream is blocked.") + "\n\n" + qsTr("This may take a few seconds…")
|
||||
testConnectionDialog.text = qsTr("Moonlight is testing your network connection to determine if any required ports are blocked.") + "\n\n" + qsTr("This may take a few seconds…")
|
||||
showSpinner = true
|
||||
}
|
||||
|
||||
@@ -398,5 +399,13 @@ CenteredGridView {
|
||||
}
|
||||
}
|
||||
|
||||
NavigableMessageDialog {
|
||||
id: showPcDetailsDialog
|
||||
property string pcDetails : "";
|
||||
text: showPcDetailsDialog.pcDetails
|
||||
imageSrc: "qrc:/res/baseline-help_outline-24px.svg"
|
||||
standardButtons: Dialog.Ok
|
||||
}
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import Session 1.0
|
||||
|
||||
Item {
|
||||
property string appName
|
||||
property var quitRunningAppFn
|
||||
property Session nextSession : null
|
||||
property string nextAppName : ""
|
||||
|
||||
@@ -17,6 +18,7 @@ Item {
|
||||
if (error !== undefined) {
|
||||
errorDialog.text = error
|
||||
errorDialog.open()
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
// If we're supposed to launch another game after this, do so now
|
||||
@@ -37,6 +39,11 @@ Item {
|
||||
|
||||
// Connect the quit completion signal
|
||||
ComputerManager.quitAppCompleted.connect(quitAppCompleted)
|
||||
|
||||
// Start the quit operation if requested
|
||||
if (quitRunningAppFn) {
|
||||
quitRunningAppFn()
|
||||
}
|
||||
}
|
||||
|
||||
StackView.onDeactivating: {
|
||||
|
||||
+460
-236
@@ -1,6 +1,7 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.2
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import StreamingPreferences 1.0
|
||||
import ComputerManager 1.0
|
||||
@@ -11,6 +12,8 @@ Flickable {
|
||||
id: settingsPage
|
||||
objectName: qsTr("Settings")
|
||||
|
||||
signal languageChanged()
|
||||
|
||||
boundsBehavior: Flickable.OvershootBounds
|
||||
|
||||
contentWidth: settingsColumn1.width > settingsColumn2.width ? settingsColumn1.width : settingsColumn2.width
|
||||
@@ -23,6 +26,49 @@ Flickable {
|
||||
}
|
||||
}
|
||||
|
||||
function isChildOfFlickable(item) {
|
||||
while (item) {
|
||||
if (item.parent === contentItem) {
|
||||
return true
|
||||
}
|
||||
|
||||
item = item.parent
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
NumberAnimation on contentY {
|
||||
id: autoScrollAnimation
|
||||
duration: 100
|
||||
}
|
||||
|
||||
Window.onActiveFocusItemChanged: {
|
||||
var item = Window.activeFocusItem
|
||||
if (item) {
|
||||
// Ignore non-child elements like the toolbar buttons
|
||||
if (!isChildOfFlickable(item)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Map the focus item's position into our content item's coordinate space
|
||||
var pos = item.mapToItem(contentItem, 0, 0)
|
||||
|
||||
// Ensure some extra space is visible around the element we're scrolling to
|
||||
var scrollMargin = height > 100 ? 50 : 0
|
||||
|
||||
if (pos.y - scrollMargin < contentY) {
|
||||
autoScrollAnimation.from = contentY
|
||||
autoScrollAnimation.to = Math.max(pos.y - scrollMargin, 0)
|
||||
autoScrollAnimation.start()
|
||||
}
|
||||
else if (pos.y + item.height + scrollMargin > contentY + height) {
|
||||
autoScrollAnimation.from = contentY
|
||||
autoScrollAnimation.to = Math.min(pos.y + item.height + scrollMargin - height, contentHeight - height)
|
||||
autoScrollAnimation.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackView.onActivated: {
|
||||
// This enables Tab and BackTab based navigation rather than arrow keys.
|
||||
// It is required to shift focus between controls on the settings page.
|
||||
@@ -87,59 +133,54 @@ Flickable {
|
||||
AutoResizingComboBox {
|
||||
property int lastIndexValue
|
||||
|
||||
function addDetectedResolution(friendlyNamePrefix, rect) {
|
||||
var indexToAdd = 0
|
||||
for (var j = 0; j < resolutionComboBox.count; j++) {
|
||||
var existing_width = parseInt(resolutionListModel.get(j).video_width);
|
||||
var existing_height = parseInt(resolutionListModel.get(j).video_height);
|
||||
|
||||
if (rect.width === existing_width && rect.height === existing_height) {
|
||||
// Duplicate entry, skip
|
||||
indexToAdd = -1
|
||||
break
|
||||
}
|
||||
else if (rect.width * rect.height > existing_width * existing_height) {
|
||||
// Candidate entrypoint after this entry
|
||||
indexToAdd = j + 1
|
||||
}
|
||||
}
|
||||
|
||||
// Insert this display's resolution if it's not a duplicate
|
||||
if (indexToAdd >= 0) {
|
||||
resolutionListModel.insert(indexToAdd,
|
||||
{
|
||||
"text": friendlyNamePrefix+" ("+rect.width+"x"+rect.height+")",
|
||||
"video_width": ""+rect.width,
|
||||
"video_height": ""+rect.height,
|
||||
"is_custom": false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// ignore setting the index at first, and actually set it when the component is loaded
|
||||
Component.onCompleted: {
|
||||
// Refresh display data before using it to build the list
|
||||
SystemProperties.refreshDisplays()
|
||||
|
||||
// Add native resolutions for all attached displays
|
||||
// Add native and safe area resolutions for all attached displays
|
||||
var done = false
|
||||
for (var displayIndex = 0; !done; displayIndex++) {
|
||||
for (var displayResIndex = 0; displayResIndex < 2; displayResIndex++) {
|
||||
var screenRect;
|
||||
var screenRect = SystemProperties.getNativeResolution(displayIndex);
|
||||
var safeAreaRect = SystemProperties.getSafeAreaResolution(displayIndex);
|
||||
|
||||
// Some platforms have different desktop resolutions
|
||||
// and native resolutions (like macOS with Retina displays)
|
||||
if (displayResIndex === 0) {
|
||||
screenRect = SystemProperties.getDesktopResolution(displayIndex)
|
||||
}
|
||||
else {
|
||||
screenRect = SystemProperties.getNativeResolution(displayIndex)
|
||||
}
|
||||
|
||||
if (screenRect.width === 0) {
|
||||
// Exceeded max count of displays
|
||||
done = true
|
||||
break
|
||||
}
|
||||
|
||||
var indexToAdd = 0
|
||||
for (var j = 0; j < resolutionComboBox.count; j++) {
|
||||
var existing_width = parseInt(resolutionListModel.get(j).video_width);
|
||||
var existing_height = parseInt(resolutionListModel.get(j).video_height);
|
||||
|
||||
if (screenRect.width === existing_width && screenRect.height === existing_height) {
|
||||
// Duplicate entry, skip
|
||||
indexToAdd = -1
|
||||
break
|
||||
}
|
||||
else if (screenRect.width * screenRect.height > existing_width * existing_height) {
|
||||
// Candidate entrypoint after this entry
|
||||
indexToAdd = j + 1
|
||||
}
|
||||
}
|
||||
|
||||
// Insert this display's resolution if it's not a duplicate
|
||||
if (indexToAdd >= 0) {
|
||||
resolutionListModel.insert(indexToAdd,
|
||||
{
|
||||
"text": "Native ("+screenRect.width+"x"+screenRect.height+")",
|
||||
"video_width": ""+screenRect.width,
|
||||
"video_height": ""+screenRect.height,
|
||||
"is_custom": false
|
||||
})
|
||||
}
|
||||
if (screenRect.width === 0) {
|
||||
// Exceeded max count of displays
|
||||
done = true
|
||||
break
|
||||
}
|
||||
|
||||
addDetectedResolution(qsTr("Native"), screenRect)
|
||||
addDetectedResolution(qsTr("Native (Excluding Notch)"), safeAreaRect)
|
||||
}
|
||||
|
||||
// Prune resolutions that are over the decoder's maximum
|
||||
@@ -175,7 +216,7 @@ Flickable {
|
||||
if (!index_set) {
|
||||
// We did not find a match. This must be a custom resolution.
|
||||
resolutionListModel.append({
|
||||
"text": "Custom ("+StreamingPreferences.width+"x"+StreamingPreferences.height+")",
|
||||
"text": qsTr("Custom")+" ("+StreamingPreferences.width+"x"+StreamingPreferences.height+")",
|
||||
"video_width": ""+StreamingPreferences.width,
|
||||
"video_height": ""+StreamingPreferences.height,
|
||||
"is_custom": true
|
||||
@@ -184,7 +225,7 @@ Flickable {
|
||||
}
|
||||
else {
|
||||
resolutionListModel.append({
|
||||
"text": "Custom",
|
||||
"text": qsTr("Custom"),
|
||||
"video_width": "",
|
||||
"video_height": "",
|
||||
"is_custom": true
|
||||
@@ -242,7 +283,8 @@ Flickable {
|
||||
|
||||
StreamingPreferences.bitrateKbps = StreamingPreferences.getDefaultBitrate(StreamingPreferences.width,
|
||||
StreamingPreferences.height,
|
||||
StreamingPreferences.fps);
|
||||
StreamingPreferences.fps,
|
||||
StreamingPreferences.enableYUV444);
|
||||
slider.value = StreamingPreferences.bitrateKbps
|
||||
}
|
||||
|
||||
@@ -397,74 +439,212 @@ Flickable {
|
||||
}
|
||||
|
||||
AutoResizingComboBox {
|
||||
function createModel() {
|
||||
var fpsListModel = Qt.createQmlObject('import QtQuick 2.0; ListModel {}', parent, '')
|
||||
property int lastIndexValue
|
||||
|
||||
var max_fps = SystemProperties.maximumStreamingFrameRate
|
||||
function updateBitrateForSelection() {
|
||||
// Only modify the bitrate if the values actually changed
|
||||
var selectedFps = parseInt(model.get(fpsComboBox.currentIndex).video_fps)
|
||||
if (StreamingPreferences.fps !== selectedFps) {
|
||||
StreamingPreferences.fps = selectedFps
|
||||
|
||||
// Default entries
|
||||
fpsListModel.append({"text": qsTr("%1 FPS").arg("30"), "video_fps": "30"})
|
||||
fpsListModel.append({"text": qsTr("%1 FPS").arg("60"), "video_fps": "60"})
|
||||
StreamingPreferences.bitrateKbps = StreamingPreferences.getDefaultBitrate(StreamingPreferences.width,
|
||||
StreamingPreferences.height,
|
||||
StreamingPreferences.fps,
|
||||
StreamingPreferences.enableYUV444);
|
||||
slider.value = StreamingPreferences.bitrateKbps
|
||||
}
|
||||
|
||||
// Add unsupported FPS values that come before the display max FPS
|
||||
if (StreamingPreferences.unsupportedFps) {
|
||||
if (max_fps > 90) {
|
||||
fpsListModel.append({"text": qsTr("%1 FPS (Unsupported)").arg("90"), "video_fps": "90"})
|
||||
lastIndexValue = currentIndex
|
||||
}
|
||||
|
||||
NavigableDialog {
|
||||
function isInputValid() {
|
||||
// If we have text that isn't valid, reject the input.
|
||||
if (!fpsField.acceptableInput && fpsField.text) {
|
||||
return false
|
||||
}
|
||||
if (max_fps > 120) {
|
||||
fpsListModel.append({"text": qsTr("%1 FPS (Unsupported)").arg("120"), "video_fps": "120"})
|
||||
|
||||
// The textbox needs to have text or placeholder text
|
||||
if (!fpsField.text && !fpsField.placeholderText) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
id: customFpsDialog
|
||||
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||
onOpened: {
|
||||
// Force keyboard focus on the textbox so keyboard navigation works
|
||||
fpsField.forceActiveFocus()
|
||||
|
||||
// standardButton() was added in Qt 5.10, so we must check for it first
|
||||
if (customFpsDialog.standardButton) {
|
||||
customFpsDialog.standardButton(Dialog.Ok).enabled = customFpsDialog.isInputValid()
|
||||
}
|
||||
}
|
||||
|
||||
// Use 64 as the cutoff for adding a separate option to
|
||||
// handle wonky displays that report just over 60 Hz.
|
||||
if (max_fps > 64) {
|
||||
// Mark any FPS value greater than 120 as unsupported
|
||||
if (StreamingPreferences.unsupportedFps && max_fps > 120) {
|
||||
fpsListModel.append({"text": qsTr("%1 FPS (Unsupported)").arg(max_fps), "video_fps": ""+max_fps})
|
||||
onClosed: {
|
||||
fpsField.clear()
|
||||
}
|
||||
|
||||
onRejected: {
|
||||
fpsComboBox.currentIndex = fpsComboBox.lastIndexValue
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
// Reject if there's invalid input
|
||||
if (!isInputValid()) {
|
||||
reject()
|
||||
return
|
||||
}
|
||||
else if (max_fps > 120) {
|
||||
fpsListModel.append({"text": qsTr("%1 FPS").arg("120"), "video_fps": "120"})
|
||||
}
|
||||
else {
|
||||
fpsListModel.append({"text": qsTr("%1 FPS").arg(max_fps), "video_fps": ""+max_fps})
|
||||
|
||||
var fps = fpsField.text ? fpsField.text : fpsField.placeholderText
|
||||
|
||||
// Find and update the custom entry
|
||||
for (var i = 0; i < fpsListModel.count; i++) {
|
||||
if (fpsListModel.get(i).is_custom) {
|
||||
fpsListModel.setProperty(i, "video_fps", fps)
|
||||
fpsListModel.setProperty(i, "text", qsTr("Custom (%1 FPS)").arg(fps))
|
||||
|
||||
// Now update the bitrate using the custom resolution
|
||||
fpsComboBox.currentIndex = i
|
||||
fpsComboBox.updateBitrateForSelection()
|
||||
|
||||
// Update the combobox width too
|
||||
fpsComboBox.recalculateWidth()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add unsupported FPS values that come after the display max FPS
|
||||
if (StreamingPreferences.unsupportedFps) {
|
||||
if (max_fps < 90) {
|
||||
fpsListModel.append({"text":qsTr("%1 FPS (Unsupported)").arg("90"), "video_fps": "90"})
|
||||
ColumnLayout {
|
||||
Label {
|
||||
text: qsTr("Enter a custom frame rate:")
|
||||
font.bold: true
|
||||
}
|
||||
if (max_fps < 120) {
|
||||
fpsListModel.append({"text":qsTr("%1 FPS (Unsupported)").arg("120"), "video_fps": "120"})
|
||||
|
||||
RowLayout {
|
||||
TextField {
|
||||
id: fpsField
|
||||
maximumLength: 4
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
placeholderText: fpsListModel.get(fpsComboBox.currentIndex).video_fps
|
||||
validator: IntValidator{bottom:10; top:9999}
|
||||
focus: true
|
||||
|
||||
onTextChanged: {
|
||||
// standardButton() was added in Qt 5.10, so we must check for it first
|
||||
if (customFpsDialog.standardButton) {
|
||||
customFpsDialog.standardButton(Dialog.Ok).enabled = customFpsDialog.isInputValid()
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
customFpsDialog.accept()
|
||||
}
|
||||
|
||||
Keys.onEnterPressed: {
|
||||
customFpsDialog.accept()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addRefreshRateOrdered(fpsListModel, refreshRate, description, custom) {
|
||||
var indexToAdd = 0
|
||||
for (var j = 0; j < fpsListModel.count; j++) {
|
||||
var existing_fps = parseInt(fpsListModel.get(j).video_fps);
|
||||
|
||||
if (refreshRate === existing_fps || (custom && fpsListModel.get(j).is_custom)) {
|
||||
// Duplicate entry, skip
|
||||
indexToAdd = -1
|
||||
break
|
||||
}
|
||||
else if (refreshRate > existing_fps) {
|
||||
// Candidate entrypoint after this entry
|
||||
indexToAdd = j + 1
|
||||
}
|
||||
}
|
||||
|
||||
return fpsListModel
|
||||
// Insert this frame rate if it's not a duplicate
|
||||
if (indexToAdd >= 0) {
|
||||
// Custom values always go at the end of the list
|
||||
if (custom) {
|
||||
indexToAdd = fpsListModel.count
|
||||
}
|
||||
|
||||
fpsListModel.insert(indexToAdd,
|
||||
{
|
||||
"text": description,
|
||||
"video_fps": ""+refreshRate,
|
||||
"is_custom": custom
|
||||
})
|
||||
}
|
||||
|
||||
return indexToAdd
|
||||
}
|
||||
|
||||
function reinitialize() {
|
||||
model = createModel()
|
||||
// Add native refresh rate for all attached displays
|
||||
var done = false
|
||||
for (var displayIndex = 0; !done; displayIndex++) {
|
||||
var refreshRate = SystemProperties.getRefreshRate(displayIndex);
|
||||
if (refreshRate === 0) {
|
||||
// Exceeded max count of displays
|
||||
done = true
|
||||
break
|
||||
}
|
||||
|
||||
addRefreshRateOrdered(fpsListModel, refreshRate, qsTr("%1 FPS").arg(refreshRate), false)
|
||||
}
|
||||
|
||||
var saved_fps = StreamingPreferences.fps
|
||||
currentIndex = 0
|
||||
var found = false
|
||||
for (var i = 0; i < model.count; i++) {
|
||||
var el_fps = parseInt(model.get(i).video_fps);
|
||||
|
||||
// Pick the highest value lesser or equal to the saved FPS
|
||||
if (saved_fps >= el_fps) {
|
||||
// Look for a matching frame rate
|
||||
if (saved_fps === el_fps) {
|
||||
currentIndex = i
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Persist the selected value
|
||||
activated(currentIndex)
|
||||
// If we didn't find one, add a custom frame rate for the current value
|
||||
if (!found) {
|
||||
currentIndex = addRefreshRateOrdered(model, saved_fps, qsTr("Custom (%1 FPS)").arg(saved_fps), true)
|
||||
}
|
||||
else {
|
||||
addRefreshRateOrdered(model, "", qsTr("Custom"), true)
|
||||
}
|
||||
|
||||
recalculateWidth()
|
||||
|
||||
lastIndexValue = currentIndex
|
||||
}
|
||||
|
||||
// ignore setting the index at first, and actually set it when the component is loaded
|
||||
Component.onCompleted: {
|
||||
reinitialize()
|
||||
languageChanged.connect(reinitialize)
|
||||
}
|
||||
|
||||
model: ListModel {
|
||||
id: fpsListModel
|
||||
// Other elements may be added at runtime
|
||||
ListElement {
|
||||
text: qsTr("30 FPS")
|
||||
video_fps: "30"
|
||||
is_custom: false
|
||||
}
|
||||
ListElement {
|
||||
text: qsTr("60 FPS")
|
||||
video_fps: "60"
|
||||
is_custom: false
|
||||
}
|
||||
}
|
||||
|
||||
id: fpsComboBox
|
||||
@@ -472,16 +652,11 @@ Flickable {
|
||||
textRole: "text"
|
||||
// ::onActivated must be used, as it only listens for when the index is changed by a human
|
||||
onActivated : {
|
||||
var selectedFps = parseInt(model.get(currentIndex).video_fps)
|
||||
|
||||
// Only modify the bitrate if the values actually changed
|
||||
if (StreamingPreferences.fps !== selectedFps) {
|
||||
StreamingPreferences.fps = selectedFps
|
||||
|
||||
StreamingPreferences.bitrateKbps = StreamingPreferences.getDefaultBitrate(StreamingPreferences.width,
|
||||
StreamingPreferences.height,
|
||||
StreamingPreferences.fps);
|
||||
slider.value = StreamingPreferences.bitrateKbps
|
||||
if (model.get(currentIndex).is_custom) {
|
||||
customFpsDialog.open()
|
||||
}
|
||||
else {
|
||||
updateBitrateForSelection()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,7 +685,7 @@ Flickable {
|
||||
|
||||
stepSize: 500
|
||||
from : 500
|
||||
to: 150000
|
||||
to: StreamingPreferences.unlockBitrate ? 500000 : 150000
|
||||
|
||||
snapMode: "SnapOnRelease"
|
||||
width: Math.min(bitrateDesc.implicitWidth, parent.width)
|
||||
@@ -519,6 +694,11 @@ Flickable {
|
||||
bitrateTitle.text = qsTr("Video bitrate: %1 Mbps").arg(value / 1000.0)
|
||||
StreamingPreferences.bitrateKbps = value
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Refresh the text after translations change
|
||||
languageChanged.connect(valueChanged)
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -531,28 +711,53 @@ Flickable {
|
||||
}
|
||||
|
||||
AutoResizingComboBox {
|
||||
// ignore setting the index at first, and actually set it when the component is loaded
|
||||
Component.onCompleted: {
|
||||
function createModel() {
|
||||
var model = Qt.createQmlObject('import QtQuick 2.0; ListModel {}', parent, '')
|
||||
|
||||
model.append({
|
||||
text: qsTr("Fullscreen"),
|
||||
val: StreamingPreferences.WM_FULLSCREEN
|
||||
})
|
||||
|
||||
model.append({
|
||||
text: qsTr("Borderless windowed"),
|
||||
val: StreamingPreferences.WM_FULLSCREEN_DESKTOP
|
||||
})
|
||||
|
||||
model.append({
|
||||
text: qsTr("Windowed"),
|
||||
val: StreamingPreferences.WM_WINDOWED
|
||||
})
|
||||
|
||||
|
||||
// Set the recommended option based on the OS
|
||||
for (var i = 0; i < model.count; i++) {
|
||||
var thisWm = model.get(i).val;
|
||||
if (thisWm === StreamingPreferences.recommendedFullScreenMode) {
|
||||
model.get(i).text += " " + qsTr("(Recommended)")
|
||||
model.move(i, 0, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return model
|
||||
}
|
||||
|
||||
|
||||
// This is used on initialization and upon retranslation
|
||||
function reinitialize() {
|
||||
if (!visible) {
|
||||
// Do nothing if the control won't even be visible
|
||||
return
|
||||
}
|
||||
|
||||
// Set the recommended option based on the OS
|
||||
for (var i = 0; i < windowModeListModel.count; i++) {
|
||||
var thisWm = windowModeListModel.get(i).val;
|
||||
if (thisWm === StreamingPreferences.recommendedFullScreenMode) {
|
||||
windowModeListModel.get(i).text += qsTr(" (Recommended)")
|
||||
windowModeListModel.move(i, 0, 1);
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
model = createModel()
|
||||
currentIndex = 0
|
||||
|
||||
// Set the current value based on the saved preferences
|
||||
var savedWm = StreamingPreferences.windowMode
|
||||
for (var i = 0; i < windowModeListModel.count; i++) {
|
||||
var thisWm = windowModeListModel.get(i).val;
|
||||
for (var i = 0; i < model.count; i++) {
|
||||
var thisWm = model.get(i).val;
|
||||
if (savedWm === thisWm) {
|
||||
currentIndex = i
|
||||
break
|
||||
@@ -562,28 +767,18 @@ Flickable {
|
||||
activated(currentIndex)
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
reinitialize()
|
||||
languageChanged.connect(reinitialize)
|
||||
}
|
||||
|
||||
id: windowModeComboBox
|
||||
visible: SystemProperties.hasDesktopEnvironment
|
||||
enabled: !SystemProperties.rendererAlwaysFullScreen
|
||||
hoverEnabled: true
|
||||
textRole: "text"
|
||||
model: ListModel {
|
||||
id: windowModeListModel
|
||||
ListElement {
|
||||
text: qsTr("Fullscreen")
|
||||
val: StreamingPreferences.WM_FULLSCREEN
|
||||
}
|
||||
ListElement {
|
||||
text: qsTr("Borderless windowed")
|
||||
val: StreamingPreferences.WM_FULLSCREEN_DESKTOP
|
||||
}
|
||||
ListElement {
|
||||
text: qsTr("Windowed")
|
||||
val: StreamingPreferences.WM_WINDOWED
|
||||
}
|
||||
}
|
||||
onActivated: {
|
||||
StreamingPreferences.windowMode = windowModeListModel.get(currentIndex).val
|
||||
StreamingPreferences.windowMode = model.get(currentIndex).val
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
@@ -722,6 +917,46 @@ Flickable {
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
id: hostSettingsGroupBox
|
||||
width: (parent.width - (parent.leftPadding + parent.rightPadding))
|
||||
padding: 12
|
||||
title: "<font color=\"skyblue\">" + qsTr("Host Settings") + "</font>"
|
||||
font.pointSize: 12
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
spacing: 5
|
||||
|
||||
CheckBox {
|
||||
id: optimizeGameSettingsCheck
|
||||
width: parent.width
|
||||
text: qsTr("Optimize game settings for streaming")
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.gameOptimizations
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.gameOptimizations = checked
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: quitAppAfter
|
||||
width: parent.width
|
||||
text: qsTr("Quit app on host PC after ending stream")
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.quitAppAfter
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.quitAppAfter = checked
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("This will close the app or game you are streaming when you end your stream. You will lose any unsaved progress!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
id: uiSettingsGroupBox
|
||||
width: (parent.width - (parent.leftPadding + parent.rightPadding))
|
||||
@@ -809,10 +1044,10 @@ Flickable {
|
||||
text: "한국어" // Korean
|
||||
val: StreamingPreferences.LANG_KO
|
||||
}
|
||||
/* ListElement {
|
||||
ListElement {
|
||||
text: "Magyar" // Hungarian
|
||||
val: StreamingPreferences.LANG_HU
|
||||
} */
|
||||
}
|
||||
ListElement {
|
||||
text: "Nederlands" // Dutch
|
||||
val: StreamingPreferences.LANG_NL
|
||||
@@ -821,17 +1056,17 @@ Flickable {
|
||||
text: "Svenska" // Swedish
|
||||
val: StreamingPreferences.LANG_SV
|
||||
}
|
||||
/* ListElement {
|
||||
ListElement {
|
||||
text: "Türkçe" // Turkish
|
||||
val: StreamingPreferences.LANG_TR
|
||||
} */
|
||||
}
|
||||
/* ListElement {
|
||||
text: "Українська" // Ukrainian
|
||||
val: StreamingPreferences.LANG_UK
|
||||
} */
|
||||
ListElement {
|
||||
text: "繁体字" // Traditional Chinese
|
||||
val: StreamingPreferences.LANG_ZH_HANT
|
||||
text: "繁體中文" // Traditional Chinese
|
||||
val: StreamingPreferences.LANG_ZH_TW
|
||||
}
|
||||
ListElement {
|
||||
text: "Português" // Portuguese
|
||||
@@ -853,6 +1088,30 @@ Flickable {
|
||||
text: "हिन्दी, हिंदी" // Hindi
|
||||
val: StreamingPreferences.LANG_HI
|
||||
} */
|
||||
ListElement {
|
||||
text: "Język polski" // Polish
|
||||
val: StreamingPreferences.LANG_PL
|
||||
}
|
||||
ListElement {
|
||||
text: "Čeština" // Czech
|
||||
val: StreamingPreferences.LANG_CS
|
||||
}
|
||||
/* ListElement {
|
||||
text: "עִבְרִית" // Hebrew
|
||||
val: StreamingPreferences.LANG_HE
|
||||
} */
|
||||
/* ListElement {
|
||||
text: "کرمانجیی خواروو" // Central Kurdish
|
||||
val: StreamingPreferences.LANG_CKB
|
||||
} */
|
||||
/* ListElement {
|
||||
text: "Lietuvių kalba" // Lithuanian
|
||||
val: StreamingPreferences.LANG_LT
|
||||
} */
|
||||
/* ListElement {
|
||||
text: "Eesti" // Estonian
|
||||
val: StreamingPreferences.LANG_ET
|
||||
} */
|
||||
}
|
||||
// ::onActivated must be used, as it only listens for when the index is changed by a human
|
||||
onActivated : {
|
||||
@@ -867,6 +1126,9 @@ Flickable {
|
||||
// Force the back operation to pop any AppView pages that exist.
|
||||
// The AppView stops working after retranslate() for some reason.
|
||||
window.clearOnBack = true
|
||||
|
||||
// Signal other controls to adjust their text
|
||||
languageChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1147,15 +1409,7 @@ Flickable {
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.swapFaceButtons
|
||||
onCheckedChanged: {
|
||||
// Check if the value changed (this is called on init too)
|
||||
if (StreamingPreferences.swapFaceButtons !== checked) {
|
||||
StreamingPreferences.swapFaceButtons = checked
|
||||
|
||||
// Save and restart SdlGamepadKeyNavigation so it can pull the new value
|
||||
StreamingPreferences.save()
|
||||
SdlGamepadKeyNavigation.disable()
|
||||
SdlGamepadKeyNavigation.enable()
|
||||
}
|
||||
StreamingPreferences.swapFaceButtons = checked
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
@@ -1212,46 +1466,6 @@ Flickable {
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
id: hostSettingsGroupBox
|
||||
width: (parent.width - (parent.leftPadding + parent.rightPadding))
|
||||
padding: 12
|
||||
title: "<font color=\"skyblue\">" + qsTr("Host Settings") + "</font>"
|
||||
font.pointSize: 12
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
spacing: 5
|
||||
|
||||
CheckBox {
|
||||
id: optimizeGameSettingsCheck
|
||||
width: parent.width
|
||||
text: qsTr("Optimize game settings for streaming")
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.gameOptimizations
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.gameOptimizations = checked
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: quitAppAfter
|
||||
width: parent.width
|
||||
text: qsTr("Quit app on host PC after ending stream")
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.quitAppAfter
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.quitAppAfter = checked
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("This will close the app or game you are streaming when you end your stream. You will lose any unsaved progress!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
id: advancedSettingsGroupBox
|
||||
width: (parent.width - (parent.leftPadding + parent.rightPadding))
|
||||
@@ -1288,7 +1502,6 @@ Flickable {
|
||||
|
||||
id: decoderComboBox
|
||||
textRole: "text"
|
||||
enabled: !enableHdr.checked
|
||||
model: ListModel {
|
||||
id: decoderListModel
|
||||
ListElement {
|
||||
@@ -1310,21 +1523,6 @@ Flickable {
|
||||
StreamingPreferences.videoDecoderSelection = decoderListModel.get(currentIndex).val
|
||||
}
|
||||
}
|
||||
|
||||
// This handles the state of the enableHdr checkbox changing
|
||||
onEnabledChanged: {
|
||||
if (enabled) {
|
||||
StreamingPreferences.videoDecoderSelection = decoderListModel.get(currentIndex).val
|
||||
}
|
||||
else {
|
||||
StreamingPreferences.videoDecoderSelection = StreamingPreferences.VDS_AUTO
|
||||
}
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered && !enabled
|
||||
ToolTip.text: qsTr("Enabling HDR overrides manual decoder selections.")
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -1357,7 +1555,6 @@ Flickable {
|
||||
|
||||
id: codecComboBox
|
||||
textRole: "text"
|
||||
enabled: !enableHdr.checked
|
||||
model: ListModel {
|
||||
id: codecListModel
|
||||
ListElement {
|
||||
@@ -1372,6 +1569,10 @@ Flickable {
|
||||
text: qsTr("HEVC (H.265)")
|
||||
val: StreamingPreferences.VCC_FORCE_HEVC
|
||||
}
|
||||
ListElement {
|
||||
text: qsTr("AV1 (Experimental)")
|
||||
val: StreamingPreferences.VCC_FORCE_AV1
|
||||
}
|
||||
}
|
||||
// ::onActivated must be used, as it only listens for when the index is changed by a human
|
||||
onActivated : {
|
||||
@@ -1379,21 +1580,6 @@ Flickable {
|
||||
StreamingPreferences.videoCodecConfig = codecListModel.get(currentIndex).val
|
||||
}
|
||||
}
|
||||
|
||||
// This handles the state of the enableHdr checkbox changing
|
||||
onEnabledChanged: {
|
||||
if (enabled) {
|
||||
StreamingPreferences.videoCodecConfig = codecListModel.get(currentIndex).val
|
||||
}
|
||||
else {
|
||||
StreamingPreferences.videoCodecConfig = StreamingPreferences.VCC_FORCE_HEVC_HDR
|
||||
}
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered && !enabled
|
||||
ToolTip.text: qsTr("Enabling HDR overrides manual codec selections.")
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
@@ -1401,8 +1587,12 @@ Flickable {
|
||||
width: parent.width
|
||||
text: qsTr("Enable HDR (Experimental)")
|
||||
font.pointSize: 12
|
||||
|
||||
enabled: SystemProperties.supportsHdr
|
||||
checked: enabled && StreamingPreferences.videoCodecConfig == StreamingPreferences.VCC_FORCE_HEVC_HDR
|
||||
checked: enabled && StreamingPreferences.enableHdr
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.enableHdr = checked
|
||||
}
|
||||
|
||||
// Updating StreamingPreferences.videoCodecConfig is handled above
|
||||
|
||||
@@ -1416,22 +1606,50 @@ Flickable {
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: unlockUnsupportedFps
|
||||
id: enableYUV444
|
||||
width: parent.width
|
||||
text: qsTr("Unlock unsupported FPS options")
|
||||
text: qsTr("Enable YUV 4:4:4 (Experimental)")
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.unsupportedFps
|
||||
onCheckedChanged: {
|
||||
// This is called on init, so only do the work if we've
|
||||
// actually changed the value.
|
||||
if (StreamingPreferences.unsupportedFps != checked) {
|
||||
StreamingPreferences.unsupportedFps = checked
|
||||
|
||||
// The selectable FPS values depend on whether
|
||||
// this option is enabled or not
|
||||
fpsComboBox.reinitialize()
|
||||
checked: StreamingPreferences.enableYUV444
|
||||
onCheckedChanged: {
|
||||
// This is called on init, so only reset to default bitrate when checked state changes.
|
||||
if (StreamingPreferences.enableYUV444 != checked) {
|
||||
StreamingPreferences.enableYUV444 = checked
|
||||
StreamingPreferences.bitrateKbps = StreamingPreferences.getDefaultBitrate(StreamingPreferences.width,
|
||||
StreamingPreferences.height,
|
||||
StreamingPreferences.fps,
|
||||
StreamingPreferences.enableYUV444);
|
||||
slider.value = StreamingPreferences.bitrateKbps
|
||||
}
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: enabled ?
|
||||
qsTr("Good for streaming desktop and text-heavy games, but not recommended for fast-paced games.")
|
||||
:
|
||||
qsTr("YUV 4:4:4 is not supported on this PC.")
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: unlockBitrate
|
||||
width: parent.width
|
||||
text: qsTr("Unlock bitrate limit (Experimental)")
|
||||
font.pointSize: 12
|
||||
|
||||
checked: StreamingPreferences.unlockBitrate
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.unlockBitrate = checked
|
||||
StreamingPreferences.bitrateKbps = Math.min(StreamingPreferences.bitrateKbps, slider.to)
|
||||
slider.value = StreamingPreferences.bitrateKbps
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("This unlocks extremely high video bitrates for use with Sunshine hosts. It should only be used when streaming over an Ethernet LAN connection.")
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
@@ -1446,10 +1664,6 @@ Flickable {
|
||||
if (StreamingPreferences.enableMdns != checked) {
|
||||
StreamingPreferences.enableMdns = checked
|
||||
|
||||
// We must save the updated preference to ensure
|
||||
// ComputerManager can observe the change internally.
|
||||
StreamingPreferences.save()
|
||||
|
||||
// Restart polling so the mDNS change takes effect
|
||||
if (window.pollingActive) {
|
||||
ComputerManager.stopPollingAsync()
|
||||
@@ -1466,17 +1680,27 @@ Flickable {
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.detectNetworkBlocking
|
||||
onCheckedChanged: {
|
||||
// This is called on init, so only do the work if we've
|
||||
// actually changed the value.
|
||||
if (StreamingPreferences.detectNetworkBlocking != checked) {
|
||||
StreamingPreferences.detectNetworkBlocking = checked
|
||||
|
||||
// We must save the updated preference to ensure
|
||||
// ComputerManager can observe the change internally.
|
||||
StreamingPreferences.save()
|
||||
}
|
||||
StreamingPreferences.detectNetworkBlocking = checked
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: showPerformanceOverlay
|
||||
width: parent.width
|
||||
text: qsTr("Show performance stats while streaming")
|
||||
font.pointSize: 12
|
||||
checked: StreamingPreferences.showPerformanceOverlay
|
||||
onCheckedChanged: {
|
||||
StreamingPreferences.showPerformanceOverlay = checked
|
||||
}
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 5000
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("Display real-time stream performance information while streaming.") + "\n\n" +
|
||||
qsTr("You can toggle it at any time while streaming using Ctrl+Alt+Shift+S or Select+L1+R1+X.") + "\n\n" +
|
||||
qsTr("The performance overlay is not supported on Steam Link or Raspberry Pi.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ Item {
|
||||
{
|
||||
// Display the error dialog after Session::exec() returns
|
||||
streamSegueErrorDialog.text = text
|
||||
console.error(text)
|
||||
}
|
||||
|
||||
function displayLaunchWarning(text)
|
||||
@@ -56,6 +57,7 @@ Item {
|
||||
toast.text = text
|
||||
toast.timeout = 3000
|
||||
toast.visible = true
|
||||
console.warn(text)
|
||||
}
|
||||
|
||||
function quitStarting()
|
||||
@@ -74,7 +76,7 @@ Item {
|
||||
streamSegueErrorDialog.text += "\n\n" + qsTr("This PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network.")
|
||||
}
|
||||
|
||||
// Enable GUI gamepad usage now
|
||||
// Re-enable GUI gamepad usage now
|
||||
SdlGamepadKeyNavigation.enable()
|
||||
|
||||
if (quitAfter) {
|
||||
@@ -117,7 +119,7 @@ Item {
|
||||
// Show the toolbar again when popped off the stack
|
||||
toolBar.visible = true
|
||||
|
||||
// Enable GUI gamepad usage now
|
||||
// Re-enable GUI gamepad usage now
|
||||
SdlGamepadKeyNavigation.enable()
|
||||
}
|
||||
|
||||
@@ -174,7 +176,7 @@ Item {
|
||||
gc()
|
||||
|
||||
// Run the streaming session to completion
|
||||
session.exec(Screen.virtualX, Screen.virtualY)
|
||||
session.exec(Window.window)
|
||||
}
|
||||
|
||||
sourceComponent: Item {}
|
||||
|
||||
+52
-19
@@ -2,8 +2,6 @@
|
||||
|
||||
#include <QThreadPool>
|
||||
|
||||
#include <random>
|
||||
|
||||
ComputerModel::ComputerModel(QObject* object)
|
||||
: QAbstractListModel(object) {}
|
||||
|
||||
@@ -44,6 +42,46 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const
|
||||
return computer->state == NvComputer::CS_UNKNOWN;
|
||||
case ServerSupportedRole:
|
||||
return computer->isSupportedServerVersion;
|
||||
case DetailsRole: {
|
||||
QString state, pairState;
|
||||
|
||||
switch (computer->state) {
|
||||
case NvComputer::CS_ONLINE:
|
||||
state = tr("Online");
|
||||
break;
|
||||
case NvComputer::CS_OFFLINE:
|
||||
state = tr("Offline");
|
||||
break;
|
||||
default:
|
||||
state = tr("Unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (computer->pairState) {
|
||||
case NvComputer::PS_PAIRED:
|
||||
pairState = tr("Paired");
|
||||
break;
|
||||
case NvComputer::PS_NOT_PAIRED:
|
||||
pairState = tr("Unpaired");
|
||||
break;
|
||||
default:
|
||||
pairState = tr("Unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
return tr("Name: %1").arg(computer->name) + '\n' +
|
||||
tr("Status: %1").arg(state) + '\n' +
|
||||
tr("Active Address: %1").arg(computer->activeAddress.toString()) + '\n' +
|
||||
tr("UUID: %1").arg(computer->uuid) + '\n' +
|
||||
tr("Local Address: %1").arg(computer->localAddress.toString()) + '\n' +
|
||||
tr("Remote Address: %1").arg(computer->remoteAddress.toString()) + '\n' +
|
||||
tr("IPv6 Address: %1").arg(computer->ipv6Address.toString()) + '\n' +
|
||||
tr("Manual Address: %1").arg(computer->manualAddress.toString()) + '\n' +
|
||||
tr("MAC Address: %1").arg(computer->macAddress.isEmpty() ? tr("Unknown") : QString(computer->macAddress.toHex(':'))) + '\n' +
|
||||
tr("Pair State: %1").arg(pairState) + '\n' +
|
||||
tr("Running Game ID: %1").arg(computer->state == NvComputer::CS_ONLINE ? QString::number(computer->currentGameId) : tr("Unknown")) + '\n' +
|
||||
tr("HTTPS Port: %1").arg(computer->state == NvComputer::CS_ONLINE ? QString::number(computer->activeHttpsPort) : tr("Unknown"));
|
||||
}
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
@@ -71,6 +109,7 @@ QHash<int, QByteArray> ComputerModel::roleNames() const
|
||||
names[WakeableRole] = "wakeable";
|
||||
names[StatusUnknownRole] = "statusUnknown";
|
||||
names[ServerSupportedRole] = "serverSupported";
|
||||
names[DetailsRole] = "details";
|
||||
|
||||
return names;
|
||||
}
|
||||
@@ -140,14 +179,9 @@ void ComputerModel::renameComputer(int computerIndex, QString name)
|
||||
m_ComputerManager->renameHost(m_Computers[computerIndex], name);
|
||||
}
|
||||
|
||||
// TODO: Use QRandomGenerator when we drop Qt 5.9 support
|
||||
QString ComputerModel::generatePinString()
|
||||
{
|
||||
std::uniform_int_distribution<int> dist(0, 9999);
|
||||
std::random_device rd;
|
||||
std::mt19937 engine(rd());
|
||||
|
||||
return QString::asprintf("%04u", dist(engine));
|
||||
return m_ComputerManager->generatePinString();
|
||||
}
|
||||
|
||||
class DeferredTestConnectionTask : public QObject, public QRunnable
|
||||
@@ -193,19 +227,18 @@ void ComputerModel::handlePairingCompleted(NvComputer*, QString error)
|
||||
|
||||
void ComputerModel::handleComputerStateChanged(NvComputer* computer)
|
||||
{
|
||||
// If this is an existing computer, we can report the data changed
|
||||
int index = m_Computers.indexOf(computer);
|
||||
if (index >= 0) {
|
||||
// Let the view know that this specific computer changed
|
||||
emit dataChanged(createIndex(index, 0), createIndex(index, 0));
|
||||
QVector<NvComputer*> newComputerList = m_ComputerManager->getComputers();
|
||||
|
||||
// Reset the model if the structural layout of the list has changed
|
||||
if (m_Computers != newComputerList) {
|
||||
beginResetModel();
|
||||
m_Computers = newComputerList;
|
||||
endResetModel();
|
||||
}
|
||||
else {
|
||||
// This is a new PC which may be inserted at an arbitrary point
|
||||
// in our computer list (since it comes from CM's QMap). Reload
|
||||
// the whole model state to ensure it stays consistent.
|
||||
beginResetModel();
|
||||
m_Computers = m_ComputerManager->getComputers();
|
||||
endResetModel();
|
||||
// Let the view know that this specific computer changed
|
||||
int index = m_Computers.indexOf(computer);
|
||||
emit dataChanged(createIndex(index, 0), createIndex(index, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ class ComputerModel : public QAbstractListModel
|
||||
BusyRole,
|
||||
WakeableRole,
|
||||
StatusUnknownRole,
|
||||
ServerSupportedRole
|
||||
ServerSupportedRole,
|
||||
DetailsRole
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
+73
-49
@@ -2,6 +2,7 @@ import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
|
||||
import ComputerManager 1.0
|
||||
import AutoUpdateChecker 1.0
|
||||
@@ -18,17 +19,53 @@ ApplicationWindow {
|
||||
property bool clearOnBack: false
|
||||
|
||||
id: window
|
||||
visible: true
|
||||
width: 1280
|
||||
height: 600
|
||||
|
||||
visibility: {
|
||||
// This function runs prior to creation of the initial StackView item
|
||||
function doEarlyInit() {
|
||||
// Override the background color to Material 2 colors for Qt 6.5+
|
||||
// in order to improve contrast between GFE's placeholder box art
|
||||
// and the background of the app grid.
|
||||
if (SystemProperties.usesMaterial3Theme) {
|
||||
Material.background = "#303030"
|
||||
}
|
||||
|
||||
SdlGamepadKeyNavigation.enable()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Show the window according to the user's preferences
|
||||
if (SystemProperties.hasDesktopEnvironment) {
|
||||
if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_WINDOWED) return "Windowed"
|
||||
else if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_MAXIMIZED) return "Maximized"
|
||||
else if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_FULLSCREEN) return "FullScreen"
|
||||
if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_MAXIMIZED) {
|
||||
window.showMaximized()
|
||||
}
|
||||
else if (StreamingPreferences.uiDisplayMode == StreamingPreferences.UI_FULLSCREEN) {
|
||||
window.showFullScreen()
|
||||
}
|
||||
else {
|
||||
window.show()
|
||||
}
|
||||
} else {
|
||||
return "FullScreen"
|
||||
window.showFullScreen()
|
||||
}
|
||||
|
||||
// Display any modal dialogs for configuration warnings
|
||||
if (SystemProperties.isWow64) {
|
||||
wow64Dialog.open()
|
||||
}
|
||||
else if (!SystemProperties.hasHardwareAcceleration) {
|
||||
if (SystemProperties.isRunningXWayland) {
|
||||
xWaylandDialog.open()
|
||||
}
|
||||
else {
|
||||
noHwDecoderDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
if (SystemProperties.unmappedGamepads) {
|
||||
unmappedGamepadDialog.unmappedGamepads = SystemProperties.unmappedGamepads
|
||||
unmappedGamepadDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,10 +86,16 @@ ApplicationWindow {
|
||||
|
||||
StackView {
|
||||
id: stackView
|
||||
initialItem: initialView
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
|
||||
Component.onCompleted: {
|
||||
// Perform our early initialization before constructing
|
||||
// the initial view and pushing it to the StackView
|
||||
doEarlyInit()
|
||||
push(initialView)
|
||||
}
|
||||
|
||||
onCurrentItemChanged: {
|
||||
// Ensure focus travels to the next view when going back
|
||||
if (currentItem) {
|
||||
@@ -126,6 +169,9 @@ ApplicationWindow {
|
||||
pollingActive = true
|
||||
}
|
||||
}
|
||||
|
||||
// Poll for gamepad input only when the window is in focus
|
||||
SdlGamepadKeyNavigation.notifyWindowFocus(visible && active)
|
||||
}
|
||||
|
||||
onActiveChanged: {
|
||||
@@ -144,47 +190,25 @@ ApplicationWindow {
|
||||
// if focus does not return within a few minutes.
|
||||
inactivityTimer.restart()
|
||||
}
|
||||
|
||||
// Poll for gamepad input only when the window is in focus
|
||||
SdlGamepadKeyNavigation.notifyWindowFocus(visible && active)
|
||||
}
|
||||
|
||||
property bool initialized: false
|
||||
|
||||
// BUG: Using onAfterSynchronizing: here causes very strange
|
||||
// failures on Linux. Many shaders fail to compile and we
|
||||
// eventually segfault deep inside the Qt OpenGL code.
|
||||
onAfterRendering: {
|
||||
// We use this callback to trigger dialog display because
|
||||
// it only happens once the window is fully constructed.
|
||||
// Doing it earlier can lead to the dialog appearing behind
|
||||
// the window or otherwise without input focus.
|
||||
if (!initialized) {
|
||||
// Set initialized before calling anything else, because
|
||||
// pumping the event loop can cause us to get another
|
||||
// onAfterRendering call and potentially reenter this code.
|
||||
initialized = true;
|
||||
|
||||
if (SystemProperties.isWow64) {
|
||||
wow64Dialog.open()
|
||||
}
|
||||
else if (!SystemProperties.hasHardwareAcceleration) {
|
||||
if (SystemProperties.isRunningXWayland) {
|
||||
xWaylandDialog.open()
|
||||
}
|
||||
else {
|
||||
noHwDecoderDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
if (SystemProperties.unmappedGamepads) {
|
||||
unmappedGamepadDialog.unmappedGamepads = SystemProperties.unmappedGamepads
|
||||
unmappedGamepadDialog.open()
|
||||
}
|
||||
}
|
||||
// Workaround for lack of instanceof in Qt 5.9.
|
||||
//
|
||||
// Based on https://stackoverflow.com/questions/13923794/how-to-do-a-is-a-typeof-or-instanceof-in-qml
|
||||
function qmltypeof(obj, className) { // QtObject, string -> bool
|
||||
// className plus "(" is the class instance without modification
|
||||
// className plus "_QML" is the class instance with user-defined properties
|
||||
var str = obj.toString();
|
||||
return str.startsWith(className + "(") || str.startsWith(className + "_QML");
|
||||
}
|
||||
|
||||
function navigateTo(url, objectName)
|
||||
function navigateTo(url, objectType)
|
||||
{
|
||||
var existingItem = stackView.find(function(item, index) {
|
||||
return item.objectName === objectName
|
||||
return qmltypeof(item, objectType)
|
||||
})
|
||||
|
||||
if (existingItem !== null) {
|
||||
@@ -251,7 +275,7 @@ ApplicationWindow {
|
||||
|
||||
Label {
|
||||
id: versionLabel
|
||||
visible: stackView.currentItem.objectName === qsTr("Settings")
|
||||
visible: qmltypeof(stackView.currentItem, "SettingsView")
|
||||
text: qsTr("Version %1").arg(SystemProperties.versionString)
|
||||
font.pointSize: 12
|
||||
horizontalAlignment: Qt.AlignRight
|
||||
@@ -261,9 +285,9 @@ ApplicationWindow {
|
||||
NavigableToolButton {
|
||||
id: discordButton
|
||||
visible: SystemProperties.hasBrowser &&
|
||||
stackView.currentItem.objectName === qsTr("Settings")
|
||||
qmltypeof(stackView.currentItem, "SettingsView")
|
||||
|
||||
iconSource: "qrc:/res/Discord-Logo-White.svg"
|
||||
iconSource: "qrc:/res/discord.svg"
|
||||
|
||||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 3000
|
||||
@@ -280,7 +304,7 @@ ApplicationWindow {
|
||||
|
||||
NavigableToolButton {
|
||||
id: addPcButton
|
||||
visible: stackView.currentItem.objectName === qsTr("Computers")
|
||||
visible: qmltypeof(stackView.currentItem, "PcView")
|
||||
|
||||
iconSource: "qrc:/res/ic_add_to_queue_white_48px.svg"
|
||||
|
||||
@@ -378,7 +402,7 @@ ApplicationWindow {
|
||||
|
||||
iconSource: "qrc:/res/ic_videogame_asset_white_48px.svg"
|
||||
|
||||
onClicked: navigateTo("qrc:/gui/GamepadMapper.qml", qsTr("Gamepad Mapping"))
|
||||
onClicked: navigateTo("qrc:/gui/GamepadMapper.qml", "GamepadMapper")
|
||||
|
||||
Keys.onDownPressed: {
|
||||
stackView.currentItem.forceActiveFocus(Qt.TabFocus)
|
||||
@@ -390,7 +414,7 @@ ApplicationWindow {
|
||||
|
||||
iconSource: "qrc:/res/settings.svg"
|
||||
|
||||
onClicked: navigateTo("qrc:/gui/SettingsView.qml", qsTr("Settings"))
|
||||
onClicked: navigateTo("qrc:/gui/SettingsView.qml", "SettingsView")
|
||||
|
||||
Keys.onDownPressed: {
|
||||
stackView.currentItem.forceActiveFocus(Qt.TabFocus)
|
||||
@@ -478,7 +502,7 @@ ApplicationWindow {
|
||||
|
||||
NavigableDialog {
|
||||
id: addPcDialog
|
||||
property string label: qsTr("Enter the IP address of your GameStream PC:")
|
||||
property string label: qsTr("Enter the IP address of your host PC:")
|
||||
|
||||
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QWindow>
|
||||
|
||||
#include "settings/streamingpreferences.h"
|
||||
#include "settings/mappingmanager.h"
|
||||
|
||||
#define AXIS_NAVIGATION_REPEAT_DELAY 150
|
||||
|
||||
SdlGamepadKeyNavigation::SdlGamepadKeyNavigation()
|
||||
: m_Enabled(false),
|
||||
SdlGamepadKeyNavigation::SdlGamepadKeyNavigation(StreamingPreferences* prefs)
|
||||
: m_Prefs(prefs),
|
||||
m_Enabled(false),
|
||||
m_UiNavMode(false),
|
||||
m_FirstPoll(false),
|
||||
m_HasFocus(false),
|
||||
m_LastAxisNavigationEventTime(0)
|
||||
{
|
||||
m_PollingTimer = new QTimer(this);
|
||||
@@ -36,7 +37,7 @@ void SdlGamepadKeyNavigation::enable()
|
||||
// arrival events. Additionally, there's a race condition between
|
||||
// our QML objects being destroyed and SDL being deinitialized that
|
||||
// this solves too.
|
||||
if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) != 0) {
|
||||
if (SDLC_FAILURE(SDL_InitSubSystem(SDL_INIT_GAMEPAD))) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) failed: %s",
|
||||
SDL_GetError());
|
||||
@@ -51,25 +52,23 @@ void SdlGamepadKeyNavigation::enable()
|
||||
// overlapping lifetimes of SdlGamepadKeyNavigation instances, so we
|
||||
// will attach ourselves.
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvent(SDL_CONTROLLERDEVICEADDED);
|
||||
SDL_FlushEvent(SDL_EVENT_GAMEPAD_ADDED);
|
||||
|
||||
// Open all currently attached game controllers
|
||||
for (int i = 0; i < SDL_NumJoysticks(); i++) {
|
||||
if (SDL_IsGameController(i)) {
|
||||
SDL_GameController* gc = SDL_GameControllerOpen(i);
|
||||
if (gc != nullptr) {
|
||||
m_Gamepads.append(gc);
|
||||
}
|
||||
int numGamepads = 0;
|
||||
SDL_JoystickID* gamepads = SDL_GetGamepads(&numGamepads);
|
||||
for (int i = 0; i < numGamepads; i++) {
|
||||
SDL_Gamepad * gc = SDL_OpenGamepad(i);
|
||||
if (gc != nullptr) {
|
||||
m_Gamepads.append(gc);
|
||||
}
|
||||
}
|
||||
|
||||
// Flush events on the first poll
|
||||
m_FirstPoll = true;
|
||||
|
||||
// Poll every 50 ms for a new joystick event
|
||||
m_PollingTimer->start(50);
|
||||
SDL_free(gamepads);
|
||||
|
||||
m_Enabled = true;
|
||||
|
||||
// Start the polling timer if the window is focused
|
||||
updateTimerState();
|
||||
}
|
||||
|
||||
void SdlGamepadKeyNavigation::disable()
|
||||
@@ -78,68 +77,73 @@ void SdlGamepadKeyNavigation::disable()
|
||||
return;
|
||||
}
|
||||
|
||||
m_PollingTimer->stop();
|
||||
m_Enabled = false;
|
||||
updateTimerState();
|
||||
Q_ASSERT(!m_PollingTimer->isActive());
|
||||
|
||||
while (!m_Gamepads.isEmpty()) {
|
||||
SDL_GameControllerClose(m_Gamepads[0]);
|
||||
SDL_CloseGamepad(m_Gamepads[0]);
|
||||
m_Gamepads.removeAt(0);
|
||||
}
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);
|
||||
SDL_QuitSubSystem(SDL_INIT_GAMEPAD);
|
||||
}
|
||||
|
||||
m_Enabled = false;
|
||||
void SdlGamepadKeyNavigation::notifyWindowFocus(bool hasFocus)
|
||||
{
|
||||
m_HasFocus = hasFocus;
|
||||
updateTimerState();
|
||||
}
|
||||
|
||||
void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||
{
|
||||
SDL_Event event;
|
||||
StreamingPreferences prefs;
|
||||
|
||||
// Discard any pending button events on the first poll to avoid picking up
|
||||
// stale input data from the stream session (like the quit combo).
|
||||
if (m_FirstPoll) {
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvent(SDL_CONTROLLERBUTTONDOWN);
|
||||
SDL_FlushEvent(SDL_CONTROLLERBUTTONUP);
|
||||
SDL_FlushEvent(SDL_EVENT_GAMEPAD_BUTTON_DOWN);
|
||||
SDL_FlushEvent(SDL_EVENT_GAMEPAD_BUTTON_UP);
|
||||
|
||||
m_FirstPoll = false;
|
||||
}
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_QUIT:
|
||||
case SDL_EVENT_QUIT :
|
||||
// SDL may send us a quit event since we initialize
|
||||
// the video subsystem on startup. If we get one,
|
||||
// forward it on for Qt to take care of.
|
||||
QCoreApplication::instance()->quit();
|
||||
break;
|
||||
case SDL_CONTROLLERBUTTONDOWN:
|
||||
case SDL_CONTROLLERBUTTONUP:
|
||||
case SDL_EVENT_GAMEPAD_BUTTON_DOWN :
|
||||
case SDL_EVENT_GAMEPAD_BUTTON_UP :
|
||||
{
|
||||
QEvent::Type type =
|
||||
event.type == SDL_CONTROLLERBUTTONDOWN ?
|
||||
event.type == SDL_EVENT_GAMEPAD_BUTTON_DOWN ?
|
||||
QEvent::Type::KeyPress : QEvent::Type::KeyRelease;
|
||||
|
||||
// Swap face buttons if needed
|
||||
if (prefs.swapFaceButtons) {
|
||||
switch (event.cbutton.button) {
|
||||
case SDL_CONTROLLER_BUTTON_A:
|
||||
event.cbutton.button = SDL_CONTROLLER_BUTTON_B;
|
||||
if (m_Prefs->swapFaceButtons) {
|
||||
switch (event.gbutton.button) {
|
||||
case SDL_GAMEPAD_BUTTON_SOUTH :
|
||||
event.gbutton.button = SDL_GAMEPAD_BUTTON_EAST;
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_B:
|
||||
event.cbutton.button = SDL_CONTROLLER_BUTTON_A;
|
||||
case SDL_GAMEPAD_BUTTON_EAST :
|
||||
event.gbutton.button = SDL_GAMEPAD_BUTTON_SOUTH;
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_X:
|
||||
event.cbutton.button = SDL_CONTROLLER_BUTTON_Y;
|
||||
case SDL_GAMEPAD_BUTTON_WEST :
|
||||
event.gbutton.button = SDL_GAMEPAD_BUTTON_NORTH;
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_Y:
|
||||
event.cbutton.button = SDL_CONTROLLER_BUTTON_X;
|
||||
case SDL_GAMEPAD_BUTTON_NORTH :
|
||||
event.gbutton.button = SDL_GAMEPAD_BUTTON_WEST;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (event.cbutton.button) {
|
||||
case SDL_CONTROLLER_BUTTON_DPAD_UP:
|
||||
switch (event.gbutton.button) {
|
||||
case SDL_GAMEPAD_BUTTON_DPAD_UP :
|
||||
if (m_UiNavMode) {
|
||||
// Back-tab
|
||||
sendKey(type, Qt::Key_Tab, Qt::ShiftModifier);
|
||||
@@ -148,7 +152,7 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||
sendKey(type, Qt::Key_Up);
|
||||
}
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_DPAD_DOWN:
|
||||
case SDL_GAMEPAD_BUTTON_DPAD_DOWN :
|
||||
if (m_UiNavMode) {
|
||||
sendKey(type, Qt::Key_Tab);
|
||||
}
|
||||
@@ -156,13 +160,13 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||
sendKey(type, Qt::Key_Down);
|
||||
}
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_DPAD_LEFT:
|
||||
case SDL_GAMEPAD_BUTTON_DPAD_LEFT :
|
||||
sendKey(type, Qt::Key_Left);
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_DPAD_RIGHT:
|
||||
case SDL_GAMEPAD_BUTTON_DPAD_RIGHT :
|
||||
sendKey(type, Qt::Key_Right);
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_A:
|
||||
case SDL_GAMEPAD_BUTTON_SOUTH :
|
||||
if (m_UiNavMode) {
|
||||
sendKey(type, Qt::Key_Space);
|
||||
}
|
||||
@@ -170,14 +174,14 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||
sendKey(type, Qt::Key_Return);
|
||||
}
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_B:
|
||||
case SDL_GAMEPAD_BUTTON_EAST :
|
||||
sendKey(type, Qt::Key_Escape);
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_X:
|
||||
case SDL_GAMEPAD_BUTTON_WEST :
|
||||
sendKey(type, Qt::Key_Menu);
|
||||
break;
|
||||
case SDL_CONTROLLER_BUTTON_Y:
|
||||
case SDL_CONTROLLER_BUTTON_START:
|
||||
case SDL_GAMEPAD_BUTTON_NORTH :
|
||||
case SDL_GAMEPAD_BUTTON_START :
|
||||
// HACK: We use this keycode to inform main.qml
|
||||
// to show the settings when Key_Menu is handled
|
||||
// by the control in focus.
|
||||
@@ -188,19 +192,37 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SDL_CONTROLLERDEVICEADDED:
|
||||
SDL_GameController* gc = SDL_GameControllerOpen(event.cdevice.which);
|
||||
case SDL_EVENT_GAMEPAD_ADDED :
|
||||
#if SDL_VERSION_ATLEAST(3, 0, 0)
|
||||
SDL_Gamepad* gc = SDL_OpenGamepad(event.gdevice.which);
|
||||
if (gc != nullptr) {
|
||||
SDL_assert(!m_Gamepads.contains(gc));
|
||||
m_Gamepads.append(gc);
|
||||
}
|
||||
#else
|
||||
SDL_Gamepad* gc = SDL_GameControllerOpen(event.cdevice.which);
|
||||
if (gc != nullptr) {
|
||||
// SDL_CONTROLLERDEVICEADDED can be reported multiple times for the same
|
||||
// gamepad in rare cases, because SDL2 doesn't fixup the device index in
|
||||
// the SDL_CONTROLLERDEVICEADDED event if an unopened gamepad disappears
|
||||
// before we've processed the add event.
|
||||
if (!m_Gamepads.contains(gc)) {
|
||||
m_Gamepads.append(gc);
|
||||
}
|
||||
else {
|
||||
// We already have this game controller open
|
||||
SDL_CloseGamepad(gc);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle analog sticks by polling
|
||||
for (auto gc : m_Gamepads) {
|
||||
short leftX = SDL_GameControllerGetAxis(gc, SDL_CONTROLLER_AXIS_LEFTX);
|
||||
short leftY = SDL_GameControllerGetAxis(gc, SDL_CONTROLLER_AXIS_LEFTY);
|
||||
short leftX = SDL_GetGamepadAxis(gc, SDL_GAMEPAD_AXIS_LEFTX);
|
||||
short leftY = SDL_GetGamepadAxis(gc, SDL_GAMEPAD_AXIS_LEFTY);
|
||||
if (SDL_GetTicks() - m_LastAxisNavigationEventTime < AXIS_NAVIGATION_REPEAT_DELAY) {
|
||||
// Do nothing
|
||||
}
|
||||
@@ -239,31 +261,6 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||
sendKey(QEvent::Type::KeyRelease, Qt::Key_Right);
|
||||
m_LastAxisNavigationEventTime = SDL_GetTicks();
|
||||
}
|
||||
|
||||
// In UI navigation mode (settings page), use the right stick to scroll
|
||||
if (m_UiNavMode) {
|
||||
short rightX = SDL_GameControllerGetAxis(gc, SDL_CONTROLLER_AXIS_RIGHTX);
|
||||
short rightY = SDL_GameControllerGetAxis(gc, SDL_CONTROLLER_AXIS_RIGHTY);
|
||||
|
||||
QPoint wheelDelta;
|
||||
if (rightX > 30000) {
|
||||
wheelDelta.setX(30);
|
||||
}
|
||||
else if (rightX < -30000) {
|
||||
wheelDelta.setX(-30);
|
||||
}
|
||||
|
||||
if (rightY > 30000) {
|
||||
wheelDelta.setY(-30);
|
||||
}
|
||||
else if (rightY < -30000) {
|
||||
wheelDelta.setY(30);
|
||||
}
|
||||
|
||||
if (!wheelDelta.isNull()) {
|
||||
sendWheel(wheelDelta);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,19 +274,17 @@ void SdlGamepadKeyNavigation::sendKey(QEvent::Type type, Qt::Key key, Qt::Keyboa
|
||||
}
|
||||
}
|
||||
|
||||
void SdlGamepadKeyNavigation::sendWheel(QPoint& angleDelta)
|
||||
void SdlGamepadKeyNavigation::updateTimerState()
|
||||
{
|
||||
QGuiApplication* app = static_cast<QGuiApplication*>(QGuiApplication::instance());
|
||||
QWindow* focusWindow = app->focusWindow();
|
||||
if (focusWindow != nullptr) {
|
||||
QPoint mousePos(focusWindow->width() / 2, focusWindow->height() / 2);
|
||||
QPoint globalPos(focusWindow->mapToGlobal(mousePos));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
||||
QWheelEvent wheelEvent(mousePos, globalPos, QPoint(), angleDelta, Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false, Qt::MouseEventSynthesizedByApplication);
|
||||
#else
|
||||
QWheelEvent wheelEvent(mousePos, globalPos, QPoint(), angleDelta, angleDelta.y(), Qt::Vertical, Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, Qt::MouseEventSynthesizedByApplication, false);
|
||||
#endif
|
||||
app->sendEvent(focusWindow, &wheelEvent);
|
||||
if (m_PollingTimer->isActive() && (!m_HasFocus || !m_Enabled)) {
|
||||
m_PollingTimer->stop();
|
||||
}
|
||||
else if (!m_PollingTimer->isActive() && m_HasFocus && m_Enabled) {
|
||||
// Flush events on the first poll
|
||||
m_FirstPoll = true;
|
||||
|
||||
// Poll every 50 ms for a new joystick event
|
||||
m_PollingTimer->start(50);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,11 +298,6 @@ int SdlGamepadKeyNavigation::getConnectedGamepads()
|
||||
Q_ASSERT(m_Enabled);
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < SDL_NumJoysticks(); i++) {
|
||||
if (SDL_IsGameController(i)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
SDL_free(SDL_GetGamepads(&count));
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
#include <QTimer>
|
||||
#include <QEvent>
|
||||
|
||||
#include <SDL.h>
|
||||
#include "SDL_compat.h"
|
||||
|
||||
#include "settings/streamingpreferences.h"
|
||||
|
||||
class SdlGamepadKeyNavigation : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SdlGamepadKeyNavigation();
|
||||
SdlGamepadKeyNavigation(StreamingPreferences* prefs);
|
||||
|
||||
~SdlGamepadKeyNavigation();
|
||||
|
||||
@@ -18,22 +20,27 @@ public:
|
||||
|
||||
Q_INVOKABLE void disable();
|
||||
|
||||
Q_INVOKABLE void notifyWindowFocus(bool hasFocus);
|
||||
|
||||
Q_INVOKABLE void setUiNavMode(bool settingsMode);
|
||||
|
||||
Q_INVOKABLE int getConnectedGamepads();
|
||||
|
||||
private:
|
||||
void sendKey(QEvent::Type type, Qt::Key key, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
|
||||
void sendWheel(QPoint& angleDelta);
|
||||
|
||||
void updateTimerState();
|
||||
|
||||
private slots:
|
||||
void onPollingTimerFired();
|
||||
|
||||
private:
|
||||
StreamingPreferences* m_Prefs;
|
||||
QTimer* m_PollingTimer;
|
||||
QList<SDL_GameController*> m_Gamepads;
|
||||
QList<SDL_Gamepad*> m_Gamepads;
|
||||
bool m_Enabled;
|
||||
bool m_UiNavMode;
|
||||
bool m_FirstPoll;
|
||||
bool m_HasFocus;
|
||||
Uint32 m_LastAxisNavigationEventTime;
|
||||
};
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+638
-385
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+533
-288
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+542
-293
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+596
-382
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+534
-285
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+856
-591
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+543
-294
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+550
-297
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+546
-293
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+533
-288
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+541
-292
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+549
-300
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+557
-308
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+573
-324
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+694
-433
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+568
-315
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+856
-591
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+594
-333
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+538
-289
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user