cellCamera: fix qt camera width and height for non-default resolutions

This commit is contained in:
Megamouse 2021-10-17 12:38:09 +02:00
parent 08011e9b78
commit 3fac832567
2 changed files with 6 additions and 0 deletions

View file

@ -1217,6 +1217,7 @@ error_code cellCameraStart(s32 dev_num)
{
g_camera.handler->set_mirrored(!!g_camera.attr[CELL_CAMERA_MIRRORFLAG].v1);
g_camera.handler->set_frame_rate(g_camera.info.framerate);
g_camera.handler->set_resolution(g_camera.info.width, g_camera.info.height);
atomic_t<bool> wake_up = false;

View file

@ -248,6 +248,11 @@ void qt_camera_video_surface::get_image(u8* buf, u64 size, u32& width, u32& heig
{
bytes_read = std::min<u64>(image_buffer.size, size);
std::memcpy(buf, image_buffer.data, bytes_read);
if (image_buffer.size != size)
{
camera_log.error("Buffer size mismatch: in=%d, out=%d. Cropping to incoming size. Please contact a developer.", size, image_buffer.size);
}
}
else
{