From f2880b08d146d794751560ccd5bc81225078df13 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Sat, 26 Jan 2019 22:36:39 +0800 Subject: [PATCH] core: Add VideoDumper to System --- src/core/core.cpp | 13 +++++++++++++ src/core/core.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/core/core.cpp b/src/core/core.cpp index a8abf9af15..b7f33d504b 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -16,6 +16,7 @@ #include "core/cheats/cheats.h" #include "core/core.h" #include "core/core_timing.h" +#include "core/dumping/backend.h" #include "core/gdbstub/gdbstub.h" #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/kernel.h" @@ -274,6 +275,14 @@ const Cheats::CheatEngine& System::CheatEngine() const { return *cheat_engine; } +VideoDumper::Backend& System::VideoDumper() { + return *video_dumper; +} + +const VideoDumper::Backend& System::VideoDumper() const { + return *video_dumper; +} + void System::RegisterMiiSelector(std::shared_ptr mii_selector) { registered_mii_selector = std::move(mii_selector); } @@ -306,6 +315,10 @@ void System::Shutdown() { timing.reset(); app_loader.reset(); + if (video_dumper->IsDumping()) { + video_dumper->StopDumping(); + } + if (auto room_member = Network::GetRoomMember().lock()) { Network::GameInfo game_info{}; room_member->SendGameInfo(game_info); diff --git a/src/core/core.h b/src/core/core.h index bcc3712517..183a5f2f5c 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -49,6 +49,10 @@ namespace Cheats { class CheatEngine; } +namespace VideoDumper { +class Backend; +} + namespace Core { class Timing; @@ -206,6 +210,12 @@ public: /// Gets a const reference to the cheat engine const Cheats::CheatEngine& CheatEngine() const; + /// Gets a reference to the video dumper backend + VideoDumper::Backend& VideoDumper(); + + /// Gets a const reference to the video dumper backend + const VideoDumper::Backend& VideoDumper() const; + PerfStats perf_stats; FrameLimiter frame_limiter; @@ -276,6 +286,9 @@ private: /// Cheats manager std::unique_ptr cheat_engine; + /// Video dumper backend + std::unique_ptr video_dumper; + /// RPC Server for scripting support std::unique_ptr rpc_server;