From 3ed9acb384ed8dda2373573f6b266a2435b3330b Mon Sep 17 00:00:00 2001 From: evgeny Date: Sun, 18 Oct 2026 16:28:36 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A3=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=81=D0=B6=D0=B0=D1=82=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=BD=D0=B5=D0=BB=D0=B8=20=D0=B7=D0=B2=D0=BE=D0=BD=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B8=20=D1=80=D0=B0=D1=81=D0=BF=D0=B0=D1=80=D0=B0?= =?UTF-8?q?=D0=BB=D0=BB=D0=B5=D0=BB=D0=B8=D1=82=D1=8C=20HEVC=20=D0=B2?= =?UTF-8?q?=D0=BD=D1=83=D1=82=D1=80=D0=B8=20=D0=BA=D0=B0=D0=B4=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/chatgui/src/callwindow.cpp | 10 ++++++++-- tools/chatgui/src/live_video_encoder.cpp | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/chatgui/src/callwindow.cpp b/tools/chatgui/src/callwindow.cpp index a5791391..e5f0e04c 100644 --- a/tools/chatgui/src/callwindow.cpp +++ b/tools/chatgui/src/callwindow.cpp @@ -191,7 +191,6 @@ CallWindow::CallWindow(QWidget* parent) : QWidget(parent, Qt::Window) { setWindowTitle(QCoreApplication::translate("ChatGui", "Call")); resize(520, 520); - setMinimumSize(420, 360); setAttribute(Qt::WA_DeleteOnClose, false); m_avatarLabel = new QLabel(this); @@ -244,10 +243,14 @@ CallWindow::CallWindow(QWidget* parent) auto* root = new QVBoxLayout(this); root->setContentsMargins(12, 12, 12, 12); + root->setSizeConstraint(QLayout::SetMinimumSize); m_videoWindow = new CallVideoWindow(this); m_panel = new QWidget(this); m_panel->setObjectName("callPanel"); m_panel->setMaximumWidth(640); m_panel->setStyleSheet("QWidget#callPanel { background: palette(window); border-radius: 12px; }"); - root->addWidget(m_panel, 0, Qt::AlignCenter); + // Вертикальное центрирование через отступы сохраняет минимальную высоту панели в расчёте размера окна. + root->addStretch(1); + root->addWidget(m_panel, 0, Qt::AlignHCenter); + root->addStretch(1); QVBoxLayout* lay = new QVBoxLayout(m_panel); lay->setContentsMargins(16, 20, 16, 16); lay->setSpacing(8); @@ -457,6 +460,9 @@ void CallWindow::updateVideoPresentation() { m_videoEnabled->setVisible(active); m_settingsBtn->setVisible(active); m_videoControls->setVisible(settings); m_showVideoBtn->setVisible(receiving); m_videoStatus->setVisible(active && !m_videoStatus->text().isEmpty()); + QSize panelMinimum = m_panel->minimumSizeHint(); + DEBUG_DEBUG(DEBUG_CATEGORY_CALL, "call layout active=%d preview=%d settings=%d window=%dx%d panel_min=%dx%d", + active, m_localPreview->isVisible(), settings, width(), height(), panelMinimum.width(), panelMinimum.height()); update(); } diff --git a/tools/chatgui/src/live_video_encoder.cpp b/tools/chatgui/src/live_video_encoder.cpp index 13f2cc68..dfa91a79 100644 --- a/tools/chatgui/src/live_video_encoder.cpp +++ b/tools/chatgui/src/live_video_encoder.cpp @@ -10,6 +10,7 @@ extern "C" { #include #include #include +#include #include #include #endif @@ -169,8 +170,12 @@ bool LiveVideoEncoder::open(const LiveVideoConfig& config, Backend backend) { if (name == "libx264" || name == "libx265") { av_dict_set(&options, "preset", "ultrafast", 0); av_dict_set(&options, "tune", "zerolatency", 0); av_dict_set(&options, "forced-idr", "1", 0); + const int workers = std::clamp(av_cpu_count(), 1, 4); QByteArray params = name == "libx264" ? "scenecut=0:open-gop=0:repeat-headers=0" - : "bframes=0:rc-lookahead=0:open-gop=0:pools=1:frame-threads=1:log-level=error"; + : "bframes=0:rc-lookahead=0:open-gop=0:frame-threads=1:wpp=1:log-level=error:pools=" + QByteArray::number(workers); + if (name == "libx265") + DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "live HEVC parallelism workers=%d frame_threads=1 wpp=1 cpu_count=%d", + workers, av_cpu_count()); if (constrained) { c->thread_count = 1; av_dict_set(&options, "profile", name == "libx264" ? "baseline" : "main", 0);