Tidy up and implement support for self capture on linux

This commit is contained in:
baldurk
2023-07-28 11:07:23 +01:00
parent 9c553bbfb1
commit 7c1164e060
26 changed files with 289 additions and 173 deletions
+8 -4
View File
@@ -394,7 +394,12 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
ui->action_Recompress_Capture->setEnabled(false);
#if defined(Q_OS_WIN32)
if(GetModuleHandleA("rdocself.dll"))
#define SELF_HOST_NAME "rdocself.dll"
#else
#define SELF_HOST_NAME "librdocself.so"
#endif
if(RENDERDOC_CanSelfHostedCapture(SELF_HOST_NAME))
{
QAction *begin = new QAction(tr("Start Self-hosted Capture"), this);
QAction *end = new QAction(tr("End Self-hosted Capture"), this);
@@ -404,21 +409,20 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
begin->setEnabled(false);
end->setEnabled(true);
RENDERDOC_StartSelfHostCapture("rdocself.dll");
RENDERDOC_StartSelfHostCapture(SELF_HOST_NAME);
});
QObject::connect(end, &QAction::triggered, [begin, end]() {
begin->setEnabled(true);
end->setEnabled(false);
RENDERDOC_EndSelfHostCapture("rdocself.dll");
RENDERDOC_EndSelfHostCapture(SELF_HOST_NAME);
});
ui->menu_Tools->addSeparator();
ui->menu_Tools->addAction(begin);
ui->menu_Tools->addAction(end);
}
#endif
m_Ctx.AddCaptureViewer(this);