obs-studio/0101-UI-Consistently-reference-the-software-H264-encoder-.patch
2023-09-11 16:45:17 -04:00

105 lines
5.1 KiB
Diff

From dfa857eceb0deaf1a273fbd3423364fd7268ea90 Mon Sep 17 00:00:00 2001
From: Neal Gompa <neal@gompa.dev>
Date: Sat, 7 Jan 2023 23:15:13 -0500
Subject: [PATCH 101/103] UI: Consistently reference the software H264 encoder
properly
The code here assumes that the only software encoder is the x264-based
H.264 encoder. That may not always remain true. This change adjusts
the encoder string to indicate that it's an H.264 encoder from x264.
---
UI/data/locale/en-US.ini | 4 ++--
UI/window-basic-auto-config-test.cpp | 6 +++---
UI/window-basic-settings-stream.cpp | 2 +-
UI/window-basic-settings.cpp | 7 ++++---
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini
index e62f38a26..339ac4d86 100644
--- a/UI/data/locale/en-US.ini
+++ b/UI/data/locale/en-US.ini
@@ -996,7 +996,7 @@ Basic.Settings.Output.Simple.Warn.Encoder="Warning: Recording with a software en
Basic.Settings.Output.Simple.Warn.Lossless="Warning: Lossless quality generates tremendously large file sizes! Lossless quality can use upward of 7 gigabytes of disk space per minute at high resolutions and framerates. Lossless is not recommended for long recordings unless you have a very large amount of disk space available."
Basic.Settings.Output.Simple.Warn.Lossless.Msg="Are you sure you want to use lossless quality?"
Basic.Settings.Output.Simple.Warn.Lossless.Title="Lossless quality warning!"
-Basic.Settings.Output.Simple.Encoder.Software="Software (x264)"
+Basic.Settings.Output.Simple.Encoder.Software.X264.H264="Software (x264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV.H264="Hardware (QSV, H.264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV.AV1="Hardware (QSV, AV1)"
Basic.Settings.Output.Simple.Encoder.Hardware.AMD.H264="Hardware (AMD, H.264)"
@@ -1007,7 +1007,7 @@ Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.AV1="Hardware (NVENC, AV1)"
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.HEVC="Hardware (NVENC, HEVC)"
Basic.Settings.Output.Simple.Encoder.Hardware.Apple.H264="Hardware (Apple, H.264)"
Basic.Settings.Output.Simple.Encoder.Hardware.Apple.HEVC="Hardware (Apple, HEVC)"
-Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU="Software (x264 low CPU usage preset, increases file size)"
+Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU.X264.H264="Software (x264 low CPU usage preset, increases file size)"
Basic.Settings.Output.Simple.Codec.AAC="AAC"
Basic.Settings.Output.Simple.Codec.AAC.Default="AAC (Default)"
Basic.Settings.Output.Simple.Codec.Opus="Opus"
diff --git a/UI/window-basic-auto-config-test.cpp b/UI/window-basic-auto-config-test.cpp
index 7d7c4278e..a8b5d884a 100644
--- a/UI/window-basic-auto-config-test.cpp
+++ b/UI/window-basic-auto-config-test.cpp
@@ -1010,7 +1010,7 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
}
#define ENCODER_TEXT(x) "Basic.Settings.Output.Simple.Encoder." x
-#define ENCODER_SOFTWARE ENCODER_TEXT("Software")
+#define ENCODER_X264 ENCODER_TEXT("Software.X264.H264")
#define ENCODER_NVENC ENCODER_TEXT("Hardware.NVENC.H264")
#define ENCODER_QSV ENCODER_TEXT("Hardware.QSV.H264")
#define ENCODER_AMD ENCODER_TEXT("Hardware.AMD.H264")
@@ -1050,7 +1050,7 @@ void AutoConfigTestPage::FinalizeResults()
auto encName = [](AutoConfig::Encoder enc) -> QString {
switch (enc) {
case AutoConfig::Encoder::x264:
- return QTStr(ENCODER_SOFTWARE);
+ return QTStr(ENCODER_X264);
case AutoConfig::Encoder::NVENC:
return QTStr(ENCODER_NVENC);
case AutoConfig::Encoder::QSV:
@@ -1063,7 +1063,7 @@ void AutoConfigTestPage::FinalizeResults()
return QTStr(QUALITY_SAME);
}
- return QTStr(ENCODER_SOFTWARE);
+ return QTStr(ENCODER_X264);
};
auto newLabel = [this](const char *str) -> QLabel * {
diff --git a/UI/window-basic-settings-stream.cpp b/UI/window-basic-settings-stream.cpp
index 2ad275a44..e2ba4b677 100644
--- a/UI/window-basic-settings-stream.cpp
+++ b/UI/window-basic-settings-stream.cpp
@@ -1670,7 +1670,7 @@ void OBSBasicSettings::ResetEncoders(bool streamOnly)
#define ENCODER_STR(str) QTStr("Basic.Settings.Output.Simple.Encoder." str)
- ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software"),
+ ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.X264.H264"),
QString(SIMPLE_ENCODER_X264));
#ifdef _WIN32
if (service_supports_encoder(vcodecs, "obs_qsv11"))
diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp
index b1e6bd6fb..ddf0adc56 100644
--- a/UI/window-basic-settings.cpp
+++ b/UI/window-basic-settings.cpp
@@ -5237,10 +5237,11 @@ void OBSBasicSettings::FillSimpleRecordingValues()
ADD_QUALITY("HQ");
ADD_QUALITY("Lossless");
- ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software"),
+ ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.X264.H264"),
QString(SIMPLE_ENCODER_X264));
- ui->simpleOutRecEncoder->addItem(ENCODER_STR("SoftwareLowCPU"),
- QString(SIMPLE_ENCODER_X264_LOWCPU));
+ ui->simpleOutRecEncoder->addItem(
+ ENCODER_STR("SoftwareLowCPU.X264.H264"),
+ QString(SIMPLE_ENCODER_X264_LOWCPU));
if (EncoderAvailable("obs_qsv11"))
ui->simpleOutRecEncoder->addItem(
ENCODER_STR("Hardware.QSV.H264"),
--
2.41.0