code: Always provide a default case for enumerations

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2022-08-28 14:55:40 +02:00
parent badca28a08
commit 0aca1fc132
3 changed files with 11 additions and 2 deletions

View file

@ -358,7 +358,7 @@ aom_av1_instance::aom_av1_instance(obs_data_t* settings, obs_encoder_t* self, bo
_settings.color_format = AOM_IMG_FMT_I444;
break;
default:
throw std::runtime_error("Something went wrong figuring out our color format.");
throw std::runtime_error("Color Format is unknown.");
}
// Color Space
@ -378,6 +378,8 @@ aom_av1_instance::aom_av1_instance(obs_data_t* settings, obs_encoder_t* self, bo
_settings.color_trc = AOM_CICP_TC_SRGB;
_settings.color_matrix = AOM_CICP_MC_BT_709;
break;
default:
throw std::runtime_error("Color Space is unknown.");
}
// Color Range
@ -388,6 +390,8 @@ aom_av1_instance::aom_av1_instance(obs_data_t* settings, obs_encoder_t* self, bo
case VIDEO_RANGE_PARTIAL:
_settings.color_range = AOM_CR_STUDIO_RANGE;
break;
default:
throw std::runtime_error("Color Range is unknown.");
}
// Monochrome
@ -1040,6 +1044,8 @@ void aom_av1_instance::get_video_info(struct video_scale_info* info)
D_LOG_WARNING("Color-format '%s' is not supported, forcing 'I444'...", obs_video_format_to_string(format));
info->format = VIDEO_FORMAT_I444;
break;
default:
throw std::runtime_error("Color Format is unknown.");
}
// Fix up color space.

View file

@ -325,6 +325,8 @@ void virtual_greenscreen_instance::video_render(gs_effect_t* effect)
nvvfxgs_process(_output_color, _output_alpha);
break;
#endif
default:
break;
}
} catch (...) {
obs_source_skip_video_filter(_self);

View file

@ -36,8 +36,9 @@ gs_color_format format_from_depth(streamfx::gfx::lut::color_depth depth)
case streamfx::gfx::lut::color_depth::_14:
case streamfx::gfx::lut::color_depth::_16:
return gs_color_format::GS_RGBA16;
default:
return GS_RGBA32F;
}
return GS_RGBA32F;
}
streamfx::gfx::lut::producer::producer()