libnx  v4.6.0
Functions
capsu.h File Reference

Application Album (caps:u) service IPC wrapper. More...

#include "../types.h"
#include "../sf/service.h"
#include "../services/caps.h"
#include "../services/acc.h"

Go to the source code of this file.

Functions

Result capsuInitialize (void)
 Initialize caps:u. Only available on [5.0.0+].
 
void capsuExit (void)
 Exit caps:u.
 
ServicecapsuGetServiceSession (void)
 Gets the Service for caps:u.
 
ServicecapsuGetServiceSession_Accessor (void)
 Gets the Service for IAlbumAccessorApplicationSession, only initialized after capsuOpenAlbumMovieStream was used (unaffected by using capsuCloseAlbumMovieStream).
 
Result capsuGetAlbumFileListDeprecated1 (CapsApplicationAlbumFileEntry *entries, s32 count, CapsContentType type, const CapsAlbumFileDateTime *start_datetime, const CapsAlbumFileDateTime *end_datetime, s32 *total_entries)
 Gets a listing of CapsApplicationAlbumFileEntry. More...
 
Result capsuGetAlbumFileListDeprecated2 (CapsApplicationAlbumFileEntry *entries, s32 count, CapsContentType type, const CapsAlbumFileDateTime *start_datetime, const CapsAlbumFileDateTime *end_datetime, AccountUid uid, s32 *total_entries)
 Gets a listing of CapsApplicationAlbumFileEntry, where the AlbumFile has an UserId which matches the input one. More...
 
Result capsuGetAlbumFileList3 (CapsApplicationAlbumEntry *entries, s32 count, CapsContentType type, const CapsAlbumFileDateTime *start_datetime, const CapsAlbumFileDateTime *end_datetime, s32 *total_entries)
 Gets a listing of CapsApplicationAlbumEntry. More...
 
Result capsuGetAlbumFileList4 (CapsApplicationAlbumEntry *entries, s32 count, CapsContentType type, const CapsAlbumFileDateTime *start_datetime, const CapsAlbumFileDateTime *end_datetime, AccountUid uid, s32 *total_entries)
 Gets a listing of CapsApplicationAlbumEntry, where the AlbumFile has an UserId which matches the input one. More...
 
Result capsuDeleteAlbumFile (CapsContentType type, const CapsApplicationAlbumFileEntry *entry)
 Deletes the specified AlbumFile. More...
 
Result capsuGetAlbumFileSize (const CapsApplicationAlbumFileEntry *entry, u64 *size)
 Gets the filesize for the entire specified AlbumFile. More...
 
Result capsuLoadAlbumScreenShotImage (s32 *width, s32 *height, CapsScreenShotAttributeForApplication *attr, void *userdata, size_t userdata_maxsize, u32 *userdata_size, void *image, size_t image_size, void *workbuf, size_t workbuf_size, const CapsApplicationAlbumFileEntry *entry, const CapsScreenShotDecodeOption *option)
 Load the ScreenShotImage for the specified AlbumFile. More...
 
Result capsuLoadAlbumScreenShotThumbnailImage (s32 *width, s32 *height, CapsScreenShotAttributeForApplication *attr, void *userdata, size_t userdata_maxsize, u32 *userdata_size, void *image, size_t image_size, void *workbuf, size_t workbuf_size, const CapsApplicationAlbumFileEntry *entry, const CapsScreenShotDecodeOption *option)
 Load the ScreenShotThumbnailImage for the specified AlbumFile. More...
 
Result capsuPrecheckToCreateContents (CapsContentType type, u64 unk)
 PrecheckToCreateContents. More...
 
Result capsuOpenAlbumMovieStream (u64 *stream, const CapsApplicationAlbumFileEntry *entry)
 Opens an AlbumMovieStream. More...
 
Result capsuCloseAlbumMovieStream (u64 stream)
 Closes an AlbumMovieStream. More...
 
Result capsuGetAlbumMovieStreamSize (u64 stream, u64 *size)
 Gets the data size of an AlbumMovieStream. More...
 
Result capsuReadAlbumMovieStream (u64 stream, s64 offset, void *buffer, size_t size, u64 *actual_size)
 Reads data from an AlbumMovieStream. More...
 
Result capsuGetAlbumMovieStreamBrokenReason (u64 stream)
 Gets the BrokenReason for an AlbumMovieStream. More...
 

Detailed Description

Application Album (caps:u) service IPC wrapper.

This is only usable with AlbumFiles associated with the current host Application.

Author
yellows8

Function Documentation

◆ capsuCloseAlbumMovieStream()

Result capsuCloseAlbumMovieStream ( u64  stream)

Closes an AlbumMovieStream.

Parameters
[in]streamStream handle.

◆ capsuDeleteAlbumFile()

Result capsuDeleteAlbumFile ( CapsContentType  type,
const CapsApplicationAlbumFileEntry entry 
)

Deletes the specified AlbumFile.

Parameters
[in]typeCapsContentType, must match CapsContentType_ExtraMovie.
[in]entryCapsApplicationAlbumFileEntry

◆ capsuGetAlbumFileList3()

Result capsuGetAlbumFileList3 ( CapsApplicationAlbumEntry entries,
s32  count,
CapsContentType  type,
const CapsAlbumFileDateTime start_datetime,
const CapsAlbumFileDateTime end_datetime,
s32 total_entries 
)

Gets a listing of CapsApplicationAlbumEntry.

Note
Only available on [7.0.0+], on prior sysvers use capsuGetAlbumFileListDeprecated1 instead.
Parameters
[out]entriesOutput array of CapsApplicationAlbumEntry.
[in]countMax size of the output array in entries.
[in]typeCapsContentType
[in]start_datetimeStart CapsAlbumFileDateTime, when NULL the default is used.
[in]end_datetimeEnd CapsAlbumFileDateTime, when NULL the default is used.
[out]total_entriesTotal output entries.

◆ capsuGetAlbumFileList4()

Result capsuGetAlbumFileList4 ( CapsApplicationAlbumEntry entries,
s32  count,
CapsContentType  type,
const CapsAlbumFileDateTime start_datetime,
const CapsAlbumFileDateTime end_datetime,
AccountUid  uid,
s32 total_entries 
)

Gets a listing of CapsApplicationAlbumEntry, where the AlbumFile has an UserId which matches the input one.

See also capssuSaveScreenShotWithUserIds.

Note
Only available on [7.0.0+], on prior sysvers use capsuGetAlbumFileListDeprecated2 instead.
Parameters
[out]entriesOutput array of CapsApplicationAlbumEntry.
[in]countMax size of the output array in entries.
[in]typeCapsContentType
[in]start_datetimeStart CapsAlbumFileDateTime, when NULL the default is used.
[in]end_datetimeEnd CapsAlbumFileDateTime, when NULL the default is used.
[in]uidAccountUid
[out]total_entriesTotal output entries.

◆ capsuGetAlbumFileListDeprecated1()

Result capsuGetAlbumFileListDeprecated1 ( CapsApplicationAlbumFileEntry entries,
s32  count,
CapsContentType  type,
const CapsAlbumFileDateTime start_datetime,
const CapsAlbumFileDateTime end_datetime,
s32 total_entries 
)

Gets a listing of CapsApplicationAlbumFileEntry.

Note
On [6.0.0+] this uses GetAlbumFileList1AafeAruidDeprecated, otherwise this uses GetAlbumFileList0AafeAruidDeprecated.
This is an old version of capsuGetAlbumFileList3.
Parameters
[out]entriesOutput array of CapsApplicationAlbumFileEntry.
[in]countMax size of the output array in entries.
[in]typeCapsContentType
[in]start_datetimeStart CapsAlbumFileDateTime, when NULL the default is used.
[in]end_datetimeEnd CapsAlbumFileDateTime, when NULL the default is used.
[out]total_entriesTotal output entries.

◆ capsuGetAlbumFileListDeprecated2()

Result capsuGetAlbumFileListDeprecated2 ( CapsApplicationAlbumFileEntry entries,
s32  count,
CapsContentType  type,
const CapsAlbumFileDateTime start_datetime,
const CapsAlbumFileDateTime end_datetime,
AccountUid  uid,
s32 total_entries 
)

Gets a listing of CapsApplicationAlbumFileEntry, where the AlbumFile has an UserId which matches the input one.

See also capssuSaveScreenShotWithUserIds.

Note
Only available on [6.0.0+].
This is an old version of capsuGetAlbumFileList4.
Parameters
[out]entriesOutput array of CapsApplicationAlbumFileEntry.
[in]countMax size of the output array in entries.
[in]typeCapsContentType
[in]start_datetimeStart CapsAlbumFileDateTime, when NULL the default is used.
[in]end_datetimeEnd CapsAlbumFileDateTime, when NULL the default is used.
[in]uidAccountUid
[out]total_entriesTotal output entries.

◆ capsuGetAlbumFileSize()

Result capsuGetAlbumFileSize ( const CapsApplicationAlbumFileEntry entry,
u64 size 
)

Gets the filesize for the entire specified AlbumFile.

Parameters
[in]entryCapsApplicationAlbumFileEntry
[out]sizeOutput filesize.

◆ capsuGetAlbumMovieStreamBrokenReason()

Result capsuGetAlbumMovieStreamBrokenReason ( u64  stream)

Gets the BrokenReason for an AlbumMovieStream.

Note
Official sw doesn't use this.
Parameters
[in]streamStream handle.

