#define SUBPICTURE_ALIGN_RIGHT 0x2
#define SUBPICTURE_ALIGN_TOP 0x4
#define SUBPICTURE_ALIGN_BOTTOM 0x8
+#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \
+ SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM )
/*****************************************************************************
* Prototypes
}
p_spu_region->i_x = p_regiondef->i_x;
p_spu_region->i_y = p_regiondef->i_y;
+ p_spu_region->i_align = p_sys->i_spu_position;
*pp_spu_region = p_spu_region;
pp_spu_region = &p_spu_region->p_next;
p_spu_region->psz_text = strdup( p_object_def->psz_text );
p_spu_region->i_x = p_regiondef->i_x + p_object_def->i_x;
p_spu_region->i_y = p_regiondef->i_y + p_object_def->i_y;
+ p_spu_region->i_align = p_sys->i_spu_position;
*pp_spu_region = p_spu_region;
pp_spu_region = &p_spu_region->p_next;
}
p_dec->fmt_in.i_codec != VLC_FOURCC('u','s','f',' ') )
{
/* Normal text subs, easy markup */
- p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
+ p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10;
if( p_style == NULL )
{
- p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
+ p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10;
}
{
msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename);
p_spu->p_region->p_style = &p_style->font_style;
- p_spu->i_flags = p_style->i_align;
+ p_spu->p_region->i_align = p_style->i_align;
}
}
p_spu->p_region->psz_text = psz_new_subtitle;
if( p_style == NULL )
{
- p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
+ p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10;
}
{
msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename);
p_spu->p_region->p_style = &p_style->font_style;
- p_spu->i_flags = p_style->i_align;
+ p_spu->p_region->i_align = p_style->i_align;
if( p_style->i_align & SUBPICTURE_ALIGN_LEFT )
{
p_spu->i_x = (i_margin_l) ? i_margin_l : p_style->i_margin_h;
//p_style->font_style.f_angle = f_angle;
p_style->i_align = 0;
- if( i_align == 0x1 || i_align == 0x4 || i_align == 0x1 ) p_style->i_align |= SUBPICTURE_ALIGN_LEFT;
+ if( i_align == 0x1 || i_align == 0x4 || i_align == 0x7 ) p_style->i_align |= SUBPICTURE_ALIGN_LEFT;
if( i_align == 0x3 || i_align == 0x6 || i_align == 0x9 ) p_style->i_align |= SUBPICTURE_ALIGN_RIGHT;
if( i_align == 0x7 || i_align == 0x8 || i_align == 0x9 ) p_style->i_align |= SUBPICTURE_ALIGN_TOP;
if( i_align == 0x1 || i_align == 0x2 || i_align == 0x3 ) p_style->i_align |= SUBPICTURE_ALIGN_BOTTOM;
}
/* Normal text subs, easy markup */
- p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
+ p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu->i_x = p_sys->i_align ? 20 : 0;
p_spu->i_y = 10;
/* where to locate the logo: */
if( p_sys->posx < 0 || p_sys->posy < 0 )
{ /* set to one of the 9 relative locations */
- p_spu->i_flags = p_sys->pos;
+ p_spu->p_region->i_align = p_sys->pos;
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->b_absolute = VLC_FALSE;
}
else
{ /* set to an absolute xy, referenced to upper left corner */
- p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
+ p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
p_spu->i_x = p_sys->posx;
p_spu->i_y = p_sys->posy;
p_spu->b_absolute = VLC_TRUE;
/* where to locate the string: */
if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 )
{ /* set to one of the 9 relative locations */
- p_spu->i_flags = p_sys->i_pos;
+ p_spu->p_region->i_align = p_sys->i_pos;
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->b_absolute = VLC_FALSE;
}
else
{ /* set to an absolute xy, referenced to upper left corner */
- p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
+ p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
p_spu->i_x = p_sys->i_xoff;
p_spu->i_y = p_sys->i_yoff;
p_spu->b_absolute = VLC_TRUE;
+ ( i_row * p_sys->i_borderh ) / p_sys->i_rows
+ ( row_inner_height - fmt_out.i_height ) / 2;
}
+ p_region->i_align = p_sys->i_align;
if( p_region_prev == NULL )
{
/* where to locate the string: */
if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 )
{ /* set to one of the 9 relative locations */
- p_spu->i_flags = p_sys->i_pos;
+ p_spu->p_region->i_align = p_sys->i_pos;
p_spu->i_x = 0;
p_spu->i_y = 0;
p_spu->b_absolute = VLC_FALSE;
}
else
{ /* set to an absolute xy, referenced to upper left corner */
- p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
+ p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
p_spu->i_x = p_sys->i_xoff;
p_spu->i_y = p_sys->i_yoff;
p_spu->b_absolute = VLC_TRUE;
}
p_spu->p_region->psz_text = strdup( psz_string );
+ p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK;
p_spu->i_start = i_start;
p_spu->i_stop = i_stop;
p_spu->b_ephemer = VLC_FALSE;
p_spu->i_x = i_hmargin;
p_spu->i_y = i_vmargin;
- p_spu->i_flags = i_flags;
+ p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK;
p_spu->i_channel = i_channel;
spu_DisplaySubpicture( p_vout->p_spu, p_spu );
}
p_spu->p_region->psz_text = strdup( psz_string );
+ p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK;
p_spu->i_start = i_start;
p_spu->i_stop = i_stop;
p_spu->b_ephemer = VLC_TRUE;
p_spu->i_x = i_hmargin;
p_spu->i_y = i_vmargin;
- p_spu->i_flags = i_flags;
+ p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK;
p_spu->i_channel = i_channel;
spu_DisplaySubpicture( p_spu_channel, p_spu );
}
p_spu->p_region->psz_text = strdup( psz_string );
+ p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK;
p_spu->i_start = i_start;
p_spu->i_stop = i_stop;
p_spu->b_ephemer = VLC_TRUE;
p_spu->i_x = i_hmargin;
p_spu->i_y = i_vmargin;
- p_spu->i_flags = i_flags;
+ p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK;
p_spu->i_channel = i_channel;
spu_DisplaySubpicture( p_vout->p_spu, p_spu );
{
if( p_spu->p_text && p_spu->p_text->p_module )
{
- p_region->i_align = p_subpic->i_flags;
-
if( p_spu->p_text->pf_render_html && p_region->psz_html )
{
p_spu->p_text->pf_render_html( p_spu->p_text,
p_region->p_cache->fmt = p_spu->p_scale->fmt_out.video;
p_region->p_cache->i_x = p_region->i_x * i_scale_width / 1000;
p_region->p_cache->i_y = p_region->i_y * i_scale_height / 1000;
+ p_region->p_cache->i_align = p_region->i_align;
p_pic = p_spu->p_scale->pf_video_filter(
p_spu->p_scale, &p_region->p_cache->picture );
p_region = p_region->p_cache;
}
- if( p_subpic->i_flags & SUBPICTURE_ALIGN_BOTTOM )
+ if( p_region->i_align & SUBPICTURE_ALIGN_BOTTOM )
{
i_y_offset = p_fmt->i_height - p_region->fmt.i_height -
- p_subpic->i_y;
+ p_subpic->i_y - p_region->i_y;
}
- else if ( !(p_subpic->i_flags & SUBPICTURE_ALIGN_TOP) )
+ else if ( !(p_region->i_align & SUBPICTURE_ALIGN_TOP) )
{
i_y_offset = p_fmt->i_height / 2 - p_region->fmt.i_height / 2;
}
- if( p_subpic->i_flags & SUBPICTURE_ALIGN_RIGHT )
+ if( p_region->i_align & SUBPICTURE_ALIGN_RIGHT )
{
i_x_offset = p_fmt->i_width - p_region->fmt.i_width -
- i_subpic_x;
+ i_subpic_x - p_region->i_x;
}
- else if ( !(p_subpic->i_flags & SUBPICTURE_ALIGN_LEFT) )
+ else if ( !(p_region->i_align & SUBPICTURE_ALIGN_LEFT) )
{
i_x_offset = p_fmt->i_width / 2 - p_region->fmt.i_width / 2;
}