MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / cellCameraSetAttribute

Function cellCameraSetAttribute

ps3fw/cellCamera.cpp:975–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

973}
974
975error_code cellCameraSetAttribute(s32 dev_num, s32 attrib, u32 arg1, u32 arg2)
976{
977 const auto attr_name = get_camera_attr_name(attrib);
978 (attrib == CELL_CAMERA_LED ? cellCamera.trace : cellCamera.todo)("cellCameraSetAttribute(dev_num=%d, attrib=%d=%s, arg1=%d, arg2=%d)", dev_num, attrib, attr_name, arg1, arg2);
979
980 auto& g_camera = g_fxo->get<camera_thread>();
981
982 if (!g_camera.init)
983 {
984 return CELL_CAMERA_ERROR_NOT_INIT;
985 }
986
987 if (!check_dev_num(dev_num))
988 {
989 return CELL_CAMERA_ERROR_PARAM;
990 }
991
992 if (g_cfg.io.camera == camera_handler::null)
993 {
994 return not_an_error(CELL_CAMERA_ERROR_NOT_OPEN);
995 }
996
997 // actually compares <= 0x63 which is equivalent
998 if (attrib < CELL_CAMERA_FORMATCAP && !g_camera.is_open)
999 {
1000 return CELL_CAMERA_ERROR_NOT_OPEN;
1001 }
1002
1003 if (error_code error = check_resolution(dev_num))
1004 {
1005 return error;
1006 }
1007
1008 if (!attr_name) // invalid attributes don't have a name
1009 {
1010 return CELL_CAMERA_ERROR_PARAM;
1011 }
1012
1013 g_camera.set_attr(attrib, arg1, arg2);
1014
1015 return CELL_OK;
1016}
1017
1018error_code cellCameraResetAttribute()
1019{

Callers 4

cellCameraOpenExFunction · 0.85
cellCameraGetBufferSizeFunction · 0.85
cellCameraReadCompleteFunction · 0.85
cellGemPrepareCameraFunction · 0.85

Calls 4

get_camera_attr_nameFunction · 0.85
check_dev_numFunction · 0.85
check_resolutionFunction · 0.85
set_attrMethod · 0.80

Tested by

no test coverage detected