1
0
Fork 0
forked from wry/wry

video: add support for a/xbgr8888 formats

This commit is contained in:
Julian Orth 2022-10-10 19:02:20 +02:00
parent ab6a39bd34
commit 8059457afb
2 changed files with 28 additions and 2 deletions

View file

@ -1,9 +1,10 @@
use {
crate::{
pipewire::pw_pod::{
SPA_VIDEO_FORMAT_BGRx, SpaVideoFormat, SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_NV12,
SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SpaVideoFormat, SPA_VIDEO_FORMAT_BGRA,
SPA_VIDEO_FORMAT_NV12, SPA_VIDEO_FORMAT_RGBA,
},
render::sys::{GLint, GL_BGRA_EXT, GL_UNSIGNED_BYTE},
render::sys::{GLint, GL_BGRA_EXT, GL_RGBA, GL_UNSIGNED_BYTE},
utils::debug_fn::debug_fn,
},
ahash::AHashMap,
@ -107,6 +108,30 @@ pub static FORMATS: &[Format] = &[
shm_supported: true,
pipewire: SPA_VIDEO_FORMAT_BGRx,
},
Format {
name: "abgr8888",
bpp: 4,
gl_format: GL_RGBA,
gl_type: GL_UNSIGNED_BYTE,
drm: fourcc_code('A', 'B', '2', '4'),
wl_id: None,
external_only_guess: false,
has_alpha: true,
shm_supported: true,
pipewire: SPA_VIDEO_FORMAT_RGBA,
},
Format {
name: "xbgr8888",
bpp: 4,
gl_format: GL_RGBA,
gl_type: GL_UNSIGNED_BYTE,
drm: fourcc_code('X', 'B', '2', '4'),
wl_id: None,
external_only_guess: false,
has_alpha: false,
shm_supported: true,
pipewire: SPA_VIDEO_FORMAT_RGBx,
},
Format {
name: "nv12",
bpp: 1, // wrong but only used for shm