Commit 684cf993 authored by Steve Lhomme's avatar 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.
parent 97ac6ec0
......@@ -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
......
......@@ -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 * );
/**@}*/
......
......@@ -125,7 +125,7 @@ typedef struct
*/
typedef struct
{
filter_t *p_blend;
vlc_blender_t *p_blend;
vlc_mutex_t lock;
......
......@@ -152,7 +152,7 @@ typedef struct
*/
typedef struct
{
filter_t *p_blend;
vlc_blender_t *p_blend;
vlc_mutex_t lock;
......
......@@ -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;
};
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment