[vlc-commits] [Git][videolan/vlc][master] opengl: add typed set_callback for opengl filters

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Oct 23 10:24:53 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
53e91250 by Romain Vimont at 2021-10-23T08:30:56+00:00
opengl: add typed set_callback for opengl filters

This will ensure that the callback has the expected signature.

- - - - -


5 changed files:

- modules/video_filter/deinterlace/glblend.c
- modules/video_output/opengl/filter.h
- modules/video_output/opengl/filter_draw.c
- modules/video_output/opengl/filter_mock.c
- modules/video_output/opengl/renderer.h


Changes:

=====================================
modules/video_filter/deinterlace/glblend.c
=====================================
@@ -262,6 +262,6 @@ vlc_module_begin()
 
     add_submodule()
         set_capability("opengl filter", 0)
-        set_callback(Open)
+        set_callback_opengl_filter(Open)
         add_shortcut("glblend")
 vlc_module_end()


=====================================
modules/video_output/opengl/filter.h
=====================================
@@ -43,6 +43,13 @@ vlc_gl_filter_open_fn(struct vlc_gl_filter *filter,
                       const config_chain_t *config,
                       struct vlc_gl_tex_size *size_out);
 
+#define set_callback_opengl_filter(open) \
+    { \
+        vlc_gl_filter_open_fn *fn = open; \
+        (void) fn; \
+        set_callback(fn); \
+    }
+
 struct vlc_gl_filter_ops {
     /**
      * Draw the result of the filter to the current framebuffer


=====================================
modules/video_output/opengl/filter_draw.c
=====================================
@@ -218,7 +218,7 @@ vlc_module_begin()
     add_shortcut("draw");
     set_shortname("draw")
     set_capability("opengl filter", 0)
-    set_callback(Open)
+    set_callback_opengl_filter(Open)
     add_bool(DRAW_CFG_PREFIX "vflip", false, \
              DRAW_VFLIP_SHORTTEXT, DRAW_VFLIP_LONGTEXT)
 vlc_module_end()


=====================================
modules/video_output/opengl/filter_mock.c
=====================================
@@ -547,7 +547,6 @@ InitPlane(struct vlc_gl_filter *filter)
     return VLC_SUCCESS;
 }
 
-static vlc_gl_filter_open_fn Open;
 static int
 Open(struct vlc_gl_filter *filter, const config_chain_t *config,
      struct vlc_gl_tex_size *size_out)
@@ -597,7 +596,7 @@ vlc_module_begin()
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VFILTER)
     set_capability("opengl filter", 0)
-    set_callback(Open)
+    set_callback_opengl_filter(Open)
     add_shortcut("mock");
     add_float(MOCK_CFG_PREFIX "angle", 0.f, NULL, NULL) /* in degrees */
     add_float(MOCK_CFG_PREFIX "speed", 0.f, NULL, NULL) /* in rotations per minute */


=====================================
modules/video_output/opengl/renderer.h
=====================================
@@ -41,7 +41,7 @@ struct pl_shader_res;
     add_shortcut("renderer") \
     set_shortname("renderer") \
     set_capability("opengl filter", 0) \
-    set_callback(vlc_gl_renderer_Open)
+    set_callback_opengl_filter(vlc_gl_renderer_Open)
 
 /**
  * OpenGL picture renderer



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/53e91250d747b7be570bdfb89f8db2e2d8ddbab4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/53e91250d747b7be570bdfb89f8db2e2d8ddbab4
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list