libnx  v4.2.0
Functions
capsc.h File Reference

Album Control (caps:c) service IPC wrapper. More...

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

Go to the source code of this file.

Functions

Result capscInitialize (void)
 Initialize caps:c.
 
void capscExit (void)
 Exit caps:c.
 
ServicecapscGetServiceSession (void)
 Gets the Service for caps:c.
 
Result capscNotifyAlbumStorageIsAvailable (CapsAlbumStorage storage)
 Notify the service that a storage is now available. More...
 
Result capscNotifyAlbumStorageIsUnAvailable (CapsAlbumStorage storage)
 Notify the service that a storage is now unavailable. More...
 
Result capscRegisterAppletResourceUserId (u64 appletResourceUserId, u64 application_id)
 Register an applet for later usage. More...
 
Result capscUnregisterAppletResourceUserId (u64 appletResourceUserId, u64 application_id)
 Unregister an applet. More...
 
Result capscGetApplicationIdFromAruid (u64 *application_id, u64 aruid)
 Get an ApplicationId that corresponds to an AppletResourceUserId. More...
 
Result capscCheckApplicationIdRegistered (u64 application_id)
 Checks whether an ApplicationId is registered. More...
 
Result capscGenerateCurrentAlbumFileId (u64 application_id, CapsAlbumFileContents contents, CapsAlbumFileId *file_id)
 Generate an AlbumFileId based on parameters and current time. More...
 
Result capscGenerateApplicationAlbumEntry (CapsApplicationAlbumEntry *appEntry, const CapsAlbumEntry *entry, u64 application_id)
 Generate an ApplicationAlbumEntry based on parameters. More...
 
Result capscSaveAlbumScreenShotFile (const CapsAlbumFileId *file_id, const void *buffer, u64 buffer_size)
 Save a jpeg image. More...
 
Result capscSaveAlbumScreenShotFileEx (const CapsAlbumFileId *file_id, u64 version, u64 makernote_offset, u64 makernote_size, const void *buffer, u64 buffer_size)
 Save a jpeg image. More...
 
Result capscSetOverlayScreenShotThumbnailData (const CapsAlbumFileId *file_id, const void *image, u64 image_size)
 Sets thumbnail data for the last taken screenshot. More...
 
Result capscSetOverlayMovieThumbnailData (const CapsAlbumFileId *file_id, const void *image, u64 image_size)
 Sets thumbnail data for the last recorded movie. More...
 
Result capscOpenAlbumMovieReadStream (u64 *stream, const CapsAlbumFileId *file_id)
 Opens an AlbumMovieReadStream. More...
 
Result capscCloseAlbumMovieStream (u64 stream)
 Closes an AlbumMovieReadStream. More...
 
Result capscGetAlbumMovieStreamSize (u64 stream, u64 *size)
 Gets the data size of an AlbumMovieReadStream. More...
 
Result capscReadMovieDataFromAlbumMovieReadStream (u64 stream, u64 offset, void *buffer, size_t size, u64 *actual_size)
 Reads data from an AlbumMovieReadStream. More...
 
Result capscGetAlbumMovieReadStreamBrokenReason (u64 stream)
 Gets the BrokenReason for an AlbumMovieReadStream. More...
 
Result capscGetAlbumMovieReadStreamImageDataSize (u64 stream, u64 *size)
 Gets the data size of an Image taken from an AlbumMovieReadStream. More...
 
Result capscReadImageDataFromAlbumMovieReadStream (u64 stream, u64 offset, void *buffer, size_t size, u64 *actual_size)
 Reads data of an Image taken from an AlbumMovieReadStream. More...
 
Result capscReadFileAttributeFromAlbumMovieReadStream (u64 stream, CapsScreenShotAttribute *attribute)
 Gets the file attribute of an AlbumMovieReadStream. More...
 
Result capscOpenAlbumMovieWriteStream (u64 *stream, const CapsAlbumFileId *file_id)
 Opens an AlbumMovieWriteStream. More...
 
Result capscFinishAlbumMovieWriteStream (u64 stream)
 Finish write to AlbumMovieWriteStream. More...
 
Result capscCommitAlbumMovieWriteStream (u64 stream)
 Closes a finished AlbumMovieWriteStream. More...
 
Result capscDiscardAlbumMovieWriteStream (u64 stream)
 Closes an AlbumMovieWriteStream in any state. More...
 
