From: Carl Hetherington Date: Wed, 14 Mar 2018 00:59:58 +0000 (+0000) Subject: Very basic DCP verification in the player (#1238). X-Git-Tag: v2.13.1~8 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=ccde188f3b560730d14933af5caa11b413c2e623 Very basic DCP verification in the player (#1238). --- diff --git a/ChangeLog b/ChangeLog index 3bf12175c..99a577390 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-03-14 Carl Hetherington + + * Very basic DCP verification option in the player. + 2018-03-07 Carl Hetherington * Fix bad DCPs when re-making in encrypted projects (#1232). diff --git a/cscript b/cscript index 3c0fce7fc..8120e8284 100644 --- a/cscript +++ b/cscript @@ -300,8 +300,8 @@ def dependencies(target): ffmpeg_options = {} return (('ffmpeg-cdist', '5fce90f', ffmpeg_options), - ('libdcp', '92d0468'), - ('libsub', '708eff1'), + ('libdcp', '623e197'), + ('libsub', 'debe9fb'), ('rtaudio-cdist', '739969e')) def configure_options(target): diff --git a/src/lib/wscript b/src/lib/wscript index ae8ab30cb..9e7d83903 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -146,6 +146,7 @@ sources = """ upmixer_a.cc upmixer_b.cc util.cc + verify_dcp_job.cc video_content.cc video_content_scale.cc video_decoder.cc diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index d42320bfd..89bff5cae 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -29,6 +29,7 @@ #include "lib/video_content.h" #include "lib/subtitle_content.h" #include "lib/ratio.h" +#include "lib/verify_dcp_job.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" #include "wx/about_dialog.h" @@ -37,6 +38,7 @@ #include "wx/player_information.h" #include "wx/update_dialog.h" #include "wx/player_config_dialog.h" +#include "wx/verify_dcp_dialog.h" #include #include #include @@ -59,6 +61,7 @@ using std::exception; using std::vector; using boost::shared_ptr; using boost::optional; +using boost::dynamic_pointer_cast; enum { ID_file_open = 1, @@ -72,6 +75,7 @@ enum { ID_view_scale_half, ID_view_scale_quarter, ID_help_report_a_problem, + ID_tools_verify, ID_tools_check_for_updates, }; @@ -120,6 +124,7 @@ public: Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional(2)), ID_view_scale_quarter); Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_about, this), wxID_ABOUT); Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_report_a_problem, this), ID_help_report_a_problem); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_verify, this), ID_tools_verify); Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_check_for_updates, this), ID_tools_check_for_updates); /* Use a panel as the only child of the Frame so that we avoid @@ -239,6 +244,8 @@ private: view->AppendRadioItem(ID_view_scale_quarter, _("Decode at quarter resolution"))->Check(c && c.get() == 2); wxMenu* tools = new wxMenu; + _tools_verify = tools->Append (ID_tools_verify, _("Verify DCP")); + tools->AppendSeparator (); tools->Append (ID_tools_check_for_updates, _("Check for updates")); wxMenu* help = new wxMenu; @@ -373,6 +380,32 @@ private: _config_dialog->Show (this); } + void tools_verify () + { + shared_ptr dcp = boost::dynamic_pointer_cast(_film->content().front()); + DCPOMATIC_ASSERT (dcp); + + JobManager* jm = JobManager::instance (); + jm->add (shared_ptr (new VerifyDCPJob (dcp->directories()))); + + wxProgressDialog* progress = new wxProgressDialog (_("DCP-o-matic Player"), _("Verifying DCP")); + + while (jm->work_to_do() || signal_manager->ui_idle()) { + dcpomatic_sleep (1); + progress->Pulse (); + } + + progress->Destroy (); + + DCPOMATIC_ASSERT (!jm->get().empty()); + shared_ptr last = dynamic_pointer_cast (jm->get().back()); + DCPOMATIC_ASSERT (last); + + VerifyDCPDialog* d = new VerifyDCPDialog (this, last->notes ()); + d->ShowModal (); + d->Destroy (); + } + void tools_check_for_updates () { UpdateChecker::instance()->run (); @@ -471,6 +504,7 @@ private: void set_menu_sensitivity () { + _tools_verify->Enable (static_cast(_film)); _file_add_ov->Enable (static_cast(_film)); _file_add_kdm->Enable (static_cast(_film)); } @@ -487,6 +521,7 @@ private: boost::signals2::scoped_connection _config_changed_connection; wxMenuItem* _file_add_ov; wxMenuItem* _file_add_kdm; + wxMenuItem* _tools_verify; }; static const wxCmdLineEntryDesc command_line_description[] = { diff --git a/src/wx/wscript b/src/wx/wscript index 227691be1..476cd468a 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -114,6 +114,7 @@ sources = """ timeline_view.cc timing_panel.cc update_dialog.cc + verify_dcp_dialog.cc video_panel.cc video_waveform_dialog.cc video_waveform_plot.cc