]> git.sesse.net Git - vlc/commitdiff
. un peu de m�nage dans video_fb.c
authorSam Hocevar <sam@videolan.org>
Wed, 9 Feb 2000 02:04:28 +0000 (02:04 +0000)
committerSam Hocevar <sam@videolan.org>
Wed, 9 Feb 2000 02:04:28 +0000 (02:04 +0000)
 . r�cup�ration des masks dans la structure framebuffer, ce qui fait que
  l'output framebuffer fonctionne � nouveau.

src/video_output/video_fb.c

index 217ef5dc6af813472ccea8f35364324a2400ee57..b9aecc0252d66046b0c87fe63ad8e4e1f1622a37 100644 (file)
 #include "intf_msg.h"
 #include "main.h"
 
-//#define RGB_MIN 0
-//#define RGB_MAX 255
-#define RGB_MIN 0
-#define RGB_MAX 255
-#define SHIFT 20
-#define U_GREEN_COEF    ((int)(-0.391 * (1<<SHIFT) / 1.164))
-#define U_BLUE_COEF     ((int)(2.018 * (1<<SHIFT) / 1.164))
-#define V_RED_COEF      ((int)(1.596 * (1<<SHIFT) / 1.164))
-#define V_GREEN_COEF    ((int)(-0.813 * (1<<SHIFT) / 1.164))
-
 /******************************************************************************
  * vout_sys_t: video output framebuffer method descriptor
  ******************************************************************************
@@ -260,6 +250,21 @@ static int FBOpenDisplay( vout_thread_t *p_vout )
         return( 1  );
         break;
     }
+
+    switch( p_vout->i_screen_depth )
+    {
+    case 15:
+    case 16:
+    case 24:
+    case 32:
+        p_vout->i_red_mask =    ( (1 << p_vout->p_sys->var_info.red.length) - 1 )
+                                    << p_vout->p_sys->var_info.red.offset;
+        p_vout->i_green_mask =    ( (1 << p_vout->p_sys->var_info.green.length) - 1 )
+                                    << p_vout->p_sys->var_info.green.offset;
+        p_vout->i_blue_mask =    ( (1 << p_vout->p_sys->var_info.blue.length) - 1 )
+                                    << p_vout->p_sys->var_info.blue.offset;
+    }
+
     p_vout->p_sys->i_page_size = p_vout->p_sys->var_info.xres *
                 p_vout->p_sys->var_info.yres * p_vout->i_bytes_per_pixel;
 
@@ -305,8 +310,9 @@ static void FBCloseDisplay( vout_thread_t *p_vout )
 /******************************************************************************
  * FBSetPalette: sets an 8 bpp palette
  ******************************************************************************
- * This function is just a prototype that does nothing. Architectures that
- * support palette allocation should override it.
+ * This function sets the palette given as an argument. It does not return
+ * anything, but could later send information on which colors it was unable
+ * to set.
  ******************************************************************************/
 static void    FBSetPalette   ( p_vout_thread_t p_vout,
                                 u16 *red, u16 *green, u16 *blue, u16 *transp )