diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-04-05 23:17:03 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-22 13:03:04 +0200 |
| commit | 21ebc2365dd7a66c05d130dc87861f7399ae834b (patch) | |
| tree | ee1feebe6e0cf10dc5d4ecddbe9ea9ccb9a6b9d8 /src/wx | |
| parent | 4f0d027f1964d0c011f89b5706fbaf654955ba2d (diff) | |
Allow specification of video bit rate separately for J2K and MPEG2.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/dcp_panel.cc | 11 | ||||
| -rw-r--r-- | src/wx/full_config_dialog.cc | 75 |
2 files changed, 63 insertions, 23 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 8ee95df18..bc8ac859c 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -270,7 +270,7 @@ DCPPanel::video_bit_rate_changed() return; } - _film->set_video_bit_rate(_video_bit_rate->GetValue() * 1000000); + _film->set_video_bit_rate(_film->video_encoding(), _video_bit_rate->GetValue() * 1000000); } @@ -397,7 +397,7 @@ DCPPanel::film_changed(FilmProperty p) setup_dcp_name (); break; case FilmProperty::VIDEO_BIT_RATE: - checked_set(_video_bit_rate, _film->video_bit_rate() / 1000000); + checked_set(_video_bit_rate, _film->video_bit_rate(_film->video_encoding()) / 1000000); break; case FilmProperty::USE_ISDCF_NAME: { @@ -460,6 +460,7 @@ DCPPanel::film_changed(FilmProperty p) set_standard(); setup_container(); setup_sensitivity(); + film_changed(FilmProperty::VIDEO_BIT_RATE); break; case FilmProperty::LIMIT_TO_SMPTE_BV20: set_standard(); @@ -754,7 +755,8 @@ DCPPanel::reencode_j2k_changed () void DCPPanel::config_changed (Config::Property p) { - _video_bit_rate->SetRange(1, Config::instance()->maximum_video_bit_rate() / 1000000); + VideoEncoding const encoding = _film ? _film->video_encoding() : VideoEncoding::JPEG2000; + _video_bit_rate->SetRange(1, Config::instance()->maximum_video_bit_rate(encoding) / 1000000); setup_frame_rate_widget (); if (p == Config::SHOW_EXPERIMENTAL_AUDIO_PROCESSORS) { @@ -836,7 +838,8 @@ DCPPanel::make_video_panel () _frame_rate_choice->add_entry(boost::lexical_cast<string>(i)); } - _video_bit_rate->SetRange(1, Config::instance()->maximum_video_bit_rate() / 1000000); + VideoEncoding const encoding = _film ? _film->video_encoding() : VideoEncoding::JPEG2000; + _video_bit_rate->SetRange(1, Config::instance()->maximum_video_bit_rate(encoding) / 1000000); _frame_rate_spin->SetRange (1, 480); _resolution->add_entry(_("2K")); diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 092c9ab26..00e5575b1 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -320,10 +320,19 @@ private: table->Add (_dcp_audio_channels); { - add_label_to_sizer (table, _panel, _("Default JPEG2000 bandwidth"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); + add_label_to_sizer(table, _panel, _("Default JPEG2000 bit rate"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); auto s = new wxBoxSizer (wxHORIZONTAL); - _video_bit_rate = new wxSpinCtrl(_panel); - s->Add(_video_bit_rate); + _j2k_video_bit_rate = new wxSpinCtrl(_panel); + s->Add(_j2k_video_bit_rate); + add_label_to_sizer (s, _panel, _("Mbit/s"), false, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); + table->Add (s, 1); + } + + { + add_label_to_sizer(table, _panel, _("Default MPEG2 bit rate"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); + auto s = new wxBoxSizer (wxHORIZONTAL); + _mpeg2_video_bit_rate = new wxSpinCtrl(_panel); + s->Add(_mpeg2_video_bit_rate); add_label_to_sizer (s, _panel, _("Mbit/s"), false, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); table->Add (s, 1); } @@ -410,8 +419,10 @@ private: _dcp_content_type->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::dcp_content_type_changed, this)); _dcp_audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::dcp_audio_channels_changed, this)); - _video_bit_rate->SetRange(50, 250); - _video_bit_rate->Bind(wxEVT_SPINCTRL, boost::bind(&DefaultsPage::video_bit_rate_changed, this)); + _j2k_video_bit_rate->SetRange(50, 250); + _j2k_video_bit_rate->Bind(wxEVT_SPINCTRL, boost::bind(&DefaultsPage::j2k_video_bit_rate_changed, this)); + _mpeg2_video_bit_rate->SetRange(1, 50); + _mpeg2_video_bit_rate->Bind(wxEVT_SPINCTRL, boost::bind(&DefaultsPage::mpeg2_video_bit_rate_changed, this)); _audio_delay->SetRange (-1000, 1000); _audio_delay->Bind (wxEVT_SPINCTRL, boost::bind (&DefaultsPage::audio_delay_changed, this)); @@ -451,8 +462,10 @@ private: _kdm_directory->SetPath (std_to_wx (config->default_kdm_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ())); _kdm_type->set (config->default_kdm_type()); checked_set (_use_isdcf_name_by_default, config->use_isdcf_name_by_default()); - checked_set(_video_bit_rate, config->default_video_bit_rate() / 1000000); - _video_bit_rate->SetRange(50, config->maximum_video_bit_rate() / 1000000); + checked_set(_j2k_video_bit_rate, config->default_video_bit_rate(VideoEncoding::JPEG2000) / 1000000); + _j2k_video_bit_rate->SetRange(50, config->maximum_video_bit_rate(VideoEncoding::JPEG2000) / 1000000); + checked_set(_mpeg2_video_bit_rate, config->default_video_bit_rate(VideoEncoding::MPEG2) / 1000000); + _mpeg2_video_bit_rate->SetRange(1, config->maximum_video_bit_rate(VideoEncoding::MPEG2) / 1000000); checked_set (_dcp_audio_channels, locale_convert<string> (config->default_dcp_audio_channels())); checked_set (_audio_delay, config->default_audio_delay ()); checked_set (_standard, config->default_interop() ? 1 : 0); @@ -527,9 +540,14 @@ private: config->set_default_kdm_duration (RoughDuration(duration, unit)); } - void video_bit_rate_changed() + void j2k_video_bit_rate_changed() + { + Config::instance()->set_default_video_bit_rate(VideoEncoding::JPEG2000, _j2k_video_bit_rate->GetValue() * 1000000); + } + + void mpeg2_video_bit_rate_changed() { - Config::instance()->set_default_video_bit_rate(_video_bit_rate->GetValue() * 1000000); + Config::instance()->set_default_video_bit_rate(VideoEncoding::MPEG2, _mpeg2_video_bit_rate->GetValue() * 1000000); } void audio_delay_changed () @@ -634,7 +652,8 @@ private: } } - wxSpinCtrl* _video_bit_rate; + wxSpinCtrl* _j2k_video_bit_rate; + wxSpinCtrl* _mpeg2_video_bit_rate; wxSpinCtrl* _audio_delay; wxSpinCtrl* _still_length; #ifdef DCPOMATIC_USE_OWN_PICKER @@ -1541,10 +1560,19 @@ private: _panel->GetSizer()->Add(table, 1, wxALL | wxEXPAND, _border); { - add_label_to_sizer(table, _panel, _("Maximum JPEG2000 bandwidth"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); + add_label_to_sizer(table, _panel, _("Maximum JPEG2000 bit rate"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); auto s = new wxBoxSizer(wxHORIZONTAL); - _maximum_video_bit_rate = new wxSpinCtrl(_panel); - s->Add(_maximum_video_bit_rate, 1); + _maximum_j2k_video_bit_rate = new wxSpinCtrl(_panel); + s->Add(_maximum_j2k_video_bit_rate, 1); + add_label_to_sizer(s, _panel, _("Mbit/s"), false, 0, wxLEFT | wxALIGN_CENTRE_VERTICAL); + table->Add(s, 1); + } + + { + add_label_to_sizer(table, _panel, _("Maximum MPEG2 bit rate"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); + auto s = new wxBoxSizer(wxHORIZONTAL); + _maximum_mpeg2_video_bit_rate = new wxSpinCtrl(_panel); + s->Add(_maximum_mpeg2_video_bit_rate, 1); add_label_to_sizer(s, _panel, _("Mbit/s"), false, 0, wxLEFT | wxALIGN_CENTRE_VERTICAL); table->Add(s, 1); } @@ -1573,8 +1601,10 @@ private: table->Add(s, 1); } - _maximum_video_bit_rate->SetRange(1, 1000); - _maximum_video_bit_rate->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_video_bit_rate_changed, this)); + _maximum_j2k_video_bit_rate->SetRange(1, 1000); + _maximum_j2k_video_bit_rate->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_j2k_video_bit_rate_changed, this)); + _maximum_mpeg2_video_bit_rate->SetRange(1, 100); + _maximum_mpeg2_video_bit_rate->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_mpeg2_video_bit_rate_changed, this)); _allow_any_dcp_frame_rate->bind(&NonStandardPage::allow_any_dcp_frame_rate_changed, this); _allow_any_container->bind(&NonStandardPage::allow_any_container_changed, this); _allow_96khz_audio->bind(&NonStandardPage::allow_96khz_audio_changed, this); @@ -1588,7 +1618,8 @@ private: { auto config = Config::instance(); - checked_set(_maximum_video_bit_rate, config->maximum_video_bit_rate() / 1000000); + checked_set(_maximum_j2k_video_bit_rate, config->maximum_video_bit_rate(VideoEncoding::JPEG2000) / 1000000); + checked_set(_maximum_mpeg2_video_bit_rate, config->maximum_video_bit_rate(VideoEncoding::MPEG2) / 1000000); checked_set(_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate()); checked_set(_allow_any_container, config->allow_any_container()); checked_set(_allow_96khz_audio, config->allow_96khz_audio()); @@ -1597,9 +1628,14 @@ private: checked_set(_isdcf_name_part_length, config->isdcf_name_part_length()); } - void maximum_video_bit_rate_changed() + void maximum_j2k_video_bit_rate_changed() + { + Config::instance()->set_maximum_video_bit_rate(VideoEncoding::JPEG2000, _maximum_j2k_video_bit_rate->GetValue() * 1000000); + } + + void maximum_mpeg2_video_bit_rate_changed() { - Config::instance()->set_maximum_video_bit_rate(_maximum_video_bit_rate->GetValue() * 1000000); + Config::instance()->set_maximum_video_bit_rate(VideoEncoding::MPEG2, _maximum_mpeg2_video_bit_rate->GetValue() * 1000000); } void allow_any_dcp_frame_rate_changed() @@ -1632,7 +1668,8 @@ private: Config::instance()->set_isdcf_name_part_length(_isdcf_name_part_length->GetValue()); } - wxSpinCtrl* _maximum_video_bit_rate = nullptr; + wxSpinCtrl* _maximum_j2k_video_bit_rate = nullptr; + wxSpinCtrl* _maximum_mpeg2_video_bit_rate = nullptr; CheckBox* _allow_any_dcp_frame_rate = nullptr; CheckBox* _allow_any_container = nullptr; CheckBox* _allow_96khz_audio = nullptr; |
