summaryrefslogtreecommitdiffstats
path: root/video/out/vo_image.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_image.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_image.c')
-rw-r--r--video/out/vo_image.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index aece3e069b..cc48ab3404 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -87,20 +87,19 @@ static bool checked_mkdir(struct vo *vo, const char *buf)
static int reconfig(struct vo *vo, struct mp_image_params *params)
{
- struct priv *p = vo->priv;
- mp_image_unrefp(&p->current);
-
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 *p = vo->priv;
+ if (!frame->current)
+ return;
- p->current = mpi;
+ p->current = frame->current;
struct mp_osd_res dim = osd_res_from_image_params(vo->params);
- osd_draw_on_image(vo->osd, dim, mpi->pts, OSD_DRAW_SUB_ONLY, p->current);
+ osd_draw_on_image(vo->osd, dim, frame->current->pts, OSD_DRAW_SUB_ONLY, p->current);
}
static void flip_page(struct vo *vo)
@@ -122,7 +121,6 @@ static void flip_page(struct vo *vo)
write_image(p->current, p->opts->opts, filename, vo->global, vo->log);
talloc_free(t);
- mp_image_unrefp(&p->current);
}
static int query_format(struct vo *vo, int fmt)
@@ -134,9 +132,6 @@ static int query_format(struct vo *vo, int fmt)
static void uninit(struct vo *vo)
{
- struct priv *p = vo->priv;
-
- mp_image_unrefp(&p->current);
}
static int preinit(struct vo *vo)
@@ -163,7 +158,7 @@ const struct vo_driver video_out_image =
.query_format = query_format,
.reconfig = reconfig,
.control = control,
- .draw_image = draw_image,
+ .draw_frame = draw_frame,
.flip_page = flip_page,
.uninit = uninit,
.global_opts = &vo_image_conf,