summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-01 19:24:28 +0200
committerwm4 <wm4@nowhere>2015-07-01 22:38:02 +0200
commit0739cfc20934ac7772ab71dbae7ecba4ba10fda4 (patch)
tree939c829441af634577d71fbdf99a60314aa3ab42 /video/out/vo_opengl.c
parentf166d1298545154618ee2d046bb3c433469469c2 (diff)
downloadmpv-0739cfc20934ac7772ab71dbae7ecba4ba10fda4.tar.bz2
mpv-0739cfc20934ac7772ab71dbae7ecba4ba10fda4.tar.xz
vo: change internal API for drawing frames
draw_image_timed is renamed to draw_frame. struct frame_timing is renamed to vo_frame. flip_page_timed is merged into draw_frame (the additional parameters are part of struct vo_frame). draw_frame also deprecates VOCTRL_REDRAW_FRAME, and replaces it with a method that works for both VOs which can cache the current frame, and VOs which need to redraw it anyway. This is preparation to making the interpolation and (work in progress) display sync code saner. Lots of other refactoring, and also some simplifications.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 2d3ab5ba93..043ddaa836 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -164,8 +164,7 @@ static void flip_page(struct vo *vo)
}
}
-static void draw_image_timed(struct vo *vo, mp_image_t *mpi,
- struct frame_timing *t)
+static void draw_frame(struct vo *vo, struct vo_frame *frame)
{
struct gl_priv *p = vo->priv;
GL *gl = p->gl;
@@ -174,7 +173,7 @@ static void draw_image_timed(struct vo *vo, mp_image_t *mpi,
return;
p->frame_started = true;
- gl_video_render_frame(p->renderer, mpi, 0, t);
+ gl_video_render_frame(p->renderer, frame, 0);
// The playloop calls this last before waiting some time until it decides
// to call flip_page(). Tell OpenGL to start execution of the GPU commands
@@ -183,13 +182,6 @@ static void draw_image_timed(struct vo *vo, mp_image_t *mpi,
if (p->use_glFinish)
gl->Finish();
-
- talloc_free(mpi);
-}
-
-static void draw_image(struct vo *vo, mp_image_t *mpi)
-{
- draw_image_timed(vo, mpi, NULL);
}
static int query_format(struct vo *vo, int format)
@@ -355,12 +347,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_LOAD_HWDEC_API:
request_hwdec_api(p, data);
return true;
- case VOCTRL_REDRAW_FRAME:
- if (!(p->glctx->start_frame && !p->glctx->start_frame(p->glctx))) {
- p->frame_started = true;
- gl_video_render_frame(p->renderer, NULL, 0, NULL);
- }
- return true;
case VOCTRL_SET_COMMAND_LINE: {
char *arg = data;
return reparse_cmdline(p, arg);
@@ -489,8 +475,7 @@ const struct vo_driver video_out_opengl = {
.query_format = query_format,
.reconfig = reconfig,
.control = control,
- .draw_image = draw_image,
- .draw_image_timed = draw_image_timed,
+ .draw_frame = draw_frame,
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct gl_priv),
@@ -505,8 +490,7 @@ const struct vo_driver video_out_opengl_hq = {
.query_format = query_format,
.reconfig = reconfig,
.control = control,
- .draw_image = draw_image,
- .draw_image_timed = draw_image_timed,
+ .draw_frame = draw_frame,
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct gl_priv),