libobs, UI: Add SDR white nits option
parent
eccde48926
commit
cd22df09c9
|
@ -1036,6 +1036,7 @@ Basic.Settings.Advanced.Video.ColorSpace="Color Space"
|
|||
Basic.Settings.Advanced.Video.ColorRange="Color Range"
|
||||
Basic.Settings.Advanced.Video.ColorRange.Partial="Partial"
|
||||
Basic.Settings.Advanced.Video.ColorRange.Full="Full"
|
||||
Basic.Settings.Advanced.Video.SdrWhiteLevel="SDR White Level (nits)"
|
||||
Basic.Settings.Advanced.Audio.MonitoringDevice="Monitoring Device"
|
||||
Basic.Settings.Advanced.Audio.MonitoringDevice.Default="Default"
|
||||
Basic.Settings.Advanced.Audio.DisableAudioDucking="Disable Windows audio ducking"
|
||||
|
|
|
@ -4989,35 +4989,15 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_18">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Video.ColorSpace</string>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
<property name="buddy">
|
||||
<cstring>colorSpace</cstring>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="disableOSXVSync">
|
||||
<property name="text">
|
||||
<string>DisableOSXVSync</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="resetOSXVSync">
|
||||
<property name="text">
|
||||
<string>ResetOSXVSyncOnExit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_20">
|
||||
|
@ -5073,17 +5053,73 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_sdrWhiteLevel">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Video.ColorSpace</string>
|
||||
<string>Basic.Settings.Advanced.Video.SdrWhiteLevel</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>colorSpace</cstring>
|
||||
<cstring>sdrWhiteLevel</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="4" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_sdrPaperWhite">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="sdrWhiteLevel">
|
||||
<property name="minimum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>480</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_18">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="disableOSXVSync">
|
||||
<property name="text">
|
||||
<string>DisableOSXVSync</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="resetOSXVSync">
|
||||
<property name="text">
|
||||
<string>ResetOSXVSyncOnExit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
@ -1490,6 +1490,7 @@ bool OBSBasic::InitBasicConfigDefaults()
|
|||
config_set_default_string(basicConfig, "Video", "ColorSpace", "709");
|
||||
config_set_default_string(basicConfig, "Video", "ColorRange",
|
||||
"Partial");
|
||||
config_set_default_uint(basicConfig, "Video", "SdrWhiteLevel", 300);
|
||||
|
||||
config_set_default_string(basicConfig, "Audio", "MonitoringDeviceId",
|
||||
"default");
|
||||
|
@ -4392,6 +4393,8 @@ int OBSBasic::ResetVideo()
|
|||
}
|
||||
|
||||
if (ret == OBS_VIDEO_SUCCESS) {
|
||||
obs_set_video_sdr_white_level((float)config_get_uint(
|
||||
basicConfig, "Video", "SdrWhiteLevel"));
|
||||
OBSBasicStats::InitializeValues();
|
||||
OBSProjector::UpdateMultiviewProjectors();
|
||||
}
|
||||
|
|
|
@ -531,6 +531,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->colorFormat, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->colorSpace, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->colorRange, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->sdrWhiteLevel, SCROLL_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->disableOSXVSync, CHECK_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->resetOSXVSync, CHECK_CHANGED, ADV_CHANGED);
|
||||
if (obs_audio_monitoring_available())
|
||||
|
@ -2521,6 +2522,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
config_get_string(main->Config(), "Video", "ColorSpace");
|
||||
const char *videoColorRange =
|
||||
config_get_string(main->Config(), "Video", "ColorRange");
|
||||
uint32_t sdrWhiteLevel = (uint32_t)config_get_uint(
|
||||
main->Config(), "Video", "SdrWhiteLevel");
|
||||
|
||||
QString monDevName;
|
||||
QString monDevId;
|
||||
|
@ -2592,6 +2595,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
SetComboByName(ui->colorFormat, videoColorFormat);
|
||||
SetComboByName(ui->colorSpace, videoColorSpace);
|
||||
SetComboByValue(ui->colorRange, videoColorRange);
|
||||
ui->sdrWhiteLevel->setValue(sdrWhiteLevel);
|
||||
|
||||
if (!SetComboByValue(ui->bindToIP, bindIP))
|
||||
SetInvalidValue(ui->bindToIP, bindIP, bindIP);
|
||||
|
@ -3297,6 +3301,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
|
|||
SaveCombo(ui->colorFormat, "Video", "ColorFormat");
|
||||
SaveCombo(ui->colorSpace, "Video", "ColorSpace");
|
||||
SaveComboData(ui->colorRange, "Video", "ColorRange");
|
||||
SaveSpinBox(ui->sdrWhiteLevel, "Video", "SdrWhiteLevel");
|
||||
if (obs_audio_monitoring_available()) {
|
||||
SaveCombo(ui->monitoringDevice, "Audio",
|
||||
"MonitoringDeviceName");
|
||||
|
|
|
@ -147,11 +147,25 @@ Initialization, Shutdown, and Information
|
|||
.. function:: bool obs_get_video_info(struct obs_video_info *ovi)
|
||||
|
||||
Gets the current video settings.
|
||||
|
||||
|
||||
:return: *false* if no video
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: float obs_get_video_sdr_white_level(void)
|
||||
|
||||
Gets the current SDR white level.
|
||||
|
||||
:return: SDR white level, 300.f if no video
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: void obs_set_video_sdr_white_level(float sdr_white_level)
|
||||
|
||||
Sets the current SDR white level.
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: bool obs_get_audio_info(struct obs_audio_info *oai)
|
||||
|
||||
Gets the current audio settings.
|
||||
|
|
|
@ -321,6 +321,7 @@ struct obs_core_video {
|
|||
gs_effect_t *deinterlace_yadif_2x_effect;
|
||||
|
||||
struct obs_video_info ovi;
|
||||
uint32_t sdr_white_level;
|
||||
|
||||
pthread_mutex_t task_mutex;
|
||||
struct circlebuf tasks;
|
||||
|
|
14
libobs/obs.c
14
libobs/obs.c
|
@ -1301,6 +1301,20 @@ bool obs_get_video_info(struct obs_video_info *ovi)
|
|||
return true;
|
||||
}
|
||||
|
||||
float obs_get_video_sdr_white_level(void)
|
||||
{
|
||||
struct obs_core_video *video = &obs->video;
|
||||
return video->graphics ? video->sdr_white_level : 300.f;
|
||||
}
|
||||
|
||||
void obs_set_video_sdr_white_level(float sdr_white_level)
|
||||
{
|
||||
struct obs_core_video *video = &obs->video;
|
||||
assert(video->graphics);
|
||||
|
||||
video->sdr_white_level = (uint32_t)sdr_white_level;
|
||||
}
|
||||
|
||||
bool obs_get_audio_info(struct obs_audio_info *oai)
|
||||
{
|
||||
struct obs_core_audio *audio = &obs->audio;
|
||||
|
|
|
@ -410,6 +410,12 @@ EXPORT bool obs_reset_audio(const struct obs_audio_info *oai);
|
|||
/** Gets the current video settings, returns false if no video */
|
||||
EXPORT bool obs_get_video_info(struct obs_video_info *ovi);
|
||||
|
||||
/** Gets the SDR white level, returns 300.0 if no video */
|
||||
EXPORT float obs_get_video_sdr_white_level(void);
|
||||
|
||||
/** Sets the SDR white level */
|
||||
EXPORT void obs_set_video_sdr_white_level(float sdr_white_level);
|
||||
|
||||
/** Gets the current audio settings, returns false if no audio */
|
||||
EXPORT bool obs_get_audio_info(struct obs_audio_info *oai);
|
||||
|
||||
|
|
Loading…
Reference in New Issue