mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-07-09 17:25:37 -06:00
Fix Camera issues found in Burnout Paradise Remastered (#4668)
* Populate pFramePointerListGarlic in sceCameraGetFrameData * More explicitly tell the apps that a frame isn't valid * remove hacky global variable * fix maybe UB
This commit is contained in:
parent
07bbc77bde
commit
03e1497f34
@ -402,7 +402,12 @@ static void ConvertRGBA8888ToRAW8(const u8* src, u8* dst, int width, int height)
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetFrameData(s32 handle, OrbisCameraFrameData* frame_data) {
|
||||
LOG_DEBUG(Lib_Camera, "called");
|
||||
if (handle < 1 || frame_data == nullptr || frame_data->sizeThis > 584) {
|
||||
if (frame_data == nullptr) {
|
||||
return ORBIS_CAMERA_ERROR_PARAM;
|
||||
}
|
||||
frame_data->status[0] = -1;
|
||||
frame_data->status[1] = -1;
|
||||
if (handle < 1 || frame_data->sizeThis > 584) {
|
||||
return ORBIS_CAMERA_ERROR_PARAM;
|
||||
}
|
||||
if (!g_library_opened || !sdl_camera) {
|
||||
@ -418,6 +423,8 @@ s32 PS4_SYSV_ABI sceCameraGetFrameData(s32 handle, OrbisCameraFrameData* frame_d
|
||||
}
|
||||
frame = SDL_AcquireCameraFrame(sdl_camera, ×tampNS);
|
||||
|
||||
frame_data->status[0] = frame != nullptr ? 0 : -1;
|
||||
frame_data->status[1] = frame != nullptr ? 0 : -1;
|
||||
if (!frame) {
|
||||
return ORBIS_CAMERA_ERROR_BUSY;
|
||||
}
|
||||
@ -454,6 +461,9 @@ s32 PS4_SYSV_ABI sceCameraGetFrameData(s32 handle, OrbisCameraFrameData* frame_d
|
||||
}
|
||||
frame_data->meta.format[0][0] = output_config0.format.formatLevel0;
|
||||
frame_data->meta.format[1][0] = output_config1.format.formatLevel0;
|
||||
// not fully correct, but good enough
|
||||
frame_data->pFramePointerListGarlic[0][0] = frame_data->pFramePointerList[0][0];
|
||||
frame_data->pFramePointerListGarlic[1][0] = frame_data->pFramePointerList[1][0];
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
@ -642,7 +652,7 @@ s32 PS4_SYSV_ABI sceCameraIsValidFrameData(s32 handle, OrbisCameraFrameData* fra
|
||||
return ORBIS_CAMERA_ERROR_NOT_OPEN;
|
||||
}
|
||||
|
||||
return 1; // valid
|
||||
return frame_data->status[0] == 0 && frame_data->status[1] == 0;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user