Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (12)
  • Steve Lhomme's avatar
    bitmapinfoheader: explicitly use BI_RGB by default · 066e235f
    Steve Lhomme authored
    BI_RGB is 0, no need to set it again to 0 later.
    066e235f
  • Steve Lhomme's avatar
    bitmapinfoheader: map VLC_CODEC_BGRX like VLC_CODEC_BGRA · 22e26729
    Steve Lhomme authored
    We may want to use BI_BITFIELDS with it too.
    22e26729
  • Steve Lhomme's avatar
    bitmpainfoheader: fix 32-bit BI_RGB mapping · 3f41da4a
    Steve Lhomme authored
    With the follwing code change in mock, the planes end up matching the XRGB
    order when playing the file with the Windows player. There is no mask involved
    here.
    
    * The first bar is black for 32-bit color [0xFF 0x00 0x00 0x00]
    * The second bar is red for 32-bit color [0x00 0xFF 0x00 0x00]
    * The third bar is green for 32-bit color [0x00 0x00 0xFF 0x00]
    * The fourth bar is blue for 32-bit color [0x00 0x00 0x00 0xFF]
    
    mock://video_track_count=1;length=6000000;video_chroma=XRGB
    --sout=#transcode{vcodec=XRGB}:std{access=file,dst=xrgb.avi,mux=avi}
    
        unsigned lines_per_color = pic->p[0].i_visible_lines / pic->p[0].i_pixel_pitch;
        for (int bar = 0; bar < pic->p[0].i_pixel_pitch; bar++)
        {
            uint8_t colors[pic->p[0].i_pixel_pitch];
            memset(colors, 0, sizeof(colors));
            colors[bar] = 0xFF;
            for (unsigned y=bar*lines_per_color; y < (bar+1)*lines_per_color; y++)
                for (int x=0; x < pic->p[0].i_visible_pitch; x += pic->p[0].i_pixel_pitch)
                {
                    memcpy(&pic->p[0].p_pixels[x + y*pic->p[0].i_pitch], colors, pic->p[0].i_pixel_pitch);
                }
        }
        memset(pic->p[0].p_pixels, pixel, block_len);
    3f41da4a
  • Steve Lhomme's avatar
    bitmapinfoheader: fix mask detection to match RGB32 with BI_RGB · a8212280
    Steve Lhomme authored
    We know BI_RGB corresponds to XRGB, so we should match it with the
    corresponding mask.
    a8212280
  • Steve Lhomme's avatar
    bitmapinfoheader: fix 32-bit mask usage · 6bf7babd
    Steve Lhomme authored
    RGB32 with the same mask as XRGB ends up using a the wrong mask.
    In both case the mask is 0xff0000/0x00ff00/0x0000ff and needs to go
    through hton32.
    
    RGB32 with default mask encoded as BI_BITFIELDS correctly play in the Windows player
    after this patch.
    6bf7babd
  • Steve Lhomme's avatar
    bitmapinfoheader: fix RGB16 mask comment · 050937a0
    Steve Lhomme authored
    When patching mock with the following code and forcing BI_RGB, to not use
    any mask, the Windows player render Blue, Green, Red planes in that order.
    The 16-bit color values have to be written as Little-Endian (SetWLE).
    
        int bars = __MAX(3, pic->p[0].i_pixel_pitch);
        uint8_t colors[4];
        unsigned lines_per_color = pic->p[0].i_visible_lines / bars;
        for (int bar = 0; bar < bars; bar++)
        {
            memset(colors, 0, sizeof(colors));
            if (pic->p[0].i_pixel_pitch == 2)
            {
                if (bar == 0)
                    SetWLE(colors, 0x1F << 11);
                else if (bar == 1)
                    SetWLE(colors, 0x3F << 5);
                else if (bar == 2)
                    SetWLE(colors, 0x1F << 0);
            }
    
            for (unsigned y=bar*lines_per_color; y < (bar+1)*lines_per_color; y++)
                for (int x=0; x < pic->p[0].i_visible_pitch; x += pic->p[0].i_pixel_pitch)
                {
                    memcpy(&pic->p[0].p_pixels[x + y*pic->p[0].i_pitch], colors, pic->p[0].i_pixel_pitch);
                }
        }
        memset(pic->p[0].p_pixels, pixel, block_len);
    050937a0
  • Steve Lhomme's avatar
    bitmapinfoheader: fix RGB15 mask comment · 177bff83
    Steve Lhomme authored
    When patching mock with the following code and forcing BI_RGB, to not use
    any mask, the Windows player render Blue, Green, Red planes in that order.
    The 16-bit color values have to be written as Little-Endian (SetWLE).
    
        int bars = __MAX(3, pic->p[0].i_pixel_pitch);
        uint8_t colors[4];
        unsigned lines_per_color = pic->p[0].i_visible_lines / bars;
        for (int bar = 0; bar < bars; bar++)
        {
            memset(colors, 0, sizeof(colors));
            if (pic->p[0].i_pixel_pitch == 2)
            {
                if (bar == 0)
                    SetWLE(colors, 0x1F << 10);
                else if (bar == 1)
                    SetWLE(colors, 0x1F << 5);
                else if (bar == 2)
                    SetWLE(colors, 0x1F << 0);
            }
    
            for (unsigned y=bar*lines_per_color; y < (bar+1)*lines_per_color; y++)
                for (int x=0; x < pic->p[0].i_visible_pitch; x += pic->p[0].i_pixel_pitch)
                {
                    memcpy(&pic->p[0].p_pixels[x + y*pic->p[0].i_pitch], colors, pic->p[0].i_pixel_pitch);
                }
        }
        memset(pic->p[0].p_pixels, pixel, block_len);
    177bff83
  • Steve Lhomme's avatar
    bitmapinfoheader: fix 15/16-bit mask usage · 6bab8418
    Steve Lhomme authored
    When using BI_BITFIELD with the data written as R5G5B5LE/B5G6R5LE the only
    mask accepted by the Windows player is our default mask passed through hton32.
    6bab8418
  • Steve Lhomme's avatar
    bitmapinfoheader: always apply hton32 on the RGB masks · 4ae5f3ed
    Steve Lhomme authored
    BI_BITFIELDS can only be used with 32-bit and 16-bit RGB. So it's always
    applied anyway.
    4ae5f3ed
  • Steve Lhomme's avatar
    bitmapinfoheader: fix double hton32 swap on masks · 7028356f
    Steve Lhomme authored
    We do a first hton32 on the mask and then SetDWBE does it again.
    What we really want is to store the mask as Little-Endian. This is also coherent
    with the GetDWLE() used for reading the masks in ParseBitmapInfoHeader().
    
    The corresponds to the 3 colors in extra data after the VLC_BITMAPINFOHEADER
    for BI_BITFIELD [1]:
    
    > If biCompression equals BI_BITFIELDS, the bitmap uses three DWORD color
    > masks (red, green, and blue, respectively), which specify the byte layout
    > of the pixels. The 1 bits in each mask indicate the bits for that color
    > within the pixel.
    
    The "bitmap" being the data after the "bitmap header".
    
    [1] https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader
    7028356f
  • Steve Lhomme's avatar
    vlc_es: add a function to get the mask for RGB chromas · d50370ee
    Steve Lhomme authored
    Even if we don't keep masks internally, some system still need to
    set RGB(A) masks. We can handle all our RGB chroma as we know
    the proper component position.
    d50370ee
  • Steve Lhomme's avatar
