[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg... [relea
From: |
Tomas Groth |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderFfmpeg... [release-0-8-0] |
Date: |
Fri, 08 Jun 2007 18:12:25 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch: release-0-8-0
Changes by: Tomas Groth <tgc> 07/06/08 18:12:24
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&only_with_tag=release-0-8-0&r1=1.3451.2.49&r2=1.3451.2.50
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.13.4.3&r2=1.13.4.4
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3451.2.49
retrieving revision 1.3451.2.50
diff -u -b -r1.3451.2.49 -r1.3451.2.50
--- ChangeLog 8 Jun 2007 13:03:45 -0000 1.3451.2.49
+++ ChangeLog 8 Jun 2007 18:12:23 -0000 1.3451.2.50
@@ -5,6 +5,8 @@
* server/asobj/NetStreamFfmpeg.cpp: Don't leave the decoding
loop/thread until the queues are empty, or the media left
in the queues wont get played.
+ * libbase/embedVideoDecoderFfmpeg.cpp: Changed the image copying,
+ and check if the decoded videoframe is bigger than expected.
2007-06-07 Udo Giacomozzi <address@hidden>
Index: libbase/embedVideoDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.cpp,v
retrieving revision 1.13.4.3
retrieving revision 1.13.4.4
diff -u -b -r1.13.4.3 -r1.13.4.4
--- libbase/embedVideoDecoderFfmpeg.cpp 7 Jun 2007 22:15:47 -0000 1.13.4.3
+++ libbase/embedVideoDecoderFfmpeg.cpp 8 Jun 2007 18:12:24 -0000 1.13.4.4
@@ -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;
}
+
}
}