gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. 33875ea91377cfac80c4


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 33875ea91377cfac80c4cc5ab766dfacf2ebcbdd
Date: Mon, 25 Oct 2010 19:47:58 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  33875ea91377cfac80c4cc5ab766dfacf2ebcbdd (commit)
      from  e280fbac6429b7b8ddb703fe3cfaed316cfdf07e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=33875ea91377cfac80c4cc5ab766dfacf2ebcbdd


commit 33875ea91377cfac80c4cc5ab766dfacf2ebcbdd
Author: Sandro Santilli <address@hidden>
Date:   Mon Oct 25 21:47:12 2010 +0200

    Have dump-gui sleep-per-iteration parametrized (-S switch) and default to 
none.

diff --git a/gui/dump.cpp b/gui/dump.cpp
index 621a380..f9e30f2 100644
--- a/gui/dump.cpp
+++ b/gui/dump.cpp
@@ -88,7 +88,8 @@ DumpGui::DumpGui(unsigned long xid, float scale, bool loop, 
RunResources& r) :
     _framecount(0),
     _samplesFetched(0),
     _bpp(32),
-    _pixelformat("BGRA32")
+    _pixelformat("BGRA32"),
+    _sleepUS(0)
 {
     if (loop) {
         std::cerr << "# WARNING:  Gnash was told to loop the movie\n";
@@ -116,7 +117,7 @@ DumpGui::init(int argc, char **argv[])
     optind = 0;
     opterr = 0;
     char c;
-    while ((c = getopt (argc, *argv, "D:")) != -1) {
+    while ((c = getopt (argc, *argv, "D:S:")) != -1) {
         if (c == 'D') {
             // Terminate if no filename is given.
             if (!optarg) {
@@ -127,6 +128,16 @@ DumpGui::init(int argc, char **argv[])
             }      
             _fileOutput = optarg;
         }
+        else if (c == 'S') {
+            // Terminate if no filename is given.
+            if (!optarg) {
+                std::cout << 
+                    _("# FATAL:  No sleep ms value given with -S argument.") <<
+                    std::endl;      
+                return false;
+            }      
+            _sleepUS = atoi(optarg)*1000; // we take milliseconds
+        }
     }
     opterr = origopterr;
 
@@ -157,29 +168,32 @@ DumpGui::run()
 
     log_debug("DumpGui entering main loop with interval of %d ms", _interval);
 
-    size_t usecs_interval = _interval*1000;
+    // heart-beat interval, in milliseconds
+    // TODO: extract this value from the swf's FPS
+    //       by default and allow overriding it
+    //
+    unsigned int clockAdvance = _interval;
 
     VirtualClock& timer = getClock();
 
     _terminate_request = false;
     while (!_terminate_request) {
 
-       _manualClock.advance(_interval); 
+        _manualClock.advance(clockAdvance); 
 
         // advance movie now
         if ( advanceMovie() ) {
             ++_framecount;
             writeFrame();
+            writeSamples();
         }
 
-        writeSamples();
-
         // check if we've reached a timeout
         if (_timeout && timer.elapsed() > _timeout ) {
             break;
         }
 
-        gnashSleep(usecs_interval);
+        if ( _sleepUS ) gnashSleep(_sleepUS);
 
     }
 
diff --git a/gui/dump.h b/gui/dump.h
index 23e1bc2..80860af 100644
--- a/gui/dump.h
+++ b/gui/dump.h
@@ -101,6 +101,8 @@ private:
 
     ManualClock _manualClock;
 
+    unsigned long _sleepUS; // micro-seconds sleep between iterations
+
 
 };
 
diff --git a/gui/gnash.cpp b/gui/gnash.cpp
index 134cee9..8647072 100644
--- a/gui/gnash.cpp
+++ b/gui/gnash.cpp
@@ -225,6 +225,7 @@ parseCommandLine(int argc, char* argv[], gnash::Player& 
player)
         { 261, "hwaccel",           Arg_parser::yes },
         { 262, "flash-version",     Arg_parser::no },
         { 'D', 0,                   Arg_parser::yes }, // Handled in dump gui
+        { 'S', 0,                   Arg_parser::yes }, // Handled in dump gui
         {   0, 0,                   Arg_parser::no  }
     };
 

-----------------------------------------------------------------------

Summary of changes:
 gui/dump.cpp  |   28 +++++++++++++++++++++-------
 gui/dump.h    |    2 ++
 gui/gnash.cpp |    1 +
 3 files changed, 24 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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