[vlc-devel] commit: Correctly set screen RGB masks for win32 and use native screen bitdepth. ( Laurent Aimar )

git version control git at videolan.org
Mon Sep 8 22:57:17 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep  8 22:59:57 2008 +0200| [52cf2e3959f6bbc9c73159ee5842d2da4d606dac] | committer: Laurent Aimar 

Correctly set screen RGB masks for win32 and use native screen bitdepth.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=52cf2e3959f6bbc9c73159ee5842d2da4d606dac
---

 modules/access/screen/win32.c |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c
index 4255bdf..f267b08 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 );




More information about the vlc-devel mailing list