Changeset 3f6f97f1326fe9d502171012699986dd404c17c4
- Timestamp:
- 03/05/05 17:49:15 (4 years ago)
- git-parent:
- Files:
-
- include/video_output.h (modified) (2 diffs)
- modules/codec/ffmpeg/video.c (modified) (1 diff)
- modules/video_filter/adjust.c (modified) (2 diffs)
- modules/video_filter/clone.c (modified) (4 diffs)
- modules/video_filter/crop.c (modified) (4 diffs)
- modules/video_filter/deinterlace.c (modified) (4 diffs)
- modules/video_filter/distort.c (modified) (2 diffs)
- modules/video_filter/invert.c (modified) (2 diffs)
- modules/video_filter/logo.c (modified) (3 diffs)
- modules/video_filter/motionblur.c (modified) (3 diffs)
- modules/video_filter/motiondetect.c (modified) (2 diffs)
- modules/video_filter/transform.c (modified) (3 diffs)
- modules/video_filter/wall.c (modified) (3 diffs)
- modules/visualization/goom.c (modified) (3 diffs)
- modules/visualization/visual/visual.c (modified) (3 diffs)
- src/input/decoder.c (modified) (2 diffs)
- src/video_output/video_output.c (modified) (8 diffs)
- src/video_output/vout_pictures.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/video_output.h
r519e40a r3f6f97f 122 122 vlc_bool_t b_direct; /**< rendered are like direct ? */ 123 123 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) */ 124 128 /**@}*/ 125 129 … … 195 199 * Prototypes 196 200 *****************************************************************************/ 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) 202 VLC_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) 204 VLC_EXPORT( vout_thread_t *, __vout_Create, ( vlc_object_t *, video_format_t * ) ); 201 205 VLC_EXPORT( void, vout_Destroy, ( vout_thread_t * ) ); 202 206 VLC_EXPORT( int, vout_VarCallback, ( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * ) ); modules/codec/ffmpeg/video.c
r3d831e0 r3f6f97f 170 170 VOUT_ASPECT_FACTOR * ( av_q2d(p_context->sample_aspect_ratio) * 171 171 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; 172 174 #else 173 175 p_dec->fmt_out.video.i_aspect = modules/video_filter/adjust.c
r906b68f r3f6f97f 151 151 int i_index; 152 152 picture_t *p_pic; 153 video_format_t fmt = {0}; 153 154 154 155 I_OUTPUTPICTURES = 0; … … 160 161 p_vout->output.i_aspect = p_vout->render.i_aspect; 161 162 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 162 171 /* Try to open the real video output */ 163 172 msg_Dbg( p_vout, "spawning the real video output" ); 164 173 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 ); 168 175 169 176 /* Everything failed */ modules/video_filter/clone.c
r906b68f r3f6f97f 206 206 picture_t *p_pic; 207 207 char *psz_default_vout; 208 video_format_t fmt = {0}; 208 209 209 210 I_OUTPUTPICTURES = 0; … … 215 216 p_vout->output.i_aspect = p_vout->render.i_aspect; 216 217 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 217 226 /* Try to open the real video output */ 218 227 msg_Dbg( p_vout, "spawning the real video outputs" ); … … 228 237 { 229 238 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 ); 233 240 } 234 241 else … … 238 245 p_vout->p_sys->ppsz_vout_list[i_vout] ); 239 246 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 ); 243 248 244 249 /* Reset the default value */ modules/video_filter/crop.c
r906b68f r3f6f97f 135 135 char *psz_var; 136 136 picture_t *p_pic; 137 video_format_t fmt = {0}; 137 138 138 139 I_OUTPUTPICTURES = 0; … … 248 249 * p_vout->p_sys->i_width / p_vout->output.i_width; 249 250 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 250 259 /* 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 ); 254 261 if( p_vout->p_sys->p_vout == NULL ) 255 262 { … … 311 318 static int Manage( vout_thread_t *p_vout ) 312 319 { 320 video_format_t fmt = {0}; 321 313 322 if( !p_vout->p_sys->b_changed ) 314 323 { … … 318 327 vout_Destroy( p_vout->p_sys->p_vout ); 319 328 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 ); 323 338 if( p_vout->p_sys->p_vout == NULL ) 324 339 { modules/video_filter/deinterlace.c
rba9826c r3f6f97f 321 321 { 322 322 vout_thread_t *p_real_vout = NULL; 323 video_format_t fmt = {0}; 323 324 324 325 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; 325 334 326 335 switch( p_vout->render.i_chroma ) … … 333 342 case DEINTERLACE_MEAN: 334 343 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 ); 339 346 break; 340 347 … … 342 349 case DEINTERLACE_BLEND: 343 350 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 ); 348 352 break; 349 353 } … … 351 355 352 356 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 ); 357 359 break; 358 360 modules/video_filter/distort.c
r906b68f r3f6f97f 166 166 int i_index; 167 167 picture_t *p_pic; 168 video_format_t fmt = {0}; 168 169 169 170 I_OUTPUTPICTURES = 0; … … 175 176 p_vout->output.i_aspect = p_vout->render.i_aspect; 176 177 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 177 186 /* Try to open the real video output */ 178 187 msg_Dbg( p_vout, "spawning the real video output" ); 179 188 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 ); 183 190 184 191 /* Everything failed */ modules/video_filter/invert.c
r906b68f r3f6f97f 112 112 int i_index; 113 113 picture_t *p_pic; 114 video_format_t fmt = {0}; 114 115 115 116 I_OUTPUTPICTURES = 0; … … 121 122 p_vout->output.i_aspect = p_vout->render.i_aspect; 122 123 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 123 132 /* Try to open the real video output */ 124 133 msg_Dbg( p_vout, "spawning the real video output" ); 125 134 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 ); 129 136 130 137 /* Everything failed */ modules/video_filter/logo.c
rfcb440b r3f6f97f 212 212 picture_t *p_pic; 213 213 int i_index; 214 video_format_t fmt = {0}; 214 215 215 216 I_OUTPUTPICTURES = 0; … … 220 221 p_vout->output.i_height = p_vout->render.i_height; 221 222 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; 222 231 223 232 /* Load the video blending filter */ … … 281 290 msg_Dbg( p_vout, "spawning the real video output" ); 282 291 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 ); 286 293 287 294 /* Everything failed */ modules/video_filter/motionblur.c
r56b5483 r3f6f97f 130 130 int i_index; 131 131 picture_t *p_pic; 132 video_format_t fmt = {0}; 132 133 133 134 I_OUTPUTPICTURES = 0; … … 154 155 msg_Dbg( p_vout, "spawning the real video output" ); 155 156 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 156 165 switch( p_vout->render.i_chroma ) 157 166 { … … 159 168 case VLC_FOURCC('I','Y','U','V'): 160 169 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 ); 164 171 break; 165 172 default: modules/video_filter/motiondetect.c
rba9826c r3f6f97f 212 212 int i_index; 213 213 picture_t *p_pic; 214 video_format_t fmt = {0}; 214 215 215 216 I_OUTPUTPICTURES = 0; … … 221 222 p_vout->output.i_aspect = p_vout->render.i_aspect; 222 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; 231 223 232 /* Try to open the real video output */ 224 233 msg_Dbg( p_vout, "spawning the real video output" ); 225 234 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 ); 229 236 230 237 /* Everything failed */ modules/video_filter/transform.c
r906b68f r3f6f97f 181 181 int i_index; 182 182 picture_t *p_pic; 183 video_format_t fmt = {0}; 183 184 184 185 I_OUTPUTPICTURES = 0; … … 190 191 p_vout->output.i_aspect = p_vout->render.i_aspect; 191 192 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 192 201 /* Try to open the real video output */ 193 202 msg_Dbg( p_vout, "spawning the real video output" ); … … 195 204 if( p_vout->p_sys->b_rotation ) 196 205 { 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 ); 203 214 } 204 215 else 205 216 { 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 ); 209 218 } 210 219 modules/video_filter/wall.c
rba9826c r3f6f97f 230 230 unsigned int i_target_width,i_target_height; 231 231 picture_t *p_pic; 232 video_format_t fmt = {0}; 232 233 int i_aspect = 4*VOUT_ASPECT_FACTOR/3; 233 234 int i_align = 0; … … 269 270 p_vout->output.i_aspect = p_vout->render.i_aspect; 270 271 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; 271 280 272 281 w1 = p_vout->output.i_width / p_vout->p_sys->i_col; … … 395 404 var_SetInteger( p_vout, "video-y", i_top + i_ypos ); 396 405 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 397 411 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 ) 403 414 { 404 415 msg_Err( p_vout, "failed to get %ix%i vout threads", modules/visualization/goom.c
rba9826c r3f6f97f 132 132 goom_thread_t *p_thread; 133 133 vlc_value_t width, height; 134 video_format_t fmt = {0}; 134 135 135 136 if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) … … 161 162 var_Get( p_thread, "goom-height", &height ); 162 163 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 ); 167 171 if( p_thread->p_vout == NULL ) 168 172 { … … 387 391 388 392 /* 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 ); 390 394 vlc_mutex_destroy( &p_sys->p_thread->lock ); 391 395 vlc_cond_destroy( &p_sys->p_thread->wait ); modules/visualization/visual/visual.c
rba9826c r3f6f97f 133 133 134 134 char *psz_effects, *psz_parser; 135 video_format_t fmt = {0}; 135 136 136 137 if( ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2') && … … 247 248 248 249 /* 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 ); 255 257 if( p_sys->p_vout == NULL ) 256 258 { … … 330 332 if( p_filter->p_sys->p_vout ) 331 333 { 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 ); 333 335 } 334 336 src/input/decoder.c
r70ee5fb r3f6f97f 780 780 781 781 /* 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 ); 783 783 } 784 784 … … 886 886 } 887 887 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 888 912 p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec; 889 913 p_sys->video = p_dec->fmt_out.video; 890 914 891 915 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 ); 897 917 if( p_sys->p_vout == NULL ) 898 918 { src/video_output/video_output.c
r6754126 r3f6f97f 10 10 * 11 11 * Authors: Vincent Seguin <seguin@via.ecp.fr> 12 * Gildas Bazin <gbazin@videolan.org> 12 13 * 13 14 * This program is free software; you can redistribute it and/or modify … … 75 76 * properties. If not found, it spawns a new one. 76 77 *****************************************************************************/ 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 ) 78 vout_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 ) 82 82 { 83 83 /* Reattach video output to input before bailing out */ … … 169 169 } 170 170 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_aspect171 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 175 175 && !p_vout->b_override_aspect ) || 176 176 p_vout->b_filter_change ) … … 196 196 msg_Dbg( p_this, "no usable vout present, spawning one" ); 197 197 198 p_vout = vout_Create( p_this, i_width, i_height, i_chroma, i_aspect );198 p_vout = vout_Create( p_this, p_fmt ); 199 199 } 200 200 … … 208 208 * to its description. On error, it returns NULL. 209 209 *****************************************************************************/ 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 ) 210 vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) 213 211 { 214 212 vout_thread_t * p_vout; /* thread descriptor */ … … 218 216 vlc_value_t val, text; 219 217 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 220 223 /* Allocate descriptor */ 221 224 p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT ); … … 242 245 /* Initialize the rendering heap */ 243 246 I_RENDERPICTURES = 0; 247 p_vout->fmt_render = *p_fmt; /* FIXME palette */ 248 p_vout->fmt_in = *p_fmt; /* FIXME palette */ 244 249 p_vout->render.i_width = i_width; 245 250 p_vout->render.i_height = i_height; … … 559 564 msg_Dbg( p_vout, "got %i direct buffer(s)", I_OUTPUTPICTURES ); 560 565 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", 571 615 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 ); 574 619 575 620 /* Calculate shifts from system-updated masks */ src/video_output/vout_pictures.c
r7a70363 r3f6f97f 287 287 subpicture_t *p_subpic ) 288 288 { 289 video_format_t fmt;290 289 int i_scale_width, i_scale_height; 291 290 … … 293 292 { 294 293 /* XXX: subtitles */ 295 296 294 return NULL; 297 295 } 298 296 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; 307 301 308 302 if( p_pic->i_type == DIRECT_PICTURE ) … … 321 315 vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic ); 322 316 323 spu_RenderSubpictures( p_vout->p_spu, & fmt,317 spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, 324 318 PP_OUTPUTPICTURE[0], p_pic, p_subpic, 325 319 i_scale_width, i_scale_height ); … … 337 331 * decoder. We can safely render subtitles on it and 338 332 * 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 ); 341 335 342 336 return p_pic; … … 356 350 357 351 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 ); 360 355 361 356 if( PP_OUTPUTPICTURE[0]->pf_unlock ) … … 379 374 { 380 375 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 ); 385 380 p_tmp_pic->i_type = MEMORY_PICTURE; 386 381 p_tmp_pic->i_status = RESERVED_PICTURE; … … 391 386 392 387 /* 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, 394 389 p_tmp_pic, p_subpic, 395 390 i_scale_width, i_scale_height ); … … 411 406 412 407 /* 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 ); 416 411 } 417 412 … … 436 431 { 437 432 *pi_width = *pi_height = *pi_x = *pi_y = 0; 438
