Changeset 23cc599d06abb5c84913c7399dd08c6b283fc49e
- Timestamp:
- 18/06/07 23:08:03
(1 year ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1182200883 +0000
- git-parent:
[877cfa025934f31c5f621fbcc6a8d0b30165b086]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1182200883 +0000
- Message:
Patch by Bernie Purcell :
"This is part of a former submission stripped out for easier
assimilation. It modifies vout_subpictures to use the existing alignment
field on each region, rather than the alignment on the subpicture plane
itself. Modifications are made to everywhere that depended on the former
behaviour, to make it use the new alignment location instead."
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5940677 |
r23cc599 |
|
| 307 | 307 | #define SUBPICTURE_ALIGN_TOP 0x4 |
|---|
| 308 | 308 | #define SUBPICTURE_ALIGN_BOTTOM 0x8 |
|---|
| | 309 | #define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \ |
|---|
| | 310 | SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM ) |
|---|
| 309 | 311 | |
|---|
| 310 | 312 | /***************************************************************************** |
|---|
| r161c8a3 |
r23cc599 |
|
| 1493 | 1493 | p_spu_region->i_x = p_regiondef->i_x; |
|---|
| 1494 | 1494 | p_spu_region->i_y = p_regiondef->i_y; |
|---|
| | 1495 | p_spu_region->i_align = p_sys->i_spu_position; |
|---|
| 1495 | 1496 | *pp_spu_region = p_spu_region; |
|---|
| 1496 | 1497 | pp_spu_region = &p_spu_region->p_next; |
|---|
| … | … | |
| 1547 | 1548 | p_spu_region->i_x = p_regiondef->i_x + p_object_def->i_x; |
|---|
| 1548 | 1549 | p_spu_region->i_y = p_regiondef->i_y + p_object_def->i_y; |
|---|
| | 1550 | p_spu_region->i_align = p_sys->i_spu_position; |
|---|
| 1549 | 1551 | *pp_spu_region = p_spu_region; |
|---|
| 1550 | 1552 | pp_spu_region = &p_spu_region->p_next; |
|---|
| rdb7b0a5 |
r23cc599 |
|
| 449 | 449 | { |
|---|
| 450 | 450 | /* Normal text subs, easy markup */ |
|---|
| 451 | | p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| | 451 | p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| 452 | 452 | p_spu->i_x = p_sys->i_align ? 20 : 0; |
|---|
| 453 | 453 | p_spu->i_y = 10; |
|---|
| … | … | |
| 575 | 575 | if( p_style == NULL ) |
|---|
| 576 | 576 | { |
|---|
| 577 | | p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| | 577 | p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| 578 | 578 | p_spu->i_x = p_sys->i_align ? 20 : 0; |
|---|
| 579 | 579 | p_spu->i_y = 10; |
|---|
| … | … | |
| 583 | 583 | msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename); |
|---|
| 584 | 584 | p_spu->p_region->p_style = &p_style->font_style; |
|---|
| 585 | | p_spu->i_flags = p_style->i_align; |
|---|
| | 585 | p_spu->p_region->i_align = p_style->i_align; |
|---|
| 586 | 586 | } |
|---|
| 587 | 587 | } |
|---|
| … | … | |
| 679 | 679 | if( p_style == NULL ) |
|---|
| 680 | 680 | { |
|---|
| 681 | | p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| | 681 | p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| 682 | 682 | p_spu->i_x = p_sys->i_align ? 20 : 0; |
|---|
| 683 | 683 | p_spu->i_y = 10; |
|---|
| … | … | |
| 687 | 687 | msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename); |
|---|
| 688 | 688 | p_spu->p_region->p_style = &p_style->font_style; |
|---|
| 689 | | p_spu->i_flags = p_style->i_align; |
|---|
| | 689 | p_spu->p_region->i_align = p_style->i_align; |
|---|
| 690 | 690 | if( p_style->i_align & SUBPICTURE_ALIGN_LEFT ) |
|---|
| 691 | 691 | { |
|---|
| … | … | |
| 1148 | 1148 | |
|---|
| 1149 | 1149 | p_style->i_align = 0; |
|---|
| 1150 | | if( i_align == 0x1 || i_align == 0x4 || i_align == 0x1 ) p_style->i_align |= SUBPICTURE_ALIGN_LEFT; |
|---|
| | 1150 | if( i_align == 0x1 || i_align == 0x4 || i_align == 0x7 ) p_style->i_align |= SUBPICTURE_ALIGN_LEFT; |
|---|
| 1151 | 1151 | if( i_align == 0x3 || i_align == 0x6 || i_align == 0x9 ) p_style->i_align |= SUBPICTURE_ALIGN_RIGHT; |
|---|
| 1152 | 1152 | if( i_align == 0x7 || i_align == 0x8 || i_align == 0x9 ) p_style->i_align |= SUBPICTURE_ALIGN_TOP; |
|---|
| r36fbb33 |
r23cc599 |
|
| 712 | 712 | |
|---|
| 713 | 713 | /* Normal text subs, easy markup */ |
|---|
| 714 | | p_spu->i_flags = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| | 714 | p_spu->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; |
|---|
| 715 | 715 | p_spu->i_x = p_sys->i_align ? 20 : 0; |
|---|
| 716 | 716 | p_spu->i_y = 10; |
|---|
| r94cc428 |
r23cc599 |
|
| 883 | 883 | if( p_sys->posx < 0 || p_sys->posy < 0 ) |
|---|
| 884 | 884 | { /* set to one of the 9 relative locations */ |
|---|
| 885 | | p_spu->i_flags = p_sys->pos; |
|---|
| | 885 | p_spu->p_region->i_align = p_sys->pos; |
|---|
| 886 | 886 | p_spu->i_x = 0; |
|---|
| 887 | 887 | p_spu->i_y = 0; |
|---|
| … | … | |
| 890 | 890 | else |
|---|
| 891 | 891 | { /* set to an absolute xy, referenced to upper left corner */ |
|---|
| 892 | | p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; |
|---|
| | 892 | p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; |
|---|
| 893 | 893 | p_spu->i_x = p_sys->posx; |
|---|
| 894 | 894 | p_spu->i_y = p_sys->posy; |
|---|
| rd6ce9ba |
r23cc599 |
|
| 297 | 297 | if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 ) |
|---|
| 298 | 298 | { /* set to one of the 9 relative locations */ |
|---|
| 299 | | p_spu->i_flags = p_sys->i_pos; |
|---|
| | 299 | p_spu->p_region->i_align = p_sys->i_pos; |
|---|
| 300 | 300 | p_spu->i_x = 0; |
|---|
| 301 | 301 | p_spu->i_y = 0; |
|---|
| … | … | |
| 304 | 304 | else |
|---|
| 305 | 305 | { /* set to an absolute xy, referenced to upper left corner */ |
|---|
| 306 | | p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; |
|---|
| | 306 | p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; |
|---|
| 307 | 307 | p_spu->i_x = p_sys->i_xoff; |
|---|
| 308 | 308 | p_spu->i_y = p_sys->i_yoff; |
|---|
| r2e0409a |
r23cc599 |
|
| 711 | 711 | + ( row_inner_height - fmt_out.i_height ) / 2; |
|---|
| 712 | 712 | } |
|---|
| | 713 | p_region->i_align = p_sys->i_align; |
|---|
| 713 | 714 | |
|---|
| 714 | 715 | if( p_region_prev == NULL ) |
|---|
| rb762118 |
r23cc599 |
|
| 483 | 483 | if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 ) |
|---|
| 484 | 484 | { /* set to one of the 9 relative locations */ |
|---|
| 485 | | p_spu->i_flags = p_sys->i_pos; |
|---|
| | 485 | p_spu->p_region->i_align = p_sys->i_pos; |
|---|
| 486 | 486 | p_spu->i_x = 0; |
|---|
| 487 | 487 | p_spu->i_y = 0; |
|---|
| … | … | |
| 490 | 490 | else |
|---|
| 491 | 491 | { /* set to an absolute xy, referenced to upper left corner */ |
|---|
| 492 | | p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; |
|---|
| | 492 | p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; |
|---|
| 493 | 493 | p_spu->i_x = p_sys->i_xoff; |
|---|
| 494 | 494 | p_spu->i_y = p_sys->i_yoff; |
|---|
| r34f8161 |
r23cc599 |
|
| 147 | 147 | |
|---|
| 148 | 148 | p_spu->p_region->psz_text = strdup( psz_string ); |
|---|
| | 149 | p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK; |
|---|
| 149 | 150 | p_spu->i_start = i_start; |
|---|
| 150 | 151 | p_spu->i_stop = i_stop; |
|---|
| … | … | |
| 154 | 155 | p_spu->i_x = i_hmargin; |
|---|
| 155 | 156 | p_spu->i_y = i_vmargin; |
|---|
| 156 | | p_spu->i_flags = i_flags; |
|---|
| | 157 | p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK; |
|---|
| 157 | 158 | p_spu->i_channel = i_channel; |
|---|
| 158 | 159 | |
|---|
| r0e39834 |
r23cc599 |
|
| 93 | 93 | |
|---|
| 94 | 94 | p_spu->p_region->psz_text = strdup( psz_string ); |
|---|
| | 95 | p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK; |
|---|
| 95 | 96 | p_spu->i_start = i_start; |
|---|
| 96 | 97 | p_spu->i_stop = i_stop; |
|---|
| … | … | |
| 100 | 101 | p_spu->i_x = i_hmargin; |
|---|
| 101 | 102 | p_spu->i_y = i_vmargin; |
|---|
| 102 | | p_spu->i_flags = i_flags; |
|---|
| | 103 | p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK; |
|---|
| 103 | 104 | p_spu->i_channel = i_channel; |
|---|
| 104 | 105 | |
|---|
| r178365a |
r23cc599 |
|
| 94 | 94 | |
|---|
| 95 | 95 | p_spu->p_region->psz_text = strdup( psz_string ); |
|---|
| | 96 | p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK; |
|---|
| 96 | 97 | p_spu->i_start = i_start; |
|---|
| 97 | 98 | p_spu->i_stop = i_stop; |
|---|
| … | … | |
| 102 | 103 | p_spu->i_x = i_hmargin; |
|---|
| 103 | 104 | p_spu->i_y = i_vmargin; |
|---|
| 104 | | p_spu->i_flags = i_flags; |
|---|
| | 105 | p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK; |
|---|
| 105 | 106 | p_spu->i_channel = i_channel; |
|---|
| 106 | 107 | |
|---|
| r1a4176c |
r23cc599 |
|
| 662 | 662 | if( p_spu->p_text && p_spu->p_text->p_module ) |
|---|
| 663 | 663 | { |
|---|
| 664 | | p_region->i_align = p_subpic->i_flags; |
|---|
| 665 | | |
|---|
| 666 | 664 | if( p_spu->p_text->pf_render_html && p_region->psz_html ) |
|---|
| 667 | 665 | { |
|---|
| … | … | |
| 729 | 727 | p_region->p_cache->i_x = p_region->i_x * i_scale_width / 1000; |
|---|
| 730 | 728 | p_region->p_cache->i_y = p_region->i_y * i_scale_height / 1000; |
|---|
| | 729 | p_region->p_cache->i_align = p_region->i_align; |
|---|
| 731 | 730 | |
|---|
| 732 | 731 | p_pic = p_spu->p_scale->pf_video_filter( |
|---|
| … | … | |
| 746 | 745 | } |
|---|
| 747 | 746 | |
|---|
| 748 | | if( p_subpic->i_flags & SUBPICTURE_ALIGN_BOTTOM ) |
|---|
| | 747 | if( p_region->i_align & SUBPICTURE_ALIGN_BOTTOM ) |
|---|
| 749 | 748 | { |
|---|
| 750 | 749 | i_y_offset = p_fmt->i_height - p_region->fmt.i_height - |
|---|
| 751 | | p_subpic->i_y; |
|---|
| 752 | | } |
|---|
| 753 | | else if ( !(p_subpic->i_flags & SUBPICTURE_ALIGN_TOP) ) |
|---|
| | 750 | p_subpic->i_y - p_region->i_y; |
|---|
| | 751 | } |
|---|
| | 752 | else if ( !(p_region->i_align & SUBPICTURE_ALIGN_TOP) ) |
|---|
| 754 | 753 | { |
|---|
| 755 | 754 | i_y_offset = p_fmt->i_height / 2 - p_region->fmt.i_height / 2; |
|---|
| 756 | 755 | } |
|---|
| 757 | 756 | |
|---|
| 758 | | if( p_subpic->i_flags & SUBPICTURE_ALIGN_RIGHT ) |
|---|
| | 757 | if( p_region->i_align & SUBPICTURE_ALIGN_RIGHT ) |
|---|
| 759 | 758 | { |
|---|
| 760 | 759 | i_x_offset = p_fmt->i_width - p_region->fmt.i_width - |
|---|
| 761 | | i_subpic_x; |
|---|
| 762 | | } |
|---|
| 763 | | else if ( !(p_subpic->i_flags & SUBPICTURE_ALIGN_LEFT) ) |
|---|
| | 760 | i_subpic_x - p_region->i_x; |
|---|
| | 761 | } |
|---|
| | 762 | else if ( !(p_region->i_align & SUBPICTURE_ALIGN_LEFT) ) |
|---|
| 764 | 763 | { |
|---|
| 765 | 764 | i_x_offset = p_fmt->i_width / 2 - p_region->fmt.i_width / 2; |
|---|