video: add support for a/xbgr8888 formats
This commit is contained in:
parent
ab6a39bd34
commit
8059457afb
2 changed files with 28 additions and 2 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
pipewire::pw_pod::{
|
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,
|
utils::debug_fn::debug_fn,
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
|
|
@ -107,6 +108,30 @@ pub static FORMATS: &[Format] = &[
|
||||||
shm_supported: true,
|
shm_supported: true,
|
||||||
pipewire: SPA_VIDEO_FORMAT_BGRx,
|
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 {
|
Format {
|
||||||
name: "nv12",
|
name: "nv12",
|
||||||
bpp: 1, // wrong but only used for shm
|
bpp: 1, // wrong but only used for shm
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ pub type GLuint = c::c_uint;
|
||||||
|
|
||||||
egl_transparent!(GLeglImageOES);
|
egl_transparent!(GLeglImageOES);
|
||||||
|
|
||||||
|
pub const GL_RGBA: GLint = 0x1908;
|
||||||
pub const GL_BGRA_EXT: GLint = 0x80E1;
|
pub const GL_BGRA_EXT: GLint = 0x80E1;
|
||||||
pub const GL_CLAMP_TO_EDGE: GLint = 0x812F;
|
pub const GL_CLAMP_TO_EDGE: GLint = 0x812F;
|
||||||
pub const GL_COLOR_ATTACHMENT0: GLenum = 0x8CE0;
|
pub const GL_COLOR_ATTACHMENT0: GLenum = 0x8CE0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue