[vlc-commits] filter: use a specific type for blend filters

Steve Lhomme git at videolan.org
Wed Sep 18 09:06:23 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Sep 17 14:56:37 2019 +0200| [684cf993daa3675473decad4aa6f8c3c0eed3c6c] | committer: Steve Lhomme

filter: use a specific type for blend filters

Blend video filters use the pf_video_blend() callback, not to be confused with
video filters using the pf_video_filter() callback and which can be chained.

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

 include/vlc_filter.h                     | 10 ++++++----
 include/vlc_subpicture.h                 |  3 ++-
 modules/spu/audiobargraph_v.c            |  2 +-
 modules/spu/logo.c                       |  2 +-
 modules/stream_out/transcode/transcode.h |  2 +-
 modules/video_output/android/display.c   |  2 +-
 src/misc/filter.c                        | 10 +++++-----
 src/misc/subpicture.c                    |  2 +-
 src/video_output/video_output.c          |  2 +-
 src/video_output/vout_internal.h         |  2 +-
 10 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index f2618cc1e1..f5d5a151cb 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -258,31 +258,33 @@ VLC_API void filter_DelProxyCallbacks( vlc_object_t *obj, filter_t *filter,
 # define filter_DelProxyCallbacks(a, b, c) \
     filter_DelProxyCallbacks(VLC_OBJECT(a), b, c)
 
+typedef filter_t vlc_blender_t;
+
 /**
  * It creates a blend filter.
  *
  * Only the chroma properties of the dest format is used (chroma
  * type, rgb masks and shifts)
  */
-VLC_API filter_t * filter_NewBlend( vlc_object_t *, const video_format_t *p_dst_chroma ) VLC_USED;
+VLC_API vlc_blender_t * filter_NewBlend( vlc_object_t *, const video_format_t *p_dst_chroma ) VLC_USED;
 
 /**
  * It configures blend filter parameters that are allowed to changed
  * after the creation.
  */
-VLC_API int filter_ConfigureBlend( filter_t *, int i_dst_width, int i_dst_height, const video_format_t *p_src );
+VLC_API int filter_ConfigureBlend( vlc_blender_t *, int i_dst_width, int i_dst_height, const video_format_t *p_src );
 
 /**
  * It blends a picture into another one.
  *
  * The input picture is not modified and not released.
  */
-VLC_API int filter_Blend( filter_t *, picture_t *p_dst, int i_dst_x, int i_dst_y, const picture_t *p_src, int i_alpha );
+VLC_API int filter_Blend( vlc_blender_t *, picture_t *p_dst, int i_dst_x, int i_dst_y, const picture_t *p_src, int i_alpha );
 
 /**
  * It destroys a blend filter created by filter_NewBlend.
  */
-VLC_API void filter_DeleteBlend( filter_t * );
+VLC_API void filter_DeleteBlend( vlc_blender_t * );
 
 /**
  * Create a picture_t *(*)( filter_t *, picture_t * ) compatible wrapper
diff --git a/include/vlc_subpicture.h b/include/vlc_subpicture.h
index 606eb451e1..3453206521 100644
--- a/include/vlc_subpicture.h
+++ b/include/vlc_subpicture.h
@@ -46,6 +46,7 @@
  */
 typedef struct subpicture_region_private_t subpicture_region_private_t;
 typedef struct vlc_spu_highlight_t vlc_spu_highlight_t;
+typedef struct filter_t vlc_blender_t;
 
 /**
  * Video subtitle region
@@ -241,7 +242,7 @@ VLC_API void subpicture_Update( subpicture_t *, const video_format_t *src, const
  *  - contains only picture (no text rendering).
  * \return the number of region(s) successfully blent
  */
-VLC_API unsigned picture_BlendSubpicture( picture_t *, filter_t *p_blend, subpicture_t * );
+VLC_API unsigned picture_BlendSubpicture( picture_t *, vlc_blender_t *, subpicture_t * );
 
 /**@}*/
 
diff --git a/modules/spu/audiobargraph_v.c b/modules/spu/audiobargraph_v.c
index 52a876e5e7..06d84d5f8d 100644
--- a/modules/spu/audiobargraph_v.c
+++ b/modules/spu/audiobargraph_v.c
@@ -125,7 +125,7 @@ typedef struct
  */
 typedef struct
 {
-    filter_t *p_blend;
+    vlc_blender_t *p_blend;
 
     vlc_mutex_t lock;
 
diff --git a/modules/spu/logo.c b/modules/spu/logo.c
index 330fa5fb18..f72c841035 100644
--- a/modules/spu/logo.c
+++ b/modules/spu/logo.c
@@ -152,7 +152,7 @@ typedef struct
  */
 typedef struct
 {
-    filter_t *p_blend;
+    vlc_blender_t *p_blend;
 
     vlc_mutex_t lock;
 
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index f38e4892ad..a704a61f45 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -126,7 +126,7 @@ struct sout_stream_id_sys_t
              filter_chain_t  *p_conv_static;
              filter_chain_t  *p_uf_chain; /**< User-specified video filters */
              filter_chain_t  *p_final_conv_static;
-             filter_t        *p_spu_blender;
+             vlc_blender_t   *p_spu_blender;
              spu_t           *p_spu;
              video_format_t  fmt_input_video;
          };
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index ebf403e4da..e5c9553bcd 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -125,7 +125,7 @@ struct vout_display_sys_t
 
     bool b_displayed;
     bool b_sub_invalid;
-    filter_t *p_spu_blend;
+    vlc_blender_t *p_spu_blend;
     picture_t *p_sub_pic;
     buffer_bounds *p_sub_buffer_bounds;
     int64_t i_sub_last_order;
diff --git a/src/misc/filter.c b/src/misc/filter.c
index a1199adce7..0b93da730a 100644
--- a/src/misc/filter.c
+++ b/src/misc/filter.c
@@ -101,10 +101,10 @@ void filter_DelProxyCallbacks( vlc_object_t *obj, filter_t *filter,
 
 /* */
 
-filter_t *filter_NewBlend( vlc_object_t *p_this,
+vlc_blender_t *filter_NewBlend( vlc_object_t *p_this,
                            const video_format_t *p_dst_chroma )
 {
-    filter_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
+    vlc_blender_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
     if( !p_blend )
         return NULL;
 
@@ -125,7 +125,7 @@ filter_t *filter_NewBlend( vlc_object_t *p_this,
     return p_blend;
 }
 
-int filter_ConfigureBlend( filter_t *p_blend,
+int filter_ConfigureBlend( vlc_blender_t *p_blend,
                            int i_dst_width, int i_dst_height,
                            const video_format_t *p_src )
 {
@@ -157,7 +157,7 @@ int filter_ConfigureBlend( filter_t *p_blend,
     return VLC_SUCCESS;
 }
 
-int filter_Blend( filter_t *p_blend,
+int filter_Blend( vlc_blender_t *p_blend,
                   picture_t *p_dst, int i_dst_x, int i_dst_y,
                   const picture_t *p_src, int i_alpha )
 {
@@ -168,7 +168,7 @@ int filter_Blend( filter_t *p_blend,
     return VLC_SUCCESS;
 }
 
-void filter_DeleteBlend( filter_t *p_blend )
+void filter_DeleteBlend( vlc_blender_t *p_blend )
 {
     if( p_blend->p_module )
         module_unneed( p_blend, p_blend->p_module );
diff --git a/src/misc/subpicture.c b/src/misc/subpicture.c
index b78698db5b..6dcd661810 100644
--- a/src/misc/subpicture.c
+++ b/src/misc/subpicture.c
@@ -289,7 +289,7 @@ void subpicture_region_ChainDelete( subpicture_region_t *p_head )
 #include <vlc_filter.h>
 
 unsigned picture_BlendSubpicture(picture_t *dst,
-                                 filter_t *blend, subpicture_t *src)
+                                 vlc_blender_t *blend, subpicture_t *src)
 {
     unsigned done = 0;
 
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 13339547e2..6dfddaad33 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -966,7 +966,7 @@ static picture_t *ConvertRGB32AndBlend(vout_thread_t *vout, picture_t *pic,
 
     if (pic)
     {
-        filter_t *swblend = filter_NewBlend(VLC_OBJECT(vout), &dst.video);
+        vlc_blender_t *swblend = filter_NewBlend(VLC_OBJECT(vout), &dst.video);
         if (swblend)
         {
             bool success = picture_BlendSubpicture(pic, swblend, subpic) > 0;
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index abf62d435f..a48637a714 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -115,7 +115,7 @@ struct vout_thread_sys_t
     vlc_mutex_t     spu_lock;
     spu_t           *spu;
     vlc_fourcc_t    spu_blend_chroma;
-    filter_t        *spu_blend;
+    vlc_blender_t   *spu_blend;
 
     /* Thread & synchronization */
     vlc_thread_t    thread;



More information about the vlc-commits mailing list