Result capscDiscardAlbumMovieWriteStreamNoDelete (u64 stream)
 Closes an AlbumMovieWriteStream in any state without deleting the temporary file. More...
 
Result capscCommitAlbumMovieWriteStreamEx (u64 stream, CapsAlbumEntry *entry)
 Closes a finished AlbumMovieWriteStream. More...
 
Result capscStartAlbumMovieWriteStreamDataSection (u64 stream)
 Start AlbumMovieWriteStream data section. More...
 
Result capscEndAlbumMovieWriteStreamDataSection (u64 stream)
 End AlbumMovieWriteStream data section. More...
 
Result capscStartAlbumMovieWriteStreamMetaSection (u64 stream)
 Start AlbumMovieWriteStream meta section. More...
 
Result capscEndAlbumMovieWriteStreamMetaSection (u64 stream)
 End AlbumMovieWriteStream meta section. More...
 
Result capscReadDataFromAlbumMovieWriteStream (u64 stream, u64 offset, void *buffer, u64 size, u64 *actual_size)
 Reads data from an AlbumMovieWriteStream. More...
 
Result capscWriteDataToAlbumMovieWriteStream (u64 stream, u64 offset, const void *buffer, u64 size)
 Write data to an AlbumMovieWriteStream. More...
 
Result capscWriteMetaToAlbumMovieWriteStream (u64 stream, u64 offset, const void *buffer, u64 size)
 Write meta data to an AlbumMovieWriteStream. More...
 
Result capscGetAlbumMovieWriteStreamBrokenReason (u64 stream)
 Gets the BrokenReason for an AlbumMovieWriteStream. More...
 
Result capscGetAlbumMovieWriteStreamDataSize (u64 stream, u64 *size)
 Gets the data size of an AlbumMovieWriteStream. More...
 
Result capscSetAlbumMovieWriteStreamDataSize (u64 stream, u64 size)
 Sets the data size of an AlbumMovieWriteStream. More...
 

Detailed Description

Album Control (caps:c) service IPC wrapper.

Author
Behemoth

Function Documentation

◆ capscCheckApplicationIdRegistered()

Result capscCheckApplicationIdRegistered ( u64  application_id)

Checks whether an ApplicationId is registered.

Note
Only available on [2.0.0+].
Parameters
[in]application_idApplicationId.

◆ capscCloseAlbumMovieStream()

Result capscCloseAlbumMovieStream ( u64  stream)

Closes an AlbumMovieReadStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscCommitAlbumMovieWriteStream()

Result capscCommitAlbumMovieWriteStream ( u64  stream)

Closes a finished AlbumMovieWriteStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscCommitAlbumMovieWriteStreamEx()

Result capscCommitAlbumMovieWriteStreamEx ( u64  stream,
CapsAlbumEntry entry 
)

Closes a finished AlbumMovieWriteStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[out]entryCapsAlbumEntry

◆ capscDiscardAlbumMovieWriteStream()

Result capscDiscardAlbumMovieWriteStream ( u64  stream)

Closes an AlbumMovieWriteStream in any state.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscDiscardAlbumMovieWriteStreamNoDelete()

Result capscDiscardAlbumMovieWriteStreamNoDelete ( u64  stream)

Closes an AlbumMovieWriteStream in any state without deleting the temporary file.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscEndAlbumMovieWriteStreamDataSection()

Result capscEndAlbumMovieWriteStreamDataSection ( u64  stream)

End AlbumMovieWriteStream data section.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscEndAlbumMovieWriteStreamMetaSection()

Result capscEndAlbumMovieWriteStreamMetaSection ( u64  stream)

End AlbumMovieWriteStream meta section.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscFinishAlbumMovieWriteStream()

Result capscFinishAlbumMovieWriteStream ( u64  stream)

Finish write to AlbumMovieWriteStream.

Note
Copies file from save to destination storage and deletes the temporary file.
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscGenerateApplicationAlbumEntry()

Result capscGenerateApplicationAlbumEntry ( CapsApplicationAlbumEntry appEntry,
const CapsAlbumEntry entry,
u64  application_id 
)

Generate an ApplicationAlbumEntry based on parameters.

Note
Output will be different between Shim Version 0 and 1.
Only available on [2.0.0+].
Parameters
[out]appEntryCapsApplicationAlbumEntry
[in]entryCapsAlbumEntry
[in]application_idApplicationId.

◆ capscGenerateCurrentAlbumFileId()

