core/VO: Allow VO drivers to add/modify frames
commit350fc4f5a2f6f4fdf9cc689d786d525f6397df5d
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Fri, 18 Sep 2009 13:27:55 +0000 (18 16:27 +0300)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Fri, 18 Sep 2009 14:12:53 +0000 (18 17:12 +0300)
tree4f133589230adc4d87d296d5b7300b811c941bdd
parent6847e5e297821bdb56ec978100243bc452f508f4
core/VO: Allow VO drivers to add/modify frames

Add interfaces to allow VO drivers to add or remove frames from the
video stream and to alter timestamps. Currently this functionality
only works with in correct-pts mode. Use the new functionality in
vo_vdpau to properly support frame-adding deinterlace modes.

Frames added by the VDPAU deinterlacing code are now properly timed.
Before every second frame was always shown immediately (probably next
monitor refresh) after the previous one, even if you were watching
things in slow motion, and framestepping didn't stop at them at all.
When seeking the deinterlace algorithm is no longer fed a mix of
frames from old and new positions.

As a side effect of the changes a problem with resize events was also
fixed. Resizing calls video_to_output_surface() to render the frame at
the new resolution, but before this function also changed the list of
history frames, so resizing could give an image different from the
original one, and also corrupt next frames due to them seeing the
wrong history. Now the function has no such side effects. There are
more resize-related problems though that will be fixed in a later
commit.

The deint_mpi[] list of reserved frames is increased from 2 to 3
entries for reasons related to the above. Having 2 entries is enough
when you initially get a new frame in draw_image() because then you'll
have those two entries plus the new one for a total of 3 (the code
relied on the oldest mpi implicitly staying reserved for the duration
of the call even after usage count was decreased). However if you want
to be able to reproduce the rendering outside draw_image(), relying on
the explicitly reserved list only, then it needs to store 3 entries.
libmpcodecs/vf.h
libmpcodecs/vf_vo.c
libvo/video_out.c
libvo/video_out.h
libvo/vo_vdpau.c
mencoder.c
mp_core.h
mplayer.c