UI: If hardware encoder selected, disable post rescale

The post-output rescale option in advanced output mode cannot currently
be used with texture-based encoders, so disable the option when a
texture-based encoder is selected.
master
jp9000 2019-02-05 18:09:00 -08:00
parent 9fee895359
commit f5ad8b5d67
1 changed files with 44 additions and 18 deletions

View File

@ -3421,35 +3421,50 @@ void OBSBasicSettings::on_advOutFFPathBrowse_clicked()
void OBSBasicSettings::on_advOutEncoder_currentIndexChanged(int idx) void OBSBasicSettings::on_advOutEncoder_currentIndexChanged(int idx)
{ {
if (loading)
return;
QString encoder = GetComboData(ui->advOutEncoder); QString encoder = GetComboData(ui->advOutEncoder);
bool loadSettings = encoder == curAdvStreamEncoder; if (!loading) {
bool loadSettings = encoder == curAdvStreamEncoder;
delete streamEncoderProps; delete streamEncoderProps;
streamEncoderProps = CreateEncoderPropertyView(QT_TO_UTF8(encoder), streamEncoderProps = CreateEncoderPropertyView(
loadSettings ? "streamEncoder.json" : nullptr, true); QT_TO_UTF8(encoder),
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps); loadSettings ? "streamEncoder.json" : nullptr,
true);
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps);
}
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
if (caps & OBS_ENCODER_CAP_PASS_TEXTURE) {
ui->advOutUseRescale->setChecked(false);
ui->advOutUseRescale->setEnabled(false);
ui->advOutRescale->setEnabled(false);
} else {
ui->advOutUseRescale->setEnabled(true);
ui->advOutRescale->setEnabled(true);
}
UNUSED_PARAMETER(idx); UNUSED_PARAMETER(idx);
} }
void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx) void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
{ {
if (loading) if (!loading) {
ui->advOutRecUseRescale->setEnabled(idx > 0);
ui->advOutRecRescaleContainer->setEnabled(idx > 0);
delete recordEncoderProps;
recordEncoderProps = nullptr;
}
if (idx <= 0) {
return; return;
}
ui->advOutRecUseRescale->setEnabled(idx > 0); QString encoder = GetComboData(ui->advOutRecEncoder);
ui->advOutRecRescaleContainer->setEnabled(idx > 0); bool loadSettings = encoder == curAdvRecordEncoder;
delete recordEncoderProps;
recordEncoderProps = nullptr;
if (idx > 0) {
QString encoder = GetComboData(ui->advOutRecEncoder);
bool loadSettings = encoder == curAdvRecordEncoder;
if (!loading) {
recordEncoderProps = CreateEncoderPropertyView( recordEncoderProps = CreateEncoderPropertyView(
QT_TO_UTF8(encoder), QT_TO_UTF8(encoder),
loadSettings ? "recordEncoder.json" : nullptr, loadSettings ? "recordEncoder.json" : nullptr,
@ -3458,6 +3473,17 @@ void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
connect(recordEncoderProps, SIGNAL(Changed()), connect(recordEncoderProps, SIGNAL(Changed()),
this, SLOT(AdvReplayBufferChanged())); this, SLOT(AdvReplayBufferChanged()));
} }
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
if (caps & OBS_ENCODER_CAP_PASS_TEXTURE) {
ui->advOutRecUseRescale->setChecked(false);
ui->advOutRecUseRescale->setEnabled(false);
ui->advOutRecRescale->setEnabled(false);
} else {
ui->advOutRecUseRescale->setEnabled(true);
ui->advOutRecRescale->setEnabled(true);
}
} }
void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int) void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int)