diff options
author | wm4 <wm4@nowhere> | 2015-11-25 22:06:58 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-25 22:06:58 +0100 |
commit | 19c1a208ece76ccd7662a21685c08706b279f2a8 (patch) | |
tree | d7eae5d9b88f1aa80dc183b3c99cc77be9d068c1 /video/out/vo_rpi.c | |
parent | 422ed428173dd5118872f6efe0d1be9b716a0304 (diff) | |
download | mpv-19c1a208ece76ccd7662a21685c08706b279f2a8.tar.bz2 mpv-19c1a208ece76ccd7662a21685c08706b279f2a8.tar.xz |
vo_rpi: set aspect ratio
Otherwise, the MMAL output component will letter-box the video within
the specified dest_rect while keeping square pixels.
Diffstat (limited to 'video/out/vo_rpi.c')
-rw-r--r-- | video/out/vo_rpi.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c index e15b3d3694..cf051cfbc2 100644 --- a/video/out/vo_rpi.c +++ b/video/out/vo_rpi.c @@ -171,17 +171,20 @@ static void resize(struct vo *vo) vo_get_src_dst_rects(vo, &src, &dst, &p->osd_res); + int src_w = src.x1 - src.x0, src_h = src.y1 - src.y0, + dst_w = dst.x1 - dst.x0, dst_h = dst.y1 - dst.y0; MMAL_DISPLAYREGION_T dr = { .hdr = { .id = MMAL_PARAMETER_DISPLAYREGION, .size = sizeof(MMAL_DISPLAYREGION_T), }, - .src_rect = { .x = src.x0, .y = src.y0, - .width = src.x1 - src.x0, .height = src.y1 - src.y0, }, - .dest_rect = { .x = dst.x0, .y = dst.y0, - .width = dst.x1 - dst.x0, .height = dst.y1 - dst.y0, }, + .src_rect = { .x = src.x0, .y = src.y0, .width = src_w, .height = src_h }, + .dest_rect = { .x = dst.x0, .y = dst.y0, .width = dst_w, .height = dst_h }, .layer = p->video_layer, .display_num = p->display_nr, + .pixel_x = dst_w * src_h, + .pixel_y = src_w * dst_h, .set = MMAL_DISPLAY_SET_SRC_RECT | MMAL_DISPLAY_SET_DEST_RECT | - MMAL_DISPLAY_SET_LAYER | MMAL_DISPLAY_SET_NUM, + MMAL_DISPLAY_SET_LAYER | MMAL_DISPLAY_SET_NUM | + MMAL_DISPLAY_SET_PIXEL, }; if (mmal_port_parameter_set(input, &dr.hdr)) |