diff options
author | Dudemanguy <random342@airmail.cc> | 2023-09-26 14:26:23 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-01 14:48:38 +0000 |
commit | 0b705983584691c6d7b1ee19c4b6950fa5334326 (patch) | |
tree | ff51915e63cb312aaeaab5f7c79ba7dd533d7db8 /video/out/vo_sdl.c | |
parent | 043189c2298ea6ee9d1d88143946e6b95e907db8 (diff) | |
download | mpv-0b705983584691c6d7b1ee19c4b6950fa5334326.tar.bz2 mpv-0b705983584691c6d7b1ee19c4b6950fa5334326.tar.xz |
vo: fully replace draw_image with draw_frame
0739cfc20934ac7772ab71dbae7ecba4ba10fda4 added the draw_frame API
deprecated draw_image internally. VOs that still used draw_image were
around, but really there's no reason to not just "upgrade" them anyway.
draw_frame is what the "real" VOs that people care about (gpu/gpu-next)
use. So we can just simplfy the code a bit now. VOCTRL_REDRAW_FRAME is
also no longer needed so that can be completely deleted as well. Note
that several of these VOs are legacy crap anyway (e.g. vaapi) and maybe
should just be deleted but whatever. vo_direct3d was also completely
untested (not that anyone should ever use it).
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r-- | video/out/vo_sdl.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index 4e2c20a681..b5e3d5b041 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -869,7 +869,7 @@ static int query_format(struct vo *vo, int format) return 0; } -static void draw_image(struct vo *vo, mp_image_t *mpi) +static void draw_frame(struct vo *vo, struct vo_frame *frame) { struct priv *vc = vo->priv; @@ -879,20 +879,16 @@ static void draw_image(struct vo *vo, mp_image_t *mpi) SDL_SetTextureBlendMode(vc->tex, SDL_BLENDMODE_NONE); - if (mpi) { - vc->osd_pts = mpi->pts; + if (frame->current) { + vc->osd_pts = frame->current->pts; mp_image_t texmpi; - if (!lock_texture(vo, &texmpi)) { - talloc_free(mpi); + if (!lock_texture(vo, &texmpi)) return; - } - mp_image_copy(&texmpi, mpi); + mp_image_copy(&texmpi, frame->current); SDL_UnlockTexture(vc->tex); - - talloc_free(mpi); } SDL_Rect src, dst; @@ -940,9 +936,6 @@ static int control(struct vo *vo, uint32_t request, void *data) } return 1; } - case VOCTRL_REDRAW_FRAME: - draw_image(vo, NULL); - return 1; case VOCTRL_SET_PANSCAN: force_resize(vo); return VO_TRUE; @@ -987,7 +980,7 @@ const struct vo_driver video_out_sdl = { .query_format = query_format, .reconfig = reconfig, .control = control, - .draw_image = draw_image, + .draw_frame = draw_frame, .uninit = uninit, .flip_page = flip_page, .wait_events = wait_events, |