diff options
| author | Anton <anton@picapica.im> | 2026-12-05 16:19:13 +0400 |
|---|---|---|
| committer | Anton <anton@picapica.im> | 2026-12-05 16:19:13 +0400 |
| commit | 59b0bdc4b0ff24dfaef0cfaed4051cfa0405379b (patch) | |
| tree | 1cb39f54be7123aabb78b3edfbb3d960f7279f3b /pica-client/callquality.cpp | |
| parent | c3298beb0779a8cc09b6d4ea0d2132c0612ea776 (diff) | |
| download | pica-pica-qr_codes.tar.gz pica-pica-qr_codes.zip | |
pica-client: improve hwaccel probing and aligning bitrate with framerateqr_codes
Diffstat (limited to 'pica-client/callquality.cpp')
| -rw-r--r-- | pica-client/callquality.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pica-client/callquality.cpp b/pica-client/callquality.cpp index 33289a1..eebf8c4 100644 --- a/pica-client/callquality.cpp +++ b/pica-client/callquality.cpp @@ -197,6 +197,36 @@ static void chooseEncoder(CallQualityPreset preset, const QList<CallHardwareEnco *acceleration = 0; } +QList<CallHardwareEncoder> callUsableHardwareEncoders(const QList<CallHardwareEncoder> &builtIn, + const QStringList &working, + int accelerationFlags) +{ + QList<CallHardwareEncoder> usable; + int verified = 0; + + for (int i = 0; i < builtIn.size(); i++) + { + const CallHardwareEncoder &e = builtIn.at(i); + + if ((accelerationFlags & e.acceleration) && working.contains(e.encoder)) + { + usable << e; + verified |= e.acceleration; + } + } + + for (int i = 0; i < builtIn.size(); i++) + { + const CallHardwareEncoder &e = builtIn.at(i); + + if ((accelerationFlags & e.acceleration) && !(verified & e.acceleration) && + e.codec == QLatin1String("h264")) + usable << e; + } + + return usable; +} + // The highest of rates, at most maxRate, at which size stays within // pixelRateCap. 0 if there is none. static int bestFrameRate(const QSize &size, const QList<int> &rates, int maxRate, double pixelRateCap) |
