New libXvMC wrapper.

Thomas Hellström unichrome at
Fri Sep 10 16:18:30 PDT 2004


I've attached a patch for a proposal of a libXvMC wrapper.
The purpose of the wrapper is to allow XvMC clients to link to different
hardware-specific dynamic XvMC libraries runtime. Contrary to the 
situation with and the dri 3D drivers there is no builtin 
mechanism for this.

Current available XvMC libs include                       (in the Xorg tree)                  (Closed-source from Nvidia site)                         (With a nonstandard VLD extension 
available from the unichrome project)
and the savage XvMC code, which I haven't looked closer at.

Up to now the option has been to link to either of these (Xine, for 
example, links to the Nvidia driver) and this will mean the lib has to 
be present at runtime and the code will only work with Nvidia hardware.

The proposed solution eliminates this problem by providing a, which, at runtime, dlopens the library listed in the file 
<configdir>XvMCConfig and resolves the  necessary symbols, including , 
if present, the nonstandard VLD extension. This will make it possible 
for codes implementing this extension to also runtime link to libraries 
not including it.

Packagers wanting to include XvMC support for a media player can easily 
do so for all hardware that supports it, without having to include the 
HW specific libraries.

I've tested it with with linux, xine and the via (xine-xxmc) and Nvidia 
(xine-xvmc) drivers and it works as expected. It also loads and fires up 
the I810 driver but unfortunately I have no hardware to test it against.

Caveats could be portability: linking the lib requires the -nostartfiles 
gcc flag. I'm also not sure which implementations of dlopen supports 
library wrapping in this way.

Comments / Opinions would be appreciated. The diff is against current 
Xorg CVS, and also includes the
VLD extension header.

Thomas Hellström
The Unichrome project

-------------- next part --------------
A non-text attachment was scrubbed...
Name: XvMCW.diff.bz2
Type: application/x-bzip
Size: 6201 bytes
Desc: not available
URL: <>

More information about the xorg mailing list