File: upstream_f127a2cc_Set-threads-option-by-default-in-Encoder.patch

package info (click to toggle)
kpipewire 6.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,364 kB
  • sloc: cpp: 6,192; xml: 133; makefile: 5; sh: 1
file content (26 lines) | stat: -rw-r--r-- 816 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From f127a2cce7f34bfe213754b8756fb96e983f7d0b Mon Sep 17 00:00:00 2001
From: Arjen Hiemstra <ahiemstra@heimr.nl>
Date: Thu, 20 Mar 2025 14:28:29 +0100
Subject: [PATCH] Set "threads" option by default in Encoder

So we don't have to repeat this in other encoders.
---
 src/encoder.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/encoder.cpp b/src/encoder.cpp
index f8b3d67..874ac08 100644
--- a/src/encoder.cpp
+++ b/src/encoder.cpp
@@ -189,6 +189,8 @@ AVDictionary *Encoder::buildEncodingOptions()
 {
     AVDictionary *options = NULL;
 
+    av_dict_set_int(&options, "threads", qMin(16, QThread::idealThreadCount()), 0);
+
     switch (m_encodingPreference) {
     case PipeWireBaseEncodedStream::EncodingPreference::NoPreference:
         av_dict_set(&options, "preset", "veryfast", 0);
-- 
GitLab