GS/FullscreenUI: Add video recording option to pause menu

Signed-off-by: SternXD <stern@sidestore.io>
This commit is contained in:
SternXD authored and lightningterror committed 2026-09-14 08:59:26 +02:00
1 parent a7ed3190e0
commit 9b37fc68a1
3 files changed
+29 -12

No files matched your search

+16 -11
View File
@@ -523,6 +523,21 @@ void GSEndCapture()
g_gs_renderer->EndCapture();
}
void GSToggleVideoCapture()
{
if (!g_gs_renderer)
return;
if (GSCapture::IsCapturing())
{
g_gs_renderer->EndCapture();
return;
}
std::string filename(fmt::format("{}.{}", GSGetBaseVideoFilename(), GSConfig.CaptureContainer));
g_gs_renderer->BeginCapture(std::move(filename));
}
void GSPresentCurrentFrame()
{
g_gs_renderer->PresentCurrentFrame();
@@ -1217,17 +1232,7 @@ BEGIN_HOTKEY_LIST(g_gs_hotkeys){"Screenshot", TRANSLATE_NOOP("Hotkeys", "Graphic
[](s32 pressed) {
if (!pressed)
{
if (GSCapture::IsCapturing())
{
MTGS::RunOnGSThread([]() { g_gs_renderer->EndCapture(); });
MTGS::WaitGS(false, false, false);
return;
}
MTGS::RunOnGSThread([]() {
std::string filename(fmt::format("{}.{}", GSGetBaseVideoFilename(), GSConfig.CaptureContainer));
g_gs_renderer->BeginCapture(std::move(filename));
});
MTGS::RunOnGSThread(&GSToggleVideoCapture);
// Sync GS thread. We want to start adding audio at the same time as video.
MTGS::WaitGS(false, false, false);
+1
View File
@@ -81,6 +81,7 @@ void GSDumpSavedMetrics();
bool GSIsSavingMetrics();
bool GSBeginCapture(std::string filename);
void GSEndCapture();
void GSToggleVideoCapture();
void GSPresentCurrentFrame();
void GSThrottlePresentation();
void GSGameChanged();
+12 -1
View File
@@ -5,6 +5,7 @@
#include "CDVD/CDVDcommon.h"
#include "GS/Renderers/Common/GSDevice.h"
#include "GS/Renderers/Common/GSTexture.h"
#include "GS/GSCapture.h"
#include "Achievements.h"
#include "CDVD/CDVDdiscReader.h"
#include "GameList.h"
@@ -1668,7 +1669,7 @@ void FullscreenUI::DrawPauseMenu(MainWindowType type)
ImVec2(10.0f, 10.0f), ImGuiWindowFlags_NoBackground))
{
static constexpr u32 submenu_item_count[] = {
11, // None
12, // None
4, // Exit
3, // Achievements
};
@@ -1769,6 +1770,16 @@ void FullscreenUI::DrawPauseMenu(MainWindowType type)
ClosePauseMenu();
}
const bool is_capturing = GSCapture::IsCapturing();
const bool can_start_capture = GSConfig.EnableVideoCapture || GSConfig.EnableAudioCapture;
if (ActiveButton(is_capturing ? FSUI_ICONSTR(ICON_FA_VIDEO_SLASH, "Stop Recording") :
FSUI_ICONSTR(ICON_FA_VIDEO, "Start Recording"),
false, is_capturing || can_start_capture))
{
GSToggleVideoCapture();
ClosePauseMenu();
}
if (ActiveButton(GSIsHardwareRenderer() ? (FSUI_ICONSTR(ICON_FA_PAINTBRUSH, "Switch To Software Renderer")) :
(FSUI_ICONSTR(ICON_FA_PAINTBRUSH, "Switch To Hardware Renderer")),
false))