diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-02 00:28:07 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-02 00:28:07 +0100 |
| commit | fc09f6798fc05d100e6a5fbf3e9b1f811be0ef46 (patch) | |
| tree | 47ff5c44f8a81fd7ef84960c52d9eba06e033583 /src/lib | |
| parent | e1e7827d75df6ea11b6bfd2aabd3eb3fb1f2e701 (diff) | |
Some more timing logging.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/j2k_wav_encoder.cc | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/lib/j2k_wav_encoder.cc b/src/lib/j2k_wav_encoder.cc index 4deedc388..0d786ab04 100644 --- a/src/lib/j2k_wav_encoder.cc +++ b/src/lib/j2k_wav_encoder.cc @@ -145,11 +145,16 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) int remote_backoff = 0; while (1) { + + { + stringstream s; + s << "Encoder thread " << pthread_self() << " sleeps."; + _log->microsecond_log (s.str(), Log::TIMING); + } + boost::mutex::scoped_lock lock (_worker_mutex); while (_queue.empty () && !_process_end) { - _log->microsecond_log ("Encoder thread sleeps", Log::TIMING); _worker_condition.wait (lock); - _log->microsecond_log ("Encoder thread wakes", Log::TIMING); } if (_process_end) { @@ -157,7 +162,13 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) } boost::shared_ptr<DCPVideoFrame> vf = _queue.front (); - _log->microsecond_log ("Encoder thread wakes with queue of " + boost::lexical_cast<string> (_queue.size ()), Log::TIMING); + + { + stringstream s; + s << "Encoder thread " << pthread_self() << " wakes with queue of " << _queue.size(); + _log->microsecond_log (s.str(), Log::TIMING); + } + _queue.pop_front (); lock.unlock (); @@ -189,9 +200,19 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) } else { try { - _log->microsecond_log ("Encoder thread begins local encode of " + lexical_cast<string> (vf->frame ()), Log::TIMING); + { + stringstream s; + s << "Encoder thread " << pthread_self() << " begins local encode of " << vf->frame(); + _log->microsecond_log (s.str(), Log::TIMING); + } + encoded = vf->encode_locally (); - _log->microsecond_log ("Encoder thread finishes local encode of " + lexical_cast<string> (vf->frame ()), Log::TIMING); + + { + stringstream s; + s << "Encoder thread " << pthread_self() << " finishes local encode of " << vf->frame(); + _log->microsecond_log (s.str(), Log::TIMING); + } } catch (std::exception& e) { stringstream s; s << "Local encode failed " << e.what() << "."; |
