Changes

Jump to navigation Jump to search
Line 30: Line 30:  
| 11 || [2.0.0+] GetAlbumEntryFromApplicationAlbumEntry
 
| 11 || [2.0.0+] GetAlbumEntryFromApplicationAlbumEntry
 
|-
 
|-
| 12 || [3.0.0+]
+
| 12 || [3.0.0+] LoadAlbumScreenShotImageEx
 
|-
 
|-
| 13 || [3.0.0+]
+
| 13 || [3.0.0+] LoadAlbumScreenShotThumbnailImageEx
 
|-
 
|-
| 14 || [3.0.0+]
+
| 14 || [3.0.0+] LoadAlbumScreenShotImageEx0
 
|-
 
|-
| 15 || [4.0.0+]
+
| 15 || [4.0.0+] GetAlbumUsage3
 
|-
 
|-
| 16 || [4.0.0+]
+
| 16 || [4.0.0+] GetAlbumMountResult
 
|-
 
|-
| 17 || [4.0.0+]
+
| 17 || [4.0.0+] GetAlbumUsage16
 
|-
 
|-
| 18 || [6.0.0+]
+
| 18 || [6.0.0+] [[#GetAppletProgramIdTable]]
 
|-
 
|-
| 100 || [5.0.0+]
+
| 19 || [11.0.0+] [[#GetAlbumFileName]]
 
|-
 
|-
| 101 || [5.0.0+]
+
| 100 || [5.0.0+] GetAlbumFileCountEx0
 +
|-
 +
| 101 || [5.0.0+] GetAlbumFileListEx0
 +
|-
 +
| 110 || [15.0.0+]
 +
|-
 +
| 120 || [17.0.0+]
 +
|-
 +
| 130 || [17.0.0+]
 +
|-
 +
| 140 || [17.0.0+]
 +
|-
 +
| 141 || [18.0.0+]
 +
|-
 +
| 150 || [17.0.0+]
 +
|-
 +
| 151 || [18.0.0+]
 +
|-
 +
| 160 || [18.0.0+]
 
|-
 
|-
 
| 202 || [1.0.0-2.3.0] SaveEditedScreenShot
 
| 202 || [1.0.0-2.3.0] SaveEditedScreenShot
 
|-
 
|-
| 301 || GetLastThumbnail
+
| 301 || GetLastOverlayScreenShotThumbnail
 
|-
 
|-
| 302 || [4.0.0+]
+
| 302 || [4.0.0+] GetLastOverlayMovieThumbnail
 
|-
 
|-
 
| 401 || GetAutoSavingStorage
 
| 401 || GetAutoSavingStorage
Line 58: Line 76:  
| 501 || GetRequiredStorageSpaceSizeToCopyAll
 
| 501 || GetRequiredStorageSpaceSizeToCopyAll
 
|-
 
|-
| 1001 || [3.0.0+]
+
| 1001 || [3.0.0+] LoadAlbumScreenShotThumbnailImageEx0
 
|-
 
|-
| 1002 || [3.0.0+]
+
| 1002 || [3.0.0+] [[#LoadAlbumScreenShotImageEx1]]
 
|-
 
|-
| 1003 || [4.0.0+]
+
| 1003 || [4.0.0+] LoadAlbumScreenShotThumbnailImageEx1
 
|-
 
|-
 
| 8001 || ForceAlbumUnmounted
 
| 8001 || ForceAlbumUnmounted
Line 72: Line 90:  
| 8012 || GetAlbumCache
 
| 8012 || GetAlbumCache
 
|-
 
|-
| 8013 || [4.0.0+]
+
| 8013 || [4.0.0+] GetAlbumCacheEx
 
|-
 
|-
 
| 8021 || [2.0.0+] GetAlbumEntryFromApplicationAlbumEntryAruid
 
| 8021 || [2.0.0+] GetAlbumEntryFromApplicationAlbumEntryAruid
Line 78: Line 96:  
| 10011 || SetInternalErrorConversionEnabled
 
| 10011 || SetInternalErrorConversionEnabled
 
|-
 
|-
| 50000 || [6.0.0+]
+
| 50000 || [6.0.0+] LoadMakerNoteInfoForDebug
 
|-
 
|-
| 60002 || [4.0.0+]
+
| 60002 || [4.0.0+] [[#OpenAccessorSession]]
 
|}
 
|}
   −
Cmd1002: Takes a total of 0x38-bytes of input, two type-0x5 input buffers, and returns 0x20-bytes of output. [4.0.0+] No longer returns output, and now takes the following buffers instead: type-0x16, type-0x46, and type-0x6.
+
== GetAppletProgramIdTable ==
 +
Takes a type-70 buffer and returns a bool. If the buffer is sufficient it writes two application ID's to the buffer (0x100000000001000 and 0x100000000001fff) and returns true. This is used by photoViewer to group all screenshots of applets.
 +
 
 +
== GetAlbumFileName ==
 +
Takes an input [[#AlbumFileId]] and a type-0x6 output buffer. Writes the filename of the corresponding file to the buffer.
   −
Cmd60002: Takes a total of 8-bytes of input, a PID, and returns an [[#IAlbumAccessorSession]].
+
== LoadAlbumScreenShotImageEx1 ==
 +
Takes a total of 0x38-bytes of input, two type-0x5 input buffers, and returns 0x20-bytes of output. [4.0.0+] No longer returns output, and now takes the following buffers instead: type-0x16, type-0x46, and type-0x6.
 +
 
 +
== OpenAccessorSession ==
 +
Takes a total of 8-bytes of input, a PID, and returns an [[#IAlbumAccessorSession]].
    
== IAlbumAccessorSession ==
 
== IAlbumAccessorSession ==
Line 96: Line 122:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 2001 ||  
+
| 2001 || OpenAlbumMovieReadStream
 
|-
 
|-
| 2002 ||  
+
| 2002 || CloseAlbumMovieReadStream
 
|-
 
|-
| 2003 ||  
+
| 2003 || GetAlbumMovieReadStreamMovieDataSize
 
|-
 
|-
| 2004 ||  
+
| 2004 || ReadMovieDataFromAlbumMovieReadStream
 +
|-
 +
| 2005 || GetAlbumMovieReadStreamBrokenReason
 
|-
 
|-
| 2005 ||  
+
| 2006 || GetAlbumMovieReadStreamImageDataSize
 
|-
 
|-
| 2006 ||  
+
| 2007 || ReadImageDataFromAlbumMovieReadStream
 
|-
 
|-
| 2007 ||  
+
| 2008 || ReadFileAttributeFromAlbumMovieReadStream
 
|-
 
|-
| 2008 ||  
+
| 5000 || [18.0.0+]
 
|}
 
|}
    
= caps:c =
 
= caps:c =
This is "nn::capsrv::sf::IAlbumControlService", previously "nn::capsrv::sf::ICaptureControllerService" with [1.0.0].
+
This is "nn::capsrv::sf::ICaptureControllerService".
 +
 
 +
[2.0.0+] This is "nn::capsrv::sf::IAlbumControlService".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 120: Line 150:  
! Cmd || Name || Notes
 
! Cmd || Name || Notes
 
|-
 
|-
| [1.0.0] 1 || ||  
+
| [1.0.0] 1 || CaptureRawImage ||  
 
|-
 
|-
| [1.0.0] 2 || ||  
+
| [1.0.0] 2 || CaptureRawImageWithTimeout ||  
 
|-
 
|-
 
| 33 || [7.0.0+] ||  
 
| 33 || [7.0.0+] ||  
 
|-
 
|-
| [1.0.0] 1001 || ||  
+
| [1.0.0] 1001 || RequestTakingScreenShot ||  
 
|-
 
|-
| [1.0.0] 1002 || ||  
+
| [1.0.0] 1002 || RequestTakingScreenShotWithTimeout ||  
 
|-
 
|-
| [1.0.0] 1011 || ||  
+
| [1.0.0] 1011 || NotifyTakingScreenShotRefused ||  
 
|-
 
|-
| 2001 || ||  
+
| 2001 || NotifyAlbumStorageIsAvailable ||  
 
|-
 
|-
| 2002 || ||  
+
| 2002 || NotifyAlbumStorageIsUnavailable ||  
 
|-
 
|-
| 2011 || [2.0.0+] ||  
+
| 2011 || [2.0.0+] RegisterAppletResourceUserId ||  
 
|-
 
|-
| 2012 || [2.0.0+] ||  
+
| 2012 || [2.0.0+] UnregisterAppletResourceUserId ||  
 
|-
 
|-
| 2013 || [2.0.0+] ||  
+
| 2013 || [2.0.0+] GetApplicationIdFromAruid ||  
 
|-
 
|-
| 2014 || [2.0.0+] ||  
+
| 2014 || [2.0.0+] CheckApplicationIdRegistered ||  
 
|-
 
|-
| 2101 || [2.0.0+] || Takes an input u8 and u64, returns a 0x18-byte struct.
+
| 2101 || [2.0.0+] GenerateCurrentAlbumFileId || Takes an input u8 and u64, returns a 0x18-byte struct.
 
|-
 
|-
| 2102 || [2.0.0+] ||  
+
| 2102 || [2.0.0+] GenerateApplicationAlbumEnrty ||  
 
|-
 
|-
| [2.0.0-3.0.2] 2201 || ||  
+
| [2.0.0-3.0.2] 2201 || SaveAlbumScreenShotFile ||  
 
|-
 
|-
| 2202 || [4.0.0+] ||  
+
| 2202 || [4.0.0+] SaveAlbumScreenShotFileEx ||  
 
|-
 
|-
| 2301 || [2.0.0+] ||  
+
| 2301 || [2.0.0+] SetOverlayScreenShotThumbnailData ||  
 
|-
 
|-
| 2302 || [4.0.0+] ||  
+
| 2302 || [4.0.0+] SetOverlayMovieThumbnailData ||  
 
|-
 
|-
| 60001 || [4.0.0+] || Takes a total of 8-bytes of input and a PID, returns an [[#IAlbumControlSession]].
+
| 60001 || [4.0.0+] OpenControlSession || Takes a total of 8-bytes of input and a PID, returns an [[#IAlbumControlSession]].
 
|}
 
|}
   Line 171: Line 201:  
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 +
|-
 +
| 2001 || OpenAlbumMovieReadStream
 +
|-
 +
| 2002 || CloseAlbumMovieReadStream
 
|-
 
|-
| 2001 || ||  
+
| 2003 || GetAlbumMovieReadStreamMovieDataSize
 
|-
 
|-
| 2002 || ||  
+
| 2004 || ReadMovieDataFromAlbumMovieReadStream
 
|-
 
|-
| 2003 || ||  
+
| 2005 || GetAlbumMovieReadStreamBrokenReason
 
|-
 
|-
| 2004 || ||  
+
| 2006 || GetAlbumMovieReadStreamImageDataSize
 
|-
 
|-
| 2005 || ||  
+
| 2007 || ReadImageDataFromAlbumMovieReadStream
 
|-
 
|-
| 2006 || ||  
+
| 2008 || ReadFileAttributeFromAlbumMovieReadStream
 
|-
 
|-
| 2007 || ||  
+
| 2345 || [18.0.0+]
 
|-
 
|-
| 2008 || ||  
+
| 2401 || OpenAlbumMovieWriteStream
 
|-
 
|-
| 2401 || ||  
+
| 2402 || FinishAlbumMovieWriteStream
 
|-
 
|-
| 2402 || ||  
+
| 2403 || CommitAlbumMovieWriteStream
 
|-
 
|-
| 2403 || ||  
+
| 2404 || DiscardAlbumMovieWriteStream
 
|-
 
|-
| 2404 || ||  
+
| 2405 || DiscardAlbumMovieWriteStreamNoDelete
 
|-
 
|-
| 2405 || ||  
+
| 2406 || [7.0.0+] CommitAlbumMovieWriteStreamEx
 
|-
 
|-
| 2406 || [7.0.0+] ||  
+
| 2411 || StartAlbumMovieWriteStreamDataSection
 
|-
 
|-
| 2411 || ||  
+
| 2412 || EndAlbumMovieWriteStreamDataSection
 
|-
 
|-
| 2412 || ||  
+
| 2413 || StartAlbumMovieWriteStreamMetaSection
 
|-
 
|-
| 2413 || ||  
+
| 2414 || EndAlbumMovieWriteStreamMetaSection
 
|-
 
|-
| 2414 || ||  
+
| 2421 || ReadDataFromAlbumMovieWriteStream
 
|-
 
|-
| 2421 || ||  
+
| 2422 || WriteDataToAlbumMovieWriteStream
 
|-
 
|-
| 2422 || ||  
+
| 2424 || WriteMetaToAlbumMovieWriteStream
 
|-
 
|-
| 2424 || ||  
+
| 2431 || GetAlbumMovieWriteStreamBrokenReason
 
|-
 
|-
| 2431 || ||  
+
| 2433 || GetAlbumMovieWriteStreamDataSize
 
|-
 
|-
| 2433 || ||  
+
| 2434 || SetAlbumMovieWriteStreamDataSize
 
|-
 
|-
| 2434 || ||  
+
| 5000 || [18.0.0+]
 
|}
 
|}
   Line 226: Line 260:     
This was added with [5.0.0+].
 
This was added with [5.0.0+].
 +
 +
Official sw via the <code>nn::album</code> wrappers uses start_DateTime = YYYY-MM-DD 1970-01-01 with the rest set to all-zero, end_DateTime is the same except year = 3000. With [[#GetAlbumFileList0AafeAruidDeprecated]], start_PosixTime = UTC 1999-12-31 00:00 (0x386BF200), and end_PosixTime = UTC 2100-01-01 00:00 (0xF4865700).
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 233: Line 269:  
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
 
| 32 || [7.0.0+] [[#SetShimLibraryVersion]]
 
|-
 
|-
| 102 || GetAlbumFileList0AafeAruidDeprecated
+
| 102 || [[#GetAlbumFileList0AafeAruidDeprecated]]
 +
|-
 +
| 103 || [[#DeleteAlbumFileByAruid]]
 +
|-
 +
| 104 || [[#GetAlbumFileSizeByAruid]]
 
|-
 
|-
| 103 || DeleteAlbumFileByAruid
+
| 105 || [[#DeleteAlbumFileByAruidForDebug]]
 
|-
 
|-
| 104 || GetAlbumFileSizeByAruid
+
| 110 || [[#LoadAlbumScreenShotImageByAruid]]
 
|-
 
|-
| 105 || DeleteAlbumFileByAruidForDebug
+
| 120 || [[#LoadAlbumScreenShotThumbnailImageByAruid]]
 
|-
 
|-
| 110 || LoadAlbumScreenShotImageByAruid
+
| 130 || [[#PrecheckToCreateContentsByAruid]]
 
|-
 
|-
| 120 || LoadAlbumScreenShotThumbnailImageByAruid
+
| 140 || [6.0.0+] [[#GetAlbumFileList1AafeAruidDeprecated]]
 
|-
 
|-
| 130 || PrecheckToCreateContentsByAruid
+
| 141 || [6.0.0+] [[#GetAlbumFileList2AafeUidAruidDeprecated]]
 
|-
 
|-
| 140 || [6.0.0+] GetAlbumFileList1AafeAruidDeprecated
+
| 142 || [7.0.0+] [[#GetAlbumFileList3AaeAruid]]
 
|-
 
|-
| 141 || [6.0.0+] GetAlbumFileList2AafeUidAruidDeprecated
+
| 143 || [7.0.0+] [[#GetAlbumFileList4AaeUidAruid]]
 
|-
 
|-
| 142 || [7.0.0+] GetAlbumFileList3AaeAruid
+
| 144 || [11.0.0+] GetAllAlbumFileList3AaeAruid
 
|-
 
|-
| 143 || [7.0.0+] GetAlbumFileList4AaeUidAruid
+
| 145 || [17.0.0+]  
 
|-
 
|-
| 60002 || OpenAccessorSessionForApplication
+
| 146 || [17.0.0+]
 +
|-
 +
| 147 || [17.0.0+]
 +
|-
 +
| 148 || [18.0.0+]
 +
|-
 +
| 60002 || [[#OpenAccessorSessionForApplication]]
 
|}
 
|}
    
== SetShimLibraryVersion ==
 
== SetShimLibraryVersion ==
 
Takes an input u64 [[#ShimLibraryVersion]], an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and a PID, no output.
 
Takes an input u64 [[#ShimLibraryVersion]], an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and a PID, no output.
 +
 +
== GetAlbumFileList0AafeAruidDeprecated ==
 +
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumFileEntry]], a PID, an u8 [[#ContentType]], two s64s, and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries (which is copied to a s32 by official sw).
 +
 +
The two s64s are the start/end PosixTime.
 +
 +
== DeleteAlbumFileByAruid ==
 +
Takes a PID, an input u8 [[#ContentType]], an [[#ApplicationAlbumFileEntry]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output.
 +
 +
The [[#ContentType]] must match 3.
 +
 +
== GetAlbumFileSizeByAruid ==
 +
Takes a PID, an input [[#ApplicationAlbumFileEntry]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and returns an output u64.
 +
 +
This gets the filesize for the entire specified Album file.
 +
 +
== DeleteAlbumFileByAruidForDebug ==
 +
Takes a PID, an [[#ApplicationAlbumFileEntry]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output.
 +
 +
The cached value loaded from [[Settings_services#GetDebugModeFlag]] must be 1, otherwise an error is returned.
 +
 +
== LoadAlbumScreenShotImageByAruid ==
 +
Takes a PID, a type-0x16 output buffer containing a [[#LoadAlbumScreenShotImageOutputForApplication]], a type-0x46 output buffer, a type-0x6 output buffer, an [[#ApplicationAlbumFileEntry]], a [[#ScreenShotDecodeOption]], and no output.
 +
 +
The type-0x46 buffer contains the RGBA8 image data. The type-0x6 buffer is a work buffer used for reading the entire AlbumFile, the buffer size must be at least the AlbumFile filesize (cleared before the cmd returns).
 +
 +
== LoadAlbumScreenShotThumbnailImageByAruid ==
 +
Takes a PID, a type-0x16 output buffer containing a [[#LoadAlbumScreenShotImageOutputForApplication]], a type-0x46 output buffer,  a type-0x6 output buffer, an [[#ApplicationAlbumFileEntry]], a [[#ScreenShotDecodeOption]], and no output.
 +
 +
The type-0x46 buffer contains the RGBA8 image data. The type-0x6 buffer is a work buffer used for reading the entire AlbumFile, the buffer size must be at least the AlbumFile filesize (cleared before the cmd returns).
 +
 +
== PrecheckToCreateContentsByAruid ==
 +
Takes a PID, an input u8 [[#ContentType]], an u64, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output.
 +
 +
== GetAlbumFileList1AafeAruidDeprecated ==
 +
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumFileEntry]], a PID, an u8 [[#ContentType]], two [[#AlbumFileDateTime]], and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries (which is copied to a s32 by official sw).
 +
 +
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment.
 +
 +
== GetAlbumFileList2AafeUidAruidDeprecated ==
 +
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumFileEntry]], a PID, an u8 [[#ContentType]], two [[#AlbumFileDateTime]], an u128 userID, and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries (which is copied to a s32 by official sw).
 +
 +
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment.
 +
 +
== GetAlbumFileList3AaeAruid ==
 +
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumEntry]], a PID, an u8 [[#ContentType]], two [[#AlbumFileDateTime]], and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries (which is copied to a s32 by official sw).
 +
 +
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment.
 +
 +
== GetAlbumFileList4AaeUidAruid ==
 +
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumEntry]], a PID, an u8 [[#ContentType]], two [[#AlbumFileDateTime]], an u128 userID, and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries (which is copied to a s32 by official sw).
 +
 +
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment.
 +
 +
== OpenAccessorSessionForApplication ==
 +
Takes a PID, an input [[#ApplicationAlbumFileEntry]], an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and returns an output [[#IAlbumAccessorApplicationSession]].
    
== IAlbumAccessorApplicationSession ==
 
== IAlbumAccessorApplicationSession ==
Line 265: Line 367:     
This was added with [5.0.0+].
 
This was added with [5.0.0+].
 +
 +
This is opened prior to using [[#OpenAlbumMovieReadStream]], when it previously wasn't opened. Official sw only closes this session when closing caps:u, not when using [[#CloseAlbumMovieReadStream]].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 270: Line 374:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 2001 || OpenAlbumMovieReadStream
+
| 2001 || [[#OpenAlbumMovieReadStream]]
 
|-
 
|-
| 2002 || CloseAlbumMovieReadStream
+
| 2002 || [[#CloseAlbumMovieReadStream]]
 
|-
 
|-
| 2003 || GetAlbumMovieReadStreamMovieDataSize
+
| 2003 || [[#GetAlbumMovieReadStreamMovieDataSize]]
 
|-
 
|-
| 2004 || ReadMovieDataFromAlbumMovieReadStream
+
| 2004 || [[#ReadMovieDataFromAlbumMovieReadStream]]
 
|-
 
|-
| 2005 || GetAlbumMovieReadStreamBrokenReason
+
| 2005 || [[#GetAlbumMovieReadStreamBrokenReason]]
 
|}
 
|}
 +
 +
=== OpenAlbumMovieReadStream ===
 +
Takes a PID, an input [[#ApplicationAlbumFileEntry]], an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and returns an output u64 [[#AlbumMovieReadStreamHandle]].
 +
 +
Up to 4 streams can be open at the same time. Multiple streams can be open at the same time for the same [[#ApplicationAlbumFileEntry]].
 +
 +
=== CloseAlbumMovieReadStream ===
 +
Takes an input u64 [[#AlbumMovieReadStreamHandle]], no output.
 +
 +
=== GetAlbumMovieReadStreamMovieDataSize ===
 +
Takes an input u64 [[#AlbumMovieReadStreamHandle]], returns an output u64.
 +
 +
This gets the size of the actual MP4, without the JPEG at the end.
 +
 +
=== ReadMovieDataFromAlbumMovieReadStream ===
 +
Takes a type-0x6 output buffer, an input u64 [[#AlbumMovieReadStreamHandle]], an input s64 offset, and returns an output u64 actual_size.
 +
 +
offset(+size) must not be negative. offset and size must be aligned to 0x40000-bytes. When offset(+size) goes beyond the size from [[#GetAlbumMovieReadStreamMovieDataSize]], the regions of the buffer which goes beyond that are cleared to 0, and actual_size is still set to the input size.
 +
 +
=== GetAlbumMovieReadStreamBrokenReason ===
 +
Takes an input u64 [[#AlbumMovieReadStreamHandle]], no output.
 +
 +
Unused by official sw.
    
= ShimLibraryVersion =
 
= ShimLibraryVersion =
This is a version field. Official sw uses func <code>nn::capsrv::GetShimLibraryVersion()</code> to load this from a global var, which is then used with various commands.
+
This is a version field. Official sw uses func <code>nn::capsrv::GetShimLibraryVersion()</code> to load this from a global var, which is then used with various commands (the input for those cmds must match value 1).
 +
 
 +
[7.0.0-9.0.0] This is value 1.
 +
 
 +
Controls which struct version to use for [[#ApplicationAlbumEntry]] / [[#AlbumFileEntry]]. However, the struct size for the newer version is used regardless on [7.0.0+] for the actual cmds.
 +
 
 +
= Enums =
 +
 
 +
=== AlbumImageOrientation ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Unknown.
 +
|-
 +
| 1 || Unknown.
 +
|-
 +
| 2 || Unknown.
 +
|-
 +
| 3 || Unknown.
 +
|}
 +
 
 +
This is "nn::album::ImageOrientation".
 +
 
 +
=== AlbumReportOption ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Don't display the screenshot-taken Overlay-applet notification.
 +
|-
 +
| 1 || Display the screenshot-taken Overlay notification.
 +
|}
 +
 
 +
This is "nn::album::AlbumReportOption".
 +
 
 +
=== ContentType ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Screenshot. Album screenshots.
 +
|-
 +
| 1 || Movie. Album videos.
 +
|-
 +
| 3 || ExtraMovie. Videos recorded by the current Application title via [[GRC_services#IMovieMaker|GRC MovieMaker]].
 +
|}
 +
 
 +
=== AlbumStorage ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Nand. ImageDirectory on the USER partition.
 +
|-
 +
| 1 || Sd. ImageDirectory on the Sd card
 +
|}
 +
 
 +
= AlbumFileDateTime =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x2 || Year
 +
|-
 +
| 0x2 || 0x1 || Month
 +
|-
 +
| 0x3 || 0x1 || Day
 +
|-
 +
| 0x4 || 0x1 || Hour
 +
|-
 +
| 0x5 || 0x1 || Minute
 +
|-
 +
| 0x6 || 0x1 || Second
 +
|-
 +
| 0x7 || 0x1 || Unique ID for when there's multiple Album files with the same timestamp.
 +
|}
 +
 
 +
This is "nn::capsrv::AlbumFileDateTime". This is a 0x8-byte struct.
   −
[7.0.0-8.1.0] This is value 1.
+
This corresponds to each field in the Album entry filename, prior to the "-": <code>YYYYMMDDHHMMSSII</code>.
    
= AlbumEntry =
 
= AlbumEntry =
Line 291: Line 500:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || Unknown
+
| 0x0 || 0x8 || Size of the entry.
 
|-
 
|-
| 0x8 || 0x8 || titleID
+
| 0x8 || 0x8 || ApplicationId
 
|-
 
|-
| 0x10 || 0x2 || Year
+
| 0x10 || 0x8 || [[#AlbumFileDateTime]]
 
|-
 
|-
| 0x12 || 0x1 || Month
+
| 0x18 || 0x1 || [[#AlbumStorage]]
 
|-
 
|-
| 0x13 || 0x1 || Day
+
| 0x19 || 0x1 || [[#ContentType]]
 
|-
 
|-
| 0x14 || 0x1 || Hour
+
| 0x1A || 0x6 || Padding.
 +
|}
 +
 
 +
This is "nn::capsrv::AlbumEntry". This is a 0x20-byte struct.
 +
 
 +
= AlbumFileEntry =
 +
This is "nn::album::AlbumFileEntry". This is identical to [[#ApplicationAlbumEntry]]. On older versions where official sw used to use cmds which use [[#ApplicationAlbumFileEntry]], this struct matches [[#ApplicationAlbumFileEntry]].
 +
 
 +
= ApplicationAlbumEntry =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 
|-
 
|-
| 0x15 || 0x1 || Minute
+
| 0x0 || 0x8 || Size of the entry.
 
|-
 
|-
| 0x16 || 0x1 || Second
+
| 0x8 || 0x8 || AES256 with hardcoded key over AlbumEntry.
 
|-
 
|-
| 0x17 || 0x1 || Unknown
+
| 0x10 || 0x8 || [[#AlbumFileDateTime]]
 
|-
 
|-
| 0x18 || 0x1 || Unknown
+
| 0x18 || 0x1 || [[#AlbumStorage]]
 
|-
 
|-
| 0x19 || 0x1 || Unknown
+
| 0x19 || 0x1 || [[#ContentType]]
 
|-
 
|-
| 0x1A || 0x6 || Padding?
+
| 0x1a || 0x5 || Padding.
 +
|-
 +
| 0x1f || 0x1 || Unknown. Set to 1 by official software.
 
|}
 
|}
   −
This is "nn::capsrv::AlbumEntry". This is a 0x20-byte struct.
+
This is "nn::capsrv::ApplicationAlbumEntry". This is a 0x20-byte struct. On older versions where [[#ShimLibraryVersion]] is 0, this was a plain AES256 with a random key generated at application launch.
 +
 
 +
With the output from [[Applet_Manager_services#caps:su|caps:su]] sdk-nso only uses this for the [[Internet_Browser|Share-applet]] (when the output is used at all), with everything else it's used as an [[#AlbumFileEntry]]. In those cases with the <code>nn::album</code> wrapper funcs, it's "converted" by just copying the struct (arrays are "converted" by just returning a ptr to the input array).
 +
 
 +
= ApplicationAlbumFileEntry =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x20 || [[#ApplicationAlbumEntry]]
 +
|-
 +
| 0x20 || 0x8 || [[#AlbumFileDateTime]]
 +
|-
 +
| 0x28 || 0x8 || Unknown.
 +
|}
 +
 
 +
This is "nn::capsrv::ApplicationAlbumFileEntry". This is a 0x30-byte struct.
 +
 
 +
On newer versions where official sw uses [[#ApplicationAlbumEntry]], [[#ApplicationAlbumEntry]] is converted to ApplicationAlbumFileEntry when using cmds which need it with:
 +
* First 0x20-bytes are the same.
 +
* u64 ApplicationAlbumFileEntry+0x20 = [[#ApplicationAlbumEntry]]+0x10.
 +
* Last 8-bytes = 0.
 +
 
 +
= ScreenShotAttribute =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Always set to 0 by official sw.
 +
|-
 +
| 0x4 || 0x4 || [[#AlbumImageOrientation]]
 +
|-
 +
| 0x8 || 0x4 || Always set to 0 by official sw.
 +
|-
 +
| 0xC || 0x4 || Always set to 1 by official sw.
 +
|-
 +
| 0x10 || 0x30 || Always set to 0 by official sw.
 +
|}
 +
 
 +
This is "nn::capsrv::detail::ScreenShotAttributeEx0" / "nn::capsrv::ScreenShotAttribute". This is a 0x40-byte struct.
 +
 
 +
= ApplicationData =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x400 || UserData
 +
|-
 +
| 0x400 || 0x4 || UserData size.
 +
|}
 +
 
 +
This is "nn::capsrv::ApplicationData". This is a 0x404-byte struct.
 +
 
 +
= UserIdList =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x80 || u128 userIDs
 +
|-
 +
| 0x80 || 0x1 || Total userIDs.
 +
|-
 +
| 0x81 || 0x7 || Padding.
 +
|}
 +
 
 +
This is "nn::capsrv::UserIdList". This is a 0x88-byte struct.
 +
 
 +
= LoadAlbumScreenShotImageOutputForApplication =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || s64 Width. Official sw copies this to a s32 output field.
 +
|-
 +
| 0x8 || 0x8 || s64 Height. Official sw copies this to a s32 output field.
 +
|-
 +
| 0x10 || 0x40 || [[#ScreenShotAttributeForApplication]]
 +
|-
 +
| 0x50 || 0x404 || [[#ApplicationData]]
 +
|-
 +
| 0x454 || 0xAC || Unused
 +
|}
 +
 
 +
This is "nn::capsrv::sf::LoadAlbumScreenShotImageOutputForApplication". This is a 0x500-byte struct.
 +
 
 +
= ScreenShotDecodeOption =
 +
This is "nn::capsrv::ScreenShotDecodeOption". This is a 0x20-byte struct.
 +
 
 +
Official sw sets this to all-zero with the input for [[#LoadAlbumScreenShotImageByAruid]]/[[#LoadAlbumScreenShotThumbnailImageByAruid]].
 +
 
 +
= ScreenShotAttributeForApplication =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Unknown.
 +
|-
 +
| 0x4 || 0x1 || Unknown.
 +
|-
 +
| 0x5 || 0x1 || Unknown.
 +
|-
 +
| 0x6 || 0x1 || Unknown.
 +
|-
 +
| 0x7 || 0x1 || Padding.
 +
|-
 +
| 0x8 || 0x4 || Unknown.
 +
|-
 +
| 0xC || 0x4 || Unknown.
 +
|-
 +
| 0x10 || 0x4 || Unknown.
 +
|-
 +
| 0x14 || 0x4 || Unknown.
 +
|-
 +
| 0x18 || 0x4 || Unknown.
 +
|-
 +
| 0x1C || 0x4 || Unknown.
 +
|-
 +
| 0x20 || 0x2 || Unknown.
 +
|-
 +
| 0x22 || 0x2 || Unknown.
 +
|-
 +
| 0x24 || 0x2 || Unknown.
 +
|-
 +
| 0x26 || 0x2 || Unknown.
 +
|-
 +
| 0x28 || 0x18 || Always zero.
 +
|}
 +
 
 +
This is "nn::capsrv::ScreenShotAttributeForApplication". This is a 0x40-byte struct.
 +
 
 +
Official sw only uses this in <code>nn::album</code> funcs which convert this to [[#AlbumFileAttribute]], with the output from [[#LoadAlbumScreenShotImageByAruid]]/[[#LoadAlbumScreenShotThumbnailImageByAruid]] (only the first u32 is used).
 +
 
 +
= AlbumFileAttribute =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || The <code>nn::album</code> funcs referenced by [[#ScreenShotAttributeForApplication]] set this to: <code>ScreenShotAttributeForApplication.first_u32 == 2</code>.
 +
|-
 +
| 0x8 || 0x8 || Set to zero by official sw.
 +
|}
 +
 
 +
This is "nn::album::AlbumFileAttribute". This is a 0x10-byte struct. See also [[#ScreenShotAttributeForApplication]].
 +
 
 +
= AlbumMovieReadStreamHandle =
 +
This is "nn::capsrv::AlbumMovieReadStreamHandle" / "nn::album::MovieStreamHandle".
   −
The data at offset 0x10 size 0x8 corresponds to each field in the Album entry filename, prior to the "-".
+
This is an u64 stream handle.
    
= Notes =
 
= Notes =
Line 329: Line 696:  
== Videos ==
 
== Videos ==
 
[[4.0.0]] includes video playback etc support in Album via mp4. These include a JPEG thumbnail, which is used for video "validation". The EXIF is also much larger: the MakerNote is 0x498-bytes, with encrypted data starting at offset +0x8. This encryption uses AES-CTR with hardcoded key/ctr. MAC calculation works the same way as the [[3.0.0]]+ JPEG MAC calculation, except with a different movie_kek_source/movie_key_source.
 
[[4.0.0]] includes video playback etc support in Album via mp4. These include a JPEG thumbnail, which is used for video "validation". The EXIF is also much larger: the MakerNote is 0x498-bytes, with encrypted data starting at offset +0x8. This encryption uses AES-CTR with hardcoded key/ctr. MAC calculation works the same way as the [[3.0.0]]+ JPEG MAC calculation, except with a different movie_kek_source/movie_key_source.
 +
 +
Each 0x40000-byte chunk in the Movie data stream is validated with a SHA256 hash table, where hash_index=offset>>18. Whether an error is thrown on mismatch is controlled by [[System_Settings|system-setting]] "capsrv!enable_album_movie_filehash_verification".
    
Note: the Album process itself uses libstagefright for video playback.
 
Note: the Album process itself uses libstagefright for video playback.
    
[[Category:Services]]
 
[[Category:Services]]

Navigation menu