Skip to content

feat(libSceVideoRecording): export the PS4 recording calls CUSA12982 imports - #28089

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
leskal:feat/libscevideorecording-ps4-imports
Dec 3, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
leskal:feat/libscevideorecording-ps4-imports

Conversation

@leskal

@leskal leskal commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What

CUSA12982 failed to link: it imports six functions from libSceVideoRecording, which only exported sceVideoRecordingSetInfo. This adds them in that file's PS4 style:

  • sceVideoRecordingGetStatus returns 0 and sceVideoRecordingStart, Stop and Close return 0x80A80006, the answers with no recorder open: this library never opens one, sceVideoRecordingSetInfo returns the same 0x80A80006 for info that needs a recorder, and libSceVideoRecordingP measured these values on a PS5. A PS5 title throws, as in SetInfo
  • sceVideoRecordingOpen2 and sceVideoRecordingQueryMemSize2 throw: the PS4 parameter layout and sizes are unknown, and libSceVideoRecordingP's Open2 throws too

CUSA12982 also needs the libSceGnmDriver imports from #27342, #27937 and #28088.

Tested

Windows 10, WinLibs GCC 15.2.0 r7: guest_video_recording_ps4 passes with the new checks on top of the SetInfo cases. With both PRs, CUSA12982 links, starts, loads its pak files and later stops on an unrelated app0.zar directory read; it does not call Open2 or QueryMemSize2 on the way.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: CUSA12982
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for additional video-recording calls. Status checks report no active recording, while start, stop, and close report that recording is not open.
    • Opening a recording and checking its memory requirements remain unsupported.

…imports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Video recording imports

Layer / File(s) Summary
Export and verify video-recording imports
core/libs/prx/libSceVideoRecording/Export.cpp, core/libs/prx/libSceVideoRecording/libSceVideoRecording.hpp, core/libs/tests/GuestVideoRecordingPs4.cpp, docs/dev/debt/changes/feat-libscevideorecording-ps4-imports.md
Adds declarations and implementations for six exports. On PS4, GetStatus returns StatusNone, while Start, Stop, and Close return ErrorNotOpen; non-PS4 calls to those functions use NotImplemented_nid_no_patch. Open2 and QueryMemSize2 call NotImplemented_nid_no_patch unconditionally. Tests check these results and exceptions. Documentation records the behavior and measurement caveats.

Suggested reviewers: nikmparis217-ux, boykopovar

Change: Feature

Merge Risk: Minimal · up to 44228

This adds six video-recording import exports so the title can link. Four return documented no-recorder values on PS4, and the other two throw not-implemented errors. Merge risk is minimal.

Security architecture risk: Minimal · up to 44228

The new imports let compatible titles link without enabling recording. The implemented PS4 paths return fixed “no recorder” results, and unsupported calls use the existing error path. The change does not show a material increase in security or failure-containment risk.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The new guest-callable paths expose fixed status values or the existing unsupported-call handler. They do not dereference guest pointers, use the supplied recording path, capture media, or change recorder state.

Resilience and Maintainability Implications

  • observed — Unsupported calls increment the existing atomic counter before reporting and throwing. Reporting uses a thread-local last-call record and a bounded shared table with timed lock acquisition. The new calls add fixed diagnostic keys, not guest-controlled keys.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e1cd510-084f-40a0-8e8e-fd81dfc01ea8
Commits

Reviewing files that changed from the base of the PR and between 4f6d47e and 44228e1.

Files selected for processing: 4

  • core/libs/prx/libSceVideoRecording/Export.cpp
  • core/libs/prx/libSceVideoRecording/libSceVideoRecording.hpp
  • core/libs/tests/GuestVideoRecordingPs4.cpp
  • docs/dev/debt/changes/feat-libscevideorecording-ps4-imports.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@PrivacyOnion PrivacyOnion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 44228e1bf9:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_video_recording_ps4_tests built cleanly.
  • CTest (guest_video_recording_ps4):
    1/1 Test #6290: guest_video_recording_ps4 ........   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceVideoRecording/Export.cpp, core/libs/prx/libSceVideoRecording/libSceVideoRecording.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified that sceVideoRecordingOpen2_nid_disambig1 and sceVideoRecordingQueryMemSize2_nid_disambig1 throw NotImplemented_nid_no_patch(func) as unknown layouts per AGENTS.md and are documented in the debt fragment.
    • Verified that sceVideoRecordingClose_nid_disambig1, sceVideoRecordingGetStatus_nid_disambig1, sceVideoRecordingStart_nid_disambig1, and sceVideoRecordingStop_nid_disambig1 check sceKernelIsPs4Process() == 1 and return expected 0x80a80006 (ErrorNotOpen) and 0 (StatusNone).
    • Verified that technical debt documentation in docs/dev/debt/changes/feat-libscevideorecording-ps4-imports.md conforms to required format and documents gaps/behavior.
    • Verified that all exported signatures in libSceVideoRecording.hpp match C linkage and APS5_VABI calling convention without LP64/LLP64 type mismatch.
    • Verified that unit test GuestVideoRecordingPs4.cpp properly exercises each added export, verifying error codes and exception throwing on unimplemented functions.

