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

Method on_handler_state

ps3fw/cellCamera.cpp:1930–1988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1928}
1929
1930bool camera_context::on_handler_state(camera_handler_base::camera_handler_state state)
1931{
1932 switch (state)
1933 {
1934 case camera_handler_base::camera_handler_state::closed:
1935 {
1936 if (is_attached)
1937 {
1938 is_attached = false;
1939 is_attached_dirty = true;
1940 }
1941 if (handler)
1942 {
1943 if (is_streaming)
1944 {
1945 cellCamera.warning("Camera closed or disconnected (state=%d). Trying to start camera...", static_cast<int>(state));
1946 Emu.BlockingCallFromMainThread([&]()
1947 {
1948 handler->open_camera();
1949 handler->start_camera();
1950 });
1951 }
1952 else if (is_open)
1953 {
1954 cellCamera.warning("Camera closed or disconnected (state=%d). Trying to open camera...", static_cast<int>(state));
1955 Emu.BlockingCallFromMainThread([&]()
1956 {
1957 handler->open_camera();
1958 });
1959 }
1960 }
1961 return false;
1962 }
1963 case camera_handler_base::camera_handler_state::open:
1964 {
1965 if (handler && is_streaming)
1966 {
1967 cellCamera.warning("Camera handler not running (state=%d). Trying to start camera...", static_cast<int>(state));
1968 Emu.BlockingCallFromMainThread([&]()
1969 {
1970 handler->start_camera();
1971 });
1972 }
1973 break;
1974 }
1975 case camera_handler_base::camera_handler_state::running:
1976 {
1977 if (!is_attached)
1978 {
1979 cellCamera.warning("Camera handler not attached. Sending attach event...", static_cast<int>(state));
1980 is_attached = true;
1981 is_attached_dirty = true;
1982 }
1983 break;
1984 }
1985 }
1986
1987 return true;

Callers

nothing calls this directly

Calls 3

open_cameraMethod · 0.45
start_cameraMethod · 0.45

Tested by

no test coverage detected