diff options
| author | Anton <anton@picapica.im> | 2026-08-14 01:29:59 +0400 |
|---|---|---|
| committer | Anton <anton@picapica.im> | 2026-08-14 01:29:59 +0400 |
| commit | ad95ec8759777c4b8df0dcd66fd8200d24e912b1 (patch) | |
| tree | c5da156d51d1839abaa3ae0804ae588ea64a8cf7 /pica-client/callwindow.cpp | |
| parent | 6ef469ba767574384c0373daa5363efb95102ed9 (diff) | |
| download | pica-pica-ad95ec8759777c4b8df0dcd66fd8200d24e912b1.tar.gz pica-pica-ad95ec8759777c4b8df0dcd66fd8200d24e912b1.zip | |
pica-client: VAAPI hardware acceleration
Diffstat (limited to 'pica-client/callwindow.cpp')
| -rw-r--r-- | pica-client/callwindow.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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; |
