Changeset 1249

Show
Ignore:
Timestamp:
01/18/10 20:51:31 (2 months ago)
Author:
astrange
Message:

Fix compilation with ffmpeg trunk.

Two patches no longer apply, but are fixed upstream or
aren't important to need updating.

PIX_FMT_RGB32 is no longer visible outside ffmpeg.
We could include its config.h but this is actually
more correct already.

Not properly tested, Huffyuv on PPC might display wrong.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ColorConversions.c

    r1246 r1249  
    340340} 
    341341 
    342 //Native-endian XRGB32 to big-endian XRGB32 
    343 static FASTCALL void RGB32toRGB32(AVFrame *picture, UInt8 *baseAddr, int rowBytes, unsigned width, unsigned height) 
     342//Little-endian XRGB32 to big-endian XRGB32 
     343static FASTCALL void RGB32toRGB32Swap(AVFrame *picture, UInt8 *baseAddr, int rowBytes, unsigned width, unsigned height) 
    344344{ 
    345345        UInt8 *srcPtr = picture->data[0]; 
     
    348348 
    349349        for (y = 0; y < height; y++) { 
    350 #ifdef __BIG_ENDIAN__ 
    351                 memcpy(baseAddr, srcPtr, width * 4); 
    352 #else 
    353350                UInt32 *oRow = (UInt32 *)baseAddr, *iRow = (UInt32 *)srcPtr; 
    354351                int x; 
    355                 for (x = 0; x < width; x++) {oRow[x] = EndianU32_NtoB(iRow[x]);} 
    356 #endif 
     352                for (x = 0; x < width; x++) {oRow[x] = EndianU32_LtoB(iRow[x]);} 
     353                 
     354                baseAddr += rowBytes; 
     355                srcPtr += srcRB; 
     356        } 
     357
     358 
     359//Big-endian XRGB32 to big-endian XRGB32 
     360static FASTCALL void RGB32toRGB32Copy(AVFrame *picture, UInt8 *baseAddr, int rowBytes, unsigned width, unsigned height) 
     361
     362        UInt8 *srcPtr = picture->data[0]; 
     363        int srcRB = picture->linesize[0]; 
     364        int y; 
     365         
     366        for (y = 0; y < height; y++) { 
     367                memcpy(baseAddr, srcPtr, width * 4); 
    357368                 
    358369                baseAddr += rowBytes; 
     
    517528                case PIX_FMT_RGB24: 
    518529                        return k24RGBPixelFormat; 
    519                 case PIX_FMT_RGB32: // FIXME: not a specific pixel format, need LE & BE like 16-bit 
     530                case PIX_FMT_ARGB: 
     531                case PIX_FMT_BGRA: 
    520532                        return k32ARGBPixelFormat; 
    521533                case PIX_FMT_YUV410P: 
     
    557569                        funcs->convert = BGR24toRGB24; 
    558570                        break; 
    559                 case PIX_FMT_RGB32
     571                case PIX_FMT_ARGB
    560572                        funcs->clear = ClearRGB32; 
    561                         funcs->convert = RGB32toRGB32; 
     573#ifdef __ppc__ 
     574                        funcs->convert = RGB32toRGB32Swap; 
     575#else 
     576                        funcs->convert = RGB32toRGB32Copy; 
     577#endif 
     578                        break; 
     579                case PIX_FMT_BGRA: 
     580                        funcs->clear = ClearRGB32; 
     581#ifdef __ppc__ 
     582                        funcs->convert = RGB32toRGB32Copy; 
     583#else 
     584                        funcs->convert = RGB32toRGB32Swap; 
     585#endif 
    562586                        break; 
    563587                case PIX_FMT_RGB24: 
  • trunk/createStaticLibs.sh

    r1222 r1249  
    7575        fi 
    7676 
    77         patch -p0 < Patches/ffmpeg-forceinline.diff 
    7877        patch -p0 < Patches/ffmpeg-no-interlaced.diff 
    7978        patch -p0 < Patches/ffmpeg-faltivec.diff 
    8079        patch -p0 < Patches/ffmpeg-no-h264-warning.diff 
    8180        patch -p0 < Patches/ffmpeg-hardcode-dsputil.diff 
    82         patch -p0 < Patches/ffmpeg-bgr24-huffyuv.diff 
    8381        patch -p0 < Patches/ffmpeg-revert-r20347.diff 
    8482        touch ffmpeg/patched