Looks Good To Me

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — comments

The change adds all six requested exports and explicitly leaves the two calls with unknown behavior unimplemented; this review did not run the reported checks.

What I ran

  • Read the prepared description, commit summary, manifest, diff, and all four changed files at head 44228e1bf943a8b46ddb0a721f801afaec870bc3.
  • Searched the pinned repository for the new export names, NotImplemented_nid_no_patch, and related recording-library references.
  • No build or tests were run. The prepared bundle did not expose files.json through the reader.

Results

Check Result Note
Change and source review passed All four changed files read
Build and tests not run Description reports Windows tests; not independently run
Files excluded by rule not verified files.json unavailable

Findings

Blocking

None identified in the files read.

Non-blocking

  • The test helper only recognizes std::runtime_error with the text “not implemented.” It would miss other exception types from the unimplemented paths, so consider asserting the specific exception contract if one exists. The helper and its use are at core/libs/tests/GuestVideoRecordingPs4.cpp:25 and core/libs/tests/GuestVideoRecordingPs4.cpp:110.

Not verified

  • No executable checks were run; the test and console results in the description are author-reported.
  • files.json was unavailable, so files excluded by rule could not be identified. The manifest lists four changed files, all of which were read.
  • No claim is made about behavior on physical hardware or other platforms.

To get this to a good state

Nothing is required. The exception assertion is an optional improvement.

@JJenkx

JJenkx commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Linux check of the exact head 44228e1bf943; the description has no Linux results. Arch Linux 7.3.5 x86-64, GCC 16.2.1, Release, -DBUILD_TESTING=ON:

  • guest_video_recording_ps4 (this PR's GuestVideoRecordingPs4.cpp): pass, not skipped.

AI-assisted: yes

@github-actions

Copy link
Copy Markdown

Exports with a name or library/NID already present in main:

  • sceVideoRecordingClose (also exported by another library in main: core/libs/prx/libSceVideoRecordingP; may be intentional)
  • sceVideoRecordingGetStatus (also exported by another library in main: core/libs/prx/libSceVideoRecordingP; may be intentional)
  • sceVideoRecordingOpen2 (also exported by another library in main: core/libs/prx/libSceVideoRecordingP; may be intentional)
  • sceVideoRecordingQueryMemSize2 (also exported by another library in main: core/libs/prx/libSceVideoRecordingP; may be intentional)
  • sceVideoRecordingStart (also exported by another library in main: core/libs/prx/libSceVideoRecordingP; may be intentional)
  • sceVideoRecordingStop (also exported by another library in main: core/libs/prx/libSceVideoRecordingP; may be intentional)

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line docs prx labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Progress report (4ea61d0 → 44228e1)

📉 System libraries: 47.82% (-0.01%, +6 declared functions)

🆕 6 declared as stubs
Library Name
libSceVideoRecording sceVideoRecordingClose_nid_disambig1
libSceVideoRecording sceVideoRecordingGetStatus_nid_disambig1
libSceVideoRecording sceVideoRecordingOpen2_nid_disambig1
libSceVideoRecording sceVideoRecordingQueryMemSize2_nid_disambig1
libSceVideoRecording sceVideoRecordingStart_nid_disambig1
libSceVideoRecording sceVideoRecordingStop_nid_disambig1

Changed libraries (implemented exports)

Library Before After Change
libSceVideoRecording 0/1 (0.00%) 0/7 (0.00%) +0.00%

@leskal leskal closed this Nov 29, 2026
@leskal leskal reopened this Nov 29, 2026
@github-actions github-actions Bot added review queue Next in the maintainer review queue: checks pass, no open change request, no conflict and removed review queue Next in the maintainer review queue: checks pass, no open change request, no conflict labels Nov 29, 2026
@B-Howell

B-Howell commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 44228e1bf943, merged onto main b535a7e71233 (clean merge). Windows 11 Pro 10.0.26300, Ryzen 7 7800X3D, WinLibs GCC 15.2.0 r7 (UCRT), Ninja, Release, -DBUILD_TESTING=ON. No GPU used.

  • guest_video_recording_ps4, guest_video_recording, guest_video_recording_native, guest_video_recording_rest_status: 4 of 4 pass, 3 of 3 runs, none skipped.
  • Control: with libSceVideoRecording set back to main the test does not compile (sceVideoRecordingGetStatus_nid_disambig1 and the others are not declared), so the control only shows the new exports are needed; there is no runtime control for new exports.
  • Diff read against AGENTS.md: Open2 and QueryMemSize2 throw, and the PS4 answers of the other four are listed as unmeasured in the debt fragment. One gap, not a bug: the new checks run only in the PS4 process, so the PS5 branch (sceKernelIsPs4Process() != 1 throwing) of GetStatus, Start, Stop and Close has no test.

AI-assisted: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs prx unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants