summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-02-05 20:36:19 +0100
committerCarl Hetherington <cth@carlh.net>2021-02-05 20:36:54 +0100
commitef578569611e2fa0e91bdd5a726fc0c251540e6d (patch)
tree9732c73ffe9b8f2ec8b3bceab9ad7ee0a30f0c82
parentb66b0060a8134c0d00d3df365d8835d5fbe00455 (diff)
Testing: add minimum frame size configuration option.v2.15.126
-rw-r--r--src/lib/config.cc4
-rw-r--r--src/lib/config.h11
-rw-r--r--src/lib/dcp_video.cc3
-rw-r--r--src/wx/full_config_dialog.cc16
4 files changed, 32 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index c0750bb4e..eda45afff 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -175,6 +175,7 @@ Config::set_defaults ()
_player_playlist_directory = boost::none;
_player_kdm_directory = boost::none;
_audio_mapping = boost::none;
+ _minimum_frame_size = 65536;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
@@ -549,6 +550,8 @@ try
_audio_mapping = AudioMapping (f.node_child("AudioMapping"), Film::current_state_version);
}
+ _minimum_frame_size = f.optional_number_child<int>("MinimumFrameSize").get_value_or(65536);
+
if (boost::filesystem::exists (_cinemas_file)) {
cxml::Document f ("Cinemas");
f.read_file (_cinemas_file);
@@ -972,6 +975,7 @@ Config::write_config () const
if (_audio_mapping) {
_audio_mapping->as_xml (root->add_child("AudioMapping"));
}
+ root->add_child("MinimumFrameSize")->add_child_text(raw_convert<string>(_minimum_frame_size));
try {
auto const s = doc.write_to_string_formatted ();
diff --git a/src/lib/config.h b/src/lib/config.h
index 957a84666..0e8fccb53 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -536,6 +536,10 @@ public:
AudioMapping audio_mapping (int output_channels);
+ int minimum_frame_size () const {
+ return _minimum_frame_size;
+ }
+
/* SET (mostly) */
void set_master_encoding_threads (int n) {
@@ -1047,6 +1051,10 @@ public:
void set_audio_mapping (AudioMapping m);
void set_audio_mapping_to_default ();
+ void set_minimum_frame_size (int size) {
+ maybe_set (_minimum_frame_size, size);
+ }
+
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
/** Emitted if read() failed on an existing Config file. There is nothing
@@ -1260,6 +1268,7 @@ private:
boost::optional<boost::filesystem::path> _player_playlist_directory;
boost::optional<boost::filesystem::path> _player_kdm_directory;
boost::optional<AudioMapping> _audio_mapping;
+ int _minimum_frame_size;
static int const _current_version;
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc
index 1f9f76771..e1666ea75 100644
--- a/src/lib/dcp_video.cc
+++ b/src/lib/dcp_video.cc
@@ -128,7 +128,8 @@ DCPVideo::encode_locally ()
auto const comment = Config::instance()->dcp_j2k_comment();
ArrayData enc = {};
- int constexpr minimum_size = 65536;
+ int const minimum_size = Config::instance()->minimum_frame_size();
+ LOG_GENERAL ("Using minimum frame size %1", minimum_size);
auto xyz = convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2));
int noise_amount = 2;
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index 43c76fddb..e718844f1 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -1342,6 +1342,14 @@ private:
}
{
+ add_label_to_sizer (table, _panel, _("Minimum size of frame (KB)"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+ wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+ _minimum_frame_size = new wxSpinCtrl (_panel);
+ s->Add (_minimum_frame_size, 1);
+ table->Add (s, 1);
+ }
+
+ {
add_top_aligned_label_to_sizer (table, _panel, _("DCP metadata filename format"));
dcp::NameFormat::Map titles;
titles['t'] = wx_to_std (_("type (cpl/pkl)"));
@@ -1414,6 +1422,7 @@ private:
_show_experimental_audio_processors->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::show_experimental_audio_processors_changed, this));
_only_servers_encode->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::only_servers_encode_changed, this));
_frames_in_memory_multiplier->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::frames_in_memory_multiplier_changed, this));
+ _minimum_frame_size->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::minimum_frame_size_changed, this));
_dcp_metadata_filename_format->Changed.connect (boost::bind (&AdvancedPage::dcp_metadata_filename_format_changed, this));
_dcp_asset_filename_format->Changed.connect (boost::bind (&AdvancedPage::dcp_asset_filename_format_changed, this));
_log_general->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::log_changed, this));
@@ -1459,6 +1468,7 @@ private:
checked_set (_log_debug_player, config->log_types() & LogEntry::TYPE_DEBUG_PLAYER);
checked_set (_log_debug_audio_analysis, config->log_types() & LogEntry::TYPE_DEBUG_AUDIO_ANALYSIS);
checked_set (_frames_in_memory_multiplier, config->frames_in_memory_multiplier());
+ checked_set (_minimum_frame_size, config->minimum_frame_size() / 1024);
#ifdef DCPOMATIC_WINDOWS
checked_set (_win32_console, config->win32_console());
#endif
@@ -1483,6 +1493,11 @@ private:
Config::instance()->set_frames_in_memory_multiplier (_frames_in_memory_multiplier->GetValue());
}
+ void minimum_frame_size_changed ()
+ {
+ Config::instance()->set_minimum_frame_size (_minimum_frame_size->GetValue() * 1024);
+ }
+
void allow_any_dcp_frame_rate_changed ()
{
Config::instance()->set_allow_any_dcp_frame_rate (_allow_any_dcp_frame_rate->GetValue ());
@@ -1559,6 +1574,7 @@ private:
wxSpinCtrl* _maximum_j2k_bandwidth;
wxChoice* _video_display_mode;
wxSpinCtrl* _frames_in_memory_multiplier;
+ wxSpinCtrl* _minimum_frame_size;
wxCheckBox* _allow_any_dcp_frame_rate;
wxCheckBox* _allow_any_container;
wxCheckBox* _show_experimental_audio_processors;