Validate the configuration and resource information as sceVideodecCreateDecoder does, map the configuration the same way and report the memory and frame buffer requirements that sceVideodec2QueryDecoderMemoryInfo gives for it.
3.0 KiB
libSceVideodec technical debt
Unknown function info
- sceVideodecCreateDecoder, sceVideodecDecode, sceVideodecDeleteDecoder, sceVideodecFlush, sceVideodecQueryResourceInfo and sceVideodecReset (libSceVideodec) - the structure layouts and the error codes follow shadPS4's PS4 library and its implementation, not measured on a PS5: the console's error for a rejected argument and its own version of the structures are unknown. The decoder runs through libSceVideodec2, which decodes H.264 with FFmpeg, and the picture is copied into the caller's frame buffer with the pitch aligned to 64 and the coded height, as the reference writes it
Functional
-
sceVideodecCreateDecoder (libSceVideodec) - the codec type is not checked and the decoder always decodes H.264, as the PS4 library does; the console's codec ids are not documented. A configuration without a maximum frame size is refused with the configuration error, and the resource information the caller passes is not used
-
sceVideodecQueryResourceInfo (libSceVideodec) - the sizes it reports are libSceVideodec2's, not the console's: the CPU memory, CPU-GPU memory and frame buffer sizes and the frame buffer alignment that
sceVideodec2QueryDecoderMemoryInfogives for the configuration mapped assceVideodecCreateDecodermaps it. The GPU memory size that query also gives has no field in this structure and is dropped. The memory pointers andthisSizeare left as the caller passed them, where shadPS4 clears the pointers; what the console writes there is not known. A larger structure is accepted, as by the module's other exports, where shadPS4 requires the exact size, and a configuration without a maximum frame size is refused with the configuration error, where shadPS4 assumes 1920x1080 or 3840x2160 -
sceVideodecDecode and sceVideodecFlush (libSceVideodec) - the picture information's video usability information (the tick rate, the sample aspect ratio and the colour description) stays zero, as the decoder does not report it, and the crop offsets are the decoded picture's crop halved, the unit the H.264 offsets use. The frame buffer holds the coded picture the decoder reports, so the rows the crop covers are in it and the caller crops them
-
sceVideodecMapMemory (libSceVideodec) - its name is listed in the PS5 3.20 export table and cross-checked against PS5 13.60. Its signature and behaviour are unverified; this no-parameter declaration only resolves the import and throws through NotImplemented_nid_no_patch.