[MPlayer-dev-eng] XvMC simplify

Ivan Kalvachev ikalvachev at gmail.com
Mon Apr 25 22:33:29 CEST 2011


Use xvmc_render struct to hold both xvmc_pix_fmt shared struct and the
specific flags needed by MPlayer. These flags were removed from FFmpeg
after the version bump.
--
Reimar did fix it by creating new structure and a second array  to
hold these flags.

However I do not like that solution, It needs function to calculate
the index of the old array and then uses this index in the new array.

I prefer a different approach, that I find simpler. Resurrect the
xvmc_render struct and made its first member hold the shared
xvmc_pix_fmt struct. This way they both would share pointer and could
be assessed just by cast. Same trick is used in FFmpeg for the
MpegEncContext.

Here is attached patch that does:
1.create xvmc_render by adding xvmc_pix_fmt to the surface_render_info
2. replace all xvmc_pix_fmt instances with xvmc_render.
3. add "shared."#x to all current use of the xvmc_render variables.
4. move surface_render_info  usages to xvmc_render-> (without .shared).
5. Clean up the usage of get_render_info() function.

I can't see anything breaking.

On side note. Reimar, good work with the mpi->usage_count.

I would like you to give a little thought on general code for the
other video outputs.
Basically mpi should be marked as used while it is visible, with
special case when there is only one available buffer. (this all is
about -dr mode).
In the XvMC (and probably other vo's like svga) the problem is that
the switch of the visible buffer doesn't happen with the issue of the
new display command. It is delayed until the actual retrace. So
freeing(usage_count--) may be a little tricky.

p.s.
I tried to limit cosmetics. If I failed tell me.
I will accept style comments after the whole code have been
indent/uncrustify-ed.

I'll commit in few days if there are no objections.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xvmc_mixstruct.patch
Type: application/octet-stream
Size: 18637 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110425/cafc84b2/attachment.obj>


More information about the MPlayer-dev-eng mailing list