From ffd2303a36030894e4ec61ab050ea88b9ebaf019 Mon Sep 17 00:00:00 2001 From: Shaolin Date: Mon, 12 Feb 2018 03:20:18 -0200 Subject: [PATCH] libobs: Log YUV space/range on video reset Closes jp9000/obs-studio#1196 --- libobs/media-io/video-io.h | 22 ++++++++++++++++++++++ libobs/obs.c | 12 ++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/libobs/media-io/video-io.h b/libobs/media-io/video-io.h index ec6b2face..03ea20b7b 100644 --- a/libobs/media-io/video-io.h +++ b/libobs/media-io/video-io.h @@ -124,6 +124,28 @@ static inline const char *get_video_format_name(enum video_format format) return "None"; } +static inline const char *get_video_colorspace_name(enum video_colorspace cs) +{ + switch (cs) { + case VIDEO_CS_709: return "709"; + case VIDEO_CS_601: + case VIDEO_CS_DEFAULT:; + } + + return "601"; +} + +static inline const char *get_video_range_name(enum video_range_type range) +{ + switch (range) { + case VIDEO_RANGE_FULL: return "Full"; + case VIDEO_RANGE_PARTIAL: + case VIDEO_RANGE_DEFAULT:; + } + + return "Partial"; +} + enum video_scale_type { VIDEO_SCALE_DEFAULT, VIDEO_SCALE_POINT, diff --git a/libobs/obs.c b/libobs/obs.c index 44c04a330..f37d85462 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -974,18 +974,26 @@ int obs_reset_video(struct obs_video_info *ovi) break; } + bool yuv = format_is_yuv(ovi->output_format); + const char *yuv_format = get_video_colorspace_name(ovi->colorspace); + const char *yuv_range = get_video_range_name(ovi->range); + blog(LOG_INFO, "---------------------------------"); blog(LOG_INFO, "video settings reset:\n" "\tbase resolution: %dx%d\n" "\toutput resolution: %dx%d\n" "\tdownscale filter: %s\n" "\tfps: %d/%d\n" - "\tformat: %s", + "\tformat: %s\n" + "\tYUV mode: %s%s%s", ovi->base_width, ovi->base_height, ovi->output_width, ovi->output_height, scale_type_name, ovi->fps_num, ovi->fps_den, - get_video_format_name(ovi->output_format)); + get_video_format_name(ovi->output_format), + yuv ? yuv_format : "None", + yuv ? "/" : "", + yuv ? yuv_range : ""); return obs_init_video(ovi); }