[vlc-devel] commit: Fix the RGB masks in v4l too. (Antoine Cellerier )

git version control git at videolan.org
Sat Sep 13 23:44:17 CEST 2008


vlc | branch: 0.9-bugfix | Antoine Cellerier <dionoea at videolan.org> | Sat Sep 13 23:46:45 2008 +0200| [e6553ac7829c288057c57de8e34febafbc9d06d2] | committer: Antoine Cellerier 

Fix the RGB masks in v4l too.

Once again, thanks to plc5_250 for the tests.
(cherry picked from commit 6e8bbe8e1a8e11492ad87fa8886c1f3cb20c026c)

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

 modules/access/v4l.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/modules/access/v4l.c b/modules/access/v4l.c
index 2dbfb2c..eaa73b0 100644
--- a/modules/access/v4l.c
+++ b/modules/access/v4l.c
@@ -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",




More information about the vlc-devel mailing list