You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-04 05:37:29
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Jul 4 08:36:31 2012 +0300
New webconv binary for x86-64 (the old one doesn't run).
---
deploy.sh | 2 +-
webconv/webconv.bin | Bin 0 -> 88050 bytes
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/deploy.sh b/deploy.sh
index 7b76c42..7429d36 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -43,7 +43,7 @@ git pull ${GITPATH} master || exit 1
echo ">>> Rebuilding and installing the website"
TEMPPATH=`mktemp -d`
-${GITPATH}/webconv/webconv-x86-linux.bin ${GITPATH}/htdocs-source ${TEMPPATH} &&
+${GITPATH}/webconv/webconv.bin ${GITPATH}/htdocs-source ${TEMPPATH} &&
rsync -r --verbose ${TEMPPATH}/* ${SITEPATH} &&
rsync -r --verbose ${GITPATH}/htdocs-binary/* ${SITEPATH} &&
echo ">>> INSTALLATION SUCCESSFUL" ||
diff --git a/webconv/webconv.bin b/webconv/webconv.bin
new file mode 100755
index 0000000..b4745e4
Binary files /dev/null and b/webconv/webconv.bin differ
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:26
|
Author: Lasse Karkkainen <tro...@tr...> Date: Wed Jul 4 02:38:39 2012 +0300 Merge branch 'master' into torrent --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:24
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Jul 4 02:33:51 2012 +0300
Fix a song browser video playback regression introduced in da635890d22b18db56309c9d73f982dcadc10ee1.
Added the missing preparation pass.
---
game/screen_songs.cc | 5 +++++
game/screen_songs.hh | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 95a5d44..9dacfcf 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -164,6 +164,11 @@ void ScreenSongs::update() {
}
}
+void ScreenSongs::prepare() {
+ double time = m_audio.getPosition();
+ if (m_video) m_video->prepare(time);
+}
+
void ScreenSongs::drawJukebox() {
double pos = m_audio.getPosition();
double len = m_audio.getLength();
diff --git a/game/screen_songs.hh b/game/screen_songs.hh
index a04d18e..e8314cd 100644
--- a/game/screen_songs.hh
+++ b/game/screen_songs.hh
@@ -25,6 +25,7 @@ public:
void reloadGL();
void manageSharedKey(input::NavButton nav); ///< same behaviour for jukebox and normal mode
void manageEvent(SDL_Event event);
+ void prepare();
void draw();
void drawCovers(); ///< draw the cover browser
Surface& getCover(Song const& song); ///< get appropriate cover image for the song (incl. no cover)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:20
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jul 3 07:17:45 2012 +0300
Add support for HDMI 3D modes 1280x1470 (720p) and 1920x2205 (1080p) in top/bottom mode. Requires custom modelines and manually setting the proper mode before starting Performous.
---
game/video_driver.cc | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 07f796a..c1ed465 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -201,7 +201,7 @@ void Window::render(boost::function<void (void)> drawFunc) {
glerror.check("setup");
// Can we do direct to framebuffer rendering (no FBO)?
if (!stereo || type == 2) { view(stereo); drawFunc(); return; }
- // Render both eyes to FBO (full resolution top/bottom)
+ // Render both eyes to FBO (full resolution top/bottom for anaglyph)
unsigned w = s_width;
unsigned h = 2 * s_height;
FBO fbo(w, h);
@@ -265,15 +265,28 @@ void Window::view(unsigned num) {
glEnable(GL_BLEND);
if (GL_EXT_framebuffer_sRGB) glEnable(GL_FRAMEBUFFER_SRGB);
shader("color").bind();
- // Setup views
+ // Setup views (with black bars for cropping)
double vx = 0.5f * (screen->w - s_width);
double vy = 0.5f * (screen->h - s_height);
double vw = s_width, vh = s_height;
if (num == 0) {
glViewport(vx, vy, vw, vh); // Drawable area of the window (excluding black bars)
} else {
- glViewportIndexedf(1, 0, vh / 2, vw, vh / 2); // Top half of the drawable area
- glViewportIndexedf(2, 0, 0, vw, vh / 2); // Bottom half of the drawable area
+ // Splitscreen stereo3d
+ if (screen->w == 1280 && screen->h == 1470) { // HDMI 720p 3D mode
+ glViewportIndexedf(1, 0, 750, 1280, 720);
+ glViewportIndexedf(2, 0, 0, 1280, 720);
+ s_width = 1280;
+ s_height = 720;
+ } else if (screen->w == 1920 && screen->h == 2205) { // HDMI 1080p 3D mode
+ glViewportIndexedf(1, 0, 1125, 1920, 1080);
+ glViewportIndexedf(2, 0, 0, 1920, 1080);
+ s_width = 1920;
+ s_height = 1080;
+ } else { // Regular top/bottom 3d
+ glViewportIndexedf(1, 0, vh / 2, vw, vh / 2); // Top half of the drawable area
+ glViewportIndexedf(2, 0, 0, vw, vh / 2); // Bottom half of the drawable area
+ }
}
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:18
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jul 3 06:47:54 2012 +0300
Improved behavior and debug when audio device fails to start.
---
game/audio.cc | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 7f09b92..224d024 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -385,8 +385,7 @@ Device::Device(unsigned int in, unsigned int out, double rate, unsigned int dev)
void Device::start() {
PaError err = Pa_StartStream(stream);
- if (err != paNoError) throw std::runtime_error("Cannot start PortAudio audio stream "
- + boost::lexical_cast<std::string>(dev) + ": " + Pa_GetErrorText(err));
+ if (err != paNoError) throw std::runtime_error(std::string("Pa_StartStream: ") + Pa_GetErrorText(err));
}
int Device::operator()(void const* input, void* output, unsigned long frames, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags) try {
@@ -478,13 +477,13 @@ struct Audio::Impl {
}
// Match found if we got here
int assigned_mics = 0;
- bool device_init_threw = true;
try {
- devices.push_back(new Device(params.in, params.out, params.rate, i));
- Device& d = devices.back();
- device_init_threw = false;
- // Start capture/playback on this device
- d.start();
+ Device* d = new Device(params.in, params.out, params.rate, i);
+ devices.push_back(d);
+ // Start capture/playback on this device (likely to throw due to audio system errors)
+ // NOTE: When it throws we want to keep the device in devices to avoid calling ~Device
+ // which often would hit the Pa_CloseStream hang bug and terminate the application.
+ d->start();
// Assign mics for all channels of the device
for (unsigned int j = 0; j < params.in; ++j) {
if (analyzers.size() >= 4) break; // Too many mics
@@ -497,15 +496,15 @@ struct Audio::Impl {
}
if (mic_used) continue;
// Add the new analyzer
- Analyzer* a = new Analyzer(d.rate, m);
+ Analyzer* a = new Analyzer(d->rate, m);
analyzers.push_back(a);
- d.mics[j] = a;
+ d->mics[j] = a;
++assigned_mics;
}
// Assign playback output for the first available stereo output
- if (!playback && d.out == 2) { d.outptr = &output; playback = true; }
- } catch (...) {
- if (!device_init_threw) devices.pop_back();
+ if (!playback && d->out == 2) { d->outptr = &output; playback = true; }
+ } catch (std::runtime_error& e) {
+ std::clog << "audio/warning: " << info.name << ": " << e.what() << std::endl;
if (dev > 0) { skip_partial = true; break; } // Numeric, end search
continue;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:15
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Mar 29 20:50:58 2012 +0300
Mark some CMake variables advanced (most notably those hordes from OpenCV).
---
cmake/Modules/FindMsgfmt.cmake | 5 ++++-
cmake/Modules/FindOpenCV.cmake | 10 +++++++++-
cmake/Modules/FindPortMidi.cmake | 1 +
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/cmake/Modules/FindMsgfmt.cmake b/cmake/Modules/FindMsgfmt.cmake
index 8238cd1..14de5bd 100644
--- a/cmake/Modules/FindMsgfmt.cmake
+++ b/cmake/Modules/FindMsgfmt.cmake
@@ -10,4 +10,7 @@ if(Msgfmt_BIN)
set(Msgfmt_FOUND 1)
else()
set(Msgfmt_FOUND 0)
-endif(Msgfmt_BIN)
\ No newline at end of file
+endif(Msgfmt_BIN)
+
+mark_as_advanced(Msgfmt_BIN)
+
diff --git a/cmake/Modules/FindOpenCV.cmake b/cmake/Modules/FindOpenCV.cmake
index 27b383b..e7de88b 100644
--- a/cmake/Modules/FindOpenCV.cmake
+++ b/cmake/Modules/FindOpenCV.cmake
@@ -196,6 +196,9 @@ if(EXISTS "${OpenCV_DIR}")
set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY})
endif(OpenCV_${__CVLIB}_LIBRARY)
+ #Avoid pollution
+ mark_as_advanced(OpenCV_${__CVLIB}_LIBRARY OpenCV_${__CVLIB}_LIBRARY_RELEASE OpenCV_${__CVLIB}_LIBRARY_DEBUG)
+
endforeach(__CVLIB)
@@ -243,7 +246,9 @@ if(EXISTS "${OpenCV_DIR}")
set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY})
endif(OpenCV_${__CVLIB}_LIBRARY)
-
+ #Avoid pollution
+ mark_as_advanced(OpenCV_${__CVLIB}_LIBRARY OpenCV_${__CVLIB}_LIBRARY_RELEASE OpenCV_${__CVLIB}_LIBRARY_DEBUG)
+
endforeach(__CVLIB)
@@ -285,3 +290,6 @@ if(OpenCV_FOUND)
endif(OpenCV_BACKWARD_COMPA)
endif(OpenCV_FOUND)
##====================================================
+
+mark_as_advanced(OpenCV_DIR OpenCV_FOUND)
+
diff --git a/cmake/Modules/FindPortMidi.cmake b/cmake/Modules/FindPortMidi.cmake
index e3774ad..ef3fa1f 100644
--- a/cmake/Modules/FindPortMidi.cmake
+++ b/cmake/Modules/FindPortMidi.cmake
@@ -24,4 +24,5 @@ if (${PortTime_LIBRARY})
endif (${PortTime_LIBRARY})
libfind_process(PortMidi)
+mark_as_advanced(PortTime_LIBRARY)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:12
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Mar 29 20:33:39 2012 +0300
Revert "Adjusted minimal libavformat version"
This reverts commit ba04de2b7b18d895f6695e6cd152863edb54604b.
---
game/ffmpeg.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 114ac7f..1b9d874 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -36,7 +36,7 @@ FFmpeg::~FFmpeg() {
boost::mutex::scoped_lock l(s_avcodec_mutex); // avcodec_close is not thread-safe
if (m_resampleContext) audio_resample_close(m_resampleContext);
if (m_codecContext) avcodec_close(m_codecContext);
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
if (m_formatContext) avformat_close_input(&m_formatContext);
#else
if (m_formatContext) av_close_input_file(m_formatContext);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:09
|
Author: Tapio Vierros <tap...@gm...> Date: Wed Mar 28 12:19:47 2012 +0300 Added Chinese translation courtesy of Wei-Lun Chao. --- lang/zh.po | 798 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 798 insertions(+), 0 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:04
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 26 04:19:06 2012 +0300
Add a separate pass for preparing a screen, for slow operations that we don't want to do in draw(), and use that for loading the next video frame.
---
game/main.cc | 1 +
game/screen.hh | 4 ++++
game/screen_sing.cc | 7 ++++++-
game/screen_sing.hh | 1 +
game/screenmanager.cc | 4 ++++
game/video.cc | 22 ++++++++++++----------
game/video.hh | 4 ++--
7 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index a0bcc10..45f3a08 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -185,6 +185,7 @@ void mainLoop(std::string const& songlist) {
glFinish();
prof("swap");
updateSurfaces();
+ sm.prepareScreen();
glFinish();
prof("surfaces");
if (config["graphic/fps"].b()) {
diff --git a/game/screen.hh b/game/screen.hh
index 64d3e29..5c3e27a 100644
--- a/game/screen.hh
+++ b/game/screen.hh
@@ -19,6 +19,8 @@ class Screen {
virtual ~Screen() {}
/// eventhandler
virtual void manageEvent(SDL_Event event) = 0;
+ /// prepare screen for drawing
+ virtual void prepare() {}
/// draws screen
virtual void draw() = 0;
/// enters screen
@@ -49,6 +51,8 @@ class ScreenManager: public Singleton <ScreenManager> {
void activateScreen(std::string const& name);
/// Does actual switching of screens (if necessary)
void updateScreen();
+ /// Prepare (slow loading operations) of the current screen for rendering
+ void prepareScreen();
/// Draws the current screen and possible transition effects
void drawScreen();
/// Reload OpenGL resources (after fullscreen toggle etc)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 7b16fb4..2a6bbd3 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -399,6 +399,11 @@ namespace {
}
+void ScreenSing::prepare() {
+ double time = m_audio.getPosition();
+ if (m_video) m_video->prepare(time);
+}
+
void ScreenSing::draw() {
// Get the time in the song
double length = m_audio.getLength();
@@ -432,7 +437,7 @@ void ScreenSing::draw() {
// Webcam
if (m_cam && config["graphic/webcam"].b()) m_cam->render();
// Video
- if (m_video /* && (!m_cam || !m_cam->is_good()) */) {
+ if (m_video) {
m_video->render(time); double tmp = m_video->dimensions().ar(); if (tmp > 0.0) ar = tmp;
}
// Top/bottom borders
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index a5a5a74..9d7438d 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -55,6 +55,7 @@ class ScreenSing: public Screen {
void exit();
void reloadGL();
void manageEvent(SDL_Event event);
+ void prepare();
void draw();
void setSong (boost::shared_ptr<Song> song_)
diff --git a/game/screenmanager.cc b/game/screenmanager.cc
index f3b30f7..5e1bb15 100644
--- a/game/screenmanager.cc
+++ b/game/screenmanager.cc
@@ -43,6 +43,10 @@ Screen* ScreenManager::getScreen(std::string const& name) {
}
}
+void ScreenManager::prepareScreen() {
+ getCurrentScreen()->prepare();
+}
+
void ScreenManager::drawScreen() {
getCurrentScreen()->draw();
drawLogo();
diff --git a/game/video.cc b/game/video.cc
index 09c104f..7adca6a 100644
--- a/game/video.cc
+++ b/game/video.cc
@@ -1,12 +1,11 @@
#include "video.hh"
#include "util.hh"
-
#include <cmath>
Video::Video(std::string const& _videoFile, double videoGap): m_mpeg(true, false, _videoFile), m_videoGap(videoGap), m_surfaceTime(), m_lastTime(), m_alpha(-0.5, 1.5) {}
-void Video::render(double time) {
+void Video::prepare(double time) {
time += m_videoGap;
VideoFrame& fr = m_videoFrame;
// Time to switch frame?
@@ -18,6 +17,17 @@ void Video::render(double time) {
m_surface.load(bitmap);
m_surfaceTime = fr.timestamp;
}
+ // Preload the next future frame
+ if (fr.data.empty()) while (m_mpeg.videoQueue.tryPop(fr) && fr.timestamp < time) {};
+ // Do a seek before next render, if required
+ if (time < m_lastTime - 1.0 || (!fr.data.empty() && time > fr.timestamp + 7.0)) {
+ m_mpeg.seek(std::max(0.0, time - 5.0)); // -5 to workaround ffmpeg inaccurate seeking
+ fr.data.clear();
+ }
+ m_lastTime = time;
+}
+
+void Video::render(double time) {
double tdist = std::abs(m_surfaceTime - time);
m_alpha.setTarget(tdist < 0.4 ? 1.2f : -0.5f);
float alpha = clamp(m_alpha.get());
@@ -33,13 +43,5 @@ void Video::render(double time) {
m_surface.draw();
}
}
- // Preload the next future frame
- if (fr.data.empty()) while (m_mpeg.videoQueue.tryPop(fr) && fr.timestamp < time) {};
- // Do a seek before next render, if required
- if (time < m_lastTime - 1.0 || (!fr.data.empty() && time > fr.timestamp + 7.0)) {
- m_mpeg.seek(std::max(0.0, time - 5.0)); // -5 to workaround ffmpeg inaccurate seeking
- fr.data.clear();
- }
- m_lastTime = time;
}
diff --git a/game/video.hh b/game/video.hh
index c1ed3ea..2390991 100644
--- a/game/video.hh
+++ b/game/video.hh
@@ -10,8 +10,8 @@ class Video {
public:
/// opens given video file
Video(std::string const& videoFile, double videoGap = 0.0);
- /// renders video
- void render(double time);
+ void prepare(double time); ///< Load the current video frame into a texture
+ void render(double time); ///< Render the prepared video frame
/// returns Dimensions of video clip
Dimensions& dimensions() { return m_surface.dimensions; }
/// returns Dimensions of video clip
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:41:01
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 26 04:14:03 2012 +0300
Display FPS with flashMessage instead of std::cout.
---
game/main.cc | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index db690cc..a0bcc10 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -190,7 +190,9 @@ void mainLoop(std::string const& songlist) {
if (config["graphic/fps"].b()) {
++frames;
if (now() - time > 1.0) {
- std::cout << frames << " FPS" << std::endl;
+ std::ostringstream oss;
+ oss << frames << " FPS";
+ sm.flashMessage(oss.str());
time += 1.0;
frames = 0;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:57
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 26 03:40:26 2012 +0300
Profiler rewritten so that it can be used inside loops.
---
game/profiler.hh | 62 +++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/game/profiler.hh b/game/profiler.hh
index f56db2b..172f186 100644
--- a/game/profiler.hh
+++ b/game/profiler.hh
@@ -1,23 +1,69 @@
#pragma once
#include "xtime.hh"
+#include <iomanip>
#include <iostream>
+#include <map>
#include <sstream>
#include <string>
+#include <vector>
-/// easy access for profiling code
+struct ProfCP {
+ unsigned long samples;
+ double total;
+ double peak;
+ double avg;
+ ProfCP(): samples(), total(), peak(), avg() {}
+ void add(double t) {
+ ++samples;
+ total += t;
+ avg = total / samples;
+ if (peak < t) peak = t;
+ }
+};
+
+static inline std::ostream& operator<<(std::ostream& os, ProfCP const& cp) {
+ os << std::fixed << std::setprecision(1);
+ if (cp.samples == 0) return os << "no data";
+ if (cp.samples > 1) os << cp.samples << "x ";
+ os << cp.avg * 1000.0 << " ms";
+ if (cp.peak > 2.0 * cp.avg) os << " peak " << cp.peak * 1000.0 << " ms";
+ return os;
+}
+
+/// @short A simple performance profiling tool
class Profiler {
- std::ostringstream m_oss;
+ typedef std::map<std::string, ProfCP> Checkpoints;
+ typedef std::pair<std::string, ProfCP> Pair;
+ Checkpoints m_checkpoints;
+ std::string m_name;
boost::xtime m_time;
+ static bool cmpFunc(Pair const& a, Pair const& b) { return a.second.total > b.second.total; }
public:
- /// create a new profiler with a given name
- Profiler(std::string const& name): m_time(now()) { m_oss << "profiler-" << name << "/info: "; }
- ~Profiler() { std::clog << m_oss.str() << std::endl; }
- /// calling the object as a function will return the time since the start
- void operator()(std::string const& tag) {
+ /// Start a profiler with the given name
+ Profiler(std::string const& name): m_name(name), m_time(now()) {}
+ ~Profiler() { dump(); }
+ /// Profiling checkpoint: record the duration since construction or previous checkpoint.
+ /// If no tag is specified, no recording is done.
+ void operator()(std::string const& tag = std::string()) {
boost::xtime n = now();
std::swap(n, m_time);
- m_oss << unsigned((m_time - n) * 1000.0 + 0.5) << " ms (" << tag << ") ";
+ double t = m_time - n;
+ m_checkpoints[tag].add(t);
+ }
+ /// Dump current stats to log and reset
+ void dump(std::string const& level = "info") {
+ if (m_checkpoints.empty()) return;
+ if (level.empty()) { m_checkpoints.clear(); return; }
+ std::vector<Pair> cps(m_checkpoints.begin(), m_checkpoints.end());
+ m_checkpoints.clear();
+ std::sort(cps.begin(), cps.end(), cmpFunc);
+ std::ostringstream oss;
+ oss << "profiler-" << m_name << "/" << level << ":";
+ for (std::vector<Pair>::const_iterator it = cps.begin(); it != cps.end(); ++it) {
+ oss << " " << it->first << " (" << it->second << ")";
+ }
+ std::clog << oss.str() << std::endl;
}
};
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:54
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 26 01:04:54 2012 +0300
Allow specifying audiodev in=N for input channels (useful with cards that require a large number of channels). Still requires mics= as well (TODO: auto-assign mics if not specified?).
---
game/audio.cc | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 8cd85f7..7f09b92 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -418,12 +418,13 @@ struct Audio::Impl {
for (ConfigItem::StringList::const_iterator it = devs.begin(), end = devs.end(); it != end; ++it) {
try {
struct Params {
- int out;
+ int out, in;
unsigned int rate;
std::string dev;
std::vector<std::string> mics;
} params = Params();
params.out = 0;
+ params.in = 0;
params.rate = 48000;
// Break into tokens:
std::map<std::string, std::string> keyvalues = parseKeyValuePairs(*it);
@@ -433,6 +434,7 @@ struct Audio::Impl {
std::string key = it2->first;
std::istringstream iss(it2->second);
if (key == "out") iss >> params.out;
+ else if (key == "in") iss >> params.in;
else if (key == "rate") iss >> params.rate;
else if (key == "dev") std::getline(iss, params.dev);
else if (key == "mics") {
@@ -442,6 +444,9 @@ struct Audio::Impl {
else throw std::runtime_error("Unknown device parameter " + key);
if (!iss.eof()) throw std::runtime_error("Syntax error parsing device parameter " + key);
}
+ // Sync mics/in settings together
+ if (params.in == 0) params.in = params.mics.size();
+ else params.mics.resize(params.in);
int count = portaudio::AudioDevices::count();
int dev = -1;
// Handle empty device
@@ -453,7 +458,7 @@ struct Audio::Impl {
if (iss >> tmp && iss.get() == EOF && tmp >= 0 && tmp < count) dev = tmp;
}
std::clog << "audio/info: Trying audio device \"" << params.dev << "\", id: " << dev
- << ", in: " << params.mics.size() << ", out: " << params.out << std::endl;
+ << ", in: " << params.in << ", out: " << params.out << std::endl;
bool skip_partial = false;
bool found = false;
portaudio::AudioDevices ad;
@@ -475,13 +480,13 @@ struct Audio::Impl {
int assigned_mics = 0;
bool device_init_threw = true;
try {
- devices.push_back(new Device(params.mics.size(), params.out, params.rate, i));
+ devices.push_back(new Device(params.in, params.out, params.rate, i));
Device& d = devices.back();
device_init_threw = false;
// Start capture/playback on this device
d.start();
// Assign mics for all channels of the device
- for (unsigned int j = 0; j < d.in; ++j) {
+ for (unsigned int j = 0; j < params.in; ++j) {
if (analyzers.size() >= 4) break; // Too many mics
std::string const& m = params.mics[j];
if (m.empty()) continue; // Input channel not used
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:51
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Mar 25 18:34:42 2012 +0200
Adjusted minimal libavformat version
---
game/ffmpeg.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 1b9d874..114ac7f 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -36,7 +36,7 @@ FFmpeg::~FFmpeg() {
boost::mutex::scoped_lock l(s_avcodec_mutex); // avcodec_close is not thread-safe
if (m_resampleContext) audio_resample_close(m_resampleContext);
if (m_codecContext) avcodec_close(m_codecContext);
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
if (m_formatContext) avformat_close_input(&m_formatContext);
#else
if (m_formatContext) av_close_input_file(m_formatContext);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:48
|
Author: Lasse Karkkainen <tro...@tr...> Date: Fri Mar 23 01:30:50 2012 +0200 New FindOpenCV.cmake for OpenCV 2.x (instead of 0.x/1.0). https://code.ros.org/trac/opencv/attachment/ticket/597/FindOpenCV.cmake - Changes to CMakeLists.txt and webcam.cc accordingly. --- cmake/Modules/FindOpenCV.cmake | 476 ++++++++++++++++++++++------------------ game/CMakeLists.txt | 2 +- game/webcam.cc | 3 +- 3 files changed, 262 insertions(+), 219 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:45
|
Author: Lasse Karkkainen <tro...@tr...> Date: Wed Mar 21 08:06:56 2012 +0200 FFmpeg internal cleanup. Will only decode one stream at a time now (not both audio and video). Refactoring of variable names, etc. --- game/ffmpeg.cc | 115 ++++++++++++++++++++++++++----------------------------- game/ffmpeg.hh | 22 ++++------ 2 files changed, 63 insertions(+), 74 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:40
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Wed Mar 21 06:22:48 2012 +0200 Restore support for older libav versions (Ubuntu 11.10). --- game/ffmpeg.cc | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc index 32a6b78..c04ba8d 100644 --- a/game/ffmpeg.cc +++ b/game/ffmpeg.cc @@ -33,7 +33,11 @@ FFmpeg::~FFmpeg() { if (pResampleCtx) audio_resample_close(pResampleCtx); if (pAudioCodecCtx) avcodec_close(pAudioCodecCtx); if (pVideoCodecCtx) avcodec_close(pVideoCodecCtx); +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0) if (pFormatCtx) avformat_close_input(&pFormatCtx); +#else + if (pFormatCtx) av_close_input_file(pFormatCtx); +#endif } double FFmpeg::duration() const { |
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:37
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Tue Nov 29 11:24:11 2011 +0200 Use std::list for fs Paths instead of std::vector. --- game/fs.cc | 3 +-- game/fs.hh | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/game/fs.cc b/game/fs.cc index cb59487..718d630 100644 --- a/game/fs.cc +++ b/game/fs.cc @@ -214,8 +214,7 @@ Paths const& getPaths(bool refresh) { paths.clear(); std::remove_copy_if(dirs.begin(), dirs.end(), std::inserter(paths, paths.end()), pathNotExist); // Assure that each path appears only once - Paths::iterator it = std::unique(paths.begin(), paths.end()); - paths.resize(it - paths.begin()); + paths.erase(std::unique(paths.begin(), paths.end()), paths.end()); } return paths; } diff --git a/game/fs.hh b/game/fs.hh index a77265a..241d110 100644 --- a/game/fs.hh +++ b/game/fs.hh @@ -1,7 +1,7 @@ #pragma once #include <boost/filesystem.hpp> -#include <vector> +#include <list> // Define this useful alias for the overlong namespace name (yes, for everyone who includes this header) namespace fs = boost::filesystem; @@ -42,7 +42,7 @@ std::string getPath(fs::path const& filename); /** Get full path to a default conguration file **/ fs::path getDefaultConfig(fs::path const &configFile); -typedef std::vector<fs::path> Paths; +typedef std::list<fs::path> Paths; /** Get all shared data paths in preference order **/ Paths const& getPaths(bool refresh = false); |
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Mar 21 05:46:46 2012 +0200
Fix some issues with timecode calculation, should fix video being off sync in some cases (in particular, with very recent libav versions). May also make sync errors appear in songs made for Performous.
---
game/ffmpeg.cc | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 8fdc974..32a6b78 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -135,10 +135,6 @@ struct ReadFramePacket: public AVPacket {
if (av_read_frame(s, this) < 0) throw FFmpeg::eof_error();
}
~ReadFramePacket() { av_free_packet(this); }
- double time() {
- return uint64_t(dts) == uint64_t(AV_NOPTS_VALUE) ?
- getNaN() : double(dts) * av_q2d(m_s->streams[stream_index]->time_base);
- }
};
void FFmpeg::decodePacket() {
@@ -179,7 +175,8 @@ int FFmpeg::decodeVideoFrame(ReadFramePacket& packet) {
int linesize = w * 3;
sws_scale(img_convert_ctx, videoFrame->data, videoFrame->linesize, 0, h, &data, &linesize);
}
- if (packet.time() == packet.time()) m_position = packet.time();
+ // Timecode calculation
+ m_position = double(videoFrame->pkt_pts) * av_q2d(pFormatCtx->streams[videoStream]->time_base);
// Construct a new video frame and push it to output queue
VideoFrame* tmp = new VideoFrame(m_position, w, h);
tmp->data.swap(buffer);
@@ -211,7 +208,9 @@ int FFmpeg::decodeAudioFrame(ReadFramePacket& packet) {
int frames = audio_resample(pResampleCtx, &resampled[0], audioFrames, outsize);
resampled.resize(frames * AUDIO_CHANNELS);
// Use timecode from packet if available
- if (packet.time() == packet.time()) m_position = packet.time();
+ if (uint64_t(packet.pts) != uint64_t(AV_NOPTS_VALUE)) {
+ m_position = double(packet.pts) * av_q2d(pFormatCtx->streams[audioStream]->time_base);
+ }
// Push to output queue (may block)
audioQueue.push(resampled, m_position);
// Increment current time
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:31
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Mar 21 05:24:47 2012 +0200
Fix handling of odd audio timestamps. Should finally fix all the wrong song playing issues.
---
game/ffmpeg.hh | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index 25f15e8..4b0ecf5 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -133,9 +133,14 @@ class AudioBuffer {
mutex::scoped_lock l(m_mutex);
while (!condition()) m_cond.wait(l);
if (m_quit) return;
- if (m_pos == 0 && timestamp != 0.0) {
- std::clog << "ffmpeg/info: The first audio frame begins at " << timestamp << " seconds instead of zero." << std::endl;
+ if (timestamp < 0.0) {
+ std::clog << "ffmpeg/warn: Negative audio timestamp " << timestamp << " seconds, frame ignored." << std::endl;
+ return;
+ }
+ // Insert silence at the beginning if the stream starts later than 0.0
+ if (m_pos == 0 && timestamp > 0.0) {
m_pos = timestamp * m_sps;
+ m_data.resize(m_pos, 0);
}
m_data.insert(m_data.end(), data.begin(), data.end());
m_pos += data.size();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:40:27
|
Author: Vincent Le Ligeour <yo...@us...> Date: Sun Mar 18 07:13:57 2012 +0100 Fixed some compilation errors by missing iostream include (for example continuous integration) --- game/ffmpeg.hh | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh index 6cbdd13..25f15e8 100644 --- a/game/ffmpeg.hh +++ b/game/ffmpeg.hh @@ -10,6 +10,7 @@ #include <boost/thread/recursive_mutex.hpp> #include <boost/thread/thread.hpp> #include <vector> +#include <iostream> using boost::uint8_t; using boost::int16_t; |
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 23:37:40
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Jul 4 02:33:51 2012 +0300
Fix a song browser video playback regression introduced in da635890d22b18db56309c9d73f982dcadc10ee1.
Added the missing preparation pass.
---
game/screen_songs.cc | 5 +++++
game/screen_songs.hh | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 95a5d44..9dacfcf 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -164,6 +164,11 @@ void ScreenSongs::update() {
}
}
+void ScreenSongs::prepare() {
+ double time = m_audio.getPosition();
+ if (m_video) m_video->prepare(time);
+}
+
void ScreenSongs::drawJukebox() {
double pos = m_audio.getPosition();
double len = m_audio.getLength();
diff --git a/game/screen_songs.hh b/game/screen_songs.hh
index a04d18e..e8314cd 100644
--- a/game/screen_songs.hh
+++ b/game/screen_songs.hh
@@ -25,6 +25,7 @@ public:
void reloadGL();
void manageSharedKey(input::NavButton nav); ///< same behaviour for jukebox and normal mode
void manageEvent(SDL_Event event);
+ void prepare();
void draw();
void drawCovers(); ///< draw the cover browser
Surface& getCover(Song const& song); ///< get appropriate cover image for the song (incl. no cover)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 04:18:03
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jul 3 07:17:45 2012 +0300
Add support for HDMI 3D modes 1280x1470 (720p) and 1920x2205 (1080p) in top/bottom mode. Requires custom modelines and manually setting the proper mode before starting Performous.
---
game/video_driver.cc | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 07f796a..c1ed465 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -201,7 +201,7 @@ void Window::render(boost::function<void (void)> drawFunc) {
glerror.check("setup");
// Can we do direct to framebuffer rendering (no FBO)?
if (!stereo || type == 2) { view(stereo); drawFunc(); return; }
- // Render both eyes to FBO (full resolution top/bottom)
+ // Render both eyes to FBO (full resolution top/bottom for anaglyph)
unsigned w = s_width;
unsigned h = 2 * s_height;
FBO fbo(w, h);
@@ -265,15 +265,28 @@ void Window::view(unsigned num) {
glEnable(GL_BLEND);
if (GL_EXT_framebuffer_sRGB) glEnable(GL_FRAMEBUFFER_SRGB);
shader("color").bind();
- // Setup views
+ // Setup views (with black bars for cropping)
double vx = 0.5f * (screen->w - s_width);
double vy = 0.5f * (screen->h - s_height);
double vw = s_width, vh = s_height;
if (num == 0) {
glViewport(vx, vy, vw, vh); // Drawable area of the window (excluding black bars)
} else {
- glViewportIndexedf(1, 0, vh / 2, vw, vh / 2); // Top half of the drawable area
- glViewportIndexedf(2, 0, 0, vw, vh / 2); // Bottom half of the drawable area
+ // Splitscreen stereo3d
+ if (screen->w == 1280 && screen->h == 1470) { // HDMI 720p 3D mode
+ glViewportIndexedf(1, 0, 750, 1280, 720);
+ glViewportIndexedf(2, 0, 0, 1280, 720);
+ s_width = 1280;
+ s_height = 720;
+ } else if (screen->w == 1920 && screen->h == 2205) { // HDMI 1080p 3D mode
+ glViewportIndexedf(1, 0, 1125, 1920, 1080);
+ glViewportIndexedf(2, 0, 0, 1920, 1080);
+ s_width = 1920;
+ s_height = 1080;
+ } else { // Regular top/bottom 3d
+ glViewportIndexedf(1, 0, vh / 2, vw, vh / 2); // Top half of the drawable area
+ glViewportIndexedf(2, 0, 0, vw, vh / 2); // Bottom half of the drawable area
+ }
}
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-07-03 04:18:00
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jul 3 06:47:54 2012 +0300
Improved behavior and debug when audio device fails to start.
---
game/audio.cc | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 7f09b92..224d024 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -385,8 +385,7 @@ Device::Device(unsigned int in, unsigned int out, double rate, unsigned int dev)
void Device::start() {
PaError err = Pa_StartStream(stream);
- if (err != paNoError) throw std::runtime_error("Cannot start PortAudio audio stream "
- + boost::lexical_cast<std::string>(dev) + ": " + Pa_GetErrorText(err));
+ if (err != paNoError) throw std::runtime_error(std::string("Pa_StartStream: ") + Pa_GetErrorText(err));
}
int Device::operator()(void const* input, void* output, unsigned long frames, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags) try {
@@ -478,13 +477,13 @@ struct Audio::Impl {
}
// Match found if we got here
int assigned_mics = 0;
- bool device_init_threw = true;
try {
- devices.push_back(new Device(params.in, params.out, params.rate, i));
- Device& d = devices.back();
- device_init_threw = false;
- // Start capture/playback on this device
- d.start();
+ Device* d = new Device(params.in, params.out, params.rate, i);
+ devices.push_back(d);
+ // Start capture/playback on this device (likely to throw due to audio system errors)
+ // NOTE: When it throws we want to keep the device in devices to avoid calling ~Device
+ // which often would hit the Pa_CloseStream hang bug and terminate the application.
+ d->start();
// Assign mics for all channels of the device
for (unsigned int j = 0; j < params.in; ++j) {
if (analyzers.size() >= 4) break; // Too many mics
@@ -497,15 +496,15 @@ struct Audio::Impl {
}
if (mic_used) continue;
// Add the new analyzer
- Analyzer* a = new Analyzer(d.rate, m);
+ Analyzer* a = new Analyzer(d->rate, m);
analyzers.push_back(a);
- d.mics[j] = a;
+ d->mics[j] = a;
++assigned_mics;
}
// Assign playback output for the first available stereo output
- if (!playback && d.out == 2) { d.outptr = &output; playback = true; }
- } catch (...) {
- if (!device_init_threw) devices.pop_back();
+ if (!playback && d->out == 2) { d->outptr = &output; playback = true; }
+ } catch (std::runtime_error& e) {
+ std::clog << "audio/warning: " << info.name << ": " << e.what() << std::endl;
if (dev > 0) { skip_partial = true; break; } // Numeric, end search
continue;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2012-05-22 06:57:38
|
Author: Lasse Karkkainen <tro...@tr...> Date: Tue May 22 09:57:26 2012 +0300 Add missing (accidentally stashed) files. Not tested. --- CMakeLists.txt | 2 + cmake/Modules/FindLibTorrent.cmake | 40 ++++++++ data/schema.xml | 4 + game/downloader.cc | 71 ++++++++++++++ game/downloader.hh | 15 +++ game/main.cc | 5 + game/screen_downloads.cc | 115 ++++++++++++++++++++++ game/screen_downloads.hh | 29 ++++++ game/screen_intro.cc | 2 + game/theme.cc | 8 ++ game/theme.hh | 15 +++ themes/default/intro_dlc.svg | 188 ++++++++++++++++++++++++++++++++++++ 12 files changed, 494 insertions(+), 0 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2012-05-12 09:18:44
|
Author: Tapio Vierros <tap...@gm...>
Date: Sat May 12 12:17:53 2012 +0300
Hacky fix for never version of ffmpeg, side effects unknown.
---
ffmpeg.cc | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ffmpeg.cc b/ffmpeg.cc
index 365de0c..f474e6e 100644
--- a/ffmpeg.cc
+++ b/ffmpeg.cc
@@ -121,8 +121,10 @@ void FFmpeg::seek_internal() {
int stream = -1;
stream = audioStream;
int64_t target = m_seekTarget * AV_TIME_BASE;
- const AVRational time_base_q = { 1, AV_TIME_BASE }; // AV_TIME_BASE_Q is the same thing with C99 struct literal (not supported by MSVC)
- if (stream != -1) target = av_rescale_q(target, time_base_q, pFormatCtx->streams[stream]->time_base);
+ // FIXME: av_rescale_q not declared on recent ffmpeg
+ // Latest Performous code does not have these lines
+ //const AVRational time_base_q = { 1, AV_TIME_BASE }; // AV_TIME_BASE_Q is the same thing with C99 struct literal (not supported by MSVC)
+ //if (stream != -1) target = av_rescale_q(target, time_base_q, pFormatCtx->streams[stream]->time_base);
av_seek_frame(pFormatCtx, stream, target, flags);
m_seekTarget = getNaN(); // Signal that seeking is done
}
|