There is a problem with blending GREY on GREY though.
Use `Xephyr -grayscale` to test.
xcb_window_t window; /* drawable X window */
xcb_gcontext_t gc; /* context to put images */
bool shm; /* whether to use MIT-SHM */
xcb_window_t window; /* drawable X window */
xcb_gcontext_t gc; /* context to put images */
bool shm; /* whether to use MIT-SHM */
+ bool gray; /* whether display is grayscale */
uint8_t bpp; /* bits per pixel */
};
uint8_t bpp; /* bits per pixel */
};
/* Determine the visual (color depth and palette) */
xcb_visualtype_t *vt = NULL;
/* Determine the visual (color depth and palette) */
xcb_visualtype_t *vt = NULL;
if ((vt = xcb_aux_find_visual_by_attrs (scr, XCB_VISUAL_CLASS_TRUE_COLOR,
scr->root_depth)) != NULL)
msg_Dbg (vout, "using TrueColor visual ID %d", (int)vt->visual_id);
if ((vt = xcb_aux_find_visual_by_attrs (scr, XCB_VISUAL_CLASS_TRUE_COLOR,
scr->root_depth)) != NULL)
msg_Dbg (vout, "using TrueColor visual ID %d", (int)vt->visual_id);
scr->root_depth)) != NULL)
msg_Dbg (vout, "using static color visual ID %d", (int)vt->visual_id);
else
scr->root_depth)) != NULL)
msg_Dbg (vout, "using static color visual ID %d", (int)vt->visual_id);
else
+ if ((scr->root_depth == 8)
+ && (vt = xcb_aux_find_visual_by_attrs (scr, XCB_VISUAL_CLASS_STATIC_GRAY,
+ scr->root_depth)) != NULL)
+ {
+ msg_Dbg (vout, "using static gray visual ID %d", (int)vt->visual_id);
+ p_sys->gray = true;
+ }
+ else
{
vt = xcb_aux_find_visual_by_id (scr, scr->root_visual);
assert (vt);
{
vt = xcb_aux_find_visual_by_id (scr, scr->root_visual);
assert (vt);
break;
case 8: /* FIXME: VLC cannot convert */
break;
case 8: /* FIXME: VLC cannot convert */
- vout->output.i_chroma = VLC_FOURCC ('R', 'G', 'B', '2');
+ vout->output.i_chroma =
+ p_sys->gray ? VLC_FOURCC ('G', 'R', 'E', 'Y')
+ : VLC_FOURCC ('R', 'G', 'B', '2');