Changes

Jump to navigation Jump to search
1,358 bytes added ,  03:28, 25 August 2019
Line 12: Line 12:  
| 1 || OpenContinuousRecorder || Takes a total of 0x28-bytes of input and a handle, returns an [[#IContinuousRecorder]].
 
| 1 || OpenContinuousRecorder || Takes a total of 0x28-bytes of input and a handle, returns an [[#IContinuousRecorder]].
 
|-
 
|-
| 2 || OpenGameMovieTrimmer || Takes a total of 0x8-bytes of input and a handle, returns an [[#IGameMovieTrimmer]].
+
| 2 || OpenGameMovieTrimmer || Takes an input u64 and a handle, returns an [[#IGameMovieTrimmer]].
 
|-
 
|-
 
| 3 || [5.0.0+] || Takes a total of 0x8-bytes of input and a handle, returns an [[#IOffscreenRecorder]].
 
| 3 || [5.0.0+] || Takes a total of 0x8-bytes of input and a handle, returns an [[#IOffscreenRecorder]].
Line 64: Line 64:  
| 20 || [[#SetThumbnailRgba]]
 
| 20 || [[#SetThumbnailRgba]]
 
|}
 
|}
 +
 +
Album uses [[Applet_Manager_services#CreateGameMovieTrimmer|CreateGameMovieTrimmer]], and retries using the cmd in a loop on error 0x8D4 with svcSleepThread(100000000) being used first. Then all 4 of these commands are used in that same func: [[#SetThumbnailRgba]] if the input buffer is set, [[#GetNotTrimmingEvent]], [[#BeginTrim]], waits on the event, then [[#EndTrim]] and cleanup.
    
=== BeginTrim ===
 
=== BeginTrim ===
Takes an input s32, a s32, and a [[#GameMovieId]], no output.
+
Takes an input s32 '''start''', a s32 '''end''', and a [[#GameMovieId]], no output.
 +
 
 +
The two s32s are the start/end timestamps in 0.5s units.
    
=== EndTrim ===
 
=== EndTrim ===
 
No input, returns an output [[#GameMovieId]].
 
No input, returns an output [[#GameMovieId]].
 +
 +
This just loads the [[#GameMovieId]] from state, when available.
    
=== GetNotTrimmingEvent ===
 
=== GetNotTrimmingEvent ===
No input, returns an output handle.
+
No input, returns an output Event handle with autoclear=false.
    
=== SetThumbnailRgba ===
 
=== SetThumbnailRgba ===
Takes a type-0x45 input buffer, a s32, and a s32, no output.
+
Takes a type-0x45 input buffer, a s32 '''width''', and a s32 '''height''', no output.
 +
 
 +
'''width''' must be 1280, '''height''' must be 720, and the buffer size must be at least 0x384000. After this validation, this just copies the input buffer to state with size 0x384000 and returns 0.
    
= grc:d =
 
= grc:d =
Line 92: Line 100:     
== Cmd1 ==
 
== Cmd1 ==
Begins video stream. Can only be called once.
+
Begins video stream. This must not be used more than once, even from a different service session: otherwise the sysmodule will assert.
    
== Cmd2 ==
 
== Cmd2 ==
Retrieves video data. Takes u32 "stream" (0: video, 1: audio), returns u32 (num_frames?), u32 data_size, u64 (start_timestamp?). Video stream writes H.264 NAL units to the output buffer (try <code>ffplay -f h264</code>). Official code uses buffer size 0x32000 for video, 0x1000 for audio, and multiple threads to read out both streams at the same time.
+
Retrieves stream data, from the video recording being done of the currently running game title. Takes u32 "stream" (0: video, 1: audio), returns u32 (num_frames?), u32 data_size, u64 (start_timestamp?). Video stream writes H.264 NAL units to the output buffer (try <code>ffplay -f h264</code>). Audio stream is PCM16, 2 channels, and sample-rate = 48000Hz. Official code uses buffer size 0x32000 for video, 0x1000 for audio, and multiple threads to read out both streams at the same time.
 +
 
 +
This will block until data is available. This will hang if there is no game title running which has video capture enabled.
    
= IOffscreenRecorder =
 
= IOffscreenRecorder =
Line 155: Line 165:     
== SetAlbumShimLibraryVersion ==
 
== SetAlbumShimLibraryVersion ==
Takes a total of 8-bytes of input, no output.
+
Takes an input u64 [[Capture_services#ShimLibraryVersion|ShimLibraryVersion]], no output.
    
== OpenOffscreenLayer ==
 
== OpenOffscreenLayer ==
Line 212: Line 222:     
= GameMovieId =
 
= GameMovieId =
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x18 || Same as the last 0x18-bytes of [[Capture_services|AlbumEntry]].
 +
|-
 +
| 0x18 || 0x28 || Unused, always zero.
 +
|}
 +
 
This is "nn::grcsrv::GameMovieId". This is a 0x40-byte struct.
 
This is "nn::grcsrv::GameMovieId". This is a 0x40-byte struct.
  

Navigation menu