libstrat: convert to experimental new (super-accurate) sf allocation semantics

This commit is contained in:
Michael Scire 2021-01-17 07:55:32 -08:00 committed by SciresM
parent 8314d015f3
commit f06de12bea
149 changed files with 2852 additions and 1746 deletions

View file

@ -24,7 +24,7 @@ namespace ams::capsrv::server {
this->server_manager_holder.emplace();
/* Register the service. */
R_ABORT_UNLESS((this->server_manager_holder->RegisterServer<Interface, Service>(ServiceName, MaxSessions, sf::GetSharedPointerTo<Interface>(*this->service_holder))));
R_ABORT_UNLESS((this->server_manager_holder->RegisterObjectForServer(this->service_holder->GetShared(), ServiceName, MaxSessions)));
/* Initialize the idle event, we're idle initially. */
os::InitializeEvent(std::addressof(this->idle_event), true, os::EventClearMode_ManualClear);

View file

@ -26,12 +26,12 @@ namespace ams::capsrv::server {
static constexpr inline size_t MaxSessions = 2;
static constexpr inline sm::ServiceName ServiceName = sm::ServiceName::Encode("caps:dc");
using Interface = IDecoderControlService;
using Service = DecoderControlService;
using ServiceHolderType = sf::UnmanagedServiceObject<IDecoderControlService, DecoderControlService>;
using ServerOptions = sf::hipc::DefaultServerManagerOptions;
using ServerManager = sf::hipc::ServerManager<NumServers, ServerOptions, MaxSessions>;
private:
std::optional<Service> service_holder;
std::optional<ServiceHolderType> service_holder;
std::optional<ServerManager> server_manager_holder;
os::EventType idle_event;
public:

View file

@ -16,17 +16,17 @@
#pragma once
#include <stratosphere.hpp>
#define AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 3001, Result, DecodeJpeg, (const sf::OutNonSecureBuffer &out, const sf::InBuffer &in, u32 width, u32 height, const capsrv::ScreenShotDecodeOption &option), (out, in, width, height, option))
AMS_SF_DEFINE_INTERFACE(ams::capsrv::server, IDecoderControlService, AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO)
namespace ams::capsrv::server {
#define AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 3001, Result, DecodeJpeg, (const sf::OutNonSecureBuffer &out, const sf::InBuffer &in, u32 width, u32 height, const ScreenShotDecodeOption &option))
AMS_SF_DEFINE_INTERFACE(IDecoderControlService, AMS_CAPSRV_DECODER_CONTROL_SERVICE_INTERFACE_INFO)
class DecoderControlService final {
public:
Result DecodeJpeg(const sf::OutNonSecureBuffer &out, const sf::InBuffer &in, u32 width, u32 height, const ScreenShotDecodeOption &option);
};
static_assert(IsIDecoderControlService<DecoderControlService>);
}
}