......@@ -783,4 +783,71 @@ vlc_es_id_GetStrId(vlc_es_id_t *id);
VLC_API enum es_format_category_e
vlc_es_id_GetCat(vlc_es_id_t *id);
/**
* Get the native endianness mask for a RGB fourcc
*
* @note the alpha mask is 0 when the chroma doesn't contain an alpha component.
*
* @return VLC_SUCCESS if the mask values were filled
*/
static inline int vlc_RGBChromaToMask( vlc_fourcc_t fcc, uint32_t *rmask,
uint32_t *gmask, uint32_t *bmask,
uint32_t *amask )
{
switch(fcc)
{
case VLC_CODEC_BGRA:
*bmask = 0xff000000;
*gmask = 0x00ff0000;
*rmask = 0x0000ff00;
*amask = 0x000000ff;
break;
case VLC_CODEC_BGRX:
*bmask = 0xff000000;
*gmask = 0x00ff0000;
*rmask = 0x0000ff00;
*amask = 0;
break;
case VLC_CODEC_RGBA:
*rmask = 0xff000000;
*gmask = 0x00ff0000;
*bmask = 0x0000ff00;
*amask = 0x000000ff;
break;
case VLC_CODEC_RGBX:
*rmask = 0xff000000;
*gmask = 0x00ff0000;
*bmask = 0x0000ff00;
*amask = 0;
break;
case VLC_CODEC_ABGR:
*amask = 0xff000000;
*bmask = 0x00ff0000;
*gmask = 0x0000ff00;
*rmask = 0x000000ff;
break;
case VLC_CODEC_XBGR:
*amask = 0;
*bmask = 0x00ff0000;
*gmask = 0x0000ff00;
*rmask = 0x000000ff;
break;
case VLC_CODEC_ARGB:
*amask = 0xff000000;
*rmask = 0x00ff0000;
*gmask = 0x0000ff00;
*bmask = 0x000000ff;
break;
case VLC_CODEC_XRGB:
*amask = 0;
*rmask = 0x00ff0000;
*gmask = 0x0000ff00;
*bmask = 0x000000ff;
break;
default:
return VLC_EINVAL;
}
return VLC_SUCCESS;
}
#endif
......@@ -44,18 +44,18 @@ static const struct
vlc_fourcc_t codec;
uint32_t i_rmask, i_gmask, i_bmask;
} bitmap_rgb_masks[] = {
{ VLC_CODEC_RGB15, 0x7c00, /* R5G5B5 */
{ VLC_CODEC_RGB15, 0x7c00, /* FIXME it should be B5G5R5LE */
0x03e0,
0x001f, },
{ VLC_CODEC_RGB16, 0xf800, /* R5G6B5 */
{ VLC_CODEC_RGB16, 0xf800, /* FIXME it should be B5G6R5LE */
0x07e0,
0x001f, },
{ VLC_CODEC_RGB24, 0x000000ff, /* BGR (see biBitCount) */
0x0000ff00,
0x00ff0000, },
{ VLC_CODEC_RGB32, 0x0000ff00, /* This is in BGR0 format */
0x00ff0000,
0xff000000U, },
{ VLC_CODEC_RGB32, 0x00ff0000, /* This is in XRGB format */
0x0000ff00,
0x000000ff, },
};
static inline void SetBitmapRGBMasks( vlc_fourcc_t i_fourcc, video_format_t *fmt )
......@@ -252,23 +252,23 @@ static inline VLC_BITMAPINFOHEADER * CreateBitmapInfoHeader( const es_format_t *
size_t *pi_total )
{
uint16_t biBitCount = 0;
uint32_t biCompression = 0;
uint32_t biCompression = BI_RGB;
bool b_has_alpha = false;
switch( fmt->i_codec )
{
case VLC_CODEC_BGRX:
case VLC_CODEC_XRGB:
biBitCount = 32;
biCompression = BI_RGB;
break;
case VLC_CODEC_BGRX:
case VLC_CODEC_XBGR:
case VLC_CODEC_XRGB:
case VLC_CODEC_RGBX:
biBitCount = 32;
biCompression = BI_BITFIELDS;
break;
case VLC_CODEC_RGB32:
biBitCount = 32;
biCompression = MatchBitmapRGBMasks( fmt ) ? BI_RGB : BI_BITFIELDS;
if ( !MatchBitmapRGBMasks( fmt ) )
biCompression = BI_BITFIELDS;
break;
case VLC_CODEC_BGRA:
case VLC_CODEC_RGBA:
......@@ -280,7 +280,6 @@ static inline VLC_BITMAPINFOHEADER * CreateBitmapInfoHeader( const es_format_t *
break;
case VLC_CODEC_RGB24:
biBitCount = 24;
biCompression = BI_RGB;
break;
case VLC_CODEC_RGB16:
case VLC_CODEC_RGB15:
......@@ -290,7 +289,6 @@ static inline VLC_BITMAPINFOHEADER * CreateBitmapInfoHeader( const es_format_t *
case VLC_CODEC_RGBP:
case VLC_CODEC_GREY:
biBitCount = 8;
biCompression = BI_RGB;
break;
case VLC_CODEC_MP4V:
biCompression = VLC_FOURCC( 'X', 'V', 'I', 'D' );
......@@ -320,44 +318,21 @@ static inline VLC_BITMAPINFOHEADER * CreateBitmapInfoHeader( const es_format_t *
p_bih->biClrUsed = 0;
if( biCompression == BI_BITFIELDS )
{
uint32_t i_rmask,i_gmask,i_bmask;
switch( fmt->i_codec )
uint32_t i_rmask,i_gmask,i_bmask, i_amask;
int ret = vlc_RGBChromaToMask( fmt->i_codec, &i_rmask, &i_gmask,
&i_bmask, &i_amask );
if (ret != VLC_SUCCESS)
{
case VLC_CODEC_ABGR:
case VLC_CODEC_XBGR:
i_rmask = hton32(0x000000ff);
i_gmask = hton32(0x0000ff00);
i_bmask = hton32(0x00ff0000);
break;
case VLC_CODEC_ARGB:
case VLC_CODEC_XRGB:
i_rmask = hton32(0x00ff0000);
i_gmask = hton32(0x0000ff00);
i_bmask = hton32(0x000000ff);
break;
case VLC_CODEC_RGBA:
case VLC_CODEC_RGBX:
i_rmask = hton32(0xff000000);
i_gmask = hton32(0x00ff0000);
i_bmask = hton32(0x0000ff00);
break;
case VLC_CODEC_BGRA:
i_rmask = hton32(0x0000ff00);
i_gmask = hton32(0x00ff0000);
i_bmask = hton32(0xff000000);
break;
default:
i_rmask = fmt->video.i_rmask;
i_gmask = fmt->video.i_gmask;
i_bmask = fmt->video.i_bmask;
break;
i_rmask = fmt->video.i_rmask;
i_gmask = fmt->video.i_gmask;
i_bmask = fmt->video.i_bmask;
}
SetDWBE( &p_bmiColors[0], i_rmask );
SetDWBE( &p_bmiColors[4], i_gmask );
SetDWBE( &p_bmiColors[8], i_bmask );
SetDWLE( &p_bmiColors[0], i_rmask );
SetDWLE( &p_bmiColors[4], i_gmask );
SetDWLE( &p_bmiColors[8], i_bmask );
if( b_has_alpha )
{
SetDWBE( &p_bmiColors[12], ~(i_rmask | i_gmask | i_bmask) );
SetDWLE( &p_bmiColors[12], i_amask );
}
}
else if( fmt->i_codec == VLC_CODEC_RGBP )
......