gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg...


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg...
Date: Fri, 08 Jun 2007 18:10:33 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Tomas Groth <tgc>       07/06/08 18:10:32

Modified files:
        .              : ChangeLog 
        libbase        : embedVideoDecoderFfmpeg.cpp 

Log message:
                * libbase/embedVideoDecoderFfmpeg.cpp: Changed the image 
copying,
                  and check if the decoded videoframe is bigger than expected.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3499&r2=1.3500
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.cpp?cvsroot=gnash&r1=1.16&r2=1.17

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3499
retrieving revision 1.3500
diff -u -b -r1.3499 -r1.3500
--- ChangeLog   8 Jun 2007 14:57:41 -0000       1.3499
+++ ChangeLog   8 Jun 2007 18:10:32 -0000       1.3500
@@ -4,6 +4,9 @@
          loop/thread until the queues are empty, or the media left
          in the queues wont get played.
        * server/movie_root.cpp: Include action.h, not Action.h.
+       * libbase/embedVideoDecoderFfmpeg.cpp: Changed the image copying,
+         and check if the decoded videoframe is bigger than expected.
+
 
 2007-06-08 Zou Lunkai <address@hidden>
 

Index: libbase/embedVideoDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- libbase/embedVideoDecoderFfmpeg.cpp 7 Jun 2007 22:13:47 -0000       1.16
+++ libbase/embedVideoDecoderFfmpeg.cpp 8 Jun 2007 18:10:32 -0000       1.17
@@ -174,6 +174,22 @@
        int got = 0;
        avcodec_decode_video(cc, frame, &got, data, size);
 
+       // If the size of the video frame changed, adjust.
+       // This could happen if the decoded video frame is
+       // bigger than the defined SWF videoframe.
+       if (cc->width != width || cc->height != height) {
+               width = cc->width;
+               height = cc->height;
+               delete decodedFrame;
+               if (outputFormat == YUV) {
+                       decodedFrame = new image::yuv(width, height);
+                       ret_image.reset(new image::yuv(width, height));
+               } else if (outputFormat == RGB) {
+                       decodedFrame = new image::rgb(width, height);
+                       ret_image.reset(new image::rgb(width, height));
+               }
+       }
+       
        if (got) {
                boost::scoped_array<uint8_t> buffer;
 
@@ -212,13 +228,18 @@
                        }
                        yuvframe->m_size = copied;
                } else if (outputFormat == RGB) {
-                       for(int line = 0; line < cc->height; line++)
-                       {
-                               for(int byte = 0; byte < (cc->width*3); byte++)
-                               {
-                                       decodedFrame->m_data[byte + 
(line*cc->width*3)] = (unsigned char) 
*(frame->data[0]+(line*frame->linesize[0])+byte);
-                               }
+
+                       uint8_t* srcptr = frame->data[0];
+                       uint8_t* srcend = frame->data[0] + frame->linesize[0] * 
cc->height;
+                       uint8_t* dstptr = decodedFrame->m_data;
+                       unsigned int srcwidth = cc->width * 3;
+
+                       while (srcptr < srcend) {
+                               memcpy(dstptr, srcptr, srcwidth);
+                               srcptr += frame->linesize[0];
+                               dstptr += srcwidth;
                        }
+
                }
        }
 




reply via email to

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