mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Improve codec autoselection logic
- Deprioritize codecs that don't have hardware decoding rather than rejecting them outright - Allow AV1 to be negotiated with autoselection if no other codec is available - Take into account YUV444 preference when picking an optimal codec - Arrange codec preference in ascending order of computational complexity when hardware decoding is unavailable
This commit is contained in:
@@ -39,6 +39,24 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
deprioritizeByMask(int mask)
|
||||
{
|
||||
QList<int> deprioritizedList;
|
||||
|
||||
int i = 0;
|
||||
while (i < this->length()) {
|
||||
if (this->value(i) & mask) {
|
||||
deprioritizedList.append(this->takeAt(i));
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
this->append(std::move(deprioritizedList));
|
||||
}
|
||||
|
||||
int maskByServerCodecModes(int serverCodecModes)
|
||||
{
|
||||
int mask = 0;
|
||||
|
||||
Reference in New Issue
Block a user