gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/NetStream.cpp serv...


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog server/asobj/NetStream.cpp serv...
Date: Wed, 16 May 2007 17:50:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Tomas Groth <tgc>       07/05/16 17:50:03

Modified files:
        .              : ChangeLog 
        server/asobj   : NetStream.cpp NetStream.h NetStreamFfmpeg.cpp 
                         NetStreamGst.cpp NetStreamGst.h 

Log message:
        Updated documentation.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3243&r2=1.3244
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStream.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStream.h?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.cpp?cvsroot=gnash&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.h?cvsroot=gnash&r1=1.21&r2=1.22

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3243
retrieving revision 1.3244
diff -u -b -r1.3243 -r1.3244
--- ChangeLog   16 May 2007 17:38:22 -0000      1.3243
+++ ChangeLog   16 May 2007 17:50:02 -0000      1.3244
@@ -1,3 +1,8 @@
+2007-05-16 Tomas Groth Christensen <address@hidden>
+
+       * server/asobj/NetStream.{h,cpp}, 
+         server/asobj/NetStream{Gst,Ffmpeg}.{h,cpp}: Updated documentation.
+
 2007-05-16 Sandro Santilli <address@hidden>
 
        * libbase/FLVParser.h: class documentation.

Index: server/asobj/NetStream.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStream.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/asobj/NetStream.cpp  15 May 2007 16:41:37 -0000      1.46
+++ server/asobj/NetStream.cpp  16 May 2007 17:50:03 -0000      1.47
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStream.cpp,v 1.46 2007/05/15 16:41:37 strk Exp $ */
+/* $Id: NetStream.cpp,v 1.47 2007/05/16 17:50:03 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -64,7 +64,7 @@
        as_object(getNetStreamInterface()),
        _netCon(NULL),
        m_env(NULL),
-       m_bufferTime(100),
+       m_bufferTime(100), // The default size needed to begin playback of 
media is 1000 miliseconds
        m_videoFrameFormat(gnash::render::videoFrameFormat()),
        m_newFrameReady(false),
        m_go(false),
@@ -178,7 +178,7 @@
        double time = 0;
        if (fn.nargs > 0)
        {
-               time = fn.arg(0).to_number(&fn.env());
+               time = static_cast<uint32_t>(fn.arg(0).to_number(&fn.env()));
        }
        ns->setBufferTime(time);
 
@@ -503,10 +503,10 @@
 }
 
 void
-NetStream::setBufferTime(double time)
+NetStream::setBufferTime(uint32_t time)
 {
        // The argument is in seconds, but we store in milliseconds
-    m_bufferTime = static_cast<uint32_t>(time*1000);
+    m_bufferTime = time*1000;
 }
 
 uint32_t

Index: server/asobj/NetStream.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStream.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/asobj/NetStream.h    15 May 2007 13:01:27 -0000      1.31
+++ server/asobj/NetStream.h    16 May 2007 17:50:03 -0000      1.32
@@ -18,7 +18,7 @@
 //
 //
 
-/*  $Id: NetStream.h,v 1.31 2007/05/15 13:01:27 tgc Exp $ */
+/*  $Id: NetStream.h,v 1.32 2007/05/16 17:50:03 tgc Exp $ */
 
 #ifndef __NETSTREAM_H__
 #define __NETSTREAM_H__
@@ -141,7 +141,10 @@
        // The handler which is invoked on status change
        boost::intrusive_ptr<as_function> m_statusHandler;
 
-       // should we start when buffer is full?
+       // should we start when the FLVParser has buffered/parsed enough frames,
+       // so that the differens between the current frames timestamp (0 at the 
+       // beginning) and the last parseable frames timestamp i bigger than 
+       // m_bufferTime.
        bool m_start_onbuffer;
 
        // The position in the inputfile, only used when not playing a FLV
@@ -181,16 +184,22 @@
                return m_go;
        }
 
-       void setBufferTime(double time);
+       /// Specifies how long to buffer data before starting to display the 
stream.
+       void setBufferTime(uint32_t time);
 
+       /// Returns what the buffer has been set to. (100 miliseconds is 
default)
        uint32_t bufferTime();
 
+       /// Returns the number of bytes loaded of the media file
        long bytesLoaded();
 
+       /// Returns the total number of bytes (size) of the media file
        long bytesTotal();
 
+       /// Tells us if there is a new video frame ready
        bool newFrameReady();
 
