Commit 0fddb7eb authored by Gildas Bazin's avatar Gildas Bazin

* Merged trunk changesets 9185 9204 9205 9273 to 0.8.1 branch.

parent 19db8d9d
......@@ -244,6 +244,7 @@ struct subpicture_t
vlc_bool_t b_ephemer; /**< If this flag is set to true
the subtitle will be displayed
untill the next one appear */
vlc_bool_t b_fade; /**< enable fading */
/**@}*/
subpicture_region_t *p_region; /**< region list composing this subtitle */
......
This diff is collapsed.
......@@ -372,6 +372,7 @@ subpicture_t *spu_CreateSubpicture( spu_t *p_spu )
memset( p_subpic, 0, sizeof(subpicture_t) );
p_subpic->i_status = RESERVED_SUBPICTURE;
p_subpic->b_absolute = VLC_TRUE;
p_subpic->b_fade = VLC_FALSE;
p_subpic->pf_render = 0;
p_subpic->pf_destroy = 0;
p_subpic->p_sys = 0;
......@@ -538,6 +539,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
else while( p_region && p_spu->p_blend &&
p_spu->p_blend->pf_video_blend )
{
int i_fade_alpha = 255;
int i_x_offset = p_region->i_x + p_subpic->i_x;
int i_y_offset = p_region->i_y + p_subpic->i_y;
......@@ -733,8 +735,21 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
p_spu->p_blend->fmt_out.video.i_visible_height =
p_fmt->i_height;
if( p_subpic->b_fade )
{
mtime_t i_fade_start = ( p_subpic->i_stop +
p_subpic->i_start ) / 2;
mtime_t i_now = mdate();
if( i_now >= i_fade_start && p_subpic->i_stop > i_fade_start )
{
i_fade_alpha = 255 * ( p_subpic->i_stop - i_now ) /
( p_subpic->i_stop - i_fade_start );
}
}
p_spu->p_blend->pf_video_blend( p_spu->p_blend, p_pic_dst,
p_pic_src, &p_region->picture, i_x_offset, i_y_offset, 255 );
p_pic_src, &p_region->picture, i_x_offset, i_y_offset,
i_fade_alpha );
p_region = p_region->p_next;
}
......
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