summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/caps/caps_a.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/caps/caps_a.h')
-rw-r--r--src/core/hle/service/caps/caps_a.h107
1 files changed, 5 insertions, 102 deletions
diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h
index 975c0ebdb..c90cff71e 100644
--- a/src/core/hle/service/caps/caps_a.h
+++ b/src/core/hle/service/caps/caps_a.h
@@ -3,7 +3,6 @@
#pragma once
-#include "common/fs/fs.h"
#include "core/hle/service/service.h"
namespace Core {
@@ -11,106 +10,15 @@ class System;
}
namespace Service::Capture {
+class AlbumManager;
class IAlbumAccessorService final : public ServiceFramework<IAlbumAccessorService> {
public:
- explicit IAlbumAccessorService(Core::System& system_);
+ explicit IAlbumAccessorService(Core::System& system_,
+ std::shared_ptr<AlbumManager> album_manager);
~IAlbumAccessorService() override;
private:
- enum class ContentType : u8 {
- Screenshot,
- Movie,
- ExtraMovie,
- };
-
- enum class AlbumStorage : u8 {
- Nand,
- Sd,
-
- };
-
- enum class ScreenShotDecoderFlag : u64 {
- None = 0,
- EnableFancyUpsampling = 1 << 0,
- EnableBlockSmoothing = 1 << 1,
- };
-
- enum class ScreenShotOrientation : u32 {
- None,
- Rotate90,
- Rotate180,
- Rotate270,
- };
-
- struct ScreenShotAttribute {
- u32 unknown_0;
- ScreenShotOrientation orientation;
- u32 unknown_1;
- u32 unknown_2;
- INSERT_PADDING_BYTES(0x30);
- };
- static_assert(sizeof(ScreenShotAttribute) == 0x40, "ScreenShotAttribute is an invalid size");
-
- struct ScreenShotDecodeOption {
- ScreenShotDecoderFlag flags;
- INSERT_PADDING_BYTES(0x18);
- };
- static_assert(sizeof(ScreenShotDecodeOption) == 0x20,
- "ScreenShotDecodeOption is an invalid size");
-
- struct AlbumFileDateTime {
- u16 year;
- u8 month;
- u8 day;
- u8 hour;
- u8 minute;
- u8 second;
- u8 unique_id;
- };
- static_assert(sizeof(AlbumFileDateTime) == 0x8, "AlbumFileDateTime is an invalid size");
-
- struct AlbumFileId {
- u64 application_id;
- AlbumFileDateTime date;
- AlbumStorage storage;
- ContentType type;
- INSERT_PADDING_BYTES(0x5);
- u8 unknown;
- };
- static_assert(sizeof(AlbumFileId) == 0x18, "AlbumFileId is an invalid size");
-
- struct AlbumEntry {
- u64 entry_size;
- AlbumFileId file_id;
- };
- static_assert(sizeof(AlbumEntry) == 0x20, "AlbumEntry is an invalid size");
-
- struct ApplicationData {
- std::array<u8, 0x400> data;
- u32 data_size;
- };
- static_assert(sizeof(ApplicationData) == 0x404, "ApplicationData is an invalid size");
-
- struct LoadAlbumScreenShotImageOutput {
- s64 width;
- s64 height;
- ScreenShotAttribute attribute;
- INSERT_PADDING_BYTES(0x400);
- };
- static_assert(sizeof(LoadAlbumScreenShotImageOutput) == 0x450,
- "LoadAlbumScreenShotImageOutput is an invalid size");
-
- struct LoadAlbumScreenShotImageOutputForApplication {
- s64 width;
- s64 height;
- ScreenShotAttribute attribute;
- ApplicationData data;
- INSERT_PADDING_BYTES(0xAC);
- };
- static_assert(sizeof(LoadAlbumScreenShotImageOutputForApplication) == 0x500,
- "LoadAlbumScreenShotImageOutput is an invalid size");
-
void DeleteAlbumFile(HLERequestContext& ctx);
void IsAlbumMounted(HLERequestContext& ctx);
void Unknown18(HLERequestContext& ctx);
@@ -119,14 +27,9 @@ private:
void LoadAlbumScreenShotImageEx1(HLERequestContext& ctx);
void LoadAlbumScreenShotThumbnailImageEx1(HLERequestContext& ctx);
-private:
- void FindScreenshots();
- Result GetAlbumEntry(AlbumEntry& out_entry, const std::filesystem::path& path);
- Result LoadImage(std::span<u8> out_image, const std::filesystem::path& path, int width,
- int height, ScreenShotDecoderFlag flag);
+ Result TranslateResult(Result in_result);
- bool is_mounted{};
- std::vector<std::filesystem::path> sd_image_paths{};
+ std::shared_ptr<AlbumManager> manager = nullptr;
};
} // namespace Service::Capture