exporter: print extra debugging information

Should be helpful for debugging any potential export hangs if there
are any in the future.
This commit is contained in:
itsmattkc
2020-03-03 01:48:38 +11:00
parent 9e8a384f14
commit 8825ff9953
2 changed files with 18 additions and 0 deletions
+13
View File
@@ -18,6 +18,9 @@ Exporter::Exporter(ViewerOutput* viewer,
export_status_(false),
export_msg_(tr("Export hasn't started yet"))
{
debug_timer_.setInterval(5000);
connect(&debug_timer_, &QTimer::timeout, this, &Exporter::DebugTimerMessage);
connect(this, &Exporter::ExportEnded, this, &Exporter::deleteLater);
}
@@ -148,6 +151,7 @@ void Exporter::EncodeFrame()
if (waiting_for_frame_ >= viewer_node_->Length()) {
video_done_ = true;
debug_timer_.stop();
ExportSucceeded();
}
@@ -155,6 +159,8 @@ void Exporter::EncodeFrame()
void Exporter::FrameRendered(const rational &time, FramePtr value)
{
debug_timer_.stop();
const QMap<rational, QByteArray>& time_hash_map = video_backend_->frame_cache()->time_hash_map();
QByteArray this_hash = time_hash_map.value(time);
@@ -172,6 +178,8 @@ void Exporter::FrameRendered(const rational &time, FramePtr value)
qDebug() << " Waiting for" << waiting_for_frame_.toDouble();
EncodeFrame();
debug_timer_.start();
}
void Exporter::AudioRendered()
@@ -247,3 +255,8 @@ void Exporter::VideoHashesComplete()
video_backend_->InvalidateCache(range);
}
}
void Exporter::DebugTimerMessage()
{
qDebug() << "Still waiting for" << waiting_for_frame_.toDouble();
}
+5
View File
@@ -3,6 +3,7 @@
#include <QMatrix4x4>
#include <QString>
#include <QTimer>
#include <QObject>
#include "codec/encoder.h"
@@ -73,6 +74,8 @@ private:
QHash<rational, FramePtr> cached_frames_;
QTimer debug_timer_;
private slots:
void FrameRendered(const rational &time, FramePtr value);
@@ -88,6 +91,8 @@ private slots:
void VideoHashesComplete();
void DebugTimerMessage();
};
#endif // EXPORTER_H