color-source: Change default color to d1d1d1

The default color can trigger photosensitivity in users suffering from
it; the new color should reduce or avoid the trigger.
This commit is contained in:
matoi974 2020-06-07 01:40:40 +05:00 committed by jp9000
parent 0d7b4e1ced
commit 57a1bab187
2 changed files with 28 additions and 1 deletions

View File

@ -113,6 +113,13 @@ static void color_source_defaults_v2(obs_data_t *settings)
obs_data_set_default_int(settings, "height", 1080);
}
static void color_source_defaults_v3(obs_data_t *settings)
{
obs_data_set_default_int(settings, "color", 0xFFD1D1D1);
obs_data_set_default_int(settings, "width", 1920);
obs_data_set_default_int(settings, "height", 1080);
}
struct obs_source_info color_source_info_v1 = {
.id = "color_source",
.type = OBS_SOURCE_TYPE_INPUT,
@ -134,7 +141,8 @@ struct obs_source_info color_source_info_v2 = {
.id = "color_source",
.version = 2,
.type = OBS_SOURCE_TYPE_INPUT,
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW |
OBS_SOURCE_CAP_OBSOLETE,
.create = color_source_create,
.destroy = color_source_destroy,
.update = color_source_update,
@ -146,3 +154,20 @@ struct obs_source_info color_source_info_v2 = {
.get_properties = color_source_properties,
.icon_type = OBS_ICON_TYPE_COLOR,
};
struct obs_source_info color_source_info_v3 = {
.id = "color_source",
.version = 3,
.type = OBS_SOURCE_TYPE_INPUT,
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
.create = color_source_create,
.destroy = color_source_destroy,
.update = color_source_update,
.get_name = color_source_get_name,
.get_defaults = color_source_defaults_v3,
.get_width = color_source_getwidth,
.get_height = color_source_getheight,
.video_render = color_source_render,
.get_properties = color_source_properties,
.icon_type = OBS_ICON_TYPE_COLOR,
};

View File

@ -281,12 +281,14 @@ MODULE_EXPORT const char *obs_module_description(void)
extern struct obs_source_info slideshow_info;
extern struct obs_source_info color_source_info_v1;
extern struct obs_source_info color_source_info_v2;
extern struct obs_source_info color_source_info_v3;
bool obs_module_load(void)
{
obs_register_source(&image_source_info);
obs_register_source(&color_source_info_v1);
obs_register_source(&color_source_info_v2);
obs_register_source(&color_source_info_v3);
obs_register_source(&slideshow_info);
return true;
}