gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog backend/sound_handler.cpp backe... [relea


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog backend/sound_handler.cpp backe... [release-0-8-0]
Date: Thu, 07 Jun 2007 12:12:36 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         release-0-8-0
Changes by:     Tomas Groth <tgc>       07/06/07 12:12:36

Modified files:
        .              : ChangeLog 
        backend        : sound_handler.cpp sound_handler_gst.cpp 
        libbase        : embedVideoDecoderFfmpeg.cpp 
                         embedVideoDecoderGst.cpp 

Log message:
                * backend/sound_handler.cpp: Fixed a warning.
                * backend/sound_handler_gst.cpp: Small cleanup.
                * libbase/embedVideoDecoder{Ffmpeg, Gst}.cpp: Made more robust,
                  can now handle if render image format is NONE. Should fix bug 
#20111

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.3451.2.28&r2=1.3451.2.29
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/sound_handler.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.7&r2=1.7.4.1
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/sound_handler_gst.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.47&r2=1.47.4.1
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderFfmpeg.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.13.4.1&r2=1.13.4.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderGst.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.4.4.1&r2=1.4.4.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3451.2.28
retrieving revision 1.3451.2.29
diff -u -b -r1.3451.2.28 -r1.3451.2.29
--- ChangeLog   6 Jun 2007 17:46:06 -0000       1.3451.2.28
+++ ChangeLog   7 Jun 2007 12:12:34 -0000       1.3451.2.29
@@ -1,3 +1,10 @@
+2007-06-07 Tomas Groth Christensen <address@hidden>
+
+       * backend/sound_handler.cpp: Fixed a warning.
+       * backend/sound_handler_gst.cpp: Small cleanup.
+       * libbase/embedVideoDecoder{Ffmpeg, Gst}.cpp: Made more robust,
+         can now handle if render image format is NONE. Should fix bug #20111
+
 2007-06-06 Ann Barcomb <address@hidden>
 
        * doc/C/usermanual/bugreport.xml: Changed examples.

Index: backend/sound_handler.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/sound_handler.cpp,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -u -b -r1.7 -r1.7.4.1
--- backend/sound_handler.cpp   28 May 2007 15:40:57 -0000      1.7
+++ backend/sound_handler.cpp   7 Jun 2007 12:12:35 -0000       1.7.4.1
@@ -31,7 +31,7 @@
     int* adjusted_size,
     void* data,
     int sample_count,  // A stereo pair counts as one
-    int sample_size,   // Should now always == 2
+    int /*sample_size*/,       // Should now always == 2
     // sample_rate and stereo are those of the incoming sample
     int sample_rate, 
     bool stereo,
@@ -112,6 +112,7 @@
                in += 2;
            }
        } else {
+
            // Linear upsampling, either to increase a sample rate
            // or to convert a mono file to stereo or both:
            // replicate each sample several times.

Index: backend/sound_handler_gst.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/sound_handler_gst.cpp,v
retrieving revision 1.47
retrieving revision 1.47.4.1
diff -u -b -r1.47 -r1.47.4.1
--- backend/sound_handler_gst.cpp       29 May 2007 17:15:14 -0000      1.47
+++ backend/sound_handler_gst.cpp       7 Jun 2007 12:12:35 -0000       1.47.4.1
@@ -20,7 +20,7 @@
 // Based on sound_handler_sdl.cpp by Thatcher Ulrich http://tulrich.com 2003
 // which has been donated to the Public Domain.
 
-/* $Id: sound_handler_gst.cpp,v 1.47 2007/05/29 17:15:14 strk Exp $ */
+/* $Id: sound_handler_gst.cpp,v 1.47.4.1 2007/06/07 12:12:35 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -381,21 +381,15 @@
                        "channels", G_TYPE_INT, sounddata->stereo ? 2 : 1,
                        "endianness", G_TYPE_INT, G_BIG_ENDIAN,
                        "width", G_TYPE_INT, 16,
+                       "depth", G_TYPE_INT, 16,
                        /*"signed", G_TYPE_INT, 1,*/ NULL);
                g_object_set (G_OBJECT (gst_element->capsfilter), "caps", caps, 
NULL);
                gst_caps_unref (caps);
 
