summaryrefslogtreecommitdiffstats
path: root/pica-client/callquality.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client/callquality.cpp')
-rw-r--r--pica-client/callquality.cpp30
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)