X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fencoder.cc;h=f468f91e113a2235ab3c69d17e35a2d6a92bf064;hb=0d5fc564792dc7ab5dd1a9025c85bd69b7b70fba;hp=8a6e1ce8c954c35a8f923e5d372e62e8254f3fa2;hpb=66b61d621173cad85fdd99ef8eb67d75b0e0a2c1;p=dcpomatic.git diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 8a6e1ce8c..f468f91e1 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -45,6 +45,7 @@ #define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL); #define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR); #define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING); +#define LOG_DEBUG_ENCODE(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE); using std::list; using std::cout; @@ -187,7 +188,7 @@ Encoder::frame_done () } } -/** Called to start encoding of the next video frame in the DCP. This is called in order, +/** Called to request encoding of the next video frame in the DCP. This is called in order, * so each time the supplied frame is the one after the previous one. * pv represents one video frame, and could be empty if there is nothing to encode * for this DCP frame. @@ -225,14 +226,18 @@ Encoder::encode (shared_ptr pv) if (_writer->can_fake_write (position)) { /* We can fake-write this frame */ + LOG_DEBUG_ENCODE("Frame @ %1 FAKE", to_string(pv->time())); _writer->fake_write (position, pv->eyes ()); frame_done (); } else if (pv->has_j2k ()) { + LOG_DEBUG_ENCODE("Frame @ %1 J2K", to_string(pv->time())); /* This frame already has JPEG2000 data, so just write it */ _writer->write (pv->j2k(), position, pv->eyes ()); } else if (_last_player_video && _writer->can_repeat(position) && pv->same (_last_player_video)) { + LOG_DEBUG_ENCODE("Frame @ %1 REPEAT", to_string(pv->time())); _writer->repeat (position, pv->eyes ()); } else { + LOG_DEBUG_ENCODE("Frame @ %1 ENCODE", to_string(pv->time())); /* Queue this new frame for encoding */ LOG_TIMING ("add-frame-to-queue queue=%1", _queue.size ()); _queue.push_back (shared_ptr (