gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog gui/Makefile.am gui/NullGui.cpp...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/Makefile.am gui/NullGui.cpp...
Date: Thu, 13 Sep 2007 09:47:33 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/13 09:47:33

Modified files:
        .              : ChangeLog 
        gui            : Makefile.am NullGui.cpp 
        libbase        : Makefile.am triangulate_impl.h 
        server         : timers.h 
        server/asobj   : NetStream.h NetStreamFfmpeg.cpp 
        server/vm      : VM.cpp 
        utilities      : processor.cpp 
Added files:
        libbase        : tu_timer.cpp tu_timer.h 

Log message:
                * gui/Makefile.am, gui/NullGui.cpp, libbase/Makefile.am,
                  libbase/triangulate_impl.h, libbase/tu_timer.cpp,
                  libbase/tu_timer.h, server/timers.h, server/asobj/NetStream.h,
                  server/asobj/NetStreamFfmpeg.cpp, server/vm/VM.cpp,
                  utilities/processor.cpp:
                  Revert Markus changes, as they introduce too many obvious 
failures.
                  Please avoid commits triggering failures on 'make check' and 
do
                  your best to have 'make check' run as many tests as possible.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4299&r2=1.4300
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Makefile.am?cvsroot=gnash&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/NullGui.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/Makefile.am?cvsroot=gnash&r1=1.81&r2=1.82
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/triangulate_impl.h?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_timer.cpp?cvsroot=gnash&rev=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_timer.h?cvsroot=gnash&rev=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/timers.h?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStream.h?cvsroot=gnash&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.91&r2=1.92
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.64&r2=1.65

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4299
retrieving revision 1.4300
diff -u -b -r1.4299 -r1.4300
--- ChangeLog   13 Sep 2007 01:12:18 -0000      1.4299
+++ ChangeLog   13 Sep 2007 09:47:30 -0000      1.4300
@@ -1,3 +1,14 @@
+2007-09-13 Sandro Santilli <address@hidden>
+
+       * gui/Makefile.am, gui/NullGui.cpp, libbase/Makefile.am,
+         libbase/triangulate_impl.h, libbase/tu_timer.cpp,
+         libbase/tu_timer.h, server/timers.h, server/asobj/NetStream.h,
+         server/asobj/NetStreamFfmpeg.cpp, server/vm/VM.cpp,
+         utilities/processor.cpp:
+         Revert Markus changes, as they introduce too many obvious failures.
+         Please avoid commits triggering failures on 'make check' and do
+         your best to have 'make check' run as many tests as possible.
+
 2007-09-13 Markus Gothe <address@hidden>
 
        * gui/NullGui.cpp libbase/Makefile.am libbase/triangulate_impl.h 

Index: gui/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/gui/Makefile.am,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- gui/Makefile.am     13 Sep 2007 01:22:33 -0000      1.105
+++ gui/Makefile.am     13 Sep 2007 09:47:31 -0000      1.106
@@ -109,7 +109,7 @@
 bundle_name = gnash.app
 
 bundle: Info.plist
-       @echo "Building: $(bundle_name)" 
+       @echo " Building: $(bundle_name)" 
        -rm -rf $(bundle_name)/Contents
        mkdir -p $(bundle_name)/Contents/MacOS
        mkdir -p $(bundle_name)/Contents/Resources

Index: gui/NullGui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/NullGui.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- gui/NullGui.cpp     13 Sep 2007 01:12:19 -0000      1.17
+++ gui/NullGui.cpp     13 Sep 2007 09:47:31 -0000      1.18
@@ -32,8 +32,7 @@
 # include <unistd.h> // for usleep
 #endif
 
