Changeset 23cc599d06abb5c84913c7399dd08c6b283fc49e

Show
Ignore:
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
  • include/vlc_vout.h

    r5940677 r23cc599  
    307307#define SUBPICTURE_ALIGN_TOP 0x4 
    308308#define SUBPICTURE_ALIGN_BOTTOM 0x8 
     309#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \ 
     310                                SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM ) 
    309311 
    310312/***************************************************************************** 
  • modules/codec/dvbsub.c

    r161c8a3 r23cc599  
    14931493        p_spu_region->i_x = p_regiondef->i_x; 
    14941494        p_spu_region->i_y = p_regiondef->i_y; 
     1495        p_spu_region->i_align = p_sys->i_spu_position; 
    14951496        *pp_spu_region = p_spu_region; 
    14961497        pp_spu_region = &p_spu_region->p_next; 
     
    15471548            p_spu_region->i_x = p_regiondef->i_x + p_object_def->i_x; 
    15481549            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; 
    15491551            *pp_spu_region = p_spu_region; 
    15501552            pp_spu_region = &p_spu_region->p_next; 
  • modules/codec/subsdec.c

    rdb7b0a5 r23cc599  
    449449    { 
    450450        /* 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; 
    452452        p_spu->i_x = p_sys->i_align ? 20 : 0; 
    453453        p_spu->i_y = 10; 
     
    575575    if( p_style == NULL ) 
    576576    { 
    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; 
    578578        p_spu->i_x = p_sys->i_align ? 20 : 0; 
    579579        p_spu->i_y = 10; 
     
    583583        msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename); 
    584584        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; 
    586586    } 
    587587} 
     
    679679    if( p_style == NULL ) 
    680680    { 
    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; 
    682682        p_spu->i_x = p_sys->i_align ? 20 : 0; 
    683683        p_spu->i_y = 10; 
     
    687687        msg_Dbg( p_dec, "style is: %s", p_style->psz_stylename); 
    688688        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; 
    690690        if( p_style->i_align & SUBPICTURE_ALIGN_LEFT ) 
    691691        { 
     
    11481148 
    11491149                    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; 
    11511151                    if( i_align == 0x3 || i_align == 0x6 || i_align == 0x9 ) p_style->i_align |= SUBPICTURE_ALIGN_RIGHT; 
    11521152                    if( i_align == 0x7 || i_align == 0x8 || i_align == 0x9 ) p_style->i_align |= SUBPICTURE_ALIGN_TOP; 
  • modules/codec/telx.c

    r36fbb33 r23cc599  
    712712 
    713713    /* 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; 
    715715    p_spu->i_x = p_sys->i_align ? 20 : 0; 
    716716    p_spu->i_y = 10; 
  • modules/video_filter/logo.c

    r94cc428 r23cc599  
    883883    if( p_sys->posx < 0 || p_sys->posy < 0 ) 
    884884    {   /* 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; 
    886886        p_spu->i_x = 0; 
    887887        p_spu->i_y = 0; 
     
    890890    else 
    891891    {   /*  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; 
    893893        p_spu->i_x = p_sys->posx; 
    894894        p_spu->i_y = p_sys->posy; 
  • modules/video_filter/marq.c

    rd6ce9ba r23cc599  
    297297    if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 ) 
    298298    {   /* 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; 
    300300        p_spu->i_x = 0; 
    301301        p_spu->i_y = 0; 
     
    304304    else 
    305305    {   /*  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; 
    307307        p_spu->i_x = p_sys->i_xoff; 
    308308        p_spu->i_y = p_sys->i_yoff; 
  • modules/video_filter/mosaic.c

    r2e0409a r23cc599  
    711711                    + ( row_inner_height - fmt_out.i_height ) / 2; 
    712712        } 
     713        p_region->i_align = p_sys->i_align; 
    713714 
    714715        if( p_region_prev == NULL ) 
  • modules/video_filter/rss.c

    rb762118 r23cc599  
    483483    if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 ) 
    484484    {   /* 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; 
    486486        p_spu->i_x = 0; 
    487487        p_spu->i_y = 0; 
     
    490490    else 
    491491    {   /*  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; 
    493493        p_spu->i_x = p_sys->i_xoff; 
    494494        p_spu->i_y = p_sys->i_yoff; 
  • src/control/mediacontrol_audio_video.c

    r34f8161 r23cc599  
    147147 
    148148    p_spu->p_region->psz_text = strdup( psz_string ); 
     149    p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK; 
    149150    p_spu->i_start = i_start; 
    150151    p_spu->i_stop = i_stop; 
     
    154155    p_spu->i_x = i_hmargin; 
    155156    p_spu->i_y = i_vmargin; 
    156     p_spu->i_flags = i_flags
     157    p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK
    157158    p_spu->i_channel = i_channel; 
    158159 
  • src/osd/osd_text.c

    r0e39834 r23cc599  
    9393 
    9494    p_spu->p_region->psz_text = strdup( psz_string ); 
     95    p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK; 
    9596    p_spu->i_start = i_start; 
    9697    p_spu->i_stop = i_stop; 
     
    100101    p_spu->i_x = i_hmargin; 
    101102    p_spu->i_y = i_vmargin; 
    102     p_spu->i_flags = i_flags
     103    p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK
    103104    p_spu->i_channel = i_channel; 
    104105 
  • src/video_output/video_text.c

    r178365a r23cc599  
    9494 
    9595    p_spu->p_region->psz_text = strdup( psz_string ); 
     96    p_spu->p_region->i_align = i_flags & SUBPICTURE_ALIGN_MASK; 
    9697    p_spu->i_start = i_start; 
    9798    p_spu->i_stop = i_stop; 
     
    102103    p_spu->i_x = i_hmargin; 
    103104    p_spu->i_y = i_vmargin; 
    104     p_spu->i_flags = i_flags
     105    p_spu->i_flags = i_flags & ~SUBPICTURE_ALIGN_MASK
    105106    p_spu->i_channel = i_channel; 
    106107 
  • src/video_output/vout_subpictures.c

    r1a4176c r23cc599  
    662662                if( p_spu->p_text && p_spu->p_text->p_module ) 
    663663                { 
    664                     p_region->i_align = p_subpic->i_flags; 
    665  
    666664                    if( p_spu->p_text->pf_render_html && p_region->psz_html ) 
    667665                    { 
     
    729727                p_region->p_cache->i_x = p_region->i_x * i_scale_width / 1000; 
    730728                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; 
    731730 
    732731                p_pic = p_spu->p_scale->pf_video_filter( 
     
    746745            } 
    747746 
    748             if( p_subpic->i_flags & SUBPICTURE_ALIGN_BOTTOM ) 
     747            if( p_region->i_align & SUBPICTURE_ALIGN_BOTTOM ) 
    749748            { 
    750749                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) ) 
    754753            { 
    755754                i_y_offset = p_fmt->i_height / 2 - p_region->fmt.i_height / 2; 
    756755            } 
    757756 
    758             if( p_subpic->i_flags & SUBPICTURE_ALIGN_RIGHT ) 
     757            if( p_region->i_align & SUBPICTURE_ALIGN_RIGHT ) 
    759758            { 
    760759                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) ) 
    764763            { 
    765764                i_x_offset = p_fmt->i_width / 2 - p_region->fmt.i_width / 2;