vlc | branch: master | Romain Vimont <[email protected]> | Wed Feb 5 15:24:37 2020 +0100| [de129a7702777b911f725a0dbc45561e2d8ce929] | committer: Alexandre Janniaux
opengl: expose functions to call sampler callbacks The fact that the sampler use internal function pointers (instead of if-blocks for example) is an internal detail. Signed-off-by: Alexandre Janniaux <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de129a7702777b911f725a0dbc45561e2d8ce929 --- modules/video_output/opengl/renderer.c | 5 +++-- modules/video_output/opengl/sampler.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c index 6dd2684683..51e3763aec 100644 --- a/modules/video_output/opengl/renderer.c +++ b/modules/video_output/opengl/renderer.c @@ -361,7 +361,7 @@ opengl_link_program(struct vlc_gl_renderer *renderer) #undef GET_ULOC #undef GET_ALOC - int ret = sampler->pf_fetch_locations(sampler, program_id); + int ret = vlc_gl_sampler_FetchLocations(sampler, program_id); assert(ret == VLC_SUCCESS); if (ret != VLC_SUCCESS) { @@ -831,7 +831,8 @@ static void DrawWithShaders(struct vlc_gl_renderer *renderer) { struct vlc_gl_sampler *sampler = renderer->sampler; const opengl_vtable_t *vt = renderer->vt; - sampler->pf_prepare_shader(sampler); + + vlc_gl_sampler_PrepareShader(sampler); vt->BindBuffer(GL_ARRAY_BUFFER, renderer->texture_buffer_object); assert(renderer->aloc.PicCoordsIn != -1); diff --git a/modules/video_output/opengl/sampler.h b/modules/video_output/opengl/sampler.h index 7ef2d950c3..b5b296872b 100644 --- a/modules/video_output/opengl/sampler.h +++ b/modules/video_output/opengl/sampler.h @@ -129,4 +129,16 @@ vlc_gl_sampler_New(struct vlc_gl_interop *interop); void vlc_gl_sampler_Delete(struct vlc_gl_sampler *sampler); +static inline int +vlc_gl_sampler_FetchLocations(struct vlc_gl_sampler *sampler, GLuint program) +{ + return sampler->pf_fetch_locations(sampler, program); +} + +static inline void +vlc_gl_sampler_PrepareShader(const struct vlc_gl_sampler *sampler) +{ + sampler->pf_prepare_shader(sampler); +} + #endif _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
