[vlc-devel] [PATCH 13/14] filter: use a specific type for blend filters
Steve Lhomme
robux4 at ycbcr.xyz
Tue Sep 17 16:22:41 CEST 2019
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.
---
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 f2618cc1e1a..2fee49e8b19 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 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 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( 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( 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( 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 606eb451e13..6ebf6d85110 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 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 *, blender_t *, subpicture_t * );
/**@}*/
diff --git a/modules/spu/audiobargraph_v.c b/modules/spu/audiobargraph_v.c
index 52a876e5e75..3e1ce568a05 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;
+ blender_t *p_blend;
vlc_mutex_t lock;
diff --git a/modules/spu/logo.c b/modules/spu/logo.c
index 330fa5fb188..9fcb9a6658a 100644
--- a/modules/spu/logo.c
+++ b/modules/spu/logo.c
@@ -152,7 +152,7 @@ typedef struct
*/
typedef struct
{
- filter_t *p_blend;
+ 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 f38e4892ad7..05b96d78cff 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;
+ 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 ebf403e4dac..839bd78a5d6 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;
+ 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 a1199adce75..7bde0d96e76 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,
+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" );
+ 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( 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( 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( 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 b78698db5b4..9777e418239 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)
+ 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 13339547e2e..d5f756ab522 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);
+ 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 abf62d435f8..aee6a305084 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;
+ blender_t *spu_blend;
/* Thread & synchronization */
vlc_thread_t thread;
--
2.17.1
More information about the vlc-devel
mailing list