Changeset 3f6f97f1326fe9d502171012699986dd404c17c4

Show
Ignore:
Timestamp:
03/05/05 17:49:15 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1110041355 +0000
git-parent:

[286a9420a21325a49fdd3b56d721ca3d8e90cde8]

git-author:
Gildas Bazin <gbazin@videolan.org> 1110041355 +0000
Message:

* include/video_output.h, ALL: changed api for vout_Request()/vout_Create() to be more flexible.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/video_output.h

    r519e40a r3f6f97f  
    122122    vlc_bool_t          b_direct;            /**< rendered are like direct ? */ 
    123123    vout_chroma_t       chroma;                      /**< translation tables */ 
     124 
     125    video_format_t      fmt_render;      /* render format (from the decoder) */ 
     126    video_format_t      fmt_in;            /* input (modified render) format */ 
     127    video_format_t      fmt_out;     /* output format (for the video output) */ 
    124128    /**@}*/ 
    125129 
     
    195199 * Prototypes 
    196200 *****************************************************************************/ 
    197 #define vout_Request(a,b,c,d,e,f) __vout_Request(VLC_OBJECT(a),b,c,d,e,f
    198 VLC_EXPORT( vout_thread_t *, __vout_Request,      ( vlc_object_t *, vout_thread_t *, unsigned int, unsigned int, uint32_t, unsigned int ) ); 
    199 #define vout_Create(a,b,c,d,e) __vout_Create(VLC_OBJECT(a),b,c,d,e
    200 VLC_EXPORT( vout_thread_t *, __vout_Create,       ( vlc_object_t *, unsigned int, unsigned int, uint32_t, unsigned int ) ); 
     201#define vout_Request(a,b,c) __vout_Request(VLC_OBJECT(a),b,c
     202VLC_EXPORT( vout_thread_t *, __vout_Request,    ( vlc_object_t *, vout_thread_t *, video_format_t * ) ); 
     203#define vout_Create(a,b) __vout_Create(VLC_OBJECT(a),b
     204VLC_EXPORT( vout_thread_t *, __vout_Create,       ( vlc_object_t *, video_format_t * ) ); 
    201205VLC_EXPORT( void,            vout_Destroy,        ( vout_thread_t * ) ); 
    202206VLC_EXPORT( int, vout_VarCallback, ( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * ) ); 
  • modules/codec/ffmpeg/video.c

    r3d831e0 r3f6f97f  
    170170            VOUT_ASPECT_FACTOR * ( av_q2d(p_context->sample_aspect_ratio) * 
    171171                p_context->width / p_context->height ); 
     172    p_dec->fmt_out.video.i_sar_num = p_context->sample_aspect_ratio.num; 
     173    p_dec->fmt_out.video.i_sar_den = p_context->sample_aspect_ratio.den; 
    172174#else 
    173175        p_dec->fmt_out.video.i_aspect = 
  • modules/video_filter/adjust.c

    r906b68f r3f6f97f  
    151151    int i_index; 
    152152    picture_t *p_pic; 
     153    video_format_t fmt = {0}; 
    153154 
    154155    I_OUTPUTPICTURES = 0; 
     
    160161    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    161162 
     163    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     164    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     165    fmt.i_x_offset = fmt.i_y_offset = 0; 
     166    fmt.i_chroma = p_vout->render.i_chroma; 
     167    fmt.i_aspect = p_vout->render.i_aspect; 
     168    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     169    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     170 
    162171    /* Try to open the real video output */ 
    163172    msg_Dbg( p_vout, "spawning the real video output" ); 
    164173 
    165     p_vout->p_sys->p_vout = vout_Create( p_vout, 
    166                      p_vout->render.i_width, p_vout->render.i_height, 
    167                      p_vout->render.i_chroma, p_vout->render.i_aspect ); 
     174    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    168175 
    169176    /* Everything failed */ 
  • modules/video_filter/clone.c

    r906b68f r3f6f97f  
    206206    picture_t *p_pic; 
    207207    char *psz_default_vout; 
     208    video_format_t fmt = {0}; 
    208209 
    209210    I_OUTPUTPICTURES = 0; 
     
    215216    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    216217 
     218    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     219    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     220    fmt.i_x_offset = fmt.i_y_offset = 0; 
     221    fmt.i_chroma = p_vout->render.i_chroma; 
     222    fmt.i_aspect = p_vout->render.i_aspect; 
     223    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     224    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     225 
    217226    /* Try to open the real video output */ 
    218227    msg_Dbg( p_vout, "spawning the real video outputs" ); 
     
    228237        { 
    229238            p_vout->p_sys->pp_vout[i_vout] = 
    230                 vout_Create( p_vout, p_vout->render.i_width, 
    231                              p_vout->render.i_height, p_vout->render.i_chroma,  
    232                              p_vout->render.i_aspect ); 
     239                vout_Create( p_vout, &fmt ); 
    233240        } 
    234241        else 
     
    238245                           p_vout->p_sys->ppsz_vout_list[i_vout] ); 
    239246            p_vout->p_sys->pp_vout[i_vout] = 
    240                 vout_Create( p_vout, p_vout->render.i_width, 
    241                              p_vout->render.i_height, p_vout->render.i_chroma,  
    242                              p_vout->render.i_aspect ); 
     247                vout_Create( p_vout, &fmt ); 
    243248 
    244249            /* Reset the default value */ 
  • modules/video_filter/crop.c

    r906b68f r3f6f97f  
    135135    char *psz_var; 
    136136    picture_t *p_pic; 
     137    video_format_t fmt = {0}; 
    137138 
    138139    I_OUTPUTPICTURES = 0; 
     
    248249                            * p_vout->p_sys->i_width / p_vout->output.i_width; 
    249250 
     251    fmt.i_width = fmt.i_visible_width = p_vout->p_sys->i_width; 
     252    fmt.i_height = fmt.i_visible_height = p_vout->p_sys->i_height; 
     253    fmt.i_x_offset = fmt.i_y_offset = 0; 
     254    fmt.i_chroma = p_vout->render.i_chroma; 
     255    fmt.i_aspect = p_vout->p_sys->i_aspect; 
     256    fmt.i_sar_num = p_vout->p_sys->i_aspect * fmt.i_height / fmt.i_width; 
     257    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     258 
    250259    /* Try to open the real video output */ 
    251     p_vout->p_sys->p_vout = vout_Create( p_vout, 
    252                     p_vout->p_sys->i_width, p_vout->p_sys->i_height, 
    253                     p_vout->render.i_chroma, p_vout->p_sys->i_aspect ); 
     260    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    254261    if( p_vout->p_sys->p_vout == NULL ) 
    255262    { 
     
    311318static int Manage( vout_thread_t *p_vout ) 
    312319{ 
     320    video_format_t fmt = {0}; 
     321 
    313322    if( !p_vout->p_sys->b_changed ) 
    314323    { 
     
    318327    vout_Destroy( p_vout->p_sys->p_vout ); 
    319328 
    320     p_vout->p_sys->p_vout = vout_Create( p_vout, 
    321                     p_vout->p_sys->i_width, p_vout->p_sys->i_height, 
    322                     p_vout->render.i_chroma, p_vout->p_sys->i_aspect ); 
     329    fmt.i_width = fmt.i_visible_width = p_vout->p_sys->i_width; 
     330    fmt.i_height = fmt.i_visible_height = p_vout->p_sys->i_height; 
     331    fmt.i_x_offset = fmt.i_y_offset = 0; 
     332    fmt.i_chroma = p_vout->render.i_chroma; 
     333    fmt.i_aspect = p_vout->p_sys->i_aspect; 
     334    fmt.i_sar_num = p_vout->p_sys->i_aspect * fmt.i_height / fmt.i_width; 
     335    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     336 
     337    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    323338    if( p_vout->p_sys->p_vout == NULL ) 
    324339    { 
  • modules/video_filter/deinterlace.c

    rba9826c r3f6f97f  
    321321{ 
    322322    vout_thread_t *p_real_vout = NULL; 
     323    video_format_t fmt = {0}; 
    323324 
    324325    msg_Dbg( p_vout, "spawning the real video output" ); 
     326 
     327    fmt.i_width = fmt.i_visible_width = p_vout->output.i_width; 
     328    fmt.i_height = fmt.i_visible_height = p_vout->output.i_height; 
     329    fmt.i_x_offset = fmt.i_y_offset = 0; 
     330    fmt.i_chroma = p_vout->output.i_chroma; 
     331    fmt.i_aspect = p_vout->output.i_aspect; 
     332    fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width; 
     333    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
    325334 
    326335    switch( p_vout->render.i_chroma ) 
     
    333342        case DEINTERLACE_MEAN: 
    334343        case DEINTERLACE_DISCARD: 
    335             p_real_vout = 
    336                 vout_Create( p_vout, 
    337                        p_vout->output.i_width, p_vout->output.i_height / 2, 
    338                        p_vout->output.i_chroma, p_vout->output.i_aspect ); 
     344            fmt.i_height = fmt.i_visible_height = p_vout->output.i_height / 2; 
     345            p_real_vout = vout_Create( p_vout, &fmt ); 
    339346            break; 
    340347 
     
    342349        case DEINTERLACE_BLEND: 
    343350        case DEINTERLACE_LINEAR: 
    344             p_real_vout = 
    345                 vout_Create( p_vout, 
    346                        p_vout->output.i_width, p_vout->output.i_height, 
    347                        p_vout->output.i_chroma, p_vout->output.i_aspect ); 
     351            p_real_vout = vout_Create( p_vout, &fmt ); 
    348352            break; 
    349353        } 
     
    351355 
    352356    case VLC_FOURCC('I','4','2','2'): 
    353         p_real_vout = 
    354             vout_Create( p_vout, 
    355                        p_vout->output.i_width, p_vout->output.i_height, 
    356                        VLC_FOURCC('I','4','2','0'), p_vout->output.i_aspect ); 
     357        fmt.i_chroma = VLC_FOURCC('I','4','2','0'); 
     358        p_real_vout = vout_Create( p_vout, &fmt ); 
    357359        break; 
    358360 
  • modules/video_filter/distort.c

    r906b68f r3f6f97f  
    166166    int i_index; 
    167167    picture_t *p_pic; 
     168    video_format_t fmt = {0}; 
    168169 
    169170    I_OUTPUTPICTURES = 0; 
     
    175176    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    176177 
     178    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     179    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     180    fmt.i_x_offset = fmt.i_y_offset = 0; 
     181    fmt.i_chroma = p_vout->render.i_chroma; 
     182    fmt.i_aspect = p_vout->render.i_aspect; 
     183    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     184    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     185 
    177186    /* Try to open the real video output */ 
    178187    msg_Dbg( p_vout, "spawning the real video output" ); 
    179188 
    180     p_vout->p_sys->p_vout = vout_Create( p_vout, 
    181                            p_vout->render.i_width, p_vout->render.i_height, 
    182                            p_vout->render.i_chroma, p_vout->render.i_aspect ); 
     189    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    183190 
    184191    /* Everything failed */ 
  • modules/video_filter/invert.c

    r906b68f r3f6f97f  
    112112    int i_index; 
    113113    picture_t *p_pic; 
     114    video_format_t fmt = {0}; 
    114115 
    115116    I_OUTPUTPICTURES = 0; 
     
    121122    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    122123 
     124    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     125    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     126    fmt.i_x_offset = fmt.i_y_offset = 0; 
     127    fmt.i_chroma = p_vout->render.i_chroma; 
     128    fmt.i_aspect = p_vout->render.i_aspect; 
     129    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     130    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     131 
    123132    /* Try to open the real video output */ 
    124133    msg_Dbg( p_vout, "spawning the real video output" ); 
    125134 
    126     p_vout->p_sys->p_vout = vout_Create( p_vout, 
    127                            p_vout->render.i_width, p_vout->render.i_height, 
    128                            p_vout->render.i_chroma, p_vout->render.i_aspect ); 
     135    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    129136 
    130137    /* Everything failed */ 
  • modules/video_filter/logo.c

    rfcb440b r3f6f97f  
    212212    picture_t *p_pic; 
    213213    int i_index; 
     214    video_format_t fmt = {0}; 
    214215 
    215216    I_OUTPUTPICTURES = 0; 
     
    220221    p_vout->output.i_height = p_vout->render.i_height; 
    221222    p_vout->output.i_aspect = p_vout->render.i_aspect; 
     223 
     224    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     225    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     226    fmt.i_x_offset = fmt.i_y_offset = 0; 
     227    fmt.i_chroma = p_vout->render.i_chroma; 
     228    fmt.i_aspect = p_vout->render.i_aspect; 
     229    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     230    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
    222231 
    223232    /* Load the video blending filter */ 
     
    281290    msg_Dbg( p_vout, "spawning the real video output" ); 
    282291 
    283     p_sys->p_vout = 
    284         vout_Create( p_vout, p_vout->render.i_width, p_vout->render.i_height, 
    285                      p_vout->render.i_chroma, p_vout->render.i_aspect ); 
     292    p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    286293 
    287294    /* Everything failed */ 
  • modules/video_filter/motionblur.c

    r56b5483 r3f6f97f  
    130130    int i_index; 
    131131    picture_t *p_pic; 
     132    video_format_t fmt = {0}; 
    132133 
    133134    I_OUTPUTPICTURES = 0; 
     
    154155    msg_Dbg( p_vout, "spawning the real video output" ); 
    155156 
     157    fmt.i_width = fmt.i_visible_width = p_vout->output.i_width; 
     158    fmt.i_height = fmt.i_visible_height = p_vout->output.i_height; 
     159    fmt.i_x_offset = fmt.i_y_offset = 0; 
     160    fmt.i_chroma = p_vout->output.i_chroma; 
     161    fmt.i_aspect = p_vout->output.i_aspect; 
     162    fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width; 
     163    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     164 
    156165    switch( p_vout->render.i_chroma ) 
    157166    { 
     
    159168    case VLC_FOURCC('I','Y','U','V'): 
    160169    case VLC_FOURCC('Y','V','1','2'): 
    161         p_vout->p_sys->p_vout = vout_Create( p_vout, 
    162                            p_vout->output.i_width, p_vout->output.i_height, 
    163                            p_vout->output.i_chroma, p_vout->output.i_aspect ); 
     170        p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    164171        break; 
    165172    default: 
  • modules/video_filter/motiondetect.c

    rba9826c r3f6f97f  
    212212    int i_index; 
    213213    picture_t *p_pic; 
     214    video_format_t fmt = {0}; 
    214215 
    215216    I_OUTPUTPICTURES = 0; 
     
    221222    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    222223 
     224    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     225    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     226    fmt.i_x_offset = fmt.i_y_offset = 0; 
     227    fmt.i_chroma = p_vout->render.i_chroma; 
     228    fmt.i_aspect = p_vout->render.i_aspect; 
     229    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     230    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     231 
    223232    /* Try to open the real video output */ 
    224233    msg_Dbg( p_vout, "spawning the real video output" ); 
    225234 
    226     p_vout->p_sys->p_vout = vout_Create( p_vout, 
    227                            p_vout->render.i_width, p_vout->render.i_height, 
    228                            p_vout->render.i_chroma, p_vout->render.i_aspect ); 
     235    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    229236 
    230237    /* Everything failed */ 
  • modules/video_filter/transform.c

    r906b68f r3f6f97f  
    181181    int i_index; 
    182182    picture_t *p_pic; 
     183    video_format_t fmt = {0}; 
    183184 
    184185    I_OUTPUTPICTURES = 0; 
     
    190191    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    191192 
     193    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     194    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     195    fmt.i_x_offset = fmt.i_y_offset = 0; 
     196    fmt.i_chroma = p_vout->render.i_chroma; 
     197    fmt.i_aspect = p_vout->render.i_aspect; 
     198    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     199    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
     200 
    192201    /* Try to open the real video output */ 
    193202    msg_Dbg( p_vout, "spawning the real video output" ); 
     
    195204    if( p_vout->p_sys->b_rotation ) 
    196205    { 
    197         p_vout->p_sys->p_vout = vout_Create( p_vout, 
    198                            p_vout->render.i_height, p_vout->render.i_width, 
    199                            p_vout->render.i_chroma, 
    200                            (uint64_t)VOUT_ASPECT_FACTOR 
    201                             * (uint64_t)VOUT_ASPECT_FACTOR 
    202                             / (uint64_t)p_vout->render.i_aspect ); 
     206        fmt.i_width = fmt.i_visible_width = p_vout->render.i_height; 
     207        fmt.i_height = fmt.i_visible_height = p_vout->render.i_width; 
     208        fmt.i_aspect = VOUT_ASPECT_FACTOR * 
     209            (uint64_t)VOUT_ASPECT_FACTOR / p_vout->render.i_aspect; 
     210        fmt.i_sar_num = VOUT_ASPECT_FACTOR; 
     211        fmt.i_sar_den = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     212 
     213        p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    203214    } 
    204215    else 
    205216    { 
    206         p_vout->p_sys->p_vout = vout_Create( p_vout, 
    207                            p_vout->render.i_width, p_vout->render.i_height, 
    208                            p_vout->render.i_chroma, p_vout->render.i_aspect ); 
     217        p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt ); 
    209218    } 
    210219 
  • modules/video_filter/wall.c

    rba9826c r3f6f97f  
    230230    unsigned int i_target_width,i_target_height; 
    231231    picture_t *p_pic; 
     232    video_format_t fmt = {0}; 
    232233    int i_aspect = 4*VOUT_ASPECT_FACTOR/3; 
    233234    int i_align = 0; 
     
    269270    p_vout->output.i_aspect = p_vout->render.i_aspect; 
    270271    var_Create( p_vout, "align", VLC_VAR_INTEGER ); 
     272 
     273    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; 
     274    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; 
     275    fmt.i_x_offset = fmt.i_y_offset = 0; 
     276    fmt.i_chroma = p_vout->render.i_chroma; 
     277    fmt.i_aspect = p_vout->render.i_aspect; 
     278    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; 
     279    fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
    271280 
    272281    w1 = p_vout->output.i_width / p_vout->p_sys->i_col; 
     
    395404            var_SetInteger( p_vout, "video-y", i_top + i_ypos ); 
    396405 
     406            fmt.i_width = fmt.i_visible_width = i_width; 
     407            fmt.i_height = fmt.i_visible_height = i_height; 
     408            fmt.i_aspect = i_aspect * i_target_height / i_height * 
     409                i_width / i_target_width; 
     410 
    397411            p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout = 
    398                 vout_Create( p_vout, i_width, i_height, 
    399                              p_vout->render.i_chroma, 
    400                              i_aspect * i_target_height / i_height * 
    401                              i_width / i_target_width ); 
    402             if( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout == NULL ) 
     412                vout_Create( p_vout, &fmt ); 
     413            if( !p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout ) 
    403414            { 
    404415                msg_Err( p_vout, "failed to get %ix%i vout threads", 
  • modules/visualization/goom.c

    rba9826c r3f6f97f  
    132132    goom_thread_t     *p_thread; 
    133133    vlc_value_t       width, height; 
     134    video_format_t    fmt = {0}; 
    134135 
    135136    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) 
     
    161162    var_Get( p_thread, "goom-height", &height ); 
    162163 
    163     p_thread->p_vout = 
    164         vout_Request( p_filter, NULL, width.i_int, height.i_int, 
    165                       VLC_FOURCC('R','V','3','2'), 
    166                       VOUT_ASPECT_FACTOR * width.i_int/height.i_int ); 
     164    fmt.i_width = fmt.i_visible_width = width.i_int; 
     165    fmt.i_height = fmt.i_visible_height = height.i_int; 
     166    fmt.i_chroma = VLC_FOURCC('R','V','3','2'); 
     167    fmt.i_aspect = VOUT_ASPECT_FACTOR * width.i_int/height.i_int; 
     168    fmt.i_sar_num = fmt.i_sar_den = 1; 
     169 
     170    p_thread->p_vout = vout_Request( p_filter, NULL, &fmt ); 
    167171    if( p_thread->p_vout == NULL ) 
    168172    { 
     
    387391 
    388392    /* Free data */ 
    389     vout_Request( p_filter, p_sys->p_thread->p_vout, 0, 0, 0, 0 ); 
     393    vout_Request( p_filter, p_sys->p_thread->p_vout, 0 ); 
    390394    vlc_mutex_destroy( &p_sys->p_thread->lock ); 
    391395    vlc_cond_destroy( &p_sys->p_thread->wait ); 
  • modules/visualization/visual/visual.c

    rba9826c r3f6f97f  
    133133 
    134134    char *psz_effects, *psz_parser; 
     135    video_format_t fmt = {0}; 
    135136 
    136137    if( ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2') && 
     
    247248 
    248249    /* Open the video output */ 
    249     p_sys->p_vout = 
    250          vout_Request( p_filter, NULL, 
    251                        p_sys->i_width, p_sys->i_height, 
    252                        VLC_FOURCC('I','4','2','0'), 
    253                        VOUT_ASPECT_FACTOR * p_sys->i_width/p_sys->i_height ); 
    254  
     250    fmt.i_width = fmt.i_visible_width = p_sys->i_width; 
     251    fmt.i_height = fmt.i_visible_height = p_sys->i_height; 
     252    fmt.i_chroma = VLC_FOURCC('I','4','2','0'); 
     253    fmt.i_aspect = VOUT_ASPECT_FACTOR * p_sys->i_width/p_sys->i_height; 
     254    fmt.i_sar_num = fmt.i_sar_den = 1; 
     255 
     256    p_sys->p_vout = vout_Request( p_filter, NULL, &fmt ); 
    255257    if( p_sys->p_vout == NULL ) 
    256258    { 
     
    330332    if( p_filter->p_sys->p_vout ) 
    331333    { 
    332         vout_Request( p_filter, p_filter->p_sys->p_vout, 0, 0, 0, 0 ); 
     334        vout_Request( p_filter, p_filter->p_sys->p_vout, 0 ); 
    333335    } 
    334336 
  • src/input/decoder.c

    r70ee5fb r3f6f97f  
    780780 
    781781        /* We are about to die. Reattach video output to p_vlc. */ 
    782         vout_Request( p_dec, p_dec->p_owner->p_vout, 0, 0, 0, 0 ); 
     782        vout_Request( p_dec, p_dec->p_owner->p_vout, 0 ); 
    783783    } 
    784784 
     
    886886        } 
    887887 
     888        if( !p_dec->fmt_out.video.i_sar_num || 
     889            !p_dec->fmt_out.video.i_sar_den ) 
     890        { 
     891            p_dec->fmt_out.video.i_sar_num = 
     892              p_dec->fmt_out.video.i_aspect * p_dec->fmt_out.video.i_height; 
     893 
     894            p_dec->fmt_out.video.i_sar_den = VOUT_ASPECT_FACTOR * 
     895              p_dec->fmt_out.video.i_width; 
     896        } 
     897 
     898        vlc_reduce( &p_dec->fmt_out.video.i_sar_num, 
     899                    &p_dec->fmt_out.video.i_sar_den, 
     900            p_dec->fmt_out.video.i_sar_num, 
     901            p_dec->fmt_out.video.i_sar_den, 0 ); 
     902 
     903    if( !p_dec->fmt_out.video.i_visible_width || 
     904        !p_dec->fmt_out.video.i_visible_height ) 
     905    { 
     906        p_dec->fmt_out.video.i_visible_width = 
     907            p_dec->fmt_out.video.i_width; 
     908        p_dec->fmt_out.video.i_visible_height = 
     909            p_dec->fmt_out.video.i_height; 
     910    } 
     911 
    888912        p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec; 
    889913        p_sys->video = p_dec->fmt_out.video; 
    890914 
    891915        p_sys->p_vout = vout_Request( p_dec, p_sys->p_vout, 
    892                                       p_sys->video.i_width, 
    893                                       p_sys->video.i_height, 
    894                                       p_sys->video.i_chroma, 
    895                                       p_sys->video.i_aspect ); 
    896  
     916                                      &p_dec->fmt_out.video ); 
    897917        if( p_sys->p_vout == NULL ) 
    898918        { 
  • src/video_output/video_output.c

    r6754126 r3f6f97f  
    1010 * 
    1111 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     12 *          Gildas Bazin <gbazin@videolan.org> 
    1213 * 
    1314 * This program is free software; you can redistribute it and/or modify 
     
    7576 * properties. If not found, it spawns a new one. 
    7677 *****************************************************************************/ 
    77 vout_thread_t * __vout_Request ( vlc_object_t *p_this, vout_thread_t *p_vout, 
    78                                  unsigned int i_width, unsigned int i_height, 
    79                                  vlc_fourcc_t i_chroma, unsigned int i_aspect ) 
    80 
    81     if( !i_width || !i_height || !i_chroma ) 
     78vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout, 
     79                               video_format_t *p_fmt ) 
     80
     81    if( !p_fmt ) 
    8282    { 
    8383        /* Reattach video output to input before bailing out */ 
     
    169169        } 
    170170 
    171         if( ( p_vout->render.i_width != i_width ) || 
    172             ( p_vout->render.i_height != i_height ) || 
    173             ( p_vout->render.i_chroma != i_chroma ) || 
    174             ( p_vout->render.i_aspect != i_aspect 
     171        if( ( p_vout->fmt_render.i_width != p_fmt->i_width ) || 
     172            ( p_vout->fmt_render.i_height != p_fmt->i_height ) || 
     173            ( p_vout->fmt_render.i_chroma != p_fmt->i_chroma ) || 
     174            ( p_vout->fmt_render.i_aspect != p_fmt->i_aspect 
    175175                    && !p_vout->b_override_aspect ) || 
    176176            p_vout->b_filter_change ) 
     
    196196        msg_Dbg( p_this, "no usable vout present, spawning one" ); 
    197197 
    198         p_vout = vout_Create( p_this, i_width, i_height, i_chroma, i_aspect ); 
     198        p_vout = vout_Create( p_this, p_fmt ); 
    199199    } 
    200200 
     
    208208 * to its description. On error, it returns NULL. 
    209209 *****************************************************************************/ 
    210 vout_thread_t * __vout_Create( vlc_object_t *p_parent, 
    211                                unsigned int i_width, unsigned int i_height, 
    212                                vlc_fourcc_t i_chroma, unsigned int i_aspect ) 
     210vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) 
    213211{ 
    214212    vout_thread_t  * p_vout;                            /* thread descriptor */ 
     
    218216    vlc_value_t      val, text; 
    219217 
     218    unsigned int i_width = p_fmt->i_width; 
     219    unsigned int i_height = p_fmt->i_height; 
     220    vlc_fourcc_t i_chroma = p_fmt->i_chroma; 
     221    unsigned int i_aspect = p_fmt->i_aspect; 
     222 
    220223    /* Allocate descriptor */ 
    221224    p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT ); 
     
    242245    /* Initialize the rendering heap */ 
    243246    I_RENDERPICTURES = 0; 
     247    p_vout->fmt_render        = *p_fmt;   /* FIXME palette */ 
     248    p_vout->fmt_in            = *p_fmt;   /* FIXME palette */ 
    244249    p_vout->render.i_width    = i_width; 
    245250    p_vout->render.i_height   = i_height; 
     
    559564    msg_Dbg( p_vout, "got %i direct buffer(s)", I_OUTPUTPICTURES ); 
    560565 
    561     AspectRatio( p_vout->render.i_aspect, &i_aspect_x, &i_aspect_y ); 
    562     msg_Dbg( p_vout, 
    563              "picture in %ix%i, chroma 0x%.8x (%4.4s), aspect ratio %i:%i", 
    564              p_vout->render.i_width, p_vout->render.i_height, 
    565              p_vout->render.i_chroma, (char*)&p_vout->render.i_chroma, 
    566              i_aspect_x, i_aspect_y ); 
    567  
    568     AspectRatio( p_vout->output.i_aspect, &i_aspect_x, &i_aspect_y ); 
    569     msg_Dbg( p_vout, 
    570              "picture out %ix%i, chroma 0x%.8x (%4.4s), aspect ratio %i:%i", 
     566    AspectRatio( p_vout->fmt_render.i_aspect, &i_aspect_x, &i_aspect_y ); 
     567 
     568    msg_Dbg( p_vout, "picture in %ix%i (%i,%i,%ix%i), " 
     569             "chroma %4.4s, ar %i:%i, sar %i:%i", 
     570             p_vout->fmt_render.i_width, p_vout->fmt_render.i_height, 
     571             p_vout->fmt_render.i_x_offset, p_vout->fmt_render.i_y_offset, 
     572             p_vout->fmt_render.i_visible_width, 
     573             p_vout->fmt_render.i_visible_height, 
     574             (char*)&p_vout->fmt_render.i_chroma, 
     575             i_aspect_x, i_aspect_y, 
     576             p_vout->fmt_render.i_sar_num, p_vout->fmt_render.i_sar_den ); 
     577 
     578    AspectRatio( p_vout->fmt_in.i_aspect, &i_aspect_x, &i_aspect_y ); 
     579 
     580    msg_Dbg( p_vout, "picture user %ix%i (%i,%i,%ix%i), " 
     581             "chroma %4.4s, ar %i:%i, sar %i:%i", 
     582             p_vout->fmt_in.i_width, p_vout->fmt_in.i_height, 
     583             p_vout->fmt_in.i_x_offset, p_vout->fmt_in.i_y_offset, 
     584             p_vout->fmt_in.i_visible_width, 
     585             p_vout->fmt_in.i_visible_height, 
     586             (char*)&p_vout->fmt_in.i_chroma, 
     587             i_aspect_x, i_aspect_y, 
     588             p_vout->fmt_in.i_sar_num, p_vout->fmt_in.i_sar_den ); 
     589 
     590    if( !p_vout->fmt_out.i_width || !p_vout->fmt_out.i_height ) 
     591    { 
     592        p_vout->fmt_out.i_width = p_vout->fmt_out.i_visible_width = 
     593            p_vout->output.i_width; 
     594        p_vout->fmt_out.i_height = p_vout->fmt_out.i_visible_height = 
     595            p_vout->output.i_height; 
     596        p_vout->fmt_out.i_x_offset =  p_vout->fmt_out.i_y_offset = 0; 
     597 
     598        p_vout->fmt_out.i_aspect = p_vout->output.i_aspect; 
     599        p_vout->fmt_out.i_chroma = p_vout->output.i_chroma; 
     600    } 
     601    if( !p_vout->fmt_out.i_sar_num || !p_vout->fmt_out.i_sar_num ) 
     602    { 
     603        p_vout->fmt_out.i_sar_num = p_vout->fmt_out.i_aspect * 
     604            p_vout->fmt_out.i_height; 
     605        p_vout->fmt_out.i_sar_den = VOUT_ASPECT_FACTOR * 
     606            p_vout->fmt_out.i_width; 
     607    } 
     608 
     609    vlc_reduce( &p_vout->fmt_out.i_sar_num, &p_vout->fmt_out.i_sar_den, 
     610                p_vout->fmt_out.i_sar_num, p_vout->fmt_out.i_sar_den, 0 ); 
     611 
     612    AspectRatio( p_vout->fmt_out.i_aspect, &i_aspect_x, &i_aspect_y ); 
     613 
     614    msg_Dbg( p_vout, "picture out %ix%i, chroma %4.4s, ar %i:%i, sar %i:%i", 
    571615             p_vout->output.i_width, p_vout->output.i_height, 
    572              p_vout->output.i_chroma, (char*)&p_vout->output.i_chroma, 
    573              i_aspect_x, i_aspect_y ); 
     616             (char*)&p_vout->output.i_chroma, 
     617             i_aspect_x, i_aspect_y, 
     618             p_vout->fmt_out.i_sar_num, p_vout->fmt_out.i_sar_den ); 
    574619 
    575620    /* Calculate shifts from system-updated masks */ 
  • src/video_output/vout_pictures.c

    r7a70363 r3f6f97f  
    287287                                                       subpicture_t *p_subpic ) 
    288288{ 
    289     video_format_t fmt; 
    290289    int i_scale_width, i_scale_height; 
    291290 
     
    293292    { 
    294293        /* XXX: subtitles */ 
    295  
    296294        return NULL; 
    297295    } 
    298296 
    299     fmt.i_aspect = p_vout->output.i_aspect; 
    300     fmt.i_chroma = p_vout->output.i_chroma; 
    301     fmt.i_width = p_vout->output.i_width; 
    302     fmt.i_height = p_vout->output.i_height; 
    303     fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width; 
    304     fmt.i_sar_den = VOUT_ASPECT_FACTOR; 
    305     i_scale_width = p_vout->output.i_width * 1000 / p_vout->render.i_width; 
    306     i_scale_height = p_vout->output.i_height * 1000 / p_vout->render.i_height; 
     297    i_scale_width = p_vout->fmt_out.i_visible_width * 1000 / 
     298        p_vout->fmt_in.i_visible_width; 
     299    i_scale_height = p_vout->fmt_out.i_visible_height * 1000 / 
     300        p_vout->fmt_in.i_visible_height; 
    307301 
    308302    if( p_pic->i_type == DIRECT_PICTURE ) 
     
    321315                vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic ); 
    322316 
    323                 spu_RenderSubpictures( p_vout->p_spu, &fmt, 
     317                spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, 
    324318                                       PP_OUTPUTPICTURE[0], p_pic, p_subpic, 
    325319                                       i_scale_width, i_scale_height ); 
     
    337331         * decoder. We can safely render subtitles on it and 
    338332         * display it. */ 
    339         spu_RenderSubpictures( p_vout->p_spu, &fmt, p_pic, p_pic, p_subpic, 
    340                                i_scale_width, i_scale_height ); 
     333        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, p_pic, p_pic, 
     334                               p_subpic, i_scale_width, i_scale_height ); 
    341335 
    342336        return p_pic; 
     
    356350 
    357351        vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic ); 
    358         spu_RenderSubpictures( p_vout->p_spu, &fmt, PP_OUTPUTPICTURE[0], 
    359                                p_pic, p_subpic, i_scale_width, i_scale_height); 
     352        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, 
     353                               PP_OUTPUTPICTURE[0], p_pic, 
     354                               p_subpic, i_scale_width, i_scale_height ); 
    360355 
    361356        if( PP_OUTPUTPICTURE[0]->pf_unlock ) 
     
    379374        { 
    380375            vout_AllocatePicture( VLC_OBJECT(p_vout), 
    381                                   p_tmp_pic, p_vout->output.i_chroma, 
    382                                   p_vout->output.i_width, 
    383                                   p_vout->output.i_height, 
    384                                   p_vout->output.i_aspect ); 
     376                                  p_tmp_pic, p_vout->fmt_out.i_chroma, 
     377                                  p_vout->fmt_out.i_width, 
     378                                  p_vout->fmt_out.i_height, 
     379                                  p_vout->fmt_out.i_aspect ); 
    385380            p_tmp_pic->i_type = MEMORY_PICTURE; 
    386381            p_tmp_pic->i_status = RESERVED_PICTURE; 
     
    391386 
    392387        /* Render subpictures on the first direct buffer */ 
    393         spu_RenderSubpictures( p_vout->p_spu, &fmt, p_tmp_pic, 
     388        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, p_tmp_pic, 
    394389                               p_tmp_pic, p_subpic, 
    395390                               i_scale_width, i_scale_height ); 
     
    411406 
    412407        /* Render subpictures on the first direct buffer */ 
    413         spu_RenderSubpictures( p_vout->p_spu, &fmt, &p_vout->p_picture[0]
    414                                &p_vout->p_picture[0], p_subpic
    415                                i_scale_width, i_scale_height ); 
     408        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out
     409                               &p_vout->p_picture[0], &p_vout->p_picture[0]
     410                               p_subpic, i_scale_width, i_scale_height ); 
    416411    } 
    417412 
     
    436431    { 
    437432        *pi_width = *pi_height = *pi_x = *pi_y = 0; 
    438