[vlc-commits] opengl: pass video_format_t with a pointer
Thomas Guillem
git at videolan.org
Fri Nov 17 10:27:59 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 17 10:26:56 2017 +0100| [e0fe3ddb3e9acaa4ee30cc684b0df774257c093a] | committer: Thomas Guillem
opengl: pass video_format_t with a pointer
CID #1462006
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e0fe3ddb3e9acaa4ee30cc684b0df774257c093a
---
modules/video_output/opengl/fragment_shaders.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index a5cb98588d..329259224a 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -502,7 +502,7 @@ xyz12_shader_init(opengl_tex_converter_t *tc)
}
#ifdef HAVE_LIBPLACEBO
-static struct pl_color_space pl_color_space_from_video_format(video_format_t fmt)
+static struct pl_color_space pl_color_space_from_video_format(const video_format_t *fmt)
{
static enum pl_color_primaries primaries[COLOR_PRIMARIES_MAX+1] = {
[COLOR_PRIMARIES_UNDEF] = PL_COLOR_PRIM_UNKNOWN,
@@ -529,13 +529,13 @@ static struct pl_color_space pl_color_space_from_video_format(video_format_t fmt
};
// Derive the signal peak/avg from the color light level metadata
- float sig_peak = fmt.lighting.MaxCLL / PL_COLOR_REF_WHITE;
- float sig_avg = fmt.lighting.MaxFALL / PL_COLOR_REF_WHITE;
+ float sig_peak = fmt->lighting.MaxCLL / PL_COLOR_REF_WHITE;
+ float sig_avg = fmt->lighting.MaxFALL / PL_COLOR_REF_WHITE;
// As a fallback value for the signal peak, we can also use the mastering
// metadata's luminance information
if (!sig_peak)
- sig_peak = fmt.mastering.max_luminance / PL_COLOR_REF_WHITE;
+ sig_peak = fmt->mastering.max_luminance / PL_COLOR_REF_WHITE;
// Sanitize the sig_peak/sig_avg, because of buggy or low quality tagging
// that's sadly common in lots of typical sources
@@ -543,8 +543,8 @@ static struct pl_color_space pl_color_space_from_video_format(video_format_t fmt
sig_avg = (sig_avg >= 0.0 && sig_avg <= 1.0) ? sig_avg : 0.0;
return (struct pl_color_space) {
- .primaries = primaries[fmt.primaries],
- .transfer = transfers[fmt.transfer],
+ .primaries = primaries[fmt->primaries],
+ .transfer = transfers[fmt->transfer],
.light = PL_COLOR_LIGHT_UNKNOWN,
.sig_peak = sig_peak,
.sig_avg = sig_avg,
@@ -607,7 +607,7 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
if (tc->pl_sh) {
struct pl_shader *sh = tc->pl_sh;
pl_shader_color_map(sh, &pl_color_map_default_params,
- pl_color_space_from_video_format(tc->fmt),
+ pl_color_space_from_video_format(&tc->fmt),
pl_color_space_unknown, false);
const struct pl_shader_res *res = tc->pl_sh_res = pl_shader_finalize(sh);
More information about the vlc-commits
mailing list