mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-24 04:15:11 +00:00
code: Always provide a default case for enumerations
This commit is contained in:
parent
badca28a08
commit
0aca1fc132
3 changed files with 11 additions and 2 deletions
|
@ -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;
|
_settings.color_format = AOM_IMG_FMT_I444;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("Something went wrong figuring out our color format.");
|
throw std::runtime_error("Color Format is unknown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Color Space
|
// 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_trc = AOM_CICP_TC_SRGB;
|
||||||
_settings.color_matrix = AOM_CICP_MC_BT_709;
|
_settings.color_matrix = AOM_CICP_MC_BT_709;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw std::runtime_error("Color Space is unknown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Color Range
|
// 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:
|
case VIDEO_RANGE_PARTIAL:
|
||||||
_settings.color_range = AOM_CR_STUDIO_RANGE;
|
_settings.color_range = AOM_CR_STUDIO_RANGE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw std::runtime_error("Color Range is unknown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monochrome
|
// 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));
|
D_LOG_WARNING("Color-format '%s' is not supported, forcing 'I444'...", obs_video_format_to_string(format));
|
||||||
info->format = VIDEO_FORMAT_I444;
|
info->format = VIDEO_FORMAT_I444;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw std::runtime_error("Color Format is unknown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix up color space.
|
// Fix up color space.
|
||||||
|
|
|
@ -325,6 +325,8 @@ void virtual_greenscreen_instance::video_render(gs_effect_t* effect)
|
||||||
nvvfxgs_process(_output_color, _output_alpha);
|
nvvfxgs_process(_output_color, _output_alpha);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
obs_source_skip_video_filter(_self);
|
obs_source_skip_video_filter(_self);
|
||||||
|
|
|
@ -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::_14:
|
||||||
case streamfx::gfx::lut::color_depth::_16:
|
case streamfx::gfx::lut::color_depth::_16:
|
||||||
return gs_color_format::GS_RGBA16;
|
return gs_color_format::GS_RGBA16;
|
||||||
|
default:
|
||||||
|
return GS_RGBA32F;
|
||||||
}
|
}
|
||||||
return GS_RGBA32F;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
streamfx::gfx::lut::producer::producer()
|
streamfx::gfx::lut::producer::producer()
|
||||||
|
|
Loading…
Reference in a new issue