| 529 | } |
| 530 | |
| 531 | error_code cellCameraOpen(s32 dev_num, vm::ptr<CellCameraInfo> info) |
| 532 | { |
| 533 | cellCamera.notice("cellCameraOpen(dev_num=%d, info=*0x%x)", dev_num, info); |
| 534 | |
| 535 | if (!info) |
| 536 | { |
| 537 | return CELL_CAMERA_ERROR_PARAM; |
| 538 | } |
| 539 | |
| 540 | auto& g_camera = g_fxo->get<camera_thread>(); |
| 541 | |
| 542 | if (!g_camera.init) |
| 543 | { |
| 544 | return CELL_CAMERA_ERROR_NOT_INIT; |
| 545 | } |
| 546 | |
| 547 | if (!check_dev_num(dev_num)) |
| 548 | { |
| 549 | return CELL_CAMERA_ERROR_PARAM; |
| 550 | } |
| 551 | |
| 552 | if (g_camera.is_open) |
| 553 | { |
| 554 | return CELL_CAMERA_ERROR_ALREADY_OPEN; |
| 555 | } |
| 556 | |
| 557 | if (auto res = check_camera_info(*info)) |
| 558 | { |
| 559 | return res; |
| 560 | } |
| 561 | |
| 562 | if (!g_camera.is_attached) |
| 563 | { |
| 564 | return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND; |
| 565 | } |
| 566 | |
| 567 | return CELL_OK; |
| 568 | } |
| 569 | |
| 570 | error_code cellCameraOpenAsync() |
| 571 | { |
nothing calls this directly
no test coverage detected