[vlc-devel] Re: Fwd: [Possible endian bug in video_chrome/video_output]

Alexander Gall gall at switch.ch
Thu Apr 27 10:32:22 CEST 2006


On Wed, 26 Apr 2006 18:51:24 +0200, Benjamin Pracht <bigben+spam at videolan.org> said:

> Le mardi 25 avril 2006 à 17:47 +0200, Alexander Gall a écrit :
>> 
>> Everything works perfectly on this screen.  However, when I use the
>> x11 or glx output modules on screen #0, the masks that vlc choses are
>> 
>> red:    0x00000007
>> green:  0x00000038
>> blue:   0x000000c0
>> 
>> instead of
>> 
>> red:    0x000000ff
>> green:  0x0000ff00
>> blue:   0x00ff0000
>> 

> Could you add some debug in modules/video_output/x11/xcommon.c, around
> the line 2042 ? Try to see which case statement is used, and to explore
> the content of p_xvisual...

Right.  I finally understand what's going on.  InitDisplay() correctly
determines the screen depth to be 24 and enters the 24/default
case. Now, XGetVisualInfo() is called with only the ScreenMask and
ClassMask flags, asking for a list of all TrueColor visuals on this
screen.  My screen happens to have 7 matching visuals

  visual:
    visual id:    0x25
    class:    TrueColor
    depth:    8 planes
    available colormap entries:    8 per subfield
    red, green, blue masks:    0x7, 0x38, 0xc0
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x27
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x28
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x2b
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x2c
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x2d
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x2e
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits

However, InitDisplay() simply picks the first, which in my case
happens to be one with depth 8.

One way to fix this would be to set the screen depth in
xvisual_template.  This would be equivalent to using
XMatchVisualInfo() instead of XGetVisualInfo(), I suppose.

I think the same problem can occur with other screen depths as well.

--
Alex

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list