UI: Allow rescaling for texture-based encoders
parent
55d80e82e1
commit
cce734a0aa
|
@ -1284,14 +1284,9 @@ inline void AdvancedOutput::SetupStreaming()
|
||||||
config_get_string(main->Config(), "AdvOut", "RescaleRes");
|
config_get_string(main->Config(), "AdvOut", "RescaleRes");
|
||||||
int streamTrack =
|
int streamTrack =
|
||||||
config_get_int(main->Config(), "AdvOut", "TrackIndex") - 1;
|
config_get_int(main->Config(), "AdvOut", "TrackIndex") - 1;
|
||||||
uint32_t caps = obs_encoder_get_caps(h264Streaming);
|
|
||||||
unsigned int cx = 0;
|
unsigned int cx = 0;
|
||||||
unsigned int cy = 0;
|
unsigned int cy = 0;
|
||||||
|
|
||||||
if ((caps & OBS_ENCODER_CAP_PASS_TEXTURE) != 0) {
|
|
||||||
rescale = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rescale && rescaleRes && *rescaleRes) {
|
if (rescale && rescaleRes && *rescaleRes) {
|
||||||
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
|
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
|
||||||
cx = 0;
|
cx = 0;
|
||||||
|
@ -1339,11 +1334,6 @@ inline void AdvancedOutput::SetupRecording()
|
||||||
obs_output_set_video_encoder(replayBuffer,
|
obs_output_set_video_encoder(replayBuffer,
|
||||||
h264Streaming);
|
h264Streaming);
|
||||||
} else {
|
} else {
|
||||||
uint32_t caps = obs_encoder_get_caps(h264Recording);
|
|
||||||
if ((caps & OBS_ENCODER_CAP_PASS_TEXTURE) != 0) {
|
|
||||||
rescale = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rescale && rescaleRes && *rescaleRes) {
|
if (rescale && rescaleRes && *rescaleRes) {
|
||||||
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
|
if (sscanf(rescaleRes, "%ux%u", &cx, &cy) != 2) {
|
||||||
cx = 0;
|
cx = 0;
|
||||||
|
|
|
@ -3672,16 +3672,8 @@ void OBSBasicSettings::on_advOutEncoder_currentIndexChanged(int idx)
|
||||||
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps);
|
ui->advOutputStreamTab->layout()->addWidget(streamEncoderProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
|
ui->advOutUseRescale->setVisible(true);
|
||||||
|
ui->advOutRescale->setVisible(true);
|
||||||
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);
|
UNUSED_PARAMETER(idx);
|
||||||
}
|
}
|
||||||
|
@ -3712,16 +3704,8 @@ void OBSBasicSettings::on_advOutRecEncoder_currentIndexChanged(int idx)
|
||||||
SLOT(AdvReplayBufferChanged()));
|
SLOT(AdvReplayBufferChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t caps = obs_get_encoder_caps(QT_TO_UTF8(encoder));
|
ui->advOutRecUseRescale->setVisible(true);
|
||||||
|
ui->advOutRecRescaleContainer->setVisible(true);
|
||||||
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)
|
void OBSBasicSettings::on_advOutFFIgnoreCompat_stateChanged(int)
|
||||||
|
|
Loading…
Reference in New Issue