From: Laurent Aimar Date: Mon, 8 Sep 2008 20:59:57 +0000 (+0200) Subject: Correctly set screen RGB masks for win32 and use native screen bitdepth. X-Git-Tag: 1.0.0-pre1~3411 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=52cf2e3959f6bbc9c73159ee5842d2da4d606dac;p=vlc Correctly set screen RGB masks for win32 and use native screen bitdepth. --- diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c index 4255bdf3af..f267b08b49 100644 --- a/modules/access/screen/win32.c +++ b/modules/access/screen/win32.c @@ -95,16 +95,39 @@ int screen_InitCapture( demux_t *p_demux ) return VLC_EGENERIC; } -#if 1 /* For now we force RV24 because of chroma inversion in the other cases*/ - i_chroma = VLC_FOURCC('R','V','2','4'); - i_bits_per_pixel = 24; -#endif - es_format_Init( &p_sys->fmt, VIDEO_ES, i_chroma ); p_sys->fmt.video.i_width = GetDeviceCaps( p_data->hdc_src, HORZRES ); p_sys->fmt.video.i_height = GetDeviceCaps( p_data->hdc_src, VERTRES ); p_sys->fmt.video.i_bits_per_pixel = i_bits_per_pixel; + switch( i_chroma ) + { + case VLC_FOURCC('R','V','1','5'): + p_sys->fmt.video.i_rmask = 0x7c00; + p_sys->fmt.video.i_gmask = 0x03e0; + p_sys->fmt.video.i_bmask = 0x001f; + break; + case VLC_FOURCC('R','V','1','6'): + p_sys->fmt.video.i_rmask = 0xf800; + p_sys->fmt.video.i_gmask = 0x07e0; + p_sys->fmt.video.i_bmask = 0x001f; + break; + case VLC_FOURCC('R','V','2','4'): + p_sys->fmt.video.i_rmask = 0x00ff0000; + p_sys->fmt.video.i_gmask = 0x0000ff00; + p_sys->fmt.video.i_bmask = 0x000000ff; + break; + case VLC_FOURCC('R','V','3','2'): + p_sys->fmt.video.i_rmask = 0x00ff0000; + p_sys->fmt.video.i_gmask = 0x0000ff00; + p_sys->fmt.video.i_bmask = 0x000000ff; + break; + default: + msg_Warn( p_demux, "Unknown RGB masks" ); + break; + } + + /* Create the bitmap info header */ p_data->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); p_data->bmi.bmiHeader.biWidth = p_sys->fmt.video.i_width; @@ -118,14 +141,6 @@ int screen_InitCapture( demux_t *p_demux ) p_data->bmi.bmiHeader.biClrUsed = 0; p_data->bmi.bmiHeader.biClrImportant = 0; - if( i_chroma == VLC_FOURCC('R','V','2','4') ) - { - /* This is in BGR format */ - p_sys->fmt.video.i_bmask = 0x00ff0000; - p_sys->fmt.video.i_gmask = 0x0000ff00; - p_sys->fmt.video.i_rmask = 0x000000ff; - } - var_Create( p_demux, "screen-fragment-size", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Get( p_demux, "screen-fragment-size", &val );