Skip to content
Snippets Groups Projects
Commit c7ab5240 authored by Romain Vimont's avatar Romain Vimont Committed by Romain Vimont
Browse files

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: default avatarvatsin1810 <suchak@sas.upenn.edu>
parent 71c7f79d
No related branches found
No related tags found
1 merge request!530Extract OpenGL filter wrapper
Pipeline #130173 passed with stage
in 10 minutes and 5 seconds
......@@ -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;
......
......@@ -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;
}
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment