Capture services: Difference between revisions
No edit summary |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 227: | Line 227: | ||
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, and end_PosixTime = UTC 2100-01-01 00:00. | 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 264: | Line 264: | ||
== GetAlbumFileList0AafeAruidDeprecated == | == GetAlbumFileList0AafeAruidDeprecated == | ||
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumFileEntry]], a PID, an u8, two s64s, and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries. | 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. | ||
The two s64s are the start/end PosixTime. | The two s64s are the start/end PosixTime. | ||
== DeleteAlbumFileByAruid == | == DeleteAlbumFileByAruid == | ||
Takes a PID, an input u8, an [[#ApplicationAlbumFileEntry]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output. | Takes a PID, an input u8 [[#ContentType]], an [[#ApplicationAlbumFileEntry]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output. | ||
The [[#ContentType]] must match 3. | |||
== GetAlbumFileSizeByAruid == | == GetAlbumFileSizeByAruid == | ||
Takes a PID, an input [[#ApplicationAlbumFileEntry]], an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and returns an output u64. | 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 == | == DeleteAlbumFileByAruidForDebug == | ||
Line 281: | Line 285: | ||
== LoadAlbumScreenShotImageByAruid == | == 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. | 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 == | == 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. | 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 == | == PrecheckToCreateContentsByAruid == | ||
Takes a PID, an input u8, an u64, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output. | Takes a PID, an input u8 [[#ContentType]], an u64, an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]], and no output. | ||
== GetAlbumFileList1AafeAruidDeprecated == | == GetAlbumFileList1AafeAruidDeprecated == | ||
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumFileEntry]], a PID, an u8, two [[#AlbumFileDateTime]], and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries. | 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. | ||
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | ||
== GetAlbumFileList2AafeUidAruidDeprecated == | == GetAlbumFileList2AafeUidAruidDeprecated == | ||
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumFileEntry]], a PID, an u8, two [[#AlbumFileDateTime]], an u128 userID, and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries. | 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. | ||
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | ||
== GetAlbumFileList3AaeAruid == | == GetAlbumFileList3AaeAruid == | ||
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumEntry]], a PID, an u8, two [[#AlbumFileDateTime]], and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries. | 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. | ||
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | ||
== GetAlbumFileList4AaeUidAruid == | == GetAlbumFileList4AaeUidAruid == | ||
Takes a type-0x6 output buffer containing an array of [[#ApplicationAlbumEntry]], a PID, an u8, two [[#AlbumFileDateTime]], an u128 userID, and an u64 [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]. Returns an output u64 for total output entries. | 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. | ||
The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | The first [[#AlbumFileDateTime]] is the start_DateTime, the second [[#AlbumFileDateTime]] is the end_DateTime. In the IPC rawdata, these use 2-byte alignment. | ||
Line 315: | Line 323: | ||
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 320: | Line 330: | ||
! 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 (the input for those cmds must match value 1). | 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- | [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. | 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. | ||
Line 363: | Line 396: | ||
! Description | ! Description | ||
|- | |- | ||
| 0 || | | 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 || | | 3 || ExtraMovie. Videos recorded by the current Application title via [[GRC_services#IMovieMaker|GRC MovieMaker]]. | ||
|} | |} | ||
= AlbumFileDateTime = | = AlbumFileDateTime = | ||
Line 440: | Line 482: | ||
= ApplicationAlbumFileEntry = | = 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. | This is "nn::capsrv::ApplicationAlbumFileEntry". This is a 0x30-byte struct. | ||
Line 496: | Line 549: | ||
! Offset || Size || Description | ! Offset || Size || Description | ||
|- | |- | ||
| 0x0 || 0x8 || Width | | 0x0 || 0x8 || s64 Width. Official sw copies this to a s32 output field. | ||
|- | |- | ||
| 0x8 || 0x8 || Height | | 0x8 || 0x8 || s64 Height. Official sw copies this to a s32 output field. | ||
|- | |- | ||
| 0x10 || 0x40 || [[#ScreenShotAttributeForApplication]] | | 0x10 || 0x40 || [[#ScreenShotAttributeForApplication]] | ||
Line 512: | Line 565: | ||
This is "nn::capsrv::ScreenShotDecodeOption". This is a 0x20-byte struct. | 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 = | = ScreenShotAttributeForApplication = | ||
Line 521: | Line 574: | ||
| 0x0 || 0x4 || Unknown. | | 0x0 || 0x4 || Unknown. | ||
|- | |- | ||
| 0x4 || | | 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. | 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]]. | 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 = | = AlbumFileAttribute = | ||
Line 539: | Line 620: | ||
This is "nn::album::AlbumFileAttribute". This is a 0x10-byte struct. See also [[#ScreenShotAttributeForApplication]]. | This is "nn::album::AlbumFileAttribute". This is a 0x10-byte struct. See also [[#ScreenShotAttributeForApplication]]. | ||
= AlbumMovieReadStreamHandle = | |||
This is "nn::capsrv::AlbumMovieReadStreamHandle" / "nn::album::MovieStreamHandle". | |||
This is an u64 stream handle. | |||
= Notes = | = Notes = |