diff options
author | wm4 <wm4@nowhere> | 2012-11-04 15:56:04 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 17:39:31 +0100 |
commit | 191bcbd1f2a0aa7ab64ed0e2768f29fedf2f4c30 (patch) | |
tree | 5051c40e3342b47369953605ea0a7edf3d1599eb /video/out/vo.c | |
parent | 97032f1b58cc4c5c17002939703ee16904691675 (diff) | |
download | mpv-191bcbd1f2a0aa7ab64ed0e2768f29fedf2f4c30.tar.bz2 mpv-191bcbd1f2a0aa7ab64ed0e2768f29fedf2f4c30.tar.xz |
video/out: make draw_image mandatory, remove VOCTRL_DRAW_IMAGE
Remove VOCTRL_DRAW_IMAGE and always set vo_driver.draw_image in VOs.
Make draw_image mandatory: change some VOs (like vo_x11) to support it,
and remove the image-to-slices fallback in vf_vo.
Remove vo_driver.is_new. This member indicated whether draw_image is
supported unconditionally, which is now always the case.
draw_image_pts is a hack until the video filter chain is changed to
include the PTS as field in mp_image. Then vo_vdpau and vo_lavc will
be changed to use draw_image.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r-- | video/out/vo.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 7ec9ccdaf7..a1f3d915b1 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -159,6 +159,15 @@ int vo_control(struct vo *vo, uint32_t request, void *data) return vo->driver->control(vo, request, data); } +static void draw_image_pts(struct vo *vo, struct mp_image *mpi, double pts) +{ + if (vo->driver->draw_image_pts) { + vo->driver->draw_image_pts(vo, mpi, pts); + } else { + vo->driver->draw_image(vo, mpi); + } +} + // Return -1 if driver appears not to support a draw_image interface, // 0 otherwise (whether the driver actually drew something or not). int vo_draw_image(struct vo *vo, struct mp_image *mpi, double pts) @@ -166,18 +175,12 @@ int vo_draw_image(struct vo *vo, struct mp_image *mpi, double pts) if (!vo->config_ok) return 0; if (vo->driver->buffer_frames) { - vo->driver->draw_image(vo, mpi, pts); + draw_image_pts(vo, mpi, pts); return 0; } vo->frame_loaded = true; vo->next_pts = pts; - // Guaranteed to support at least DRAW_IMAGE later - if (vo->driver->is_new) { - vo->waiting_mpi = mpi; - return 0; - } - if (vo_control(vo, VOCTRL_DRAW_IMAGE, mpi) == VO_NOTIMPL) - return -1; + vo->waiting_mpi = mpi; return 0; } @@ -217,12 +220,10 @@ int vo_draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h, int void vo_new_frame_imminent(struct vo *vo) { - if (!vo->driver->is_new) - return; if (vo->driver->buffer_frames) vo_control(vo, VOCTRL_NEWFRAME, NULL); else { - vo_control(vo, VOCTRL_DRAW_IMAGE, vo->waiting_mpi); + draw_image_pts(vo, vo->waiting_mpi, vo->next_pts); vo->waiting_mpi = NULL; } } |