Add a bit more debug logging to the player.
authorCarl Hetherington <cth@carlh.net>
Wed, 20 May 2020 18:20:08 +0000 (20:20 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 20 May 2020 19:56:28 +0000 (21:56 +0200)
src/lib/dcpomatic_log.h
src/lib/log_entry.cc
src/lib/log_entry.h
src/lib/player.cc
src/lib/shuffler.cc
test/test.cc

index c969c508d1b27aa43276b40efb4e4351921f7dc3..52a77f2f1615cbaeac919aeff48bcb7dcdf23319 100644 (file)
@@ -38,3 +38,5 @@ extern boost::shared_ptr<Log> dcpomatic_log;
 #define LOG_DEBUG_THREED_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DEBUG_THREED);
 #define LOG_DISK(...)         dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DISK);
 #define LOG_DISK_NC(...)      dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DISK);
+#define LOG_DEBUG_PLAYER(...)    dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_PLAYER);
+#define LOG_DEBUG_PLAYER_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DEBUG_PLAYER);
index 01d1415c701fbe4d218c1abb54a5e097b6bd5c66..f890d488ab920c256ce417b9fa05d3d7dcf7eb5b 100644 (file)
@@ -33,6 +33,7 @@ int const LogEntry::TYPE_TIMING       = 0x020;
 int const LogEntry::TYPE_DEBUG_EMAIL  = 0x040;
 int const LogEntry::TYPE_DEBUG_VIDEO_VIEW = 0x080;
 int const LogEntry::TYPE_DISK         = 0x100;
+int const LogEntry::TYPE_DEBUG_PLAYER = 0x200;
 
 using std::string;
 
index 136ab00f905182566d3a81afb1a1c20c451dcd95..4bace41a43b88a94c978bd066dd3e592ff9fcc75 100644 (file)
@@ -37,6 +37,7 @@ public:
        static const int TYPE_DEBUG_EMAIL;
        static const int TYPE_DEBUG_VIDEO_VIEW; ///< real-time video viewing (i.e. "playback")
        static const int TYPE_DISK;
+       static const int TYPE_DEBUG_PLAYER;     ///< the Player class
 
        explicit LogEntry (int type);
        virtual ~LogEntry () {}
index 4f81199a5a49847394ff58834786624bbec2d4a0..d2e5ed52104b136b136b5c578f08d745ab12c4a9 100644 (file)
@@ -23,6 +23,7 @@
 #include "audio_buffers.h"
 #include "content_audio.h"
 #include "dcp_content.h"
+#include "dcpomatic_log.h"
 #include "job.h"
 #include "image.h"
 #include "raw_image_proxy.h"
@@ -664,6 +665,7 @@ Player::pass ()
                break;
        }
        case BLACK:
+               LOG_DEBUG_PLAYER ("Emit black for gap at %1", to_string(_black.position()));
                emit_video (black_player_video_frame(EYES_BOTH), _black.position());
                _black.set_position (_black.position() + one_video_frame());
                break;
@@ -836,10 +838,12 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
                                }
                                while (j < fill_to || eyes != fill_to_eyes) {
                                        if (last != _last_video.end()) {
+                                               LOG_DEBUG_PLAYER("Fill using last video at %1 in 3D mode", to_string(j));
                                                shared_ptr<PlayerVideo> copy = last->second->shallow_copy();
                                                copy->set_eyes (eyes);
                                                emit_video (copy, j);
                                        } else {
+                                               LOG_DEBUG_PLAYER("Fill using black at %1 in 3D mode", to_string(j));
                                                emit_video (black_player_video_frame(eyes), j);
                                        }
                                        if (eyes == EYES_RIGHT) {
index 2d646552605463f2cffe29c23ff43be3302f44e4..d913f48ef5301f12fc6e3d0b0d1ca6b77dce48a7 100644 (file)
@@ -116,6 +116,7 @@ void
 Shuffler::flush ()
 {
        BOOST_FOREACH (Store i, _store) {
+               LOG_DEBUG_PLAYER("Flushing %1 from shuffler", i.second.frame);
                Video (i.first, i.second);
        }
 }
index 3ec78e68b3c16377bcb821a90399473909c7671f..90decc2df31d677f9f3699478eaf0bc3a43e1ed7 100644 (file)
@@ -87,7 +87,9 @@ setup_test_config ()
        Config::instance()->set_default_j2k_bandwidth (100000000);
        Config::instance()->set_default_interop (false);
        Config::instance()->set_default_still_length (10);
-       Config::instance()->set_log_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR | LogEntry::TYPE_DEBUG_THREED | LogEntry::TYPE_DEBUG_ENCODE);
+       Config::instance()->set_log_types (
+               LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR | LogEntry::TYPE_DEBUG_THREED | LogEntry::TYPE_DEBUG_ENCODE | LogEntry::TYPE_DEBUG_PLAYER
+               );
        Config::instance()->set_automatic_audio_analysis (false);
 }