2020-06-25 07:58:13 +02:00
|
|
|
// Copyright 2018 yuzu Emulator Project
|
2018-08-01 22:24:03 +02:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-10-07 19:29:33 +02:00
|
|
|
#include "common/common_funcs.h"
|
|
|
|
#include "common/common_types.h"
|
2020-04-01 01:16:36 +02:00
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2018-08-01 22:24:03 +02:00
|
|
|
namespace Service::SM {
|
|
|
|
class ServiceManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Service::Capture {
|
|
|
|
|
2020-06-25 07:59:16 +02:00
|
|
|
enum class AlbumImageOrientation {
|
2020-04-01 01:16:36 +02:00
|
|
|
Orientation0 = 0,
|
|
|
|
Orientation1 = 1,
|
|
|
|
Orientation2 = 2,
|
|
|
|
Orientation3 = 3,
|
|
|
|
};
|
|
|
|
|
2021-12-03 02:12:24 +01:00
|
|
|
enum class AlbumReportOption : s32 {
|
2020-04-01 01:16:36 +02:00
|
|
|
Disable = 0,
|
|
|
|
Enable = 1,
|
|
|
|
};
|
|
|
|
|
2020-06-25 07:59:16 +02:00
|
|
|
enum class ContentType : u8 {
|
2020-04-01 01:16:36 +02:00
|
|
|
Screenshot = 0,
|
|
|
|
Movie = 1,
|
|
|
|
ExtraMovie = 3,
|
|
|
|
};
|
|
|
|
|
2020-06-25 07:59:16 +02:00
|
|
|
enum class AlbumStorage : u8 {
|
2020-04-01 01:16:36 +02:00
|
|
|
NAND = 0,
|
|
|
|
SD = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AlbumFileDateTime {
|
2020-06-25 07:59:16 +02:00
|
|
|
s16 year{};
|
|
|
|
s8 month{};
|
|
|
|
s8 day{};
|
|
|
|
s8 hour{};
|
|
|
|
s8 minute{};
|
|
|
|
s8 second{};
|
|
|
|
s8 uid{};
|
2020-04-01 01:16:36 +02:00
|
|
|
};
|
2020-06-25 07:59:16 +02:00
|
|
|
static_assert(sizeof(AlbumFileDateTime) == 0x8, "AlbumFileDateTime has incorrect size.");
|
2020-04-01 01:16:36 +02:00
|
|
|
|
|
|
|
struct AlbumEntry {
|
2020-06-25 07:59:16 +02:00
|
|
|
u64 size{};
|
|
|
|
u64 application_id{};
|
|
|
|
AlbumFileDateTime datetime{};
|
|
|
|
AlbumStorage storage{};
|
|
|
|
ContentType content{};
|
|
|
|
INSERT_PADDING_BYTES(6);
|
2020-04-01 01:16:36 +02:00
|
|
|
};
|
2020-06-25 07:59:16 +02:00
|
|
|
static_assert(sizeof(AlbumEntry) == 0x20, "AlbumEntry has incorrect size.");
|
2020-04-01 01:16:36 +02:00
|
|
|
|
|
|
|
struct AlbumFileEntry {
|
2020-06-25 07:59:16 +02:00
|
|
|
u64 size{}; // Size of the entry
|
|
|
|
u64 hash{}; // AES256 with hardcoded key over AlbumEntry
|
|
|
|
AlbumFileDateTime datetime{};
|
|
|
|
AlbumStorage storage{};
|
|
|
|
ContentType content{};
|
|
|
|
INSERT_PADDING_BYTES(5);
|
|
|
|
u8 unknown{1}; // Set to 1 on official SW
|
2020-04-01 01:16:36 +02:00
|
|
|
};
|
2020-06-25 07:59:16 +02:00
|
|
|
static_assert(sizeof(AlbumFileEntry) == 0x20, "AlbumFileEntry has incorrect size.");
|
2020-04-01 01:16:36 +02:00
|
|
|
|
|
|
|
struct ApplicationAlbumEntry {
|
2020-06-25 07:59:16 +02:00
|
|
|
u64 size{}; // Size of the entry
|
|
|
|
u64 hash{}; // AES256 with hardcoded key over AlbumEntry
|
|
|
|
AlbumFileDateTime datetime{};
|
|
|
|
AlbumStorage storage{};
|
|
|
|
ContentType content{};
|
|
|
|
INSERT_PADDING_BYTES(5);
|
|
|
|
u8 unknown{1}; // Set to 1 on official SW
|
2020-04-01 01:16:36 +02:00
|
|
|
};
|
2020-06-25 07:59:16 +02:00
|
|
|
static_assert(sizeof(ApplicationAlbumEntry) == 0x20, "ApplicationAlbumEntry has incorrect size.");
|
2020-04-01 01:16:36 +02:00
|
|
|
|
|
|
|
struct ApplicationAlbumFileEntry {
|
2020-06-25 07:59:16 +02:00
|
|
|
ApplicationAlbumEntry entry{};
|
|
|
|
AlbumFileDateTime datetime{};
|
|
|
|
u64 unknown{};
|
2020-04-01 01:16:36 +02:00
|
|
|
};
|
2020-06-25 07:59:16 +02:00
|
|
|
static_assert(sizeof(ApplicationAlbumFileEntry) == 0x30,
|
|
|
|
"ApplicationAlbumFileEntry has incorrect size.");
|
2020-04-01 01:16:36 +02:00
|
|
|
|
|
|
|
/// Registers all Capture services with the specified service manager.
|
2020-11-26 21:19:08 +01:00
|
|
|
void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
|
2018-08-01 22:24:03 +02:00
|
|
|
|
|
|
|
} // namespace Service::Capture
|