[mythtv] Question on Xv output and NuppelVideoPlayer

Clyde Stubbs clyde at htsoft.com
Thu Jul 1 01:57:46 EDT 2004

I have some questions about the video output in NuppelVideoPlayer,
in particular about the Xv implementation.

I've not used any of the other video output methods other than Xv,
but I have looked through the code for the various other drivers.

I'll explain my understanding of how it works - I'd appreciate
confirmation or correction if I've got something wrong.

The interface between NuppelVideoPlayer and the various
video_out drivers seems to center around two functions - PrepareFrame
and Show. The names imply, and the implementation of most of the
output drivers seems to confirm, that PrepareFrame does the hard work
of getting a frame ready to display, and Show actually triggers it
to be displayed on the screen.

In videoout_xv.cpp, however, PrepareFrame does various things culminating
in some variant of XvPutImage(), and Show is simpy a call to XSync().

Now I know that XSync() does very little, and certainly does nothing
to the video card that might affect the display. With certain video
card drivers, XSync() might delay returning until the card is no longer
busy, but this is certainly not true for all drivers, nor does the
X documentation suggest that.

XVPutImage writes a frame to a buffer in the video card; as I understand
it, the actual display of that frame will occur at the next vertical
blanking period, when the card will switch buffers. I believe that the
buffer switch must occur during the blanking period otherwise there
would be tearing or other artefacts visible on the screen.

Am I correct in my understanding so far? If so, doesn't this mean
that in videoout_xv.cpp that the XVPutImage call should be in Show(),
not in PrepareFrame()?


More information about the mythtv-dev mailing list