diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-02-08 12:19:51 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-02-08 12:19:51 +0000 |
| commit | c8e32123f94a9bb7c3bd13611053bcf6ce08b760 (patch) | |
| tree | 1ff3a10e76c7827138a61d64d8d9c76f61af6714 /src | |
| parent | 07a95f6750979c8e353d1434d7fca6b780fc3a1f (diff) | |
Log some stats from the writer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/writer.cc | 20 | ||||
| -rw-r--r-- | src/lib/writer.h | 5 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 91a692ba0..563acc02d 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -46,6 +46,10 @@ Writer::Writer (shared_ptr<Film> f) , _finish (false) , _queued_full_in_memory (0) , _last_written_frame (-1) + , _full_written (0) + , _fake_written (0) + , _repeat_written (0) + , _pushed_to_disk (0) { /* Remove any old DCP */ boost::filesystem::remove_all (_film->dir (_film->dcp_name ())); @@ -159,6 +163,18 @@ Writer::thread () --_queued_full_in_memory; } + switch (qi.type) { + case QueueItem::FULL: + ++_full_written; + break; + case QueueItem::FAKE: + ++_fake_written; + break; + case QueueItem::REPEAT: + ++_repeat_written; + break; + } + lock.unlock (); switch (qi.type) { case QueueItem::FULL: @@ -204,6 +220,8 @@ Writer::thread () assert (i != _queue.rend()); QueueItem qi = *i; + ++_pushed_to_disk; + lock.unlock (); _film->log()->log (String::compose ("Writer full (awaiting %1); pushes %2 to disk", _last_written_frame + 1, qi.frame)); qi.encoded->write (_film, qi.frame); @@ -284,6 +302,8 @@ Writer::finish () )); dcp.write_xml (); + + _film->log()->log (String::compose ("Wrote %1 FULL, %2 FAKE, %3 REPEAT; %4 pushed to disk", _full_written, _fake_written, _repeat_written, _pushed_to_disk)); } /** Tell the writer that frame `f' should be a repeat of the frame before it */ diff --git a/src/lib/writer.h b/src/lib/writer.h index 68e422a50..ba989b022 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -84,6 +84,11 @@ private: int _last_written_frame; static const int _maximum_frames_in_memory; + int _full_written; + int _fake_written; + int _repeat_written; + int _pushed_to_disk; + boost::shared_ptr<libdcp::MonoPictureAsset> _picture_asset; boost::shared_ptr<libdcp::MonoPictureAssetWriter> _picture_asset_writer; boost::shared_ptr<libdcp::SoundAsset> _sound_asset; |