+       /// Returns the newest video frame
        image::image_base* get_video();
 
 private:

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- server/asobj/NetStreamFfmpeg.cpp    15 May 2007 16:31:03 -0000      1.51
+++ server/asobj/NetStreamFfmpeg.cpp    16 May 2007 17:50:03 -0000      1.52
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamFfmpeg.cpp,v 1.51 2007/05/15 16:31:03 rsavoye Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.52 2007/05/16 17:50:03 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -999,7 +999,12 @@
 void
 NetStreamFfmpeg::advance()
 {
-       // Check if we should start the playback when a certain amount is 
buffered
+       // This can happen in 2 cases: 
+       // 1) When playback has just started and we've been waiting for the 
buffer 
+       //    to be filled (buffersize set by setBufferTime() and default is 100
+       //    miliseconds).
+       // 2) The buffer has be "starved" (not being filled as quickly as 
needed),
+       //    and we then wait until the buffer contains some data (1 sec) 
again.
        if (m_go && m_pause && m_start_onbuffer && m_parser && 
m_parser->isTimeLoaded(m_bufferTime)) {
                setStatus(bufferFull);
                m_pause = false;

Index: server/asobj/NetStreamGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/asobj/NetStreamGst.cpp       16 May 2007 16:37:26 -0000      1.44
+++ server/asobj/NetStreamGst.cpp       16 May 2007 17:50:03 -0000      1.45
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamGst.cpp,v 1.44 2007/05/16 16:37:26 tgc Exp $ */
+/* $Id: NetStreamGst.cpp,v 1.45 2007/05/16 17:50:03 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -384,12 +384,12 @@
 
 
 bool
-NetStreamGst::buildFLVVideoPipeline(bool* video)
+NetStreamGst::buildFLVVideoPipeline(bool &video)
 {
        log_debug("Building FLV decoding pipeline");
        FLVVideoInfo* videoInfo = m_parser->getVideoInfo();
 
-       bool doVideo = *video;
+       bool doVideo = video;
 
        if (videoInfo) {
                doVideo = true;
@@ -483,16 +483,16 @@
                g_object_set (G_OBJECT (videoinputcaps), "caps", videonincaps, 
NULL);
                gst_caps_unref (videonincaps);
        }
-       *video = doVideo;
+       video = doVideo;
 
        return true;
 
 }
 
 bool
-NetStreamGst::buildFLVSoundPipeline(bool* sound)
+NetStreamGst::buildFLVSoundPipeline(bool &sound)
 {
-       bool doSound = *sound;
+       bool doSound = sound;
 
        FLVAudioInfo* audioInfo = m_parser->getAudioInfo();
        if (!audioInfo) doSound = false;
@@ -553,7 +553,7 @@
                }
        }
 
-       *sound = doSound;
+       sound = doSound;
 
        return true;
 }
@@ -640,11 +640,11 @@
        
        // Setup the decoder and source
        if (m_isFLV) {
-               if (!buildFLVVideoPipeline(&video)) {
+               if (!buildFLVVideoPipeline(video)) {
                        unrefElements();
                        return;
                }
-               if (sound && !buildFLVSoundPipeline(&sound)) {
+               if (sound && !buildFLVSoundPipeline(sound)) {
                        unrefElements();
                        return;
                }
@@ -829,6 +829,12 @@
 NetStreamGst::advance()
 {
        // Check if we should start the playback when a certain amount is 
buffered
+       // This can happen in 2 cases: 
+       // 1) When playback has just started and we've been waiting for the 
buffer 
+       //    to be filled (buffersize set by setBufferTime() and default is 100
+       //    miliseconds).
+       // 2) The buffer has be "starved" (not being filled as quickly as 
needed),
+       //    and we then wait until the buffer contains some data (1 sec) 
again.
        if (m_isFLV && m_pause && m_go && m_start_onbuffer && m_parser && 
m_parser->isTimeLoaded(m_bufferTime))
        {
                if ( ! playPipeline() )

Index: server/asobj/NetStreamGst.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/asobj/NetStreamGst.h 16 May 2007 16:37:27 -0000      1.21
+++ server/asobj/NetStreamGst.h 16 May 2007 17:50:03 -0000      1.22
@@ -14,7 +14,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: NetStreamGst.h,v 1.21 2007/05/16 16:37:27 tgc Exp $ */
+/* $Id: NetStreamGst.h,v 1.22 2007/05/16 17:50:03 tgc Exp $ */
 
 #ifndef __NETSTREAMGST_H__
 #define __NETSTREAMGST_H__
@@ -74,13 +74,21 @@
        //
        /// @return true on success, false on failure
        ///
-       bool buildFLVSoundPipeline(bool* sound);
+       /// @param sound
+       ///     Determines if sound should be setup. It is passed by reference 
+       /// and might be changed.
+       ///
+       bool buildFLVSoundPipeline(bool &sound);
 
        /// Creates the video decoder and source element for playing FLVs
        //
        /// @return true on success, false on failure
        ///
-       bool buildFLVVideoPipeline(bool* video);
+       /// @param video
+       ///     Determines if video should be setup. It is passed by reference 
+       /// and might be changed.
+       ///
+       bool buildFLVVideoPipeline(bool &video);
 
        /// Creates the decoder and source element for playing non-FLVs
        //




reply via email to

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