Result capscGenerateCurrentAlbumFileId ( u64  application_id,
CapsAlbumFileContents  contents,
CapsAlbumFileId file_id 
)

Generate an AlbumFileId based on parameters and current time.

Parameters
[in]application_idApplicationId.
Note
Only available on [2.0.0+].
Parameters
[in]contentsCapsAlbumFileContents
[out]file_idCapsAlbumFileId

◆ capscGetAlbumMovieReadStreamBrokenReason()

Result capscGetAlbumMovieReadStreamBrokenReason ( u64  stream)

Gets the BrokenReason for an AlbumMovieReadStream.

Note
Official sw doesn't use this.
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscGetAlbumMovieReadStreamImageDataSize()

Result capscGetAlbumMovieReadStreamImageDataSize ( u64  stream,
u64 size 
)

Gets the data size of an Image taken from an AlbumMovieReadStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[out]sizeExpected size of an Image.

◆ capscGetAlbumMovieStreamSize()

Result capscGetAlbumMovieStreamSize ( u64  stream,
u64 size 
)

Gets the data size of an AlbumMovieReadStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[out]sizeSize of the actual MP4, without the JPEG at the end.

◆ capscGetAlbumMovieWriteStreamBrokenReason()

Result capscGetAlbumMovieWriteStreamBrokenReason ( u64  stream)

Gets the BrokenReason for an AlbumMovieWriteStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscGetAlbumMovieWriteStreamDataSize()

Result capscGetAlbumMovieWriteStreamDataSize ( u64  stream,
u64 size 
)

Gets the data size of an AlbumMovieWriteStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[out]sizeSize of the data section.

◆ capscGetApplicationIdFromAruid()

Result capscGetApplicationIdFromAruid ( u64 application_id,
u64  aruid 
)

Get an ApplicationId that corresponds to an AppletResourceUserId.

Note
Returns value set by capscRegisterAppletResourceUserId.
Only available on [2.0.0+].
Parameters
[out]application_idApplicationId.
[in]appletResourceUserIdAppletResourceUserId.

◆ capscNotifyAlbumStorageIsAvailable()

Result capscNotifyAlbumStorageIsAvailable ( CapsAlbumStorage  storage)

Notify the service that a storage is now available.

Note
This will result in capsrv mounting the image directory on that storage medium.
Parameters
[in]storageCapsAlbumStorage

◆ capscNotifyAlbumStorageIsUnAvailable()

Result capscNotifyAlbumStorageIsUnAvailable ( CapsAlbumStorage  storage)

Notify the service that a storage is now unavailable.

Note
This will result in capsrv unmounting the image directory on that storage medium.
Parameters
[in]storageCapsAlbumStorage

◆ capscOpenAlbumMovieReadStream()

Result capscOpenAlbumMovieReadStream ( u64 stream,
const CapsAlbumFileId file_id 
)

Opens an AlbumMovieReadStream.

Note
This opens IAlbumControlSession if not previously opened, it's closed during capscExit.
Up to 4 streams can be open at the same time. Multiple streams can be open at the same time for the same CapsAlbumFileId.
Only available on [4.0.0+].
Parameters
[out]streamStream handle.
[in]entryCapsAlbumFileId

◆ capscOpenAlbumMovieWriteStream()

Result capscOpenAlbumMovieWriteStream ( u64 stream,
const CapsAlbumFileId file_id 
)

Opens an AlbumMovieWriteStream.

Note
This opens IAlbumControlSession if not previously opened, it's closed during capsaExit.
Up to 2 streams can be open at the same time.
Only available on [4.0.0+].
Parameters
[out]streamStream handle.
[in]entryCapsAlbumFileId

◆ capscReadDataFromAlbumMovieWriteStream()

Result capscReadDataFromAlbumMovieWriteStream ( u64  stream,
u64  offset,
void *  buffer,
u64  size,
u64 actual_size 
)

Reads data from an AlbumMovieWriteStream.

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

◆ capscReadFileAttributeFromAlbumMovieReadStream()

Result capscReadFileAttributeFromAlbumMovieReadStream ( u64  stream,
CapsScreenShotAttribute attribute 
)

Gets the file attribute of an AlbumMovieReadStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[out]attrCapsScreenShotAttribute

◆ capscReadImageDataFromAlbumMovieReadStream()

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

Reads data of an Image taken from an AlbumMovieReadStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[in]offsetOffset.
[out]bufferOutput data buffer.
[in]sizeData buffer size.
[out]actual_sizeActual read size.

