Ticket #336: logframecrc.diff

File logframecrc.diff, 1.6 kB (added by astrange, 7 months ago)

debugging aid (v2)

  • FFusionCodec.c

    old new  
    4141#include "FrameBuffer.h" 
    4242#include "CommonUtils.h" 
    4343#include "pthread.h" 
     44#include "libavutil/adler32.h" 
    4445 
    4546void inline swapFrame(AVFrame * *a, AVFrame * *b) 
    4647{ 
     
    13031304        } 
    13041305        else if (myDrp->pixelFormat == k2vuyPixelFormat && glob->avContext->pix_fmt == PIX_FMT_YUV420P) 
    13051306        { 
     1307                 
     1308                if (glob->fileLog) { 
     1309                        uint32_t crc = av_adler32_update(0, picture->data[0], myDrp->height*picture->linesize[0]); 
     1310                        FFusionDebugPrint("%p Drew frame #%d, drp->buffer %p y buf %p crc %#x\n", glob, myDrp->frameNumber, myDrp->buffer, picture->data[0], crc); 
     1311                } 
    13061312                Y420toY422((UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height, picture); 
    13071313        } 
    13081314        else if (myDrp->pixelFormat == k24RGBPixelFormat && glob->avContext->pix_fmt == PIX_FMT_BGR24) 
     
    16681674    int len = 0; 
    16691675    long availableData = dataProc ? codecMinimumDataSize : kInfiniteDataSize; 
    16701676         
    1671         FFusionDebugPrint("%p Decompress on frame #%d (%d bytes).\n", glob, glob->decode.lastFrame, length); 
     1677        FFusionDebugPrint("%p Decompressing frame - %d bytes.\n", glob, length); 
    16721678    picture->data[0] = 0; 
    16731679         
    16741680    while (!got_picture && length != 0)  
     
    17001706        dataPtr += len; 
    17011707                length -= len; 
    17021708    } 
     1709         
     1710        if (glob->fileLog) { 
     1711                uint32_t crc = av_adler32_update(0, picture->data[0], height*picture->linesize[0]); 
     1712                FFusionDebugPrint("%p Decompressed frame #%d, y buf %p crc %#x\n", glob, glob->decode.lastFrame+1, picture->data[0], crc); 
     1713        } 
     1714         
    17031715    return err; 
    17041716} 
    17051717