summaryrefslogtreecommitdiffstats
path: root/video/out/vo.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-12 23:17:35 +0200
committerwm4 <wm4@nowhere>2014-08-12 23:24:08 +0200
commit5ed7bc6321119365dc1a5d330774e32ac6b6a54e (patch)
tree941486fbb0c2e21fc093e55b7cbc8dfe08a370c6 /video/out/vo.h
parentdf58e822377af0a3802bba862de80eafaea732cb (diff)
downloadmpv-5ed7bc6321119365dc1a5d330774e32ac6b6a54e.tar.bz2
mpv-5ed7bc6321119365dc1a5d330774e32ac6b6a54e.tar.xz
video: fix and simplify video format changes and last frame display
The previous commit broke these things, and fixing them is separate in this commit in order to reduce the volume of changes. Move the image queue from the VO to the playback core. The image queue is a remnant of the old way how vdpau was implemented, and increasingly became more and more an artifact. In the end, it did only one thing: computing the duration of the current frame. This was done by taking the PTS difference between the current and the future frame. We keep this, but by moving it out of the VO, we don't have to special-case format changes anymore. This simplifies the code a lot. Since we need the queue to compute the duration only, a queue size larger than 2 makes no sense, and we can hardcode that. Also change how the last frame is handled. The last frame is a bit of a problem, because video timing works by showing one frame after another, which makes it a special case. Make the VO provide a function to notify us when the frame is done, instead. The frame duration is used for that. This is not perfect. For example, changing playback speed during the last frame doesn't update the end time. Pausing will not stop the clock that times the last frame. But I don't think this matters for such a corner case.
Diffstat (limited to 'video/out/vo.h')
-rw-r--r--video/out/vo.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index 0fe796dc73..0a8dca8c41 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -263,9 +263,6 @@ struct vo {
int dwidth;
int dheight;
float monitor_par;
-
- // --- Accessed by user-thread only.
- bool hasframe; // >= 1 frame has been drawn, so redraw is possible
};
struct mpv_global;
@@ -276,13 +273,12 @@ struct vo *init_best_video_out(struct mpv_global *global,
int vo_reconfig(struct vo *vo, struct mp_image_params *p, int flags);
int vo_control(struct vo *vo, uint32_t request, void *data);
-void vo_queue_image(struct vo *vo, struct mp_image *mpi);
-bool vo_has_next_frame(struct vo *vo, bool eof);
-double vo_get_next_pts(struct vo *vo, int index);
-bool vo_needs_new_image(struct vo *vo);
bool vo_is_ready_for_frame(struct vo *vo, int64_t next_pts);
-void vo_queue_frame(struct vo *vo, int64_t pts_us, int64_t duration);
+void vo_queue_frame(struct vo *vo, struct mp_image *image,
+ int64_t pts_us, int64_t duration);
void vo_wait_frame(struct vo *vo);
+bool vo_still_displaying(struct vo *vo);
+bool vo_has_frame(struct vo *vo);
void vo_redraw(struct vo *vo);
void vo_seek_reset(struct vo *vo);
void vo_destroy(struct vo *vo);