◆ capscReadMovieDataFromAlbumMovieReadStream()

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

Reads data from an AlbumMovieReadStream.

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

◆ capscRegisterAppletResourceUserId()

Result capscRegisterAppletResourceUserId ( u64  appletResourceUserId,
u64  application_id 
)

Register an applet for later usage.

Note
Called at application launch by the system.
Will generate a random AES-256 key for this application for use on Shim-Version 0.
Only available on [2.0.0+].
Parameters
[in]appletResourceUserIdAppletResourceUserId.
[in]application_idApplicationId.

◆ capscSaveAlbumScreenShotFile()

Result capscSaveAlbumScreenShotFile ( const CapsAlbumFileId file_id,
const void *  buffer,
u64  buffer_size 
)

Save a jpeg image.

Note
Only available on [2.0.0-3.0.2].
Parameters
[in]file_idCapsAlbumFileId
[in]bufferJPEG image buffer.
[in]buffer_sizeSize of the JPEG image.

◆ capscSaveAlbumScreenShotFileEx()

Result capscSaveAlbumScreenShotFileEx ( const CapsAlbumFileId file_id,
u64  version,
u64  makernote_offset,
u64  makernote_size,
const void *  buffer,
u64  buffer_size 
)

Save a jpeg image.

Note
Only available on [4.0.0+].
Version 3 as of [9.1.0].
Parameters
[in]file_idCapsAlbumFileId
[in]versionRevision number.
[in]makernote_offsetOffset to makernote in JPEG buffer.
[in]makernote_sizeSize of the makernote in JPEG buffer.
[in]bufferJPEG image buffer.
[in]buffer_sizeSize of the JPEG image.

◆ capscSetAlbumMovieWriteStreamDataSize()

Result capscSetAlbumMovieWriteStreamDataSize ( u64  stream,
u64  size 
)

Sets the data size of an AlbumMovieWriteStream.

Note
Must not be bigger than 2GiB.
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[out]sizeSize of the data section.

◆ capscSetOverlayMovieThumbnailData()

Result capscSetOverlayMovieThumbnailData ( const CapsAlbumFileId file_id,
const void *  image,
u64  image_size 
)

Sets thumbnail data for the last recorded movie.

Note
Only availabe on [4.0.0+].
96×54 Image will get saved.
Parameters
[in]file_idCapsAlbumFileId
[in]imageRGBA8 image buffer.
[in]image_sizesize of the RGBA8 image buffer.

◆ capscSetOverlayScreenShotThumbnailData()

Result capscSetOverlayScreenShotThumbnailData ( const CapsAlbumFileId file_id,
const void *  image,
u64  image_size 
)

Sets thumbnail data for the last taken screenshot.

Note
96×54 Image will get saved.
Parameters
[in]file_idCapsAlbumFileId
[in]imageRGBA8 image buffer.
[in]image_sizesize of the RGBA8 image buffer.

◆ capscStartAlbumMovieWriteStreamDataSection()

Result capscStartAlbumMovieWriteStreamDataSection ( u64  stream)

Start AlbumMovieWriteStream data section.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscStartAlbumMovieWriteStreamMetaSection()

Result capscStartAlbumMovieWriteStreamMetaSection ( u64  stream)

Start AlbumMovieWriteStream meta section.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.

◆ capscUnregisterAppletResourceUserId()

Result capscUnregisterAppletResourceUserId ( u64  appletResourceUserId,
u64  application_id 
)

Unregister an applet.

Note
Called at application exit by the system.
Only available on [2.0.0+].
Parameters
[in]appletResourceUserIdAppletResourceUserId.
[in]application_idApplicationId.

◆ capscWriteDataToAlbumMovieWriteStream()

Result capscWriteDataToAlbumMovieWriteStream ( u64  stream,
u64  offset,
const void *  buffer,
u64  size 
)

Write data to an AlbumMovieWriteStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[in]offsetOffset.
[in]bufferInput data buffer.
[in]sizeData buffer size.

◆ capscWriteMetaToAlbumMovieWriteStream()

Result capscWriteMetaToAlbumMovieWriteStream ( u64  stream,
u64  offset,
const void *  buffer,
u64  size 
)

Write meta data to an AlbumMovieWriteStream.

Note
Only available on [4.0.0+].
Parameters
[in]streamStream handle.
[in]offsetOffset.
[in]bufferInput data buffer.
[in]sizeData buffer size.