Romain Vimont pushed to branch master at VideoLAN / VLC
Commits: c7ab5240 by Romain Vimont at 2021-08-22T12:16:59+00:00 Extract OpenGL filter wrapper In order to implement several standalone video filters (with capability "video filter") using OpenGL filters (with capability "opengl filter"), define an helper to delegate the work to the "opengl" video filter. Co-authored-by: vatsin1810 <[email protected]> - - - - - 3 changed files: - modules/video_filter/deinterlace/glblend.c - modules/video_output/opengl/gl_util.c - modules/video_output/opengl/gl_util.h Changes: ===================================== modules/video_filter/deinterlace/glblend.c ===================================== @@ -205,16 +205,7 @@ static int OpenVideoFilter(vlc_object_t *obj) if (!is_supported) return VLC_EGENERIC; - const config_chain_t *prev_chain = filter->p_cfg; - var_Create(filter, "opengl-filter", VLC_VAR_STRING); - var_SetString(filter, "opengl-filter", "glblend"); - - filter->p_cfg = NULL; - module_t *module = module_need(obj, "video filter", "opengl", true); - filter->p_cfg = prev_chain; - - var_Destroy(filter, "opengl-filter"); - + module_t *module = vlc_gl_WrapOpenGLFilter(filter, "glblend"); if (module == NULL) return VLC_EGENERIC; ===================================== modules/video_output/opengl/gl_util.c ===================================== @@ -25,6 +25,9 @@ #include "gl_util.h" +#include <vlc_filter.h> +#include <vlc_modules.h> + static void LogShaderErrors(vlc_object_t *obj, const opengl_vtable_t *vt, GLuint id) { @@ -131,3 +134,19 @@ finally_1: return program; } + +module_t * +vlc_gl_WrapOpenGLFilter(filter_t *filter, const char *opengl_filter_name) +{ + const config_chain_t *prev_chain = filter->p_cfg; + var_Create(filter, "opengl-filter", VLC_VAR_STRING); + var_SetString(filter, "opengl-filter", opengl_filter_name); + + filter->p_cfg = NULL; + module_t *module = module_need(filter, "video filter", "opengl", true); + filter->p_cfg = prev_chain; + + var_Destroy(filter, "opengl-filter"); + + return module; +} ===================================== modules/video_output/opengl/gl_util.h ===================================== @@ -70,4 +70,16 @@ vlc_gl_BuildProgram(vlc_object_t *obj, const opengl_vtable_t *vt, GLsizei vstring_count, const GLchar **vstrings, GLsizei fstring_count, const GLchar **fstrings); +/** + * Wrap an OpenGL filter from a video filter + * + * Open an OpenGL filter (with capability "opengl filter") from a video filter + * (with capability "video filter"). + * + * This internally uses the "opengl" video filter to load the OpenGL filter + * with the given name. + */ +module_t * +vlc_gl_WrapOpenGLFilter(filter_t *filter, const char *opengl_filter_name); + #endif View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c7ab524092e40c4a7fb0435f8d6a2948bc00a850 -- View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c7ab524092e40c4a7fb0435f8d6a2948bc00a850 You're receiving this email because of your account on code.videolan.org.
_______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
