From ad95ec8759777c4b8df0dcd66fd8200d24e912b1 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 14 Aug 2026 01:29:59 +0400 Subject: pica-client: VAAPI hardware acceleration --- pica-client/callwindow.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'pica-client/callwindow.cpp') diff --git a/pica-client/callwindow.cpp b/pica-client/callwindow.cpp index 5eb21cc..b2975d5 100644 --- a/pica-client/callwindow.cpp +++ b/pica-client/callwindow.cpp @@ -38,11 +38,19 @@ CallWindow::CallWindow(QByteArray peer_id, bool incoming) lbVideo->setAlignment(Qt::AlignCenter); lbVideo->setMinimumSize(320, 240); lbVideo->hide(); +#ifdef HAVE_VAAPI + videoGpu = new VaapiVideoWidget(this); + videoGpu->setMinimumSize(320, 240); + videoGpu->hide(); +#endif callTimer = new QTimer(this); callElapsedSeconds = 0; lv->addWidget(lbTimer); lv->addWidget(lbVideo); +#ifdef HAVE_VAAPI + lv->addWidget(videoGpu); +#endif lh->addWidget(pbAccept, Qt::AlignLeft); lh->addWidget(pbCall, Qt::AlignLeft); @@ -95,6 +103,24 @@ void CallWindow::showRemoteFrame(QImage frame) Qt::SmoothTransformation)); } +#ifdef HAVE_VAAPI +void CallWindow::showRemoteHwFrame(AVFramePtr frame) +{ + if (!frame) + return; + + // These frames hold a GPU surface rather than pixels, so the label cannot + // show them - the GL widget takes over the video area instead. + if (videoGpu->isHidden()) + { + lbVideo->hide(); + videoGpu->show(); + } + + videoGpu->setFrame(frame); +} +#endif + void CallWindow::update_call_timer() { int hours, minutes, seconds; -- cgit v1.2.1