GNOME Bugzilla – Bug 577436
xvimagesink should use xcontext->depth and not count bits in colorkey
Last modified: 2009-03-31 10:58:10 UTC
in gst_xvimagesink_get_xv_support() we currently count bits in attribute.max_value to setup the colorkey for different screen-depths. The max value is always a constant in the Xorg drivers. It will not reflect any particular depth. Well, maybe it reflects the maximum depth supported by the driver, and since practically all drivers support depth=24 the max value is the same across all those drivers. Below are some link to the source code of the Xorg drivers (since there is no offical specification for this stuff AFAICS): http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/radeon_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-i740/tree/src/i740_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/src/i830_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-mach64/tree/src/atimach64xv.c http://cgit.freedesktop.org/xorg/driver/xf86-video-mga/tree/src/mga_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-r128/tree/src/r128_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-s3/tree/src/s3_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-savage/tree/src/savage_video.c http://cgit.freedesktop.org/xorg/driver/xf86-video-siliconmotion/tree/src/smi_video.c Could people that have a xvideo driver where XV_COLORKEY is implemented (xvinfo | grep XV_COLORKEY), try gst-plugins-base/tests/icles/test-colorkey, then apply the patch and try again. Please report wheter it worked before and after and attach the xvinfo output.
Created attachment 131763 [details] [review] use xcontext->depth
I don't have access to the ATI gfx card I was working on at the time of changing this colorkey stuff, and this laptop doesn't have the attribute. Another machine at home, with Intel integrated gfx has: supported visuals: depth 24, visualID 0x21 "XV_COLORKEY" (range 0 to 16777215) client settable attribute client gettable attribute (current value is 66046) This change seems sensible to me.
lets give it a try. commit 2f90615d14574c62453f55a854f4599bce1391a3 Author: Stefan Kost <ensonic@users.sf.net> Date: Thu Mar 26 18:54:56 2009 +0200 xvimagesink: use xcontext->depth instead of bits in attr.max_value for colorkey According to the drivers in http://cgit.freedesktop.org/xorg/driver/ we should format the colorkey depending on xcontext->depth. This is what they will use to interprete the value. The max_value in turn is usualy a constant regardless of the depth.