1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

cellSysutilAvcExt: add some param checks

This commit is contained in:
Megamouse 2024-09-06 14:48:00 +02:00
parent fe1fa45956
commit 2bc0d19c9d

View File

@ -4,9 +4,15 @@
LOG_CHANNEL(cellSysutilAvcExt);
error_code cellSysutilAvcSetAttribute(CellSysUtilAvcAttribute attr_id, vm::ptr<void> param);
error_code cellSysutilAvcLoadAsync(vm::ptr<CellSysutilAvcCallback> func, vm::ptr<void> userdata, sys_memory_container_t container, CellSysUtilAvcMediaType media, CellSysUtilAvcVideoQuality videoQuality, CellSysUtilAvcVoiceQuality voiceQuality, vm::ptr<CellSysutilAvcRequestId> request_id);
error_code cellSysutilAvcExtIsMicAttached(vm::ptr<s32> status)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtIsMicAttached(status=*0x%x)", status);
ensure(!!status); // Not actually checked
return CELL_OK;
}
@ -25,6 +31,10 @@ error_code cellSysutilAvcExtSetWindowRotation(vm::ptr<SceNpId> player_id, f32 ro
error_code cellSysutilAvcExtGetWindowPosition(vm::ptr<SceNpId> player_id, vm::ptr<f32> position_x, vm::ptr<f32> position_y, vm::ptr<f32> position_z)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowPosition(player_id=*0x%x, position_x=*0x%x, position_y=*0x%x, position_z=*0x%x)", player_id, position_x, position_y, position_z);
if (!player_id || !position_x || !position_y || !position_z)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -43,6 +53,10 @@ error_code cellSysutilAvcExtSetWindowPosition(vm::ptr<SceNpId> player_id, f32 po
error_code cellSysutilAvcExtGetWindowSize(vm::ptr<SceNpId> player_id, vm::ptr<f32> size_x, vm::ptr<f32> size_y)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowSize(player_id=*0x%x, size_x=*0x%x, size_y=*0x%x)", player_id, size_x, size_y);
if (!player_id || !size_x || !size_y)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -55,6 +69,10 @@ error_code cellSysutilAvcExtStartCameraDetection()
error_code cellSysutilAvcExtGetWindowShowStatus(vm::ptr<SceNpId> player_id, vm::ptr<b8> is_visible)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowShowStatus(player_id=*0x%x, is_visible=*0x%x)", player_id, is_visible);
if (!player_id || !is_visible)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -67,18 +85,30 @@ error_code cellSysutilAvcExtSetChatMode(u32 mode)
error_code cellSysutilAvcExtGetNamePlateShowStatus(vm::ptr<b8> is_visible)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetNamePlateShowStatus(is_visible=*0x%x)", is_visible);
if (!is_visible)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
error_code cellSysutilAvcExtSetWindowAlpha(vm::ptr<SceNpId> player_id, f32 alpha, CellSysutilAvcTransitionType transition_type)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtSetWindowAlpha(player_id=*0x%x, alpha=%f, transition_type=0x%x)", player_id, alpha, +transition_type);
if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
error_code cellSysutilAvcExtSetWindowSize(vm::ptr<SceNpId> player_id, f32 size_x, f32 size_y, CellSysutilAvcTransitionType transition_type)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtSetWindowSize(player_id=*0x%x, size_x=%f, size_y=%f, transition_type=0x%x)", player_id, size_x, size_y, +transition_type);
if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -93,7 +123,30 @@ error_code cellSysutilAvcExtLoadAsyncEx(vm::ptr<CellSysutilAvcCallback> func, vm
{
cellSysutilAvcExt.todo("cellSysutilAvcExtLoadAsyncEx(func=*0x%x, userdata=*0x%x, container=0x%x, media=0x%x, videoQuality=0x%x, voiceQuality=0x%x, option=*0x%x, request_id=*0x%x)",
func, userdata, container, +media, +videoQuality, +voiceQuality, option, request_id);
return CELL_OK;
if (!option)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
switch (option->avcOptionParamVersion)
{
case CELL_SYSUTIL_AVC_OPTION_PARAM_VERSION:
if (option->sharingVideoBuffer && media == CELL_SYSUTIL_AVC_VOICE_CHAT)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
//cellSysutilAvcSetAttribute(0x10000100, &option->sharingVideoBuffer);
break;
case 180:
if (option->sharingVideoBuffer && media == CELL_SYSUTIL_AVC_VOICE_CHAT)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
//cellSysutilAvcSetAttribute(0x10000100, &option->sharingVideoBuffer);
//cellSysutilAvcSetAttribute(0x10000102, &option->maxPlayers);
break;
default:
return CELL_AVC_ERROR_UNKNOWN;
}
return cellSysutilAvcLoadAsync(func, userdata, container, media, videoQuality, voiceQuality, request_id);
}
error_code cellSysutilAvcExtSetShowNamePlate()
@ -111,12 +164,19 @@ error_code cellSysutilAvcExtStopVoiceDetection()
error_code cellSysutilAvcExtShowWindow(vm::ptr<SceNpId> player_id, CellSysutilAvcTransitionType transition_type)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtStopVoiceDetection(player_id=*0x%x, transition_type=0x%x)", player_id, +transition_type);
if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
error_code cellSysutilAvcExtIsCameraAttached(vm::ptr<s32> status)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtIsCameraAttached(status=*0x%x)", status);
ensure(!!status); // Not actually checked
return CELL_OK;
}
@ -129,6 +189,10 @@ error_code cellSysutilAvcExtHidePanelEx(CellSysutilAvcTransitionType transition_
error_code cellSysutilAvcExtHideWindow(vm::ptr<SceNpId> player_id, CellSysutilAvcTransitionType transition_type)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtHideWindow(player_id=*0x%x, transition_type=0x%x)", player_id, +transition_type);
if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -141,6 +205,10 @@ error_code cellSysutilAvcExtSetChatGroup()
error_code cellSysutilAvcExtGetWindowRotation(vm::ptr<SceNpId> player_id, vm::ptr<f32> rotation_x, vm::ptr<f32> rotation_y, vm::ptr<f32> rotation_z)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowRotation(player_id=*0x%x, rotation_x=*0x%x, rotation_y=*0x%x, rotation_z=*0x%x)", player_id, rotation_x, rotation_y, rotation_z);
if (!player_id || !rotation_x || !rotation_y || !rotation_z)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -153,6 +221,10 @@ error_code cellSysutilAvcExtStartMicDetection()
error_code cellSysutilAvcExtGetWindowAlpha(vm::ptr<SceNpId> player_id, vm::ptr<f32> alpha)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowAlpha(player_id=*0x%x, alpha=*0x%x)", player_id, alpha);
if (!player_id || !alpha)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -165,6 +237,10 @@ error_code cellSysutilAvcExtStartVoiceDetection()
error_code cellSysutilAvcExtGetSurfacePointer(vm::ptr<SceNpId> player_id, vm::pptr<void> surface_ptr, vm::ptr<s32> surface_size, vm::ptr<s32> surface_size_x, vm::ptr<s32> surface_size_y)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtGetSurfacePointer(player_id=*0x%x, surface_ptr=*0x%x, surface_size=*0x%x, surface_size_x=*0x%x, surface_size_y=*0x%x)", player_id, surface_ptr, surface_size, surface_size_x, surface_size_y);
if (!player_id || !surface_ptr || !surface_size || !surface_size_x || !surface_size_y)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}
@ -177,12 +253,35 @@ error_code cellSysutilAvcExtStopMicDetection()
error_code cellSysutilAvcExtInitOptionParam(s32 avcOptionParamVersion, vm::ptr<CellSysutilAvcOptionParam> option)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtInitOptionParam(avcOptionParamVersion=0x%x, option=*0x%x)", avcOptionParamVersion, option);
if (!option)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
option->avcOptionParamVersion = avcOptionParamVersion;
switch (option->avcOptionParamVersion)
{
case CELL_SYSUTIL_AVC_OPTION_PARAM_VERSION:
break;
case 180:
option->maxPlayers = 16;
break;
default:
return CELL_AVC_ERROR_UNKNOWN;
}
option->sharingVideoBuffer = false;
return CELL_OK;
}
error_code cellSysutilAvcExtSetWindowZorder(vm::ptr<SceNpId> player_id, u32 zorder)
{
cellSysutilAvcExt.todo("cellSysutilAvcExtSetWindowZorder(player_id=*0x%x, zorder=0x%x)", player_id, zorder);
if (!player_id || zorder < CELL_SYSUTIL_AVC_ZORDER_FORWARD_MOST || zorder > CELL_SYSUTIL_AVC_ZORDER_BEHIND_MOST)
return CELL_AVC_ERROR_INVALID_ARGUMENT;
return CELL_OK;
}