gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog macros/ffmpeg.m4 libbase/embedV...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog macros/ffmpeg.m4 libbase/embedV...
Date: Thu, 31 May 2007 21:18:21 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/05/31 21:18:20

Modified files:
        .              : ChangeLog 
        macros         : ffmpeg.m4 
        libbase        : embedVideoDecoderFfmpeg.cpp 

Log message:
        * macros/ffmpeg.m4: Define HAVE_SWSCALE_H if swscale.h is present.      
  
        * libbase/embedVideoDecoderFfmpeg.cpp: If swscale.h is available,
          use swscale and friends. Otherwise, default to img_convert.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3428&r2=1.3429
http://cvs.savannah.gnu.org/viewcvs/gnash/macros/ffmpeg.m4?cvsroot=gnash&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.cpp?cvsroot=gnash&r1=1.11&r2=1.12

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3428
retrieving revision 1.3429
diff -u -b -r1.3428 -r1.3429
--- ChangeLog   31 May 2007 16:44:56 -0000      1.3428
+++ ChangeLog   31 May 2007 21:18:19 -0000      1.3429
@@ -1,3 +1,9 @@
+2007-05-31 Bastiaan Jacques <address@hidden>
+
+       * macros/ffmpeg.m4: Define HAVE_SWSCALE_H if swscale.h is present.
+       * libbase/embedVideoDecoderFfmpeg.cpp: If swscale.h is available,
+       use swscale and friends. Otherwise, default to img_convert.
+
 2007-05-31 Sandro Santilli <address@hidden>
 
        * backend/sound_handler.h: document attach_aux_streamer and

Index: macros/ffmpeg.m4
===================================================================
RCS file: /sources/gnash/gnash/macros/ffmpeg.m4,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- macros/ffmpeg.m4    18 May 2007 19:39:19 -0000      1.41
+++ macros/ffmpeg.m4    31 May 2007 21:18:20 -0000      1.42
@@ -14,7 +14,7 @@
 dnl  along with this program; if not, write to the Free Software
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-dnl $Id: ffmpeg.m4,v 1.41 2007/05/18 19:39:19 martinwguy Exp $
+dnl $Id: ffmpeg.m4,v 1.42 2007/05/31 21:18:20 bjacques Exp $
 
 AC_DEFUN([GNASH_PATH_FFMPEG],
 [
@@ -132,6 +132,13 @@
     FFMPEG_CFLAGS=""
   fi
 
+  if test x"$avcodec_h" != x; then
+    swscale_h="`dirname $avcodec_h`/swscale.h"
+    if test -f "$swscale_h"; then
+      AC_DEFINE(HAVE_SWSCALE_H, 1, [Define if swscale.h is found])
+    fi
+  fi
+
   dnl Look for the library
   AC_ARG_WITH(ffmpeg_lib, AC_HELP_STRING([--with-ffmpeg-lib], [directory where 
ffmpeg libraries are]), with_ffmpeg_lib=${withval})
   AC_CACHE_VAL(ac_cv_path_ffmpeg_lib, [

Index: libbase/embedVideoDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- libbase/embedVideoDecoderFfmpeg.cpp 31 May 2007 09:19:31 -0000      1.11
+++ libbase/embedVideoDecoderFfmpeg.cpp 31 May 2007 21:18:20 -0000      1.12
@@ -90,18 +90,8 @@
 uint8_t*
 embedVideoDecoderFfmpeg::convertRGB24(AVCodecContext* srcCtx, AVFrame* 
srcFrame)
 {
-       static SwsContext* context = NULL;
        int width = srcCtx->width, height = srcCtx->height;
 
-       if (!context) {
-               context = sws_getContext(width, height, srcCtx->pix_fmt,
-                                        width, height, PIX_FMT_RGB24,
-                                        SWS_FAST_BILINEAR, NULL, NULL, NULL);
-               if (!context) {
-                       return NULL;
-               }
-       }
-
        int bufsize = avpicture_get_size(PIX_FMT_RGB24, width, height);
        if (bufsize == -1) {
                return NULL;
@@ -115,7 +105,21 @@
        AVPicture picture;
 
        avpicture_fill(&picture, buffer, PIX_FMT_RGB24, width, height);
+#ifndef HAVE_SWSCALE_H
+       img_convert(&picture, PIX_FMT_RGB24, (AVPicture*) srcFrame, 
srcCtx->pix_fmt,
+                   width, height);
+#else
+       static SwsContext* context = NULL;
 
+       if (!context) {
+               context = sws_getContext(width, height, srcCtx->pix_fmt,
+                                        width, height, PIX_FMT_RGB24,
+                                        SWS_FAST_BILINEAR, NULL, NULL, NULL);
+               if (!context) {
+                       delete [] buffer;
+                       return NULL;
+               }
+       }
 
        int rv = sws_scale(context, srcFrame->data, srcFrame->linesize, 0, 
                           width, picture.data, picture.linesize);
@@ -124,6 +128,8 @@
                return NULL;
        }
 
+#endif // HAVE_SWSCALE_H
+
        srcFrame->linesize[0] = picture.linesize[0];
        srcFrame->data[0] = picture.data[0];
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]