◆ capsuGetAlbumMovieStreamSize()

Result capsuGetAlbumMovieStreamSize ( u64  stream,
u64 size 
)

Gets the data size of an AlbumMovieStream.

Parameters
[in]streamStream handle.
[out]sizeSize of the actual MP4, without the JPEG at the end.

◆ capsuLoadAlbumScreenShotImage()

Result capsuLoadAlbumScreenShotImage ( s32 width,
s32 height,
CapsScreenShotAttributeForApplication attr,
void *  userdata,
size_t  userdata_maxsize,
u32 userdata_size,
void *  image,
size_t  image_size,
void *  workbuf,
size_t  workbuf_size,
const CapsApplicationAlbumFileEntry entry,
const CapsScreenShotDecodeOption option 
)

Load the ScreenShotImage for the specified AlbumFile.

Parameters
[out]widthOutput image width. Optional, can be NULL.
[out]heightOutput image height. Optional, can be NULL.
[out]attrCapsScreenShotAttributeForApplication
[out]userdataOutput buffer containing the UserData. Optional, can be NULL. This buffer is cleared to 0 using userdata_maxsize, prior to doing the memcpy.
[in]userdata_maxsizeMax size of the userdata buffer. Optional, can be 0.
[out]userdata_sizeUserdata size field, clamped to max size sizeof(CapsApplicationData::userdata) when needed.
[out]imageRGBA8 image output buffer.
[in]image_sizeImage buffer size, should be at least large enough for RGBA8 1280x720.
[out]workbufWork buffer, cleared to 0 by the cmd before it returns.
[in]workbuf_sizeWork buffer size, must be at least the size of the JPEG within the AlbumFile.
[in]entryCapsApplicationAlbumFileEntry
[in]optionCapsScreenShotDecodeOption

◆ capsuLoadAlbumScreenShotThumbnailImage()

Result capsuLoadAlbumScreenShotThumbnailImage ( s32 width,
s32 height,
CapsScreenShotAttributeForApplication attr,
void *  userdata,
size_t  userdata_maxsize,
u32 userdata_size,
void *  image,
size_t  image_size,
void *  workbuf,
size_t  workbuf_size,
const CapsApplicationAlbumFileEntry entry,
const CapsScreenShotDecodeOption option 
)

Load the ScreenShotThumbnailImage for the specified AlbumFile.

Parameters
[out]widthOutput image width. Optional, can be NULL.
[out]heightOutput image height. Optional, can be NULL.
[out]attrCapsScreenShotAttributeForApplication
[out]userdataOutput buffer containing the UserData. Optional, can be NULL. This buffer is cleared to 0 using userdata_maxsize, prior to doing the memcpy.
[in]userdata_maxsizeMax size of the userdata buffer. Optional, can be 0.
[out]userdata_sizeUserdata size field, clamped to max size sizeof(CapsApplicationData::userdata) when needed.
[out]imageRGBA8 image output buffer.
[in]image_sizeImage buffer size, should be at least large enough for RGBA8 320x180.
[out]workbufWork buffer, cleared to 0 by the cmd before it returns.
[in]workbuf_sizeWork buffer size, must be at least the size of the JPEG within the AlbumFile.
[in]entryCapsApplicationAlbumFileEntry
[in]optionCapsScreenShotDecodeOption

◆ capsuOpenAlbumMovieStream()

Result capsuOpenAlbumMovieStream ( u64 stream,
const CapsApplicationAlbumFileEntry entry 
)

Opens an AlbumMovieStream.

Note
This opens IAlbumAccessorApplicationSession if not previously opened, it's closed during capsuExit.
Up to 4 streams can be open at the same time. Multiple streams can be open at the same time for the same CapsApplicationAlbumFileEntry.
Parameters
[out]streamStream handle.
[in]entryCapsApplicationAlbumFileEntry

◆ capsuPrecheckToCreateContents()

Result capsuPrecheckToCreateContents ( CapsContentType  type,
u64  unk 
)

PrecheckToCreateContents.

Official sw only uses this with CapsContentType_ExtraMovie.

Parameters
[in]typeCapsContentType
[in]unkUnknown.

◆ capsuReadAlbumMovieStream()

Result capsuReadAlbumMovieStream ( u64  stream,
s64  offset,
void *  buffer,
size_t  size,
u64 actual_size 
)

Reads data from an AlbumMovieStream.

Note
offset(+size) must not be negative. offset and size must be aligned to 0x40000-bytes.
When offset(+size) goes beyond the size from capsuGetAlbumMovieStreamSize, the regions of the buffer which goes beyond that are cleared to 0, and actual_size is still set to the input size.
Parameters
[in]streamStream handle.
[in]offsetOffset.
[out]Outputdata buffer.
[in]sizeData buffer size.
[out]actual_sizeActual read size.