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

Function cellCameraClose

ps3fw/cellCamera.cpp:672–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672error_code cellCameraClose(s32 dev_num)
673{
674 cellCamera.notice("cellCameraClose(dev_num=%d)", dev_num);
675
676 if (error_code error = check_init_and_open(dev_num))
677 {
678 return error;
679 }
680
681 // TODO: Yet another CELL_CAMERA_ERROR_BUSY
682
683 if (dev_num != 0)
684 {
685 return CELL_CAMERA_ERROR_PARAM;
686 }
687
688 if (error_code error = check_resolution(dev_num))
689 {
690 return error;
691 }
692
693 auto& g_camera = g_fxo->get<camera_thread>();
694 std::lock_guard lock(g_camera.mutex);
695 g_camera.is_streaming = false;
696
697 if (g_camera.info.buffer)
698 {
699 vm::dealloc(g_camera.info.buffer.addr(), vm::main);
700 }
701 if (g_camera.info.pbuf[0])
702 {
703 vm::dealloc(g_camera.info.pbuf[0].addr(), vm::main);
704 }
705 if (g_camera.info.pbuf[1])
706 {
707 vm::dealloc(g_camera.info.pbuf[1].addr(), vm::main);
708 }
709
710 g_camera.close_camera();
711 g_camera.is_open = false;
712
713 return CELL_OK;
714}
715
716error_code cellCameraCloseAsync()
717{

Callers

nothing calls this directly

Calls 5

check_init_and_openFunction · 0.85
check_resolutionFunction · 0.85
deallocFunction · 0.85
addrMethod · 0.45
close_cameraMethod · 0.45

Tested by

no test coverage detected