summaryrefslogtreecommitdiffstats
path: root/pica-client/callsettings.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-10-04 20:27:09 +0400
committerAnton <anton@picapica.im>2026-10-04 20:27:09 +0400
commit8f87c8491ffd9567df97979e9c18d4c148357870 (patch)
tree3e8516066c96834defae2be933ce034d928ca7b3 /pica-client/callsettings.cpp
parent7d6512f8051af51b89b6c9166c44607bfe1b83c3 (diff)
downloadpica-pica-8f87c8491ffd9567df97979e9c18d4c148357870.tar.gz
pica-pica-8f87c8491ffd9567df97979e9c18d4c148357870.zip
pica-client: more hardware acceleration options on Windows
Diffstat (limited to 'pica-client/callsettings.cpp')
-rw-r--r--pica-client/callsettings.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/pica-client/callsettings.cpp b/pica-client/callsettings.cpp
index b97d46a..586fbae 100644
--- a/pica-client/callsettings.cpp
+++ b/pica-client/callsettings.cpp
@@ -101,6 +101,31 @@ CallSettings CallSettings::load()
cs.captureHeight = st.loadValue("video.capture_height", kDefaultCaptureHeight).toInt();
cs.captureFrameRate = st.loadValue("video.capture_framerate", kDefaultCaptureFrameRate).toInt();
+ // Only the keys this build has checkboxes for: a database carried over
+ // from another platform must not switch on a path that cannot exist here.
+ cs.videoEncodingAcceleration = 0;
+ cs.videoDecodingAcceleration = 0;
+#ifdef HAVE_VAAPI
+ if (st.loadValue("video.vaapi_encoding", 0).toBool())
+ cs.videoEncodingAcceleration |= VideoAccelerationVaapi;
+ if (st.loadValue("video.vaapi_decoding", 0).toBool())
+ cs.videoDecodingAcceleration |= VideoAccelerationVaapi;
+#endif
+#ifdef HAVE_D3D12VA
+ if (st.loadValue("video.d3d12va_encoding", 0).toBool())
+ cs.videoEncodingAcceleration |= VideoAccelerationD3d12va;
+ if (st.loadValue("video.d3d12va_decoding", 0).toBool())
+ cs.videoDecodingAcceleration |= VideoAccelerationD3d12va;
+#endif
+#ifdef Q_OS_WIN
+ if (st.loadValue("video.mediafoundation_encoding", 0).toBool())
+ cs.videoEncodingAcceleration |= VideoAccelerationMediaFoundation;
+ if (st.loadValue("video.d3d11va_decoding", 0).toBool())
+ cs.videoDecodingAcceleration |= VideoAccelerationD3d11va;
+ if (st.loadValue("video.dxva2_decoding", 0).toBool())
+ cs.videoDecodingAcceleration |= VideoAccelerationDxva2;
+#endif
+
// A stored value that makes no sense - a hand-edited database, or a
// setting written by a build that offered something this one does not -
// would otherwise be passed to the encoder and fail the call rather than