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

Function cellCameraGetType

ps3fw/cellCamera.cpp:747–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

745}
746
747error_code cellCameraGetType(s32 dev_num, vm::ptr<s32> type)
748{
749 cellCamera.trace("cellCameraGetType(dev_num=%d, type=*0x%x)", dev_num, type);
750
751 auto& g_camera = g_fxo->get<camera_thread>();
752
753 if (!g_camera.init)
754 {
755 return CELL_CAMERA_ERROR_NOT_INIT;
756 }
757
758 if (g_cfg.io.camera == camera_handler::null)
759 {
760 return not_an_error(CELL_CAMERA_ERROR_DEVICE_NOT_FOUND);
761 }
762
763 if (!check_dev_num(dev_num) || !type)
764 {
765 return CELL_CAMERA_ERROR_PARAM;
766 }
767
768 if (error_code error = check_resolution(dev_num))
769 {
770 return error;
771 }
772
773 if (!g_camera.is_attached)
774 {
775 return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND;
776 }
777
778 switch (g_cfg.io.camera_type.get())
779 {
780 case fake_camera_type::unknown: *type = CELL_CAMERA_TYPE_UNKNOWN; break;
781 case fake_camera_type::eyetoy: *type = CELL_CAMERA_EYETOY; break;
782 case fake_camera_type::eyetoy2: *type = CELL_CAMERA_EYETOY2; break;
783 case fake_camera_type::uvc1_1: *type = CELL_CAMERA_USBVIDEOCLASS; break;
784 }
785
786 return CELL_OK;
787}
788
789s32 cellCameraIsAvailable(s32 dev_num)
790{

Callers 2

cellCameraIsAvailableFunction · 0.85
cellCameraIsAttachedFunction · 0.85

Calls 3

check_dev_numFunction · 0.85
check_resolutionFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected