[vlc-devel] [PATCH v2 13/19] kva: use the placed picture dimensions from the core
Steve Lhomme
robux4 at ycbcr.xyz
Tue Aug 25 16:20:26 CEST 2020
---
modules/video_output/kva.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index ec8b4be93cf..9e4d67d7315 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -430,11 +430,10 @@ static int Control( vout_display_t *vd, int query, va_list args )
case VOUT_DISPLAY_CHANGE_ZOOM:
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
{
- vout_display_place_t place;
- vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
+ const vout_display_place_t *place = vd->place;
- sys->kvas.ulAspectWidth = place.width;
- sys->kvas.ulAspectHeight = place.height;
+ sys->kvas.ulAspectWidth = place->width;
+ sys->kvas.ulAspectHeight = place->height;
kvaSetup( &sys->kvas );
return VLC_SUCCESS;
}
@@ -935,16 +934,15 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
i_movie_width = movie_rect.xRight - movie_rect.xLeft;
i_movie_height = movie_rect.yTop - movie_rect.yBottom;
- vout_display_place_t place;
- vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_TOP_LEFT);
+ const vout_display_place_t *place = vd->place;
int x = ( i_mouse_x - movie_rect.xLeft ) *
- place.width / i_movie_width + place.x;
+ place->width / i_movie_width + place->x;
int y = ( i_mouse_y - movie_rect.yBottom ) *
- place.height / i_movie_height;
+ place->height / i_movie_height;
/* Invert Y coordinate and add y offset */
- y = ( place.height - y ) + place.y;
+ y = ( place->height - y ) + place->y;
vout_display_SendMouseMovedDisplayCoordinates( vd, x, y );
--
2.26.2
More information about the vlc-devel
mailing list