1 // Copyright 2018 yuzu Emulator Project
2 // Licensed under GPLv2 or any later version
3 // Refer to the license.txt file included.
4 
5 #pragma once
6 
7 #include "core/hle/service/service.h"
8 
9 namespace Core {
10 class System;
11 }
12 
13 namespace Service::SM {
14 class ServiceManager;
15 }
16 
17 namespace Service::Capture {
18 
19 enum class AlbumImageOrientation {
20     Orientation0 = 0,
21     Orientation1 = 1,
22     Orientation2 = 2,
23     Orientation3 = 3,
24 };
25 
26 enum class AlbumReportOption {
27     Disable = 0,
28     Enable = 1,
29 };
30 
31 enum class ContentType : u8 {
32     Screenshot = 0,
33     Movie = 1,
34     ExtraMovie = 3,
35 };
36 
37 enum class AlbumStorage : u8 {
38     NAND = 0,
39     SD = 1,
40 };
41 
42 struct AlbumFileDateTime {
43     s16 year{};
44     s8 month{};
45     s8 day{};
46     s8 hour{};
47     s8 minute{};
48     s8 second{};
49     s8 uid{};
50 };
51 static_assert(sizeof(AlbumFileDateTime) == 0x8, "AlbumFileDateTime has incorrect size.");
52 
53 struct AlbumEntry {
54     u64 size{};
55     u64 application_id{};
56     AlbumFileDateTime datetime{};
57     AlbumStorage storage{};
58     ContentType content{};
59     INSERT_PADDING_BYTES(6);
60 };
61 static_assert(sizeof(AlbumEntry) == 0x20, "AlbumEntry has incorrect size.");
62 
63 struct AlbumFileEntry {
64     u64 size{}; // Size of the entry
65     u64 hash{}; // AES256 with hardcoded key over AlbumEntry
66     AlbumFileDateTime datetime{};
67     AlbumStorage storage{};
68     ContentType content{};
69     INSERT_PADDING_BYTES(5);
70     u8 unknown{1}; // Set to 1 on official SW
71 };
72 static_assert(sizeof(AlbumFileEntry) == 0x20, "AlbumFileEntry has incorrect size.");
73 
74 struct ApplicationAlbumEntry {
75     u64 size{}; // Size of the entry
76     u64 hash{}; // AES256 with hardcoded key over AlbumEntry
77     AlbumFileDateTime datetime{};
78     AlbumStorage storage{};
79     ContentType content{};
80     INSERT_PADDING_BYTES(5);
81     u8 unknown{1}; // Set to 1 on official SW
82 };
83 static_assert(sizeof(ApplicationAlbumEntry) == 0x20, "ApplicationAlbumEntry has incorrect size.");
84 
85 struct ApplicationAlbumFileEntry {
86     ApplicationAlbumEntry entry{};
87     AlbumFileDateTime datetime{};
88     u64 unknown{};
89 };
90 static_assert(sizeof(ApplicationAlbumFileEntry) == 0x30,
91               "ApplicationAlbumFileEntry has incorrect size.");
92 
93 /// Registers all Capture services with the specified service manager.
94 void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
95 
96 } // namespace Service::Capture
97