Mercurial > mplayer.hg
comparison libvo/video_out.c @ 36187:09b2e3d9f51b
border_pos support for a few more vos.
author | reimar |
---|---|
date | Sat, 25 May 2013 07:43:22 +0000 |
parents | 3b15983f5e48 |
children | 36bf5f450577 |
comparison
equal
deleted
inserted
replaced
36186:3b15983f5e48 | 36187:09b2e3d9f51b |
---|---|
404 /** | 404 /** |
405 * \brief helper function for the kind of panscan-scaling that needs a source | 405 * \brief helper function for the kind of panscan-scaling that needs a source |
406 * and destination rectangle like Direct3D and VDPAU | 406 * and destination rectangle like Direct3D and VDPAU |
407 */ | 407 */ |
408 static void src_dst_split_scaling(int src_size, int dst_size, int scaled_src_size, | 408 static void src_dst_split_scaling(int src_size, int dst_size, int scaled_src_size, |
409 float bpos, | |
409 int *src_start, int *src_end, int *dst_start, int *dst_end) { | 410 int *src_start, int *src_end, int *dst_start, int *dst_end) { |
410 if (scaled_src_size > dst_size) { | 411 if (scaled_src_size > dst_size) { |
411 int border = src_size * (scaled_src_size - dst_size) / scaled_src_size; | 412 int border = src_size * (scaled_src_size - dst_size) / scaled_src_size; |
412 // round to a multiple of 2, this is at least needed for vo_direct3d and ATI cards | 413 // round to a multiple of 2, this is at least needed for vo_direct3d and ATI cards |
413 border = (border / 2 + 1) & ~1; | 414 border = (border / 2 + 1) & ~1; |
416 *dst_start = 0; | 417 *dst_start = 0; |
417 *dst_end = dst_size; | 418 *dst_end = dst_size; |
418 } else { | 419 } else { |
419 *src_start = 0; | 420 *src_start = 0; |
420 *src_end = src_size; | 421 *src_end = src_size; |
421 *dst_start = (dst_size - scaled_src_size) / 2; | 422 *dst_start = apply_border_pos(dst_size, scaled_src_size, bpos); |
422 *dst_end = *dst_start + scaled_src_size; | 423 *dst_end = *dst_start + scaled_src_size; |
423 } | 424 } |
424 } | 425 } |
425 | 426 |
426 /** | 427 /** |
453 aspect(&scaled_width, &scaled_height, A_WINZOOM); | 454 aspect(&scaled_width, &scaled_height, A_WINZOOM); |
454 panscan_calc_windowed(); | 455 panscan_calc_windowed(); |
455 scaled_width += vo_panscan_x; | 456 scaled_width += vo_panscan_x; |
456 scaled_height += vo_panscan_y; | 457 scaled_height += vo_panscan_y; |
457 if (borders) { | 458 if (borders) { |
458 borders->left = (vo_dwidth - scaled_width ) / 2; | 459 borders->left = apply_border_pos(vo_dwidth, scaled_width, vo_border_pos_x); |
459 borders->top = (vo_dheight - scaled_height) / 2; | 460 borders->top = apply_border_pos(vo_dheight, scaled_height, vo_border_pos_y); |
460 } | 461 } |
461 src_dst_split_scaling(src_width, vo_dwidth, scaled_width, | 462 src_dst_split_scaling(src_width, vo_dwidth, scaled_width, vo_border_pos_x, |
462 &src->left, &src->right, &dst->left, &dst->right); | 463 &src->left, &src->right, &dst->left, &dst->right); |
463 src_dst_split_scaling(src_height, vo_dheight, scaled_height, | 464 src_dst_split_scaling(src_height, vo_dheight, scaled_height, vo_border_pos_y, |
464 &src->top, &src->bottom, &dst->top, &dst->bottom); | 465 &src->top, &src->bottom, &dst->top, &dst->bottom); |
465 } | 466 } |
466 src->left += crop->left; src->right += crop->left; | 467 src->left += crop->left; src->right += crop->left; |
467 src->top += crop->top; src->bottom += crop->top; | 468 src->top += crop->top; src->bottom += crop->top; |
468 src->width = src->right - src->left; | 469 src->width = src->right - src->left; |