-               // number of buffers to send
-               int numBuf = 
static_cast<int>(ceil(static_cast<float>(sounddata->data_size) / 
static_cast<float>(BUFFER_SIZE)));
-               if (loop_count == -1) {
-                       numBuf = -1;
-               } else if (loop_count > 0) {
-                       numBuf = numBuf * (loop_count+1) -1;
-               }
                // setup fake source
                g_object_set (G_OBJECT (gst_element->input),
                                        "sizetype", 2, "can-activate-pull", 
FALSE, "signal-handoffs", TRUE,
-                                       "sizemax", BUFFER_SIZE, "num-buffers", 
numBuf, NULL);
+                                       "sizemax", BUFFER_SIZE, NULL);
                // Setup the callback
                gst_element->handoff_signal_id = g_signal_connect 
(gst_element->input, "handoff", G_CALLBACK (callback_handoff), gst_element);
 

Index: libbase/embedVideoDecoderFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderFfmpeg.cpp,v
retrieving revision 1.13.4.1
retrieving revision 1.13.4.2
diff -u -b -r1.13.4.1 -r1.13.4.2
--- libbase/embedVideoDecoderFfmpeg.cpp 6 Jun 2007 15:44:13 -0000       1.13.4.1
+++ libbase/embedVideoDecoderFfmpeg.cpp 7 Jun 2007 12:12:35 -0000       1.13.4.2
@@ -148,15 +148,25 @@
 std::auto_ptr<image::image_base> 
 embedVideoDecoderFfmpeg::decodeFrame(uint8_t* data, int size)
 {
+
        std::auto_ptr<image::image_base> ret_image;
 
        if (outputFormat == YUV) {
                ret_image.reset(new image::yuv(width, height));
        } else if (outputFormat == RGB) {
                ret_image.reset(new image::rgb(width, height));
+       } else {
+               ret_image.reset(NULL);
+               return ret_image;
+       }
+
+       // If there is nothing to decode in the new frame
+       // we just return the lastest.
+       if (data == NULL || codec == NULL || size == 0) {
+               ret_image->update(decodedFrame->m_data);
+               return ret_image;
        } 
 
-       if (data == NULL || codec == NULL || size == 0) return ret_image;
 
        // Allocate a frame to store the decoded frame in
        AVFrame* frame = avcodec_alloc_frame();
@@ -169,6 +179,7 @@
 
                if (outputFormat == NONE) { // NullGui?
                        av_free(frame);
+                       ret_image->update(decodedFrame->m_data);
                        return ret_image;
 
                } else if (outputFormat == YUV && cc->pix_fmt != 
PIX_FMT_YUV420P) {
@@ -209,8 +220,6 @@
                                }
                        }
                }
-       } else {
-               return ret_image;
        }
 
        ret_image->update(decodedFrame->m_data);

Index: libbase/embedVideoDecoderGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderGst.cpp,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.2
diff -u -b -r1.4.4.1 -r1.4.4.2
--- libbase/embedVideoDecoderGst.cpp    6 Jun 2007 15:44:13 -0000       1.4.4.1
+++ libbase/embedVideoDecoderGst.cpp    7 Jun 2007 12:12:36 -0000       1.4.4.2
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// $Id: embedVideoDecoderGst.cpp,v 1.4.4.1 2007/06/06 15:44:13 tgc Exp $
+// $Id: embedVideoDecoderGst.cpp,v 1.4.4.2 2007/06/07 12:12:36 tgc Exp $
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -182,9 +182,17 @@
                ret_image.reset(new image::yuv(width, height));
        } else if (outputFormat == RGB) {
                ret_image.reset(new image::rgb(width, height));
+       } else {
+               ret_image.reset(NULL);
+               return ret_image;
        } 
 
-       if (data == NULL || size == 0) return ret_image;
+       // If there is nothing to decode in the new frame
+       // we just return the lastest.
+       if (data == NULL || size == 0 || !decoder) {
+               ret_image->update(decodedFrame->m_data);
+               return ret_image;
+       }
 
        frame = data;
        frameSize = size;
@@ -194,6 +202,7 @@
        output_lock = new boost::mutex::scoped_lock(output_mutex);
 
        ret_image->update(decodedFrame->m_data);
+
        return ret_image;
 }
 




reply via email to

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