Remove config of grok server port (#2900).
authorCarl Hetherington <cth@carlh.net>
Thu, 28 Nov 2024 18:24:45 +0000 (19:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 29 Nov 2024 22:32:32 +0000 (23:32 +0100)
The server now always uses port 80.

src/lib/config.cc
src/lib/config.h
src/lib/grok/context.h
src/lib/grok/messenger.h
src/wx/grok/gpu_config_panel.h

index cd285abd1198252491a16af85e2b81c74094c107..2787b2de25108ba0badd7737c7cd5beb63473b7d 100644 (file)
@@ -1747,7 +1747,6 @@ Config::Grok::Grok(cxml::ConstNodePtr node)
        , binary_location(node->string_child("BinaryLocation"))
        , selected(node->number_child<int>("Selected"))
        , licence_server(node->string_child("LicenceServer"))
-       , licence_port(node->number_child<int>("LicencePort"))
        , licence(node->string_child("Licence"))
 {
 
@@ -1761,7 +1760,6 @@ Config::Grok::as_xml(xmlpp::Element* node) const
        node->add_child("Enable")->add_child_text((enable ? "1" : "0"));
        node->add_child("Selected")->add_child_text(raw_convert<string>(selected));
        node->add_child("LicenceServer")->add_child_text(licence_server);
-       node->add_child("LicencePort")->add_child_text(raw_convert<string>(licence_port));
        node->add_child("Licence")->add_child_text(licence);
 }
 
index 52fe47b3fc954e07977e51597df65febe4bab1ef..45ac7ffb89c910210888352a30811a9e4f03a5d1 100644 (file)
@@ -657,7 +657,6 @@ public:
                boost::filesystem::path binary_location;
                int selected = 0;
                std::string licence_server;
-               int licence_port = 5000;
                std::string licence;
        };
 
index 70181466b940cbf5aba6855a226d37d2b6311542..602c8b13ff63574f1d58da7f9aeffd4c2ec2350a 100644 (file)
@@ -229,7 +229,6 @@ public:
                                        _dcpomatic_context->film->video_frame_rate(),
                                        _dcpomatic_context->film->video_bit_rate(VideoEncoding::JPEG2000),
                                        grok.licence_server,
-                                       grok.licence_port,
                                        grok.licence)) {
                                _launch_failed = true;
                                return false;
index 89205d0a8fd2934645d4dad43125ea3f5fa4fa82..608462b0e63dd06f74a541638258f43afc0a1c8f 100644 (file)
@@ -542,11 +542,9 @@ struct Messenger
                uint32_t fps,
                uint32_t bandwidth,
                const std::string server,
-               uint32_t port,
                const std::string license
                )
        {
-
                std::unique_lock<std::mutex> lk(shutdownMutex_);
                if (async_result_.valid()) {
                        return true;
@@ -555,14 +553,13 @@ struct Messenger
                        init_.unlink();
                }
                startThreads();
-               auto fullServer = server + ":" + std::to_string(port);
                char cmd[4096];
                snprintf(cmd, sizeof(cmd),
                                "./grk_compress -batch_src %s,%d,%d,%d,%d,%d -out_fmt j2k -k 1 "
                                "-G %d -%s %d,%d -j %s -J %s -v",
                                GRK_MSGR_BATCH_IMAGE.c_str(), width, stride, height, samplesPerPixel, depth,
                                device, is4K ? "cinema4K" : "cinema2K", fps, bandwidth,
-                               license.c_str(), fullServer.c_str());
+                               license.c_str(), server.c_str());
 
                return launch(cmd, dir);
        }
index a73c2650304ca1c8c0a64091e16df1ac21111363..5696aa8ce985f4a0a8fef2fa38a68d8566fdeb86 100644 (file)
@@ -137,11 +137,6 @@ private:
                _server = new wxTextCtrl(_panel, wxID_ANY);
                table->Add(_server, 1, wxEXPAND | wxALL);
 
-               add_label_to_sizer(table, _panel, _("Port"), false, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
-               _port = new wxSpinCtrl(_panel, wxID_ANY);
-               _port->SetRange(0, 65535);
-               table->Add(_port);
-
                add_label_to_sizer(table, _panel, _("License"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
                _licence = new PasswordEntry(_panel);
                table->Add(_licence->get_panel(), 1, wxEXPAND | wxALL);
@@ -149,7 +144,6 @@ private:
                _enable_gpu->bind(&GPUPage::enable_gpu_changed, this);
                _binary_location->Bind(wxEVT_DIRPICKER_CHANGED, boost::bind (&GPUPage::binary_location_changed, this));
                _server->Bind(wxEVT_TEXT, boost::bind(&GPUPage::server_changed, this));
-               _port->Bind(wxEVT_SPINCTRL, boost::bind(&GPUPage::port_changed, this));
                _licence->Changed.connect(boost::bind(&GPUPage::licence_changed, this));
 
                setup_sensitivity();
@@ -162,7 +156,6 @@ private:
                _binary_location->Enable(grok.enable);
                _gpu_list_control->Enable(grok.enable);
                _server->Enable(grok.enable);
-               _port->Enable(grok.enable);
                _licence->get_panel()->Enable(grok.enable);
        }
 
@@ -175,7 +168,6 @@ private:
                _gpu_list_control->update();
                _gpu_list_control->set_selection(grok.selected);
                checked_set(_server, grok.licence_server);
-               checked_set(_port, grok.licence_port);
                checked_set(_licence, grok.licence);
        }
 
@@ -207,7 +199,6 @@ private:
        void port_changed()
        {
                auto grok = Config::instance()->grok().get_value_or({});
-               grok.licence_port = _port->GetValue();
                Config::instance()->set_grok(grok);
        }
 
@@ -222,6 +213,5 @@ private:
        wxDirPickerCtrl* _binary_location = nullptr;
        GpuList* _gpu_list_control = nullptr;
        wxTextCtrl* _server = nullptr;
-       wxSpinCtrl* _port = nullptr;
        PasswordEntry* _licence = nullptr;
 };