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:
Cameron Gutman
2024-08-19 23:41:42 -05:00
parent 17448c02b0
commit 6d6cd6fc35
2 changed files with 42 additions and 14 deletions
+18
View File
@@ -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;