Home | History | Annotate | Download | only in patches
      1 --- pwlib-1.10.4/include/ptbuildopts.h.in.ori	2007-03-09 22:33:33.765601000 +0800
      2 +++ pwlib-1.10.4/include/ptbuildopts.h.in	2007-03-12 20:13:12.301453000 +0800
      3 @@ -533,6 +533,8 @@
      4  #undef P_HTTP
      5  #undef P_CONFIG_FILE
      6  
      7 +#undef P_MEDIALIB
      8 +
      9  /////////////////////////////////////////////////
     10  //
     11  // PThreads and related vars
     12 --- pwlib-1.10.4/src/ptlib/common/vconvert.cxx.ori	2007-03-09 22:34:32.222001000 +0800
     13 +++ pwlib-1.10.4/src/ptlib/common/vconvert.cxx	2007-03-12 20:26:37.823674000 +0800
     14 @@ -258,6 +258,10 @@
     15  #include "tinyjpeg.h"
     16  #endif
     17  
     18 +#ifdef P_MEDIALIB
     19 +#include <mlib.h>
     20 +#endif
     21 +
     22  static PColourConverterRegistration * RegisteredColourConvertersListHead = NULL;
     23  
     24  PSYNONYM_COLOUR_CONVERTER(SBGGR8, SBGGR8);
     25 @@ -1579,6 +1583,26 @@
     26    const BYTE    *uplane    = yplane+nbytes;                // 1 byte U for a block of 4 pixels
     27    const BYTE    *vplane    = uplane+(nbytes/4);            // 1 byte V for a block of 4 pixels
     28  
     29 +#ifdef P_MEDIALIB
     30 +  const BYTE *y0;
     31 +  const BYTE *y1;
     32 +  const BYTE *cb;
     33 +  const BYTE *cr;
     34 +  unsigned int   x,p;
     35 +
     36 +  for(int i = 0; i < srcFrameHeight; i += 2) {
     37 +    p = i*srcFrameWidth;
     38 +    x = p/4;
     39 +    y0 = yplane + p;
     40 +    y1 = y0 + srcFrameWidth;
     41 +    cb = uplane + x;
     42 +    cr = vplane + x;
     43 +    mlib_VideoColorJFIFYCC2RGB420_Nearest(dstFrameBuffer,
     44 +      dstFrameBuffer+3*dstFrameWidth, y0, y1, cb, cr,
     45 +      srcFrameWidth);
     46 +    dstFrameBuffer += 6*dstFrameWidth;
     47 +  }
     48 +#else
     49    unsigned int   pixpos[4] = {0, 1, srcFrameWidth, srcFrameWidth + 1};
     50    unsigned int   originalPixpos[4] = {0, 1, srcFrameWidth, srcFrameWidth + 1};
     51  
     52 @@ -1644,6 +1668,7 @@
     53  
     54    if (bytesReturned != NULL)
     55      *bytesReturned = dstFrameBytes;
     56 +#endif  
     57  
     58    return TRUE;
     59  }
     60 --- pwlib-1.10.4/configure.ac.ori	2007-03-09 22:39:46.224978000 +0800
     61 +++ pwlib-1.10.4/configure.ac	2007-03-12 23:20:33.615060000 +0800
     62 @@ -1012,6 +1012,16 @@
     63  AC_SUBST(HAS_SASL2)
     64  
     65  dnl ########################################################################
     66 +dnl check for mediaLib library
     67 +
     68 +HAS_MEDIALIB=no
     69 +AC_CHECK_LIB(mlib, mlib_VideoColorJFIFYCC2RGB420_Nearest, HAS_MEDIALIB=yes, HAS_MEDIALIB=no)
     70 +if test $HAS_MEDIALIB = yes; then
     71 +    AC_DEFINE(P_MEDIALIB)
     72 +    ENDLDLIBS="-lmlib $ENDLDLIBS"
     73 +fi
     74 +
     75 +dnl ########################################################################
     76  dnl look for OpenLDAP (requires SASL)
     77  
     78  dnl MSWIN_DISPLAY    openldap,Open LDAP
     79