[vlc-commits] ci_filters: add callbacks to control a filter

Thomas Guillem git at videolan.org
Fri Sep 29 13:18:31 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep 29 13:09:37 2017 +0200| [3672d3a75fa9241a73c33797f6a27302e42de0e7] | committer: Thomas Guillem

ci_filters: add callbacks to control a filter

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3672d3a75fa9241a73c33797f6a27302e42de0e7
---

 modules/video_filter/ci_filters.m | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index 7630be18a4..28a335519b 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -110,6 +110,8 @@ struct  filter_desc
         }                       ranges[2];
         int                     vlc_type;
     } const             param_descs[NUM_FILTER_PARAM_MAX];
+    void (*pf_init)(filter_t *filter, struct filter_chain *fchain);
+    void (*pf_control)(filter_t *filter, struct filter_chain *fchain);
 };
 
 static struct filter_desc       filter_desc_table[] =
@@ -331,6 +333,8 @@ Filter(filter_t *filter, picture_t *src)
                                      forKey: ci_param_name];
             }
 
+            if (filter_desc_table[fchain->filter].pf_control)
+                filter_desc_table[fchain->filter].pf_control(filter, fchain);
             ci_img = [fchain->ci_filter valueForKey: kCIOutputImageKey];
         }
 
@@ -419,6 +423,8 @@ Open_FilterInit(filter_t *filter, struct filter_chain *fchain)
         var_AddCallback(filter, filter_param_descs[i].vlc,
                         ParamsCallback, fchain);
     }
+    if (filter_desc_table[fchain->filter].pf_init)
+        filter_desc_table[fchain->filter].pf_init(filter, fchain);
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list