[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, master, updated. 1d6558ab6b2bad9083b2
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. 1d6558ab6b2bad9083b2aeae609c0f4b63171a30 |
Date: |
Wed, 27 Oct 2010 08:14:34 +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 1d6558ab6b2bad9083b2aeae609c0f4b63171a30 (commit)
via 2ff9c91dec30598930a12f26975b1a90d17339af (commit)
from 2fa2a0633d6c3ca5f0b583858c307437c643a00b (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=1d6558ab6b2bad9083b2aeae609c0f4b63171a30
commit 1d6558ab6b2bad9083b2aeae609c0f4b63171a30
Author: Sandro Santilli <address@hidden>
Date: Wed Oct 27 10:14:13 2010 +0200
Add note about additional @fps arg to -D (for dump gui)
diff --git a/gui/dump/README b/gui/dump/README
index 595314f..1e4a109 100644
--- a/gui/dump/README
+++ b/gui/dump/README
@@ -15,3 +15,12 @@ gnash --help are:
-D <filename>
Name of a file to dump video frames to.
+ By default the frequency of video frames dump is driven by
+ the heart-beat (defaults to 10ms per beat [100FPS],
+ you can change using the -d switch).
+ You can override video output FPS by appending a @<value> to
+ the filename. This will be independent to heart-beating, which
+ would be always best to be a submultiple of SWF and video output
+ FPSs. Example:
+
+ dump-gui -D address@hidden input.swf
http://git.savannah.gnu.org/cgit//commit/?id=2ff9c91dec30598930a12f26975b1a90d17339af
commit 2ff9c91dec30598930a12f26975b1a90d17339af
Author: Sandro Santilli <address@hidden>
Date: Wed Oct 27 10:09:22 2010 +0200
Allow specifying a desired video output FPS by appending @<num> to the
filename with -D switch
diff --git a/gui/dump/dump.cpp b/gui/dump/dump.cpp
index f9e30f2..3d4c13c 100644
--- a/gui/dump/dump.cpp
+++ b/gui/dump/dump.cpp
@@ -42,6 +42,9 @@
#include <iostream>
#include <string>
#include <fstream>
+#include <boost/algorithm/string/split.hpp>
+#include <boost/algorithm/string/classification.hpp>
+#include <boost/lexical_cast.hpp>
#ifndef RENDERER_AGG
#error Dump gui requires AGG renderer
@@ -89,6 +92,9 @@ DumpGui::DumpGui(unsigned long xid, float scale, bool loop,
RunResources& r) :
_samplesFetched(0),
_bpp(32),
_pixelformat("BGRA32"),
+ _fileOutput(),
+ _fileOutputFPS(0), // dump at every heart-beat by default
+ _lastVideoFrameDump(0), // this will be computed
_sleepUS(0)
{
if (loop) {
@@ -126,7 +132,13 @@ DumpGui::init(int argc, char **argv[])
std::endl;
return false;
}
- _fileOutput = optarg;
+ std::vector<std::string> file_fps;
+ boost::split(file_fps, optarg,
+ boost::is_any_of("@"), boost::token_compress_on);
+ _fileOutput = file_fps[0];
+ if ( file_fps.size() > 1 ) {
+ _fileOutputFPS = boost::lexical_cast<unsigned
int>(file_fps[1]);
+ }
}
else if (c == 'S') {
// Terminate if no filename is given.
@@ -165,6 +177,13 @@ DumpGui::init(int argc, char **argv[])
bool
DumpGui::run()
{
+ if ( _fileOutputFPS ) {
+ _fileOutputAdvance = static_cast<int>(1000/_fileOutputFPS);
+ } else {
+ _fileOutputAdvance = _interval;
+ _fileOutputFPS = static_cast<int>(1000/_fileOutputAdvance);
+ }
+
log_debug("DumpGui entering main loop with interval of %d ms", _interval);
@@ -182,14 +201,21 @@ DumpGui::run()
_manualClock.advance(clockAdvance);
// advance movie now
- if ( advanceMovie() ) {
- ++_framecount;
+ advanceMovie();
+
+ writeSamples();
+
+ // Dump a video frame if it's time for it or no frame
+ // was dumped yet
+ size_t elapsed = timer.elapsed();
+ if ( ! _framecount ||
+ elapsed - _lastVideoFrameDump >= _fileOutputAdvance )
+ {
writeFrame();
- writeSamples();
}
// check if we've reached a timeout
- if (_timeout && timer.elapsed() > _timeout ) {
+ if (_timeout && timer.elapsed() >= _timeout ) {
break;
}
@@ -201,7 +227,7 @@ DumpGui::run()
double fps = _framecount*1000.0 / total_time;
std::cout << "TIME=" << total_time << std::endl;
- std::cout << "FPS_ACTUAL=" << fps << std::endl;
+ std::cout << "FPS_ACTUAL=" << _fileOutputFPS << std::endl;
// In this Gui, quit() does not exit, but it is necessary to catch the
// last frame for screenshots.
@@ -219,7 +245,6 @@ void
DumpGui::setInterval(unsigned int interval)
{
std::cout << "INTERVAL=" << interval << std::endl;
- std::cout << "FPS_DESIRED=" << (1000.0 / static_cast<double>(interval)) <<
std::endl;
_interval = interval;
}
@@ -241,6 +266,9 @@ DumpGui::writeFrame()
_fileStream.write(reinterpret_cast<char*>(_offscreenbuf.get()),
_offscreenbuf_size);
+
+ _lastVideoFrameDump = getClock().elapsed();
+ ++_framecount;
}
void
@@ -297,14 +325,15 @@ DumpGui::init_dumpfile()
std::cerr << "# FATAL: Unable to write file '" << _fileOutput << "'"
<< std::endl;
exit(EXIT_FAILURE);
}
-
+
// Yes, this should go to cout. The user needs to know this
// information in order to process the file. Print out in a
// format that is easy to source into shell.
std::cout <<
"# Gnash created a raw dump file with the following properties:" <<
std::endl <<
"COLORSPACE=" << _pixelformat << std::endl <<
- "NAME=" << _fileOutput << std::endl;
+ "NAME=" << _fileOutput <<
+ std::endl;
}
diff --git a/gui/dump/dump.h b/gui/dump/dump.h
index 80860af..6a3de08 100644
--- a/gui/dump/dump.h
+++ b/gui/dump/dump.h
@@ -93,8 +93,11 @@ private:
unsigned int _bpp; /* bits per pixel */
std::string _pixelformat; /* colorspace name (eg, "RGB24") */
- std::string _fileOutput; /* path to output file */
- std::ofstream _fileStream; /* stream for output file */
+ std::string _fileOutput; /* path to video output file */
+ unsigned int _fileOutputFPS; /* requested FPS of video output file */
+ unsigned int _fileOutputAdvance; /* ms of time between video dump frms */
+ unsigned long _lastVideoFrameDump; /* time of last video frame dump */
+ std::ofstream _fileStream; /* stream for output file */
void init_dumpfile(); /* convenience method to create dump
file */
boost::shared_ptr<sound::sound_handler> _soundHandler;
@@ -103,6 +106,8 @@ private:
unsigned long _sleepUS; // micro-seconds sleep between iterations
+ unsigned int _videoDumpFPS;
+
};
-----------------------------------------------------------------------
Summary of changes:
gui/dump/README | 9 +++++++++
gui/dump/dump.cpp | 47 ++++++++++++++++++++++++++++++++++++++---------
gui/dump/dump.h | 9 +++++++--
3 files changed, 54 insertions(+), 11 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, master, updated. 1d6558ab6b2bad9083b2aeae609c0f4b63171a30,
Sandro Santilli <=