[gst-devel] patch: correct handling of XVideo COLORKEY attributes

Ben Liblit liblit at eecs.berkeley.edu
Sat Nov 2 22:14:06 CET 2002


My video card (a GeForce 3) offers several settable XVideo attributes, 
such as brightness, contrast, etc.  Two of those attributes are 
XV_COLORKEY and XV_AUTOPAINT_COLORKEY.  I don't *completely* understand 
these, but the impression that I get is that XV_COLORKEY is a pixel 
which will be used as a video output mask: video is only painted over 
those parts of the window which are colored using the XV_COLORKEY pixel.

In the common case where you don't want any masking at all, you can fill 
the entire window using XV_COLORKEY.  A simpler approach, though, is to 
set the boolean XV_AUTOPAINT_COLORKEY attribute to "true".  This 
apparently causes the driver to do the XV_COLORKEY window filling 
automatically.

Curiously, the Xine movie player turns XV_AUTOPAINT_COLORKEY off, and 
leaves it off even after it is done.  So any subsequent video player 
that comes along will not get any video in its video window unless it 
either turns XV_AUTOPAINT_COLORKEY back on or else does some painting of 
its own using the XV_COLORKEY pixel.  GStreamer suffers from exactly 
this bug.  If Xine has *ever* been run on a display, then GStreamer's 
xvideosink plugin will not yield any output.  :-(

Attached below please find a small patch to fix this problem by turning 
XV_AUTOPAINT_COLORKEY back on.  I've tested it on my system and it works 
like a charm.  It should harmlessly do nothing on video cards that don't 
have this attribute at all.  The patch fixes both videosink and 
xvideosink.  I fixed the former before learning that it has been 
deprecated by the later.  Feel free to ignore the videosink change if 
that code is truly dead.

MPlayer had this same bug until very recently; I discovered the problem 
and submitted essentially the same fix, which was incorporated into the 
recent mplayer 0.90-pre9 release.  If you're interested, see 
<http://mplayerhq.hu/pipermail/mplayer-users/2002-October/022024.html> 
and 
<http://mplayerhq.hu/pipermail/mplayer-dev-eng/2002-October/012071.html> 
for archives of the discussions which led to my current understanding of 
the issue.

Thank you!
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gst-xv-patch
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20021102/75628fc4/attachment.txt>


More information about the gstreamer-devel mailing list