(API Change) Add colorspace info to obs_video_info

This was an important change because we were originally using an
hard-coded 709/partial range color matrix for the output, which was
causing problems for people wanting to use different formats or color
spaces.  This will now automatically generate the color matrix depending
on the format, color space, and range, or use an identity matrix if the
video format is RGB instead of YUV.
This commit is contained in:
jp9000
2014-12-11 19:51:30 -08:00
parent 59c4731aa6
commit b07862286a
5 changed files with 37 additions and 10 deletions

View File

@@ -131,16 +131,7 @@ static inline void render_output_texture(struct obs_core_video *video,
gs_set_render_target(target, NULL);
set_render_size(width, height);
/* TODO: replace with programmable code */
const float mat_val[16] =
{
-0.100644f, -0.338572f, 0.439216f, 0.501961f,
0.182586f, 0.614231f, 0.062007f, 0.062745f,
0.439216f, -0.398942f, -0.040274f, 0.501961f,
0.000000f, 0.000000f, 0.000000f, 1.000000f
};
gs_effect_set_val(matrix, mat_val, sizeof(mat_val));
gs_effect_set_val(matrix, video->color_matrix, sizeof(float) * 16);
gs_effect_set_texture(image, texture);
gs_enable_blending(false);