screencopy: Enable support for BGR888 shared memory buffers (#143)

This simply adds the cases to the conversion functions. The rest of the
code needs no change from screen and window capture to work as expected.
This commit is contained in:
Alexis Brodeur 2023-12-03 17:02:23 -05:00 committed by GitHub
parent 8b2183b3a5
commit c23f738673
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,7 +154,8 @@ uint32_t drmFourccFromSHM(wl_shm_format format) {
case WL_SHM_FORMAT_ARGB2101010:
case WL_SHM_FORMAT_ABGR2101010:
case WL_SHM_FORMAT_RGBA1010102:
case WL_SHM_FORMAT_BGRA1010102: return (uint32_t)format;
case WL_SHM_FORMAT_BGRA1010102:
case WL_SHM_FORMAT_BGR888: return (uint32_t)format;
default: Debug::log(ERR, "[screencopy] Unknown format {}", (int)format); abort();
}
}
@ -178,6 +179,7 @@ spa_video_format pwFromDrmFourcc(uint32_t format) {
case DRM_FORMAT_ABGR2101010: return SPA_VIDEO_FORMAT_ABGR_210LE;
case DRM_FORMAT_RGBA1010102: return SPA_VIDEO_FORMAT_RGBA_102LE;
case DRM_FORMAT_BGRA1010102: return SPA_VIDEO_FORMAT_BGRA_102LE;
case DRM_FORMAT_BGR888: return SPA_VIDEO_FORMAT_BGR;
default: Debug::log(ERR, "[screencopy] Unknown format {}", (int)format); abort();
}
}