]> git.sesse.net Git - vlc/blobdiff - modules/video_chroma/i420_rgb.c
Split i422->packed YUV and i422->planar YUV. Add i422->YUVA. This still needs some...
[vlc] / modules / video_chroma / i420_rgb.c
index 068c84504dd4c3cd84a9d7fdba7c02a18621e4a5..4eb2398ad59626af47ecb13c05574e0836bcfa03 100644 (file)
@@ -26,8 +26,6 @@
  * Preamble
  *****************************************************************************/
 #include <math.h>                                            /* exp(), pow() */
-#include <string.h>                                            /* strerror() */
-#include <stdlib.h>                                      /* malloc(), free() */
 
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
@@ -155,6 +153,14 @@ static int Activate( vlc_object_t *p_this )
                         msg_Dbg(p_this, "RGB pixel format is A8R8G8B8");
                         p_vout->chroma.pf_convert = E_(I420_A8R8G8B8);
                     }
+                    else if( p_vout->output.i_rmask == 0xff000000
+                          && p_vout->output.i_gmask == 0x00ff0000
+                          && p_vout->output.i_bmask == 0x0000ff00 )
+                    {
+                        /* R8G8B8A8 pixel format */
+                        msg_Dbg(p_this, "RGB pixel format is R8G8B8A8");
+                        p_vout->chroma.pf_convert = E_(I420_R8G8B8A8);
+                    }
                     else if( p_vout->output.i_rmask == 0x0000ff00
                           && p_vout->output.i_gmask == 0x00ff0000
                           && p_vout->output.i_bmask == 0xff000000 )
@@ -163,10 +169,18 @@ static int Activate( vlc_object_t *p_this )
                         msg_Dbg(p_this, "RGB pixel format is B8G8R8A8");
                         p_vout->chroma.pf_convert = E_(I420_B8G8R8A8);
                     }
+                    else if( p_vout->output.i_rmask == 0x000000ff
+                          && p_vout->output.i_gmask == 0x0000ff00
+                          && p_vout->output.i_bmask == 0x00ff0000 )
+                    {
+                        /* A8B8G8R8 pixel format */
+                        msg_Dbg(p_this, "RGB pixel format is A8B8G8R8");
+                        p_vout->chroma.pf_convert = E_(I420_A8B8G8R8);
+                    }
                     else
                         return -1;
 #else
-                    // generic C chroma converter */
+                    /* generic C chroma converter */
                     p_vout->chroma.pf_convert = E_(I420_RGB32);
 #endif
                     break;
@@ -414,9 +428,9 @@ static void Set8bppPalette( vout_thread_t *p_vout, uint8_t *p_rgb8 )
                     p_cmap_b[ j ] = CLIP( b );
 
 #if 0
-                   printf("+++Alloc RGB cmap %d (%d, %d, %d)\n", j,
-                          p_cmap_r[ j ] >>8, p_cmap_g[ j ] >>8, 
-                          p_cmap_b[ j ] >>8);
+            printf("+++Alloc RGB cmap %d (%d, %d, %d)\n", j,
+               p_cmap_r[ j ] >>8, p_cmap_g[ j ] >>8,
+               p_cmap_b[ j ] >>8);
 #endif
 
                     /* Allocate color */