[vlc-devel] [PATCH v1 27/33] ci_filters: use the filter push mode

Steve Lhomme robux4 at ycbcr.xyz
Fri Sep 25 16:47:03 CEST 2020


---
 modules/video_filter/ci_filters.m | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index e53395826d5..ede6b0241ec 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -348,8 +348,8 @@ static void filter_PsychedelicControl(filter_t *filter, struct filter_chain *fch
     @catch (NSException * e) { /* inputCenter key doesn't exist */ }
 }
 
-static picture_t *
-Filter(filter_t *filter, picture_t *src)
+static int
+Filter(filter_t *filter, picture_t *src, struct vlc_video_sink *sink)
 {
     filter_sys_t *p_sys = filter->p_sys;
     struct ci_filters_ctx *ctx = p_sys->ctx;
@@ -357,7 +357,7 @@ Filter(filter_t *filter, picture_t *src)
 
     filter_desc_table_GetFilterTypes(p_sys->psz_filter, filter_types);
     if (ctx->fchain->filter != filter_types[0])
-        return src;
+        return vlc_video_sink_PutPicture(sink, src);
 
     picture_t *dst = picture_NewFromFormat(&ctx->cvpx_pool_fmt);
     if (!dst)
@@ -377,8 +377,8 @@ Filter(filter_t *filter, picture_t *src)
     if (ctx->src_converter)
     {
         src = filter_FilterSingle(ctx->src_converter, src);
-        if (!src)
-            return NULL;
+        if (unlikely(src == NULL))
+            return VLC_EGENERIC;
     }
 
     @autoreleasepool {
@@ -417,19 +417,19 @@ Filter(filter_t *filter, picture_t *src)
     if (ctx->dst_converter)
     {
         dst = filter_FilterSingle(ctx->dst_converter, dst);
-        if (!dst)
-            return NULL;
+        if (unlikely(dst == NULL))
+            return VLC_EGENERIC;
     }
 
     p_sys->mouse_moved = false;
-    return dst;
+    return vlc_video_sink_PutPicture(sink, dst);
 
 error:
     if (dst)
         picture_Release(dst);
     picture_Release(src);
     p_sys->mouse_moved = false;
-    return NULL;
+    return VLC_EGENERIC;
 }
 
 static int
@@ -677,7 +677,7 @@ Open(vlc_object_t *obj, char const *psz_filter)
     p_sys->psz_filter = psz_filter;
     p_sys->ctx = ctx;
 
-    filter->pf_video_filter = Filter;
+    filter->pf_video_filter_into = Filter;
     filter->pf_video_mouse = Mouse;
 
     return VLC_SUCCESS;
-- 
2.26.2



More information about the vlc-devel mailing list