-#include <boost/timer.hpp>
-using boost::timer;
+#include "tu_timer.h"
 
 namespace gnash
 {
@@ -41,27 +40,27 @@
 bool
 NullGui::run()
 {
-  timer prevtimer;
-  timer start_timer;  // returns milliseconds
+  uint64_t prevtimer=0;
+  uint64_t start_timer = tu_timer::get_ticks();  // returns milliseconds
 
   prevtimer = start_timer;
 
   while (true)
   {
   
-    timer timer;
+    uint64_t timer=0;
 
     // synchronize to frame time 
     if (_timeout || (_interval>1))  // avoid timing completely for interval==1
     while (1) 
     {
         
-      timer.restart();
+      timer = tu_timer::get_ticks();
             
-      if (timer.elapsed_min() - prevtimer.elapsed() >= _interval)
+      if (timer - prevtimer >= _interval)
         break; // next frame, please!
     
-      if (timer.elapsed() < prevtimer.elapsed()) // time glitch protection
+      if (timer < prevtimer) // time glitch protection
         prevtimer = timer;
         
       usleep(1);
@@ -70,7 +69,7 @@
     
     if ( _timeout )
     {
-      if ( timer.elapsed() - start_timer.elapsed() > _timeout)
+      if ( timer - start_timer > _timeout)
       {
         break;
       }

Index: libbase/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/libbase/Makefile.am,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- libbase/Makefile.am 13 Sep 2007 01:12:19 -0000      1.81
+++ libbase/Makefile.am 13 Sep 2007 09:47:31 -0000      1.82
@@ -94,6 +94,7 @@
        tu_file.cpp \
        $(SDL_FILE) \
        tu_random.cpp \
+       tu_timer.cpp \
        tu_types.cpp \
        utf8.cpp \
        utility.cpp \
@@ -137,6 +138,7 @@
        tu_opengl_includes.h \
        tu_random.h \
        tu_swap.h \
+       tu_timer.h \
        tu_types.h \
        utf8.h \
        utility.h \

Index: libbase/triangulate_impl.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/triangulate_impl.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- libbase/triangulate_impl.h  13 Sep 2007 01:12:19 -0000      1.25
+++ libbase/triangulate_impl.h  13 Sep 2007 09:47:31 -0000      1.26
@@ -24,7 +24,7 @@
 // code, see the FIST web page at:
 // http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html
 
-/* $Id: triangulate_impl.h,v 1.25 2007/09/13 01:12:19 nihilus Exp $ */
+/* $Id: triangulate_impl.h,v 1.26 2007/09/13 09:47:31 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -38,8 +38,7 @@
 
 #define PROFILE_TRIANGULATE
 #ifdef PROFILE_TRIANGULATE
-#include <boost/timer.hpp>
-using boost::timer;
+#include "tu_timer.h"
 #endif // PROFILE_TRIANGULATE
 
 // Template this whole thing on coord_t, so int16_t and float versions
@@ -2227,7 +2226,7 @@
        }
 
 #ifdef PROFILE_TRIANGULATE
-       timer start;
+       uint64_t        start_ticks = tu_timer::get_profile_ticks();
 #endif // PROFILE_TRIANGULATE
 
        // Local generator, for some parts of the algo that need random numbers.
@@ -2249,8 +2248,8 @@
        }
 
 #ifdef PROFILE_TRIANGULATE
-       fprintf(stderr, "join poly = %1.6f sec\n", start.elapsed());
-       timer join;
+       uint64_t        join_ticks = tu_timer::get_profile_ticks();
+       fprintf(stderr, "join poly = %1.6f sec\n", 
tu_timer::profile_ticks_to_seconds(join_ticks - start_ticks));
 #endif // PROFILE_TRIANGULATE
 
 // Debugging only: dump coords of joined poly.
@@ -2382,12 +2381,12 @@
        }
        
 #ifdef PROFILE_TRIANGULATE
-       timer clip;
-       fprintf(stderr, "clip poly = %1.6f sec\n", (clip.elapsed_min() - 
join.elapsed()));
-       fprintf(stderr, "total for poly = %1.6f sec\n", (clip.elapsed_min() - 
start.elapsed()));
+       uint64_t        clip_ticks = tu_timer::get_profile_ticks();
+       fprintf(stderr, "clip poly = %1.6f sec\n", 
tu_timer::profile_ticks_to_seconds(clip_ticks - join_ticks));
+       fprintf(stderr, "total for poly = %1.6f sec\n", 
tu_timer::profile_ticks_to_seconds(clip_ticks - start_ticks));
        fprintf(stderr, "vert count = %d, verts clipped / sec = %f\n",
                input_vert_count,
-               input_vert_count / (clip.elapsed_min() - join.elapsed()));
+               input_vert_count / 
tu_timer::profile_ticks_to_seconds(clip_ticks - join_ticks));
 #endif // PROFILE_TRIANGULATE
 
        assert(penv.m_polys.size() == 0);

Index: server/timers.h
===================================================================
RCS file: /sources/gnash/gnash/server/timers.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- server/timers.h     13 Sep 2007 01:12:20 -0000      1.26
+++ server/timers.h     13 Sep 2007 09:47:32 -0000      1.27
@@ -31,8 +31,7 @@
 #include "as_function.h" // for visibility of destructor by intrusive_ptr
 #include "smart_ptr.h"
 
-#include <boost/timer.hpp>
-using boost::timer;
+#include "tu_timer.h"
 
 #include <string>
 

Index: server/asobj/NetStream.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStream.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- server/asobj/NetStream.h    13 Sep 2007 01:12:20 -0000      1.49
+++ server/asobj/NetStream.h    13 Sep 2007 09:47:32 -0000      1.50
@@ -19,7 +19,7 @@
 //
 //
 
-/*  $Id: NetStream.h,v 1.49 2007/09/13 01:12:20 nihilus Exp $ */
+/*  $Id: NetStream.h,v 1.50 2007/09/13 09:47:32 strk Exp $ */
 
 #ifndef __NETSTREAM_H__
 #define __NETSTREAM_H__
@@ -187,9 +187,9 @@
 public:
 
        NetStream();
-#if defined(USE_FFMEPG) || defined(SOUND_GST)
+
        virtual ~NetStream(){}
-#endif
+
        /// Closes the video session and frees all ressources used for decoding
        /// except the FLV-parser (this might not be correct).
        virtual void close(){}

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -b -r1.91 -r1.92
--- server/asobj/NetStreamFfmpeg.cpp    13 Sep 2007 01:12:20 -0000      1.91
+++ server/asobj/NetStreamFfmpeg.cpp    13 Sep 2007 09:47:32 -0000      1.92
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamFfmpeg.cpp,v 1.91 2007/09/13 01:12:20 nihilus Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.92 2007/09/13 09:47:32 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -36,7 +36,7 @@
 #include "embedVideoDecoderFfmpeg.h"
 
 #include <boost/scoped_array.hpp>
-#include <ctime>
+
 
 #if defined(_WIN32) || defined(WIN32)
 # include <windows.h>  // for sleep()
@@ -635,7 +635,7 @@
        ns->m_last_audio_timestamp = 0;
        ns->m_current_timestamp = 0;
 
-       ns->m_start_clock = std::clock();
+       ns->m_start_clock = tu_timer::get_ticks();
 
        ns->m_unqueued_data = NULL;
 
@@ -1033,7 +1033,7 @@
                m_last_audio_timestamp = 0;
                m_current_timestamp = 0;
 
-               m_start_clock = std::clock();
+               m_start_clock = tu_timer::get_ticks();
 
        } else if (m_isFLV) {
 
@@ -1106,7 +1106,7 @@
                if (m_ACodecCtx && get_sound_handler()) {
                        current_clock = m_current_timestamp;
                } else {
-                       current_clock = std::clock() - m_start_clock;
+                       current_clock = tu_timer::get_ticks() - m_start_clock;
                        m_current_timestamp = current_clock;
                }
 
@@ -1198,7 +1198,7 @@
        m_pause = true;
 
        // Save the current time so we later can tell how long the pause lasted
-       m_time_of_pause = std::clock();
+       m_time_of_pause = tu_timer::get_ticks();
 }
 
 void NetStreamFfmpeg::unpausePlayback()
@@ -1211,11 +1211,11 @@
        m_pause = false;        
 
        if (m_current_timestamp == 0) {
-               m_start_clock = std::clock();
+               m_start_clock = tu_timer::get_ticks();
        } else {
                // Add the paused time to the start time so that the playhead 
doesn't
                // noticed that we have been paused
-               m_start_clock += std::clock() - m_time_of_pause;
+               m_start_clock += tu_timer::get_ticks() - m_time_of_pause;
        }
 
        // Re-connect to the soundhandler.

Index: server/vm/VM.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- server/vm/VM.cpp    13 Sep 2007 01:12:20 -0000      1.17
+++ server/vm/VM.cpp    13 Sep 2007 09:47:32 -0000      1.18
@@ -16,7 +16,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: VM.cpp,v 1.17 2007/09/13 01:12:20 nihilus Exp $ */
+/* $Id: VM.cpp,v 1.18 2007/09/13 09:47:32 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -27,7 +27,7 @@
 #include "movie_instance.h"
 #include "movie_root.h"
 #include "Global.h"
-#include <ctime> // for std::clocks()
+#include "tu_timer.h" // for tu_timer::get_ticks()
 #include "rc.h" //for overriding default version string with rcfile
 
 #include <memory>
@@ -75,7 +75,7 @@
        :
        _root_movie(new movie_root()),
        _swfversion(topmovie.get_version()),
-       _start_time(std::clock())
+       _start_time(tu_timer::get_ticks())
 {
 }
 
@@ -134,7 +134,7 @@
 uint64_t
 VM::getTime()
 {
-  return  (std::clock() -  _start_time);
+  return  (tu_timer::get_ticks() -  _start_time);
 }
 
 void

Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- utilities/processor.cpp     13 Sep 2007 01:12:20 -0000      1.64
+++ utilities/processor.cpp     13 Sep 2007 09:47:32 -0000      1.65
@@ -43,9 +43,6 @@
 #include "debugger.h"
 #include "VM.h"
 
-#include <boost/timer.hpp>
-using boost::timer;
-
 extern "C"{
        #include <unistd.h>
 #ifdef HAVE_GETOPT_H
@@ -119,18 +116,21 @@
 // How many time do we allow to hit the end ?
 static size_t allowed_end_hits = 1;
 
-timer lastAdvanceTimer;
+double lastAdvanceTimer;
 
 void
 resetLastAdvanceTimer()
 {
-       lastAdvanceTimer.restart();
+       using namespace tu_timer;
+       lastAdvanceTimer = ticks_to_seconds(get_ticks());
 }
 
 double
 secondsSinceLastAdvance()
 {
-       return (lastAdvanceTimer.elapsed());
+       using namespace tu_timer;
+       double now = ticks_to_seconds(get_ticks());
+       return ( now - lastAdvanceTimer);
 }
 
 int

Index: libbase/tu_timer.cpp
===================================================================
RCS file: libbase/tu_timer.cpp
diff -N libbase/tu_timer.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libbase/tu_timer.cpp        13 Sep 2007 09:47:31 -0000      1.13
@@ -0,0 +1,107 @@
+// tu_timer.cpp        -- by Thatcher Ulrich <address@hidden>
+
+// This source code has been donated to the Public Domain.  Do
+// whatever you want with it.
+
+// Utility/profiling timer.
+
+
+#include "tu_timer.h"
+
+
+#if defined(_WIN32) || defined(WIN32)
+
+#include <windows.h>
+#include <mmsystem.h>
+
+
+uint64_t tu_timer::get_ticks()
+{
+       return timeGetTime();
+}
+
+
+double tu_timer::ticks_to_seconds(uint64_t ticks)
+{
+       return ticks * (1.0f / 1000.f);
+}
+
+
+uint64_t       tu_timer::get_profile_ticks()
+{
+       // @@ use rdtsc?
+
+       //Nano-second timer.
+       LARGE_INTEGER   li;
+       QueryPerformanceCounter(&li);
+
+       return li.QuadPart;
+}
+
+
+double tu_timer::profile_ticks_to_seconds(uint64_t ticks)
+{
+       LARGE_INTEGER   freq;
+       QueryPerformanceFrequency(&freq);
+
+       double  seconds = (double) ticks;
+       seconds /= (double) freq.QuadPart;
+
+       return seconds;
+}
+
+
+#else  // not _WIN32
+
+
+#include <sys/time.h>
+
+
+// The profile ticks implementation is just fine for a normal timer.
+
+
+uint64_t tu_timer::get_ticks()
+{
+       return static_cast<uint64_t>(get_profile_ticks()/1000.0);
+}
+
+
+double tu_timer::ticks_to_seconds(uint64_t ticks)
+{
+       return profile_ticks_to_seconds(ticks);
+}
+
+
+uint64_t       tu_timer::get_profile_ticks()
+{
+       // @@ TODO prefer rdtsc when available?
+
+       // Return microseconds.
+       struct timeval tv;
+       
+       gettimeofday(&tv, 0);
+
+       uint64_t result = tv.tv_sec * 1000000;
+
+       result += tv.tv_usec;
+       // Time Unit: microsecond
+
+       return result;
+}
+
+
+double tu_timer::profile_ticks_to_seconds(uint64_t ticks)
+{
+       // ticks is microseconds.  Convert to seconds.
+       return ticks / 1000000.0;
+}
+
+#endif // not _WIN32
+
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 8 
+// tab-width: 8
+// indent-tabs-mode: t
+// End:

Index: libbase/tu_timer.h
===================================================================
RCS file: libbase/tu_timer.h
diff -N libbase/tu_timer.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libbase/tu_timer.h  13 Sep 2007 09:47:31 -0000      1.8
@@ -0,0 +1,46 @@
+// tu_timer.h  -- by Thatcher Ulrich <address@hidden>
+
+// This source code has been donated to the Public Domain.  Do
+// whatever you want with it.
+
+// Utility/profiling timer.
+
+
+#ifndef TU_TIMER_H
+
+#include "tu_config.h"
+#include "tu_types.h"
+
+
+namespace tu_timer
+{
+       // General-purpose wall-clock timer.  May not be hi-res enough
+       // for profiling. Time Unit: millisecond
+       DSOEXPORT uint64_t get_ticks();
+
+       // Time Unit: second
+       DSOEXPORT double ticks_to_seconds(uint64_t ticks);
+       
+       // Hi-res timer for CPU profiling.
+
+       // Return a hi-res timer value.  Time 0 is arbitrary, so
+       // generally you want to call this at the start and end of an
+       // operation, and pass the difference to
+       // profile_ticks_to_seconds() to find out how long the
+       // operation took.
+       DSOEXPORT uint64_t      get_profile_ticks();
+
+       // Convert a hi-res ticks value into seconds.
+       DSOEXPORT double        profile_ticks_to_seconds(uint64_t 
profile_ticks);
+}
+
+
+#endif // TU_TIMER_H
+
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 8 
+// tab-width: 8
+// indent-tabs-mode: t
+// End:




reply via email to

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