| 973 | } |
| 974 | |
| 975 | error_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 | |
| 1018 | error_code cellCameraResetAttribute() |
| 1019 | { |
no test coverage detected