UI: Allow rescaling for texture-based encoders

master
jp9000 2020-02-18 21:00:57 -08:00
parent 55d80e82e1
commit cce734a0aa
2 changed files with 4 additions and 30 deletions

View File

@ -1284,14 +1284,9 @@ inline void AdvancedOutput::SetupStreaming()
config_get_string(main->Config(), "AdvOut", "RescaleRes");
int streamTrack =
config_get_int(main->Config(), "AdvOut", "TrackIndex") - 1;
uint32_t caps = obs_encoder_get_caps(h264Streaming);
unsigned int cx = 0;
unsigned int cy = 0;
if ((caps & OBS_ENCODER_CAP_PASS_TEXTURE) != 0) {
rescale = false;
}
if (rescale && rescaleRes && *rescaleRes) {
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
cx = 0;
@ -1339,11 +1334,6 @@ inline void AdvancedOutput::SetupRecording()
obs_output_set_video_encoder(replayBuffer,
h264Streaming);
} else {
uint32_t caps = obs_encoder_get_caps(h264Recording);
if ((caps & OBS_ENCODER_CAP_PASS_TEXTURE) != 0) {
rescale = false;
}
if (rescale && rescaleRes && *rescaleRes) {
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
cx = 0;

View File

@ -3672,16 +3672,8 @@ void OBSBasicSettings::on_advOutEncoder_currentIndexChanged(int idx)
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->setVisible(false);
ui->advOutRescale->setVisible(false);
} else {
ui->advOutUseRescale->setVisible(true);
ui->advOutRescale->setVisible(true);
}
UNUSED_PARAMETER(idx);
}
@ -3712,16 +3704,8 @@ void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
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->setVisible(false);
ui->advOutRecRescaleContainer->setVisible(false);
} else {
ui->advOutRecUseRescale->setVisible(true);
ui->advOutRecRescaleContainer->setVisible(true);
}
}
void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int)