summaryrefslogtreecommitdiffstats
path: root/video/out/vo_direct3d.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-26 14:26:23 -0500
committerDudemanguy <random342@airmail.cc>2023-10-01 14:48:38 +0000
commit0b705983584691c6d7b1ee19c4b6950fa5334326 (patch)
treeff51915e63cb312aaeaab5f7c79ba7dd533d7db8 /video/out/vo_direct3d.c
parent043189c2298ea6ee9d1d88143946e6b95e907db8 (diff)
downloadmpv-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_direct3d.c')
-rw-r--r--video/out/vo_direct3d.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 1c78cebbc6..af17b4cf59 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -850,9 +850,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
d3d_priv *priv = vo->priv;
switch (request) {
- case VOCTRL_REDRAW_FRAME:
- d3d_draw_frame(priv);
- return VO_TRUE;
case VOCTRL_SET_PANSCAN:
calc_fs_rect(priv);
priv->vo->want_redraw = true;
@@ -993,27 +990,27 @@ static bool get_video_buffer(d3d_priv *priv, struct mp_image *out)
return true;
}
-static void draw_image(struct vo *vo, mp_image_t *mpi)
+static void draw_frame(struct vo *vo, struct vo_frame *frame)
{
d3d_priv *priv = vo->priv;
if (!priv->d3d_device)
- goto done;
+ return;
struct mp_image buffer;
if (!get_video_buffer(priv, &buffer))
- goto done;
+ return;
- mp_image_copy(&buffer, mpi);
+ if (!frame->current)
+ return;
+
+ mp_image_copy(&buffer, frame->current);
d3d_unlock_video_objects(priv);
priv->have_image = true;
- priv->osd_pts = mpi->pts;
+ priv->osd_pts = frame->current->pts;
d3d_draw_frame(priv);
-
-done:
- talloc_free(mpi);
}
static mp_image_t *get_window_screenshot(d3d_priv *priv)
@@ -1242,7 +1239,7 @@ const struct vo_driver video_out_direct3d = {
.query_format = query_format,
.reconfig = reconfig,
.control = control,
- .draw_image = draw_image,
+ .draw_frame = draw_frame,
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(d3d_priv),