Skip to content

Commit

Permalink
UI: Add suffix to deprecated encoders
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Aug 17, 2024
1 parent 539e47e commit 7a90c80
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions UI/window-basic-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2174,9 +2174,12 @@ void OBSBasicSettings::LoadAdvOutputStreamingEncoderProperties()
if (!SetComboByValue(ui->advOutEncoder, type)) {
uint32_t caps = obs_get_encoder_caps(type);
if ((caps & ENCODER_HIDE_FLAGS) != 0) {
const char *name = obs_encoder_get_display_name(type);
QString encName =
QT_UTF8(obs_encoder_get_display_name(type));
if (caps & OBS_ENCODER_CAP_DEPRECATED)
encName += " (" + QTStr("Deprecated") + ")";

ui->advOutEncoder->insertItem(0, QT_UTF8(name),
ui->advOutEncoder->insertItem(0, encName,
QT_UTF8(type));
SetComboByValue(ui->advOutEncoder, type);
}
Expand Down Expand Up @@ -2292,9 +2295,12 @@ void OBSBasicSettings::LoadAdvOutputRecordingEncoderProperties()
if (!SetComboByValue(ui->advOutRecEncoder, type)) {
uint32_t caps = obs_get_encoder_caps(type);
if ((caps & ENCODER_HIDE_FLAGS) != 0) {
const char *name = obs_encoder_get_display_name(type);
QString encName =
QT_UTF8(obs_encoder_get_display_name(type));
if (caps & OBS_ENCODER_CAP_DEPRECATED)
encName += " (" + QTStr("Deprecated") + ")";

ui->advOutRecEncoder->insertItem(1, QT_UTF8(name),
ui->advOutRecEncoder->insertItem(1, encName,
QT_UTF8(type));
SetComboByValue(ui->advOutRecEncoder, type);
} else {
Expand Down Expand Up @@ -5083,6 +5089,11 @@ static void DisableIncompatibleCodecs(QComboBox *cbox, const QString &format,
if (encoderId.empty())
continue;

if (obs_get_encoder_caps(encoderId.c_str()) &
OBS_ENCODER_CAP_DEPRECATED) {
encDisplayName += " (" + QTStr("Deprecated") + ")";
}

const char *codec = obs_get_encoder_codec(encoderId.c_str());

bool is_compatible =
Expand Down

0 comments on commit 7a90c80

Please sign in to comment.