feat(libSceContentExport): implement the export calls #1537

Closed
Deses wants to merge 1 commit from upstream-pr/1537 into main
Deses commented 2026-10-08 11:40:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deses on 2026-10-08T11:40:07Z.


What

Implements sceContentExportStart, sceContentExportFinish, sceContentExportFromFile and sceContentExportFromFileWithThumbnail in libSceContentExport, and adds the ContentExportParam struct (title, comment, content type; 579 bytes).

  • Start returns a positive session id; Finish closes it. Term drops all open sessions.
  • FromFile* copy the source file (and the thumbnail) to /_ce in the host root and write the guest path of the copy to the path buffer. The host has no capture gallery, so the exported copy is the only observable result.
  • Console error codes are returned for conditions the host can hit: FILE_NOT_FOUND, NOT_SUPPORTED_FORMAT (content type outside image/jpeg|png|gif, video/mp4|webm), LARGE_TITLE, LARGE_COMMENT, NOT_SUPPORT_FORMAT_THUMBNAIL (not png/jpg), DISKFULL. Not initialized, unknown session, null arguments and a too small path buffer throw, as Init2 and Term already do.
  • sceContentExportFromData takes its real signature but still throws: the data provider callback protocol has a single source. Recorded in TechnicalDebt (Unknown function info).

Signatures and NIDs (recomputed from the names, all match):

  • AlexAltea/orbital tools/ida/db_types.json lines 545-554 (commit b321fcdb)
  • SharpProspero ContentExport.cs / ContentExporter.cs (session flow Init2, Start, FromFile, Finish, Term)
  • shadPS4 src/core/libraries/content_export/ (struct layouts, error codes content_export_error.h lines 9-26)
  • Sony TRC R5089 confirms DISKFULL and that the returned path may not be accessible

Unconfirmed: title and comment are validated but not stored; whether Start itself can return BUSY/EXECUTION_MAX.

Tested

Windows 11, GCC 15.2.0 (WinLibs), Release, build of this branch rebased on current upstream/main (full build, libs target, ctest): ctest -R guest_content_export passes (FromFile copies the bytes, thumbnail copy, each error code, session lifecycle, re-init after Term). check_conventions.py and check_test_registration.py clean. No title tested.

CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head b8e28684: https://github.com/Deses/AnyPS5/actions/runs/37804513306, Linux and Windows (full build, libs, ctest) green.

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
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4786192659 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1537). Originally posted by [Deses](https://github.com/Deses) on 2026-10-08T11:40:07Z. --- ### What Implements `sceContentExportStart`, `sceContentExportFinish`, `sceContentExportFromFile` and `sceContentExportFromFileWithThumbnail` in libSceContentExport, and adds the `ContentExportParam` struct (title, comment, content type; 579 bytes). - `Start` returns a positive session id; `Finish` closes it. `Term` drops all open sessions. - `FromFile*` copy the source file (and the thumbnail) to `/_ce` in the host root and write the guest path of the copy to the `path` buffer. The host has no capture gallery, so the exported copy is the only observable result. - Console error codes are returned for conditions the host can hit: `FILE_NOT_FOUND`, `NOT_SUPPORTED_FORMAT` (content type outside `image/jpeg|png|gif`, `video/mp4|webm`), `LARGE_TITLE`, `LARGE_COMMENT`, `NOT_SUPPORT_FORMAT_THUMBNAIL` (not png/jpg), `DISKFULL`. Not initialized, unknown session, null arguments and a too small path buffer throw, as `Init2` and `Term` already do. - `sceContentExportFromData` takes its real signature but still throws: the data provider callback protocol has a single source. Recorded in TechnicalDebt (Unknown function info). Signatures and NIDs (recomputed from the names, all match): - AlexAltea/orbital `tools/ida/db_types.json` lines 545-554 (commit b321fcdb) - SharpProspero `ContentExport.cs` / `ContentExporter.cs` (session flow Init2, Start, FromFile, Finish, Term) - shadPS4 `src/core/libraries/content_export/` (struct layouts, error codes `content_export_error.h` lines 9-26) - Sony TRC R5089 confirms `DISKFULL` and that the returned path may not be accessible Unconfirmed: title and comment are validated but not stored; whether `Start` itself can return `BUSY`/`EXECUTION_MAX`. ### Tested Windows 11, GCC 15.2.0 (WinLibs), Release, build of this branch rebased on current upstream/main (full build, libs target, ctest): `ctest -R guest_content_export` passes (`FromFile` copies the bytes, thumbnail copy, each error code, session lifecycle, re-init after `Term`). `check_conventions.py` and `check_test_registration.py` clean. No title tested. CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head `b8e28684`: https://github.com/Deses/AnyPS5/actions/runs/37804513306, Linux and Windows (full build, `libs`, ctest) green. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-09 08:57:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:57:21Z.


Same as #1582.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077743225 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1537#issuecomment-6077743225). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:57:21Z. --- Same as #1582.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1537
No description provided.