]> git.sesse.net Git - vlc/commitdiff
Fix the RGB masks in v4l too.
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 13 Sep 2008 21:46:45 +0000 (23:46 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 13 Sep 2008 21:47:15 +0000 (23:47 +0200)
Once again, thanks to plc5_250 for the tests.

modules/access/v4l.c

index 2dbfb2c4039ca8119e50f4cc12ba715236d60da3..eaa73b0f3631710b05dd622b346109a1825b8ee1 100644 (file)
@@ -503,12 +503,24 @@ static int Open( vlc_object_t *p_this )
         fmt.video.i_aspect = 4 * VOUT_ASPECT_FACTOR / 3;
 
         /* Setup rgb mask for RGB formats */
-        if( p_sys->i_fourcc == VLC_FOURCC('R','V','2','4') )
+        switch( p_sys->i_fourcc )
         {
-            /* This is in BGR format */
-            fmt.video.i_bmask = 0x00ff0000;
-            fmt.video.i_gmask = 0x0000ff00;
-            fmt.video.i_rmask = 0x000000ff;
+            case VLC_FOURCC('R','V','1','5'):
+                fmt.video.i_rmask = 0x001f;
+                fmt.video.i_gmask = 0x03e0;
+                fmt.video.i_bmask = 0x7c00;
+                break;
+            case VLC_FOURCC('R','V','1','6'):
+                fmt.video.i_rmask = 0x001f;
+                fmt.video.i_gmask = 0x07e0;
+                fmt.video.i_bmask = 0xf800;
+                break;
+            case VLC_FOURCC('R','V','2','4'):
+            case VLC_FOURCC('R','V','3','2'):
+                fmt.video.i_rmask = 0x00ff0000;
+                fmt.video.i_gmask = 0x0000ff00;
+                fmt.video.i_bmask = 0x000000ff;
+                break;
         }
 
         msg_Dbg( p_demux, "added new video es %4.4s %dx%d",