[mythtv] [exp. patch] xv xvmc merge (v3)

Daniel Kristjansson danielk at cat.nyu.edu
Thu Apr 7 01:46:14 UTC 2005


On Fri, 2005-04-01 at 12:53 -0500, Isaac Richards wrote:
> > Yeah, also made worse due to the limited # of buffers with xvmc.  Could
> > possible look into tying it into the release_buffer mechanism better, as a
> > way of hopefully knowing when it's completely done with a frame.  Or, your
> > approach below could work too.
> Actually, if the release_buffer callback from libavcodec is accurate as to 
> when it's done with the frame, it could be as simple as just refcounting the 
> frames (2 to start, -1 when displayed, -1 when marked unused by 
> release_buffer), and have a function in the frame struct call back into the 
> videoout class to return it to the queue..

Ok, there were some additional problems with XvMC. In normal use the
displaying frame was added to the available list while still on-screen.
This led to problems in a low buffer situation. In the paused state,
the pause frame was sometimes added to the available list between the
ProcessFrame() and Show() calls, causing lost frames when 
BLEND_SUBPICTURE OSD was being used (i.e. with nvidia XvMC.)
I've abstracted buffer management into a VideoBuffer class, and
taken care of these corner cases. The upshot is I can now pause
repeatedly and skip forward and backward as quickly as my fingers
will move and not kill XvMC playback....

The patch is too big to attach, so it's at:
    http://www.mrl.nyu.edu/~danielk/mythtv/xv-xvmc-merge-v3.tbz

Also
1/ For some reason HDTV playback is broken by these changes. I'll try
to debug that problem, it seems to be an initialization problem.

2/ I'm not being very aggressive at adding frames to the available
queue, I only add them to the list if all the children have been
displayed. It should be safe to add them once their children have
been rendered.

3/ For the VideoFrame buffering, I've changed the Qt queue's to STL
deque's for easier out-of-order find and out-of-order removals, 
however the VideoBuffer class could be a lot more efficient than
it is. A reimplementation should be easier now that all the buffer
management is in that one class (or will be in the next patch.)

4/ add standard work-in-progress warning

-- Daniel



More information about the mythtv-dev mailing list