0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

libobs: Add VIDEO_CS_SRGB support

This commit is contained in:
jpark37 2020-01-25 10:23:32 -08:00
parent 6a79657a19
commit a69151e204
3 changed files with 8 additions and 6 deletions

View File

@ -176,9 +176,10 @@ static inline const char *get_video_colorspace_name(enum video_colorspace cs)
switch (cs) {
case VIDEO_CS_709:
return "709";
case VIDEO_CS_SRGB:
return "sRGB";
case VIDEO_CS_601:
case VIDEO_CS_DEFAULT:
case VIDEO_CS_SRGB:;
case VIDEO_CS_DEFAULT:;
}
return "601";

View File

@ -173,6 +173,8 @@ bool video_format_get_parameters(enum video_colorspace color_space,
#endif
if (color_space == VIDEO_CS_DEFAULT)
color_space = VIDEO_CS_601;
else if (color_space == VIDEO_CS_SRGB)
color_space = VIDEO_CS_709;
for (size_t i = 0; i < NUM_FORMATS; i++) {
if (format_info[i].color_space != color_space)

View File

@ -92,12 +92,11 @@ static inline int get_ffmpeg_scale_type(enum video_scale_type type)
static inline const int *get_ffmpeg_coeffs(enum video_colorspace cs)
{
switch (cs) {
case VIDEO_CS_DEFAULT:
return sws_getCoefficients(SWS_CS_ITU601);
case VIDEO_CS_601:
return sws_getCoefficients(SWS_CS_ITU601);
case VIDEO_CS_709:
case VIDEO_CS_SRGB:
return sws_getCoefficients(SWS_CS_ITU709);
case VIDEO_CS_DEFAULT:
case VIDEO_CS_601:
default:
return sws_getCoefficients(SWS_CS_ITU601);
}