Use u64 for system_time_t, as s64 doesn't make much sense in a microsecond context.

This commit is contained in:
Megamouse 2023-02-22 22:14:40 +01:00
parent ccb7528a59
commit 6b30cdac09
9 changed files with 38 additions and 28 deletions

View file

@ -147,7 +147,7 @@ void camera_context::save(utils::serial& ar)
GET_OR_USE_SERIALIZATION_VERSION(ar.is_writing(), cellCamera);
ar(notify_data_map, start_timestamp, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num);
ar(notify_data_map, start_timestamp_us, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num);
}
static bool check_dev_num(s32 dev_num)
@ -1268,7 +1268,7 @@ error_code cellCameraStart(s32 dev_num)
// TODO: Yet another CELL_CAMERA_ERROR_TIMEOUT
g_camera.start_timestamp = get_guest_system_time();
g_camera.start_timestamp_us = get_guest_system_time();
g_camera.is_streaming = true;
return CELL_OK;
@ -1385,18 +1385,18 @@ error_code cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read)
if (has_new_frame)
{
g_camera.frame_timestamp = ::narrow<u32>(get_guest_system_time() - g_camera.start_timestamp);
g_camera.frame_timestamp_us = get_guest_system_time() - g_camera.start_timestamp_us;
}
if (read) // NULL returns CELL_OK
{
read->timestamp = g_camera.frame_timestamp;
read->timestamp = g_camera.frame_timestamp_us;
read->frame = g_camera.frame_num;
read->bytesread = g_camera.bytes_read;
auto& shared_data = g_fxo->get<gem_camera_shared>();
shared_data.frame_timestamp.store(read->timestamp);
shared_data.frame_timestamp_us.store(read->timestamp);
}
return CELL_OK;
@ -1672,7 +1672,7 @@ void camera_context::operator()()
const u64 camera_id = 0;
data2 = image_data_size << 32 | buffer_number << 16 | camera_id;
data3 = get_guest_system_time() - start_timestamp; // timestamp
data3 = get_guest_system_time() - start_timestamp_us; // timestamp
}
else // CELL_CAMERA_READ_FUNCCALL, also default
{
@ -1801,7 +1801,7 @@ void camera_context::reset_state()
pbuf_locked[0] = false;
pbuf_locked[1] = false;
has_new_frame = false;
frame_timestamp = 0;
frame_timestamp_us = 0;
bytes_read = 0;
